Commit 5e5bb239 authored by Leigh Stoller's avatar Leigh Stoller

Minor UI tweaks to make creating a disk image more apparent

and less scary (to Mike).
parent 3498409e
...@@ -46,7 +46,7 @@ $optargs = OptionalPageArguments("target", PAGEARG_STRING, ...@@ -46,7 +46,7 @@ $optargs = OptionalPageArguments("target", PAGEARG_STRING,
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Snapshot Node Disk into Existing Image Descriptor"); PAGEHEADER("Snapshot Node Disk into New or Existing Image");
# Need these below. # Need these below.
$imageid = $image->imageid(); $imageid = $image->imageid();
...@@ -125,8 +125,7 @@ if (! isset($confirmed)) { ...@@ -125,8 +125,7 @@ if (! isset($confirmed)) {
$url = CreateURL("loadimage", $image); $url = CreateURL("loadimage", $image);
$newurl = CreateURL("newimageid_ez", "node_id", $target); $newurl = CreateURL("newimageid_ez", "node_id", $target);
echo "<center><form action='$url' method='post'>\n". echo "<br><center><form action='$url' method='post'>\n".
"<h2><b>Warning!</b></h2>".
"<b>Doing a snapshot of '$target' into image '$image_name' ". "<b>Doing a snapshot of '$target' into image '$image_name' ".
"will overwrite any previous snapshot for that image.<br><br> ". "will overwrite any previous snapshot for that image.<br><br> ".
"Are you sure you want to continue?</b><br>". "Are you sure you want to continue?</b><br>".
...@@ -137,7 +136,8 @@ if (! isset($confirmed)) { ...@@ -137,7 +136,8 @@ if (! isset($confirmed)) {
"</form>". "</form>".
"<br>". "<br>".
"If you do not want to overwrite this image, then ". "If you do not want to overwrite this image, then ".
"<a href='$newurl'>Create a new image</a>". "<a href='$newurl'>create a new image</a> based on the image ".
"that is currently loaded on $target. ".
"</center>"; "</center>";
PAGEFOOTER(); PAGEFOOTER();
......
...@@ -93,13 +93,33 @@ if ($node->HasSerialConsole()) { ...@@ -93,13 +93,33 @@ if ($node->HasSerialConsole()) {
"<a href=\"faq.php3#tiptunnel\">(howto)", "<a href=\"faq.php3#tiptunnel\">(howto)",
"nodetipacl.php3?node_id=$node_id"); "nodetipacl.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Report a Problem&nbsp;<img src=\"/new.gif\">" , WRITESUBMENUBUTTON("Report a Problem" ,
"reportnode.php3?node_id=$node_id"); "reportnode.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Show Console Log", WRITESUBMENUBUTTON("Show Console Log",
"showconlog.php3?node_id=$node_id&linecount=500"); "showconlog.php3?node_id=$node_id&linecount=500");
} }
if ($node->AccessCheck($this_user, $TB_NODEACCESS_LOADIMAGE)) {
$baseimage = $node->def_boot_image();
if ($baseimage &&
$baseimage->AccessCheck($this_user, $TB_IMAGEID_DESTROY)) {
WRITESUBMENUBUTTON("Create a Disk Image",
"loadimage.php3?target=$node_id" .
"&imageid=" . $baseimage->imageid() .
"&version=" . $baseimage->version());
}
else {
#
# This can happen for virtual nodes which are running the
# defaut osid. User must create a new descriptor.
#
WRITESUBMENUBUTTON("Create a Disk Image",
"newimageid_ez.php3?node_id=$node_id");
}
}
# #
# SSH to option. # SSH to option.
# #
...@@ -132,26 +152,6 @@ if ($isadmin || ...@@ -132,26 +152,6 @@ if ($isadmin ||
"bootlog.php3?node_id=$node_id"); "bootlog.php3?node_id=$node_id");
} }
if ($node->AccessCheck($this_user, $TB_NODEACCESS_LOADIMAGE)) {
$baseimage = $node->def_boot_image();
if ($baseimage &&
$baseimage->AccessCheck($this_user, $TB_IMAGEID_DESTROY)) {
WRITESUBMENUBUTTON("Create a Disk Image",
"loadimage.php3?target=$node_id" .
"&imageid=" . $baseimage->imageid() .
"&version=" . $baseimage->version());
}
else {
#
# This can happen for virtual nodes which are running the
# defaut osid. User must create a new descriptor.
#
WRITESUBMENUBUTTON("Create a Disk Image",
"newimageid_ez.php3?node_id=$node_id");
}
}
if (($isadmin || if (($isadmin ||
$node->AccessCheck($this_user, $TB_NODEACCESS_READINFO)) && $node->AccessCheck($this_user, $TB_NODEACCESS_READINFO)) &&
($node->TypeClass() == "robot")) { ($node->TypeClass() == "robot")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment