restore autoinstaller in web interface
[invirt/packages/invirt-web.git] / code / templates / list.tmpl
index ae0d564..2475542 100644 (file)
@@ -6,11 +6,11 @@
 VM List
 #end def
 
-#def createTable()
+#def createForm()
 #if $cant_add_vm
 <p>$cant_add_vm</p>
 #else
-<p>Create a new VM:</p>
+<h2>Create a new VM</h2>
 #if $err
 <p class="error">We had a problem with your request:</p>
 #else if $varExists('new_machine')
@@ -19,50 +19,85 @@ VM List
     <form action="create" method="POST">
     <input type="hidden" name="back" value="list"/>
       <table>
+#filter None
       $errorRow('create', $err)
+#end filter
        <tr>
          <td>Name</td>
          <td><input type="text" name="name" value="$defaults.name"/></td>
        </tr>
+#filter None
 $errorRow('name', $err)
+#end filter
        <tr>
          <td>Memory</td>
          <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
        </tr>
+#filter None
 $errorRow('memory', $err)
+#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>
        </tr>
+#filter None
 $errorRow('disk', $err)
-       <tr>
-         <td>HVM/ParaVM$helppopup('hvm_paravm')</td>
-         <td>
-#for $value, $name in (('hvm', 'HVM'), ('paravm', 'ParaVM'))
-   <input #slurp
-#if $defaults.vmtype == $value then 'checked' else ''
- type="radio" name="vmtype" value="$value">$name</input>
-#end for
-         </td>
-       </tr>
+#end filter
+        <tr>
+          <td>HVM/ParaVM#slurp
+#filter None
+$helppopup('hvm_paravm')#slurp
+#end filter
+</td>
+          <td>
+#filter None
+$vmTypeList($defaults.type)
+#end filter
+</td>
+        </tr>
+#filter None
 $errorRow('vmtype', $err)
+#end filter
+        <tr>
+          <td>Clone image?</td>
+          <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>
+        </tr>
+#filter None
+$errorRow('autoinstall', $err)
+#end filter
+       <!--<tr>
+         <td>Autoinstall#slurp
+#filter None
+$helppopup('autoinstall')#slurp
+#end filter
+</td>
+         <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
+#filter None
+$autoList($defaults.cdrom, "document.getElementById('cd_or_auto_auto').checked = true;document.getElementById('cdromlist').value = ''")
+             (experimental; 1-2 minutes, and you have a machine; root pw is 'password'.)
+#end filter
+         </input>
+       </tr>-->
        <tr>
          <td>Boot CD</td>
-         <td>$cdromList($cdroms, $defaults.cdrom)</td>
+         <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
+#filter None
+$cdromList($defaults.cdrom, "document.getElementById('cd_or_auto_cd').checked = true;document.getElementById('autoinstalllist').value = ''")
+#end filter
+</td>
+         </input>
        </tr>
 $errorRow('cdrom', $err)
-       <tr>
-         <td>Clone image?</td>
-         <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>
-       </tr>
 $errorRow('cdrom', $err)
        <tr>
          <td>Owner</td>
          <td><input type="text" name="owner" value="$defaults.owner"/></td>
        </tr>
+#filter None
        $errorRow('owner', $err)
+#end filter
       </table>
       <input type="submit" class="button" value="Create it!"/>
     </form>
@@ -84,15 +119,15 @@ $errorRow('cdrom', $err)
 <td>#slurp
 #if $machine.uptime
 $machine.uptime#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
+#else if $has_vnc[$machine] != 'Off'
+#filter None
 $has_vnc[$machine]
+#end filter
 #end if
 </td>
        <td>
@@ -111,16 +146,27 @@ $has_vnc[$machine]
 #def machineList($machines)
     <table>
       <tr>
-       <td>Name</td>
-       <td>Memory</td>
-       <td>Owner</td>
-        <td>Administrator</td>
-       <td>IP</td>
-       <td>Uptime</td>
-       <td>VNC</td>
-       <td></td>
+       <th>Name</th>
+       <th>Memory</th>
+       <th>Owner#slurp
+#filter None
+$helppopup('owner')#slurp
+#end filter
+</th>
+        <th>Administrator#slurp
+#filter None
+$helppopup('administrator')#slurp
+#end filter
+</th>
+       <th>IP</th>
+       <th>Uptime</th>
+       <th>VNC</th>
+       <th></th>
+      </tr>
       #for $machine in $machines:
+    #filter None
        $machineRow($machine)
+    #end filter
       #end for
     </table>
 #end def
@@ -130,14 +176,14 @@ $has_vnc[$machine]
 <p style="font-size: 125%;">SIPB Virtual Servers is an <strong>alpha service</strong>.  <a href="/static/about.html">What does this mean?</a></p>
 #if not $machines
 <p>You don't currently control any VMs.</p>   
-#else
-    <p>You have the following VMs:</p>
 #end if
     <p><a href="list">refresh</a></p>
     <div id="machinelist">
+    #filter None
     $machineList($machines)
+    #end filter
     </div>
-<div id="createtable">
-$createTable()
-</div>
+#filter None
+$createForm()
+#end filter
 #end def