More updates.
[invirt/packages/invirt-web.git] / templates / list.tmpl
index f820385..a27fe0b 100644 (file)
@@ -18,9 +18,9 @@ List of your VMs
        <td>IP</td>
        <td>MAC Address</td>
        <td>Hostname</td>
-       <td>Status</td>
+       <td>Uptime</td>
        <td>VNC</td>
-       <td>Restart?</td>
+       <td></td>
       #for $machine in $machines:
       <tr> 
        <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
@@ -36,47 +36,60 @@ List of your VMs
        <td></td>
        <td></td>
 #end if
-       <td>Good!</td>
-       <td><a href="vnc?machine_id=$machine.machine_id">Console</a></td>
+<td>#slurp
+#if $uptimes[$machine]
+$uptimes[$machine]#slurp
+#else
+Off#slurp
+#end if
+</td>
+       <td>#slurp
+#if $has_vnc[$machine] == True
+<a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
+#else
+$has_vnc[$machine]
+#end if
+</td>
        <td>
-         <form action="restart">
+         <form action="command">
            <input type="hidden" name="machine_id"
                   value="$machine.machine_id"/>
-           <input type="submit" class="button"
-                  value="restart"/>
+#if $uptimes[$machine]
+           <input type="submit" class="button" name="action" value="Shutdown"/>
+#else
+           <input type="submit" class="button" name="action" value="Power on"/>
+#end if
          </form>
        </td>
       </tr>
       #end for
     </table>
 #end if
-
+#if $can_add_vm
     <p>Create a new VM:</p>
-    <form action="create">
+    <form action="create" method="POST">
       <table>
        <tr>
          <td>Name</td>
-         <td><input type="text" name="name" value="$user.username"/></td>
+         <td>${user.username}_<input type="text" name="name" value=""/></td>
        </tr>
        <tr>
-         #set $maxmem=256
          <td>Memory</td>
-         <td><input type="text" name="memory" value="$maxmem" size=3/> megabytes ($maxmem max)</td>
+         <td><input type="text" name="memory" value="$default_mem" size=3/> megabytes ($max_mem max)</td>
        </tr>
        <tr>
-         #set $maxdisk=1.5
          <td>Disk</td>
-         <td><input type="text" name="disk" value="$maxdisk" size=3/> gigabytes ($maxdisk max)</td>
+         <td><input type="text" name="disk" value="$default_disk" size=3/> gigabytes (${"%0.1f" % ($max_disk-0.05)} max)</td>
        </tr>
        <tr>
-         <td>HVM/ParaVM</td>
+         <td>HVM/ParaVM$helppopup('hvm_paravm')</td>
          <td>
            <input checked type="radio" name="vmtype" value="hvm">HVM</input>
            <input type="radio" name="vmtype" value="paravm">ParaVM</input>
          </td>
        </tr>
        <tr>
-         <td>Initial Install</td>
+         <td>Boot CD</td>
          <td>
            <select name="cdrom">
              <option selected value="">None</option>
@@ -91,5 +104,7 @@ List of your VMs
       </table>
       <input type="submit" class="button" value="Create it!"/>
     </form>
-
+#else
+<p>You are at the maximum number of VMs.</p>
+#end if
 #end def