Autoinstallers for Debian Buster and Ubuntu Bionic
[invirt/packages/invirt-web.git] / code / templates / list.mako
index 3d0c50c..ad12933 100644 (file)
@@ -63,7 +63,7 @@ VM List
          <td><label><input type="radio" name="cd_or_auto" id="cd_or_auto_auto"
                  onchange="$('cdromlist').value = ''; $('vmtype-linux').checked = true" />
 ${self.fn.autoList(defaults.cdrom, "$('cd_or_auto_auto').checked = true;$('cdromlist').value = '';$('vmtype-linux').checked = true")}
-             (experimental; 2-3 minutes, and you have a machine with empty root password.)
+             (experimental; 15-20 minutes, and you have a machine with empty root password.)
 </label></td>
        </tr>
        <tr>
@@ -96,21 +96,22 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
 </%def>
 
 <%def name="machineRow(machine, dark)">
+<%
+       on = (machine.uptime is not None)
+%>
       <tr\
 % if dark:
  class="stripedrow" \
 % endif
 > 
        <td rowspan="2">
-       % if machine.uptime and installing[machine]:
+       % if on and installing[machine]:
        <img src="static/power_installing.png" alt="Installing..." />
        % else:
-         <form action="machine/${machine.machine_id}/command/${'shutdown' if machine.uptime else 'create'}" method="post">
+         <form action="machine/${machine.machine_id}/command/${'shutdown' if on else 'create'}" method="post">
            <input type="hidden" name="back" value="list"/>
-           <input type="hidden" name="machine_id"
-                  value="${machine.machine_id}"/>
-<input type="submit" class="power ${'on' if machine.uptime else 'off'}" name="action" value="${'Shutdown' if machine.uptime else 'Power on'}"\
-% if machine.uptime:
+<input type="submit" class="power ${'on' if on else 'off'}" name="action" value="${'Shutdown' if on else 'Power on'}"\
+% if on:
  onclick="return confirm('Are you sure you want to power off this VM?');"
 % endif
 />
@@ -127,7 +128,7 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
        <td></td>
 % endif
 <td>\
-% if machine.uptime:
+% if on:
 ${datetime.timedelta(seconds=int(machine.uptime))}\
 % endif
 </td>