X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/867613f209f2f414afd261258c73b6adf4bdd905..130435f257877a1f8bb82f2b432b45c973e5aefc:/templates/list.tmpl?ds=sidebyside diff --git a/templates/list.tmpl b/templates/list.tmpl index f820385..d6c0e00 100644 --- a/templates/list.tmpl +++ b/templates/list.tmpl @@ -1,95 +1,133 @@ #from skeleton import skeleton #extends skeleton + #def title List of your VMs #end def -#def body -#if not $machines - -#else -

You have the following VMs:

- - - - - - - - - - - - #for $machine in $machines: - - - - -#if $machine.nics -#set $nic = $machine.nics[0] - - - +#def createTable() +#if $cant_add_vm +

$cant_add_vm

#else - - - +

Create a new VM:

+#if $err +

We had a problem with your request:

+#else if $varExists('new_machine') +

Congratulations! You successfully created a new VM called $new_machine.

#end if - - - - - #end for -
NameMemoryownerIPMAC AddressHostnameStatusVNCRestart?
$machine.name${machine.memory}M$machine.owner$nic.ip$nic.mac_addr$nic.hostnameGood!Console -
- - -
-
-#end if - -

Create a new VM:

-
+ + + $errorRow('create', $err) - + +$errorRow('name', $err) - #set $maxmem=256 - + +$errorRow('memory', $err) - #set $maxdisk=1.5 - + +$errorRow('disk', $err) - + +$errorRow('vmtype', $err) - - + + +$errorRow('cdrom', $err) + + + + + $errorRow('owner', $err)
Name
Memory megabytes ($maxmem max) MiB ($max_memory max)
Disk gigabytes ($maxdisk max) GiB (${"%0.1f" % ($max_disk-0.05)} max)
HVM/ParaVMHVM/ParaVM$helppopup('hvm_paravm') - HVM - ParaVM +#for $value, $name in (('hvm', 'HVM'), ('paravm', 'ParaVM')) + $name +#end for
Initial Install - - Boot CD$cdromList($cdroms, $defaults.cdrom)
Owner
+#end if +#end def + +#def machineRow($machine) + + $machine.name + ${machine.memory}M + $machine.owner +#if $machine.nics +#set $nic = $machine.nics[0] + $nic.ip +#else + +#end if +#slurp +#if $machine.uptime +$machine.uptime#slurp +#else +Off#slurp +#end if + + #slurp +#if $has_vnc[$machine] == True +Console#slurp +#else +$has_vnc[$machine] +#end if + + +
+ + + +
+ + +#end def +#def machineList($machines) + + + + + + + + + + #for $machine in $machines: + $machineRow($machine) + #end for +
NameMemoryOwnerIPUptimeVNC
+#end def + + +#def body +#if not $machines +

You don't currently control any VMs.

+#else +

You have the following VMs:

+#end if +

refresh

+
+ $machineList($machines) +
+
+$createTable() +
#end def