diff --git a/www/aptui/show-nodetype.php b/www/aptui/show-nodetype.php index fa9727e2d071ae676ba059088515f0c6104b442c..8b8f6ad255f8487d582062ffb08f2528a3d96519 100644 --- a/www/aptui/show-nodetype.php +++ b/www/aptui/show-nodetype.php @@ -27,6 +27,7 @@ $BOOTSTRAP5OK = true; chdir(".."); include("defs.php3"); include("node_defs.php"); +include_once("imageid_defs.php"); chdir("apt"); include("quickvm_sup.php"); # Must be after quickvm_sup.php since it changes the auth domain. @@ -157,7 +158,8 @@ else { # List of nodes for a table. # $nodes_result = DBQueryFatal("select n.node_id,r.pid,r.eid, ". - " e.expt_head_uid as uid,e.expt_expires ". + " e.expt_head_uid as uid,e.expt_expires, ". + " n.def_boot_osid,n.def_boot_osid_vers ". " from nodes as n ". "left join reserved as r on ". " r.node_id=n.node_id ". @@ -176,6 +178,30 @@ else { $blob["eid"] = $row["eid"]; $blob["uid"] = $row["uid"]; $blob["expires"] = DateStringGMT($row["expt_expires"]); + $blob["def_boot_image_url"] = null; + + if ($row["def_boot_osid"]) { + $osid = $row["def_boot_osid"]; + $vers = $row["def_boot_osid_vers"]; + $image = Image::Lookup($osid,$vers); + + if ($image) { + $name = $image->imagename(); + $url = "show-image.php?imageid=${osid}&version=${vers}"; + } + else { + $osinfo = OSInfo::Lookup($osid,$vers); + if ($osinfo) { + $url = "$TBBASE/showosinfo.php3?osid=${osid}"; + $name = $osinfo->osname(); + } + } + if (isset($url)) { + $blob["def_boot_image_url"] = $url; + $blob["def_boot_image_name"] = $name; + $blob["def_boot_image_vers"] = $vers; + } + } } $list[] = $blob; } diff --git a/www/aptui/template/show-nodetype.html b/www/aptui/template/show-nodetype.html index b45c8eacf3640b56f0a2f7d340bf2b106f80a9be..f0c01304c8a61ce34486d9a7827a7f73c7e25f97 100644 --- a/www/aptui/template/show-nodetype.html +++ b/www/aptui/template/show-nodetype.html @@ -435,6 +435,7 @@ <th>Eid</th> <th>User</th> <th class="sorter-sugar" data-filter="false">Expires</th> + <th>Image</th> </tr> </thead> <tbody> @@ -457,6 +458,13 @@ target="_blank"><%- blob.uid %></a> </td> <td class="format-date"><%- blob.expires %></td> + <td> + <% if (blob.def_boot_image_url) { %> + <a href="<%= blob.def_boot_image_url %>"> + <%- blob.def_boot_image_name + ":" + + blob.def_boot_image_vers %></a> + <% } %> + </td> </tr> <% }); %> </tbody>