1 #from skeleton import skeleton
13 <p>Create a new VM:</p>
15 <p class="error">We had a problem with your request:</p>
16 #else if $varExists('new_machine')
17 <p>Congratulations! You successfully created a new VM called $new_machine.</p>
19 <form action="create" method="POST" onsubmit="return jsFormSubmit('create', this);">
21 $errorRow('create', $err)
24 <td><input type="text" name="name" value="$defaults.name"/></td>
26 $errorRow('name', $err)
29 <td><input type="text" name="memory" value="$defaults.memory" size=3/> megabytes ($max_memory max)</td>
31 $errorRow('memory', $err)
34 <td><input type="text" name="disk" value="$defaults.disk" size=3/> gigabytes (${"%0.1f" % ($max_disk-0.05)} max)</td>
36 $errorRow('disk', $err)
38 <td>HVM/ParaVM$helppopup('hvm_paravm')</td>
40 #for $value, $name in (('hvm', 'HVM'), ('paravm', 'ParaVM'))
42 #if $defaults.vmtype == $value then 'checked' else ''
43 type="radio" name="vmtype" value="$value">$name</input>
47 $errorRow('vmtype', $err)
50 <td>$cdromList($cdroms, $defaults.cdrom)</td>
52 $errorRow('cdrom', $err)
54 <input type="submit" class="button" value="Create it!"/>
59 #def machineRow($machine)
61 <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
62 <td>${machine.memory}M</td>
63 <td>$machine.owner</td>
65 #set $nic = $machine.nics[0]
67 <td>$nic.hostname</td>
80 #if $has_vnc[$machine] == True
81 <a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
87 <form action="command" method="post" onsubmit="return rowFormSubmit(this, 'list');">
88 <input type="hidden" name="machine_id"
89 value="$machine.machine_id"/>
90 <input type="submit" class="button" name="action" value="#slurp
91 #if $machine.uptime then 'Shutdown' else 'Power on'
98 #def machineList($machines)
109 #for $machine in $machines:
110 $machineRow($machine)
118 <p>You don't currently control any VMs.</p>
120 <p>You have the following VMs:</p>
122 <p><a href="list" onclick="new Ajax.Updater('machinelist', 'list?js=machinelist', {method: 'get' });return false">refresh</a></p>
123 <div id="machinelist">
124 $machineList($machines)
126 <div id="createtable">