Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
bfe9774b
Commit
bfe9774b
authored
Oct 05, 2012
by
Leigh B Stoller
Browse files
Show more detail on the pool page when in admin mode.
parent
79e12d50
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/node_defs.php
View file @
bfe9774b
...
...
@@ -303,7 +303,21 @@ class Node
$node_id
=
$this
->
node_id
();
$query_result
=
DBQueryFatal
(
"select status from nodes where node_id='
$nodeid
'"
);
DBQueryFatal
(
"select status from nodes where node_id='
$node_id
'"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
return
""
;
}
$row
=
mysql_fetch_array
(
$query_result
);
return
$row
[
"status"
];
}
function
RealNodeStatus
()
{
$node_id
=
$this
->
node_id
();
$query_result
=
DBQueryFatal
(
"select status from node_status "
.
"where node_id='
$node_id
'"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
return
""
;
...
...
www/showpool.php
View file @
bfe9774b
<?php
#
# Copyright (c) 2009-201
0
University of Utah and the Flux Group.
# Copyright (c) 2009-201
2
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -22,6 +22,8 @@
# }}}
#
include
(
"defs.php3"
);
include
(
"showstuff.php3"
);
include
(
"table_defs.php"
);
#
# Only known and logged in users can look at experiments.
...
...
@@ -51,6 +53,7 @@ if (!$experiment) {
$pid
=
$experiment
->
pid
();
$eid
=
$experiment
->
eid
();
$counts
=
array
();
$nodes
=
array
();
#
# Get the counts per node.
...
...
@@ -69,6 +72,20 @@ while ($row = mysql_fetch_array($query_result)) {
$counts
[
$node_id
]
=
$count
;
}
#
# Get the distinct set of nodes using the shared nodes.
#
$query_result
=
DBQueryFatal
(
"select r.node_id from reserved as r "
.
"left join nodes as n on n.node_id=r.node_id "
.
"where n.node_id!=n.phys_nodeid and "
.
" r.sharing_mode is not null "
);
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
$node_id
=
$row
[
"node_id"
];
$nodes
[
$node_id
]
=
$node_id
;
}
$query_result
=
DBQueryFatal
(
"select r.node_id,n.type,n.def_boot_osid,ru.*,o.osname, "
.
" ns.status as nodestatus, "
.
...
...
@@ -140,6 +157,46 @@ echo "</table>\n";
# Sort initialized later when page fully loaded.
AddSortedTable
(
'pooltable'
);
#
#
#
if
(
$isadmin
)
{
$table
=
array
(
'#id'
=>
"Containers"
,
'#title'
=>
"Containers"
,
'#sortable'
=>
1
,
'#headings'
=>
array
(
"node_id"
=>
"node_id"
,
"PID"
=>
"PID"
,
"EID"
=>
"EID"
,
"Status"
=>
"Status"
,
));
$rows
=
array
();
foreach
(
$nodes
as
$node_id
)
{
$node
=
Node
::
Lookup
(
$node_id
);
if
(
!
$node
)
continue
;
$status
=
$node
->
RealNodeStatus
();
$experiment
=
$node
->
Reservation
();
$pid
=
$experiment
->
pid
();
$eid
=
$experiment
->
eid
();
$creator
=
$experiment
->
creator
();
$nodeurl
=
CreateURL
(
"shownode"
,
$node
);
$nodehref
=
"<a href='
$nodeurl
'>
$node_id
</a>"
;
$expurl
=
CreateURL
(
"showexp"
,
$experiment
);
$exphref
=
"<a href='
$expurl
'>
$eid
</a>"
;
$rows
[
$node_id
]
=
array
(
"node_id"
=>
$nodehref
,
"PID"
=>
$pid
,
"EID"
=>
$exphref
,
"Status"
=>
$status
,
);
}
list
(
$html
,
$button
)
=
TableRender
(
$table
,
$rows
);
echo
$html
;
}
#
# Standard Testbed Footer
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment