1 #from skeleton import skeleton
14 <h2>Create a new VM</h2>
16 <p class="error">We had a problem with your request:</p>
17 #else if $varExists('new_machine')
18 <p>Congratulations! You successfully created a new VM called $new_machine.</p>
20 <form action="create" method="POST">
21 <input type="hidden" name="back" value="list"/>
24 $errorRow('create', $err)
28 <td><input type="text" name="name" value="$defaults.name"/>.${config.dns.domains[0]}</td>
31 $errorRow('name', $err)
35 <td><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td>
38 $errorRow('description', $err)
42 <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
45 $errorRow('memory', $err)
49 <td><input type="text" name="disksize" value="$defaults.disk" size=3/> GiB (${"%0.1f" % ($max_disk-0.05)} max)</td>
52 $errorRow('disk', $err)
57 $helppopup('HVM/ParaVM')#slurp
62 $vmTypeList($defaults.type)
67 $errorRow('vmtype', $err)
70 $errorRow('autoinstall', $err)
75 $helppopup('Autoinstall')#slurp
78 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
80 $autoList($defaults.cdrom, "document.getElementById('cd_or_auto_auto').checked = true;document.getElementById('cdromlist').value = ''")
81 (experimental; 1-2 minutes, and you have a machine with empty root password.)
87 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
89 $cdromList($defaults.cdrom, "document.getElementById('cd_or_auto_cd').checked = true;document.getElementById('autoinstalllist').value = ''")
94 $errorRow('cdrom', $err)
95 $errorRow('cdrom', $err)
98 <td><input type="text" name="owner" value="$defaults.owner"/></td>
101 $errorRow('owner', $err)
104 <input type="submit" class="button" value="Create it!"/><br />
105 Windows notes: #slurp
107 $helppopup('Windows')#slurp
113 #def machineRow($machine)
116 <form action="command" method="post">
117 <input type="hidden" name="back" value="list"/>
118 <input type="hidden" name="machine_id"
119 value="$machine.machine_id"/>
120 <input type="submit" class="power #slurp
121 #if $machine.uptime then 'on' else 'off'
122 " name="action" value="#slurp
123 #if $machine.uptime then 'Power off' else 'Power on'
127 <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
128 <td>${machine.memory}M</td>
129 <td>$machine.owner</td>
130 <td>$machine.administrator</td>
132 #set $nic = $machine.nics[0]
139 ${datetime.timedelta(seconds=int(machine.uptime))}#slurp
143 #if $has_vnc[$machine] == True
144 <a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
145 #else if $has_vnc[$machine] != 'Off'
153 <td colspan="7" style="padding-left: 1em; color: #666">$machine.description</td>
157 #def machineList($machines)
158 <table cellspacing="0" cellpadding="2">
165 $helppopup('Owner')#slurp
168 <th>Administrator#slurp
170 $helppopup('Administrator')#slurp
177 #for $machine in $machines:
179 $machineRow($machine)
183 <script type="text/javascript" src="/static/stripe.js"></script>
184 <script type="text/javascript">
185 document.observe("dom:loaded", function() {
186 stripe(\$('machinelist').getElementsByTagName('table')[0],
194 <p style="font-size: 125%;"><a href="/static/about.html">What is XVM?</a></p>
196 <p>You don't currently control any VMs.</p>
198 <p><a href="list">refresh</a></p>
199 <div id="machinelist">
201 $machineList($machines)