Added the name of machine that is being deleted
[invirt/packages/invirt-web.git] / code / templates / info.mako
index 5af29bb..5423f3d 100644 (file)
@@ -11,6 +11,11 @@ Info on ${machine.name}
   % for key, value in fields:
   <tr><td>${key}:</td><td>${value}</td></tr>
   % endfor
   % for key, value in fields:
   <tr><td>${key}:</td><td>${value}</td></tr>
   % endfor
+  % if on:
+   % if 'monitoring' in config and len(config.monitoring) and 'baseuri' in config.monitoring[0]:
+    <tr><td>CPU history:</td><td><img src="${config.monitoring[0].baseuri}usage.cgi?type=cpu;uuid=${machine.uuid}" alt="Domain CPU usage" /></td></tr>
+   % endif
+  % endif
 </table>
 </%def>
 
 </table>
 </%def>
 
@@ -26,26 +31,27 @@ Info on ${machine.name}
   VNC console not enabled; still booting?
  % endif
 % endif
   VNC console not enabled; still booting?
  % endif
 % endif
-<form action="command" method="POST">
-  <input type="hidden" name="back" value="info"/>
-  <input type="hidden" name="machine_id" value="${machine.machine_id}"/>
+<%def name="command_button(title, value, cdrom=False, extra='')">
+<form action="machine/${machine.machine_id}/command/${value}" method="POST">
+  <input type="hidden" name="back" value="info" />
+  <input type="submit" class="button" name="action" value="${title}" ${extra | n}/>
+% if cdrom:
+  Boot CD: ${self.fn.cdromList()}
+% endif
+</form>
+</%def>
   <div>
        % if on:
   <div>
        % if on:
-       <button type="submit" class="button" name="action" value="Power off">Power off (hard)</button>
-       <button type="submit" class="button" name="action" value="Shutdown">Shut down</button>
-       <input type="submit" class="button" name="action" value="Reboot"/>
+       ${command_button("Power off", "destroy")}
+       ${command_button("Shutdown", "shutdown")}
+       ${command_button("Reboot", "reboot", cdrom=True)}
        % else:
        % else:
-       <input type="submit" class="button" name="action" value="Power on"/>
+       ${command_button("Power on", "create", cdrom=True)}
        % endif
   </div>
   <div>
        % endif
   </div>
   <div>
-    Boot CD:
-${self.fn.cdromList()}
+       ${command_button("Delete VM", "delete", extra="onclick=\"return confirm('Are you sure that you want to delete this VM (\\\'" + machine.name + "\\\')?');\"")}
   </div>
   </div>
-  <div>
-      <input type="submit" class="button" name="action" value="Delete VM" onclick="return confirm('Are you sure that you want to delete this VM?');"/>
-  </div>
-</form>
 </%def>
 
 <%def name="modifyForm()">
 </%def>
 
 <%def name="modifyForm()">
@@ -57,8 +63,7 @@ ${self.fn.cdromList()}
 % if on:
 (To edit ram, disk size, or machine name, turn off the machine first.)
 % endif
 % if on:
 (To edit ram, disk size, or machine name, turn off the machine first.)
 % endif
-<form action="modify" method="POST">
-  <input type="hidden" name="machine_id" value="${defaults.machine_id}"/>
+<form action="machine/${machine.machine_id}/modify" method="POST">
   <table>
     <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">${defaults.description}</textarea></td></tr>
     <tr><td>Owner${self.fn.helppopup("Owner")}:</td><td><input type="text" name="owner", value="${defaults.owner}"/></td></tr>
   <table>
     <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">${defaults.description}</textarea></td></tr>
     <tr><td>Owner${self.fn.helppopup("Owner")}:</td><td><input type="text" name="owner", value="${defaults.owner}"/></td></tr>