web: don't send mail on error if it's one of us testing
[invirt/packages/invirt-web.git] / code / templates / list.tmpl
index 7d484f3..61eafdb 100644 (file)
@@ -1,5 +1,6 @@
 #from skeleton import skeleton
 #extends skeleton
 #from skeleton import skeleton
 #extends skeleton
+#import datetime
 
 
 #def title
 
 
 #def title
@@ -24,12 +25,19 @@ VM List
 #end filter
        <tr>
          <td>Name</td>
 #end filter
        <tr>
          <td>Name</td>
-         <td><input type="text" name="name" value="$defaults.name"/></td>
+         <td><input type="text" name="name" value="$defaults.name"/>.xvm.mit.edu</td>
        </tr>
 #filter None
 $errorRow('name', $err)
 #end filter
        <tr>
        </tr>
 #filter None
 $errorRow('name', $err)
 #end filter
        <tr>
+         <td>Description</td>
+         <td><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td>
+       </tr>
+#filter None
+$errorRow('description', $err)
+#end filter
+       <tr>
          <td>Memory</td>
          <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
        </tr>
          <td>Memory</td>
          <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
        </tr>
@@ -38,7 +46,7 @@ $errorRow('memory', $err)
 #end filter
        <tr>
          <td>Disk</td>
 #end filter
        <tr>
          <td>Disk</td>
-         <td><input type="text" name="disk" value="$defaults.disk" size=3/> GiB (${"%0.1f" % ($max_disk-0.05)} max)</td>
+         <td><input type="text" name="disksize" value="$defaults.disk" size=3/> GiB (${"%0.1f" % ($max_disk-0.05)} max)</td>
        </tr>
 #filter None
 $errorRow('disk', $err)
        </tr>
 #filter None
 $errorRow('disk', $err)
@@ -46,7 +54,7 @@ $errorRow('disk', $err)
         <tr>
           <td>HVM/ParaVM#slurp
 #filter None
         <tr>
           <td>HVM/ParaVM#slurp
 #filter None
-$helppopup('hvm_paravm')#slurp
+$helppopup('HVM/ParaVM')#slurp
 #end filter
 </td>
           <td>
 #end filter
 </td>
           <td>
@@ -58,10 +66,23 @@ $vmTypeList($defaults.type)
 #filter None
 $errorRow('vmtype', $err)
 #end filter
 #filter None
 $errorRow('vmtype', $err)
 #end filter
-       <tr>
+        <tr>
+          <td>Clone image?</td>
+#if $can_clone
+          <td><input type="checkbox" name="clone_from" id="clone_from" value="ice3" onchange="onclone(event)"/>
+              (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.)
+              <script type='text/javascript'>function onclone(e){ document.getElementById('cdromlist').value = ''; }</script></td>
+#else
+         <td><input type="checkbox" name="clone_from" id="clone_from" value="ice3" disabled="disabled"/> Image cloning is currently disabled for maintenance</td>
+#end if
+        </tr>
+#filter None
+$errorRow('autoinstall', $err)
+#end filter
+       <!--<tr>
          <td>Autoinstall#slurp
 #filter None
          <td>Autoinstall#slurp
 #filter None
-$helppopup('autoinstall')#slurp
+$helppopup('Autoinstall')#slurp
 #end filter
 </td>
          <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
 #end filter
 </td>
          <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
@@ -70,7 +91,7 @@ $autoList($defaults.cdrom, "document.getElementById('cd_or_auto_auto').checked =
              (experimental; 1-2 minutes, and you have a machine; root pw is 'password'.)
 #end filter
          </input>
              (experimental; 1-2 minutes, and you have a machine; root pw is 'password'.)
 #end filter
          </input>
-       </tr>
+       </tr>-->
        <tr>
          <td>Boot CD</td>
          <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
        <tr>
          <td>Boot CD</td>
          <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
@@ -97,6 +118,16 @@ $errorRow('cdrom', $err)
 
 #def machineRow($machine)
       <tr> 
 
 #def machineRow($machine)
       <tr> 
+       <td rowspan="2">
+         <form action="command" method="post">
+           <input type="hidden" name="back" value="list"/>
+           <input type="hidden" name="machine_id"
+                  value="$machine.machine_id"/>
+<input type="submit" class="button" name="action" value="#slurp
+#if $machine.uptime then 'Power off' else 'Power on'
+"/>
+         </form>
+       </td>
        <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
        <td>${machine.memory}M</td>
        <td>$machine.owner</td>
        <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
        <td>${machine.memory}M</td>
        <td>$machine.owner</td>
@@ -109,7 +140,7 @@ $errorRow('cdrom', $err)
 #end if
 <td>#slurp
 #if $machine.uptime
 #end if
 <td>#slurp
 #if $machine.uptime
-$machine.uptime#slurp
+${datetime.timedelta(seconds=int(machine.uptime))}#slurp
 #end if
 </td>
        <td>#slurp
 #end if
 </td>
        <td>#slurp
@@ -121,38 +152,31 @@ $has_vnc[$machine]
 #end filter
 #end if
 </td>
 #end filter
 #end if
 </td>
-       <td>
-         <form action="command" method="post">
-           <input type="hidden" name="back" value="list"/>
-           <input type="hidden" name="machine_id"
-                  value="$machine.machine_id"/>
-<input type="submit" class="button" name="action" value="#slurp
-#if $machine.uptime then 'Power off' else 'Power on'
-"/>
-         </form>
-       </td>
+      </tr>
+      <tr>
+        <td colspan="7" style="padding-left: 1em; color: #666">$machine.description</td>
       </tr>
 #end def
 
 #def machineList($machines)
       </tr>
 #end def
 
 #def machineList($machines)
-    <table>
+    <table cellspacing="0" cellpadding="2">
       <tr>
       <tr>
+       <th></th>
        <th>Name</th>
        <th>Memory</th>
        <th>Owner#slurp
 #filter None
        <th>Name</th>
        <th>Memory</th>
        <th>Owner#slurp
 #filter None
-$helppopup('owner')#slurp
+$helppopup('Owner')#slurp
 #end filter
 </th>
         <th>Administrator#slurp
 #filter None
 #end filter
 </th>
         <th>Administrator#slurp
 #filter None
-$helppopup('administrator')#slurp
+$helppopup('Administrator')#slurp
 #end filter
 </th>
        <th>IP</th>
        <th>Uptime</th>
        <th>VNC</th>
 #end filter
 </th>
        <th>IP</th>
        <th>Uptime</th>
        <th>VNC</th>
-       <th></th>
       </tr>
       #for $machine in $machines:
     #filter None
       </tr>
       #for $machine in $machines:
     #filter None
@@ -160,6 +184,13 @@ $helppopup('administrator')#slurp
     #end filter
       #end for
     </table>
     #end filter
       #end for
     </table>
+    <script type="text/javascript" src="/static/stripe.js"></script>
+    <script type="text/javascript">
+        document.observe("dom:loaded", function() {
+            stripe(\$('machinelist').getElementsByTagName('table')[0],
+                   'stripedrow');
+        });
+    </script>
 #end def
 
 
 #end def