Use daemon/sipb-xen.mit.edu and don't give user fake auth token in an HTML comment.
[invirt/packages/invirt-web.git] / templates / info.tmpl
index f2ebe51..c84e8eb 100644 (file)
 #extends skeleton
 
 #def title
-Created!
+Info on $machine.name
+#end def
+
+#def infoTable()
+<p>Info on ${machine.name}:</p>
+<table>
+  #for $key, $value in $fields
+  <tr><td>$key:</td><td>$value</td></tr>
+  #end for
+</table>
+#end def
+
+#def commands()
+<form action="command" action="POST">
+  <input type="hidden" name="back" value="info"/>
+  <input type="hidden" name="machine_id" value="$machine.machine_id"/>
+  <table>
+    
+    <tr><td>
+       #if $on
+       #if $has_vnc
+       <a href="vnc?machine_id=$machine.machine_id">Console</a>
+       #else
+       VNC is not enabled
+       #end if
+       #else
+
+       #end if
+    </td></tr>
+      <tr>
+       #if $on
+       <td><input type="submit" class="button" name="action" value="Power off"/></td>
+       <td><input type="submit" class="button" name="action" value="Shutdown"/></td>
+       <td><input type="submit" class="button" name="action" value="Reboot"/></td>
+       #else
+       <td><input type="submit" class="button" name="action" value="Power on"/></td>
+       #end if
+      <td>Boot CD:</td>
+      <td>$cdromList($cdroms)</td>
+  </tr>
+    <tr>
+      <td><input type="submit" class="button" name="action" value="Delete VM" onclick="return confirm('Are you sure that you want to delete this VM?');"/></td>
+    </tr>
+  </table>
+</form>
+#end def
+
+#def modifyForm()
+#if $err
+<p class="error">We had a problem with your request:</p>
+#else if $varExists('new_machine')
+<p>Successfully modified.</p>
+#end if
+#if $on
+(To edit ram, disk size, or machine name, turn off the machine first.)
+#end if
+</p>
+<form action="modify" method="POST">
+  <input type="hidden" name="machine_id" value="$defaults.machine_id"/>
+  <table>
+    <tr><td>Owner${helppopup("owner")}:</td><td><input type="text" name="owner", value="$defaults.owner"/></td></tr>
+$errorRow('owner', $err)
+    <tr><td>Administrator${helppopup("administrator")}:</td><td><input type="text" name="administrator", value="$defaults.administrator"/></td></tr>
+$errorRow('administrator', $err)
+    <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr>
+$errorRow('contact', $err)
+#if $machine.nics
+    <tr><td>Hostname:</td><td><input type="text" name="hostname" value="$defaults.hostname"/>.servers.csail.mit.edu</td></tr>
+#end if
+$errorRow('hostname', $err)
+#if not $on
+    <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/></td></tr>
+$errorRow('name', $err)
+    <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr>
+$errorRow('memory', $err)
+    <tr><td>Disk:</td><td><input type="text" size=3 name="disk" value="$defaults.disk"/>GiB (max $max_disk)</td><td>WARNING: Modifying disk size may corrupt your data.</td></tr>
+$errorRow('disk', $err)
+#else
+$errorRow('name', $err)
+$errorRow('memory', $err)
+$errorRow('disk', $err)
+#end if
+    <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr>
+  </table>
+</form>
 #end def
 
 #def body
 <h1>Info</h1>
-<p>Info on ${machine.name}.</p>
+<div id="info">
+  $infoTable()
+</div>
+
+<p>Commands:</p>
+<div id="commands">
+  $commands()
+</div>
+<p>Change settings:
+<div id="modify">
+  $modifyForm()
+</div>
 #end def