Changeset 2417 for package_branches/invirt-web/cherrypy/code/templates
- Timestamp:
- Aug 9, 2009, 8:13:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy/code/templates/info.mako
r2416 r2417 27 27 % endif 28 28 % endif 29 <form action="command" method="POST"> 30 <input type="hidden" name="back" value="info"/> 31 <input type="hidden" name="machine_id" value="${machine.machine_id}"/> 29 <%def name="command_button(title, value, cdrom=False, extra='')"> 30 <form action="machine/${machine.machine_id}/command/${value}" method="POST"> 31 <input type="hidden" name="back" value="machine/${machine.machine_id}/info" /> 32 <input type="submit" class="button" name="action" value="${title}" ${extra | n}/> 33 % if cdrom: 34 Boot CD: ${self.fn.cdromList()} 35 % endif 36 </form> 37 </%def> 32 38 <div> 33 39 % if on: 34 <button type="submit" class="button" name="action" value="Power off">Power off (hard)</button>35 <button type="submit" class="button" name="action" value="Shutdown">Shut down</button>36 <input type="submit" class="button" name="action" value="Reboot"/>40 ${command_button("Power off", "destroy")} 41 ${command_button("Shutdown", "shutdown")} 42 ${command_button("Reboot", "reboot", cdrom=True)} 37 43 % else: 38 <input type="submit" class="button" name="action" value="Power on"/>44 ${command_button("Power on", "create", cdrom=True)} 39 45 % endif 40 46 </div> 41 47 <div> 42 Boot CD: 43 ${self.fn.cdromList()} 44 </div> 45 <div> 46 <input type="submit" class="button" name="action" value="Delete VM" onclick="return confirm('Are you sure that you want to delete this VM?');"/> 48 ${command_button("Delete VM", "delete", extra='''onclick="return confirm('Are you sure that you want to delete this VM?');"''')} 47 49 </div> 48 50 </form>
Note: See TracChangeset
for help on using the changeset viewer.