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
aa1ff71c
Commit
aa1ff71c
authored
May 16, 2002
by
Leigh B. Stoller
Browse files
Add vrons and their phys mapping.
parent
c717dd78
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/reserved.php3
View file @
aa1ff71c
...
...
@@ -6,21 +6,18 @@ include("defs.php3");
#
PAGEHEADER
(
"Utah Testbed Machine Status"
);
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"SELECT n.node_id, n.type, nt.class, j.pid, j.eid, j.vname "
.
"FROM nodes AS n LEFT JOIN reserved AS j ON n.node_id = j.node_id "
.
"LEFT JOIN node_types AS nt ON n.type=nt.type "
.
"WHERE role='testnode' ORDER BY priority,type"
);
if
(
!
$query_result
)
{
$err
=
mysql_error
();
TBERROR
(
"Database Error getting node reservation status:
$err
\n
"
,
1
);
}
$uid
=
GETLOGIN
();
LOGGEDINORDIE
(
$uid
);
$isadmin
=
ISADMIN
(
$uid
);
$query_result
=
DBQueryFatal
(
"SELECT n.node_id, n.phys_nodeid, n.type, nt.class, "
.
" nt.isvirtnode, j.pid, j.eid, j.vname from nodes AS n "
.
"LEFT JOIN reserved AS j ON n.node_id = j.node_id "
.
"LEFT JOIN node_types AS nt ON n.type=nt.type "
.
"WHERE role='testnode' or role='virtnode' "
.
"ORDER BY priority,type"
);
#
# Count the types up.
#
...
...
@@ -74,6 +71,8 @@ while ($r = mysql_fetch_array($query_result)) {
$res1
=
$r
[
"pid"
];
$res2
=
$r
[
"eid"
];
$res3
=
$r
[
"vname"
];
$isvirt
=
$r
[
"isvirtnode"
];
$phys
=
$r
[
"phys_nodeid"
];
if
(
!
$res1
||
$res1
==
"NULL"
)
{
$res1
=
"--"
;
}
...
...
@@ -83,7 +82,11 @@ while ($r = mysql_fetch_array($query_result)) {
if
(
!
$res3
||
$res3
==
"NULL"
)
{
$res3
=
"--"
;
}
echo
"<tr><td>
$id
</td> <td>
$type
(
$class
)</td> "
;
if
(
$isvirt
)
echo
"<tr><td>
$id
(
$phys
)</td> "
;
else
echo
"<tr><td>
$id
</td> "
;
echo
"<td>
$type
(
$class
)</td> "
;
# If I'm an admin, I can see pid/eid/vname, but if not, I only see eid
if
(
$isadmin
)
{
echo
"<td>
$res1
</td> "
;
}
echo
"<td>
$res2
</td> "
;
...
...
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