From: Greg Price Date: Thu, 17 Apr 2008 03:13:41 +0000 (-0400) Subject: improve display of VM list X-Git-Tag: sipb-xen-www/3.4~41 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/bee5d6b79f93e627eb105cd443701ac1975fd927 improve display of VM list svn path=/trunk/packages/sipb-xen-www/; revision=424 --- diff --git a/code/main.py b/code/main.py index d17ed97..c419f32 100755 --- a/code/main.py +++ b/code/main.py @@ -210,6 +210,9 @@ def getListDict(user): owner=user, cdrom='gutsy-i386') checkpoint.checkpoint('Got defaults') + def sortkey(machine): + return (machine.owner != user, machine.owner, machine.name) + machines = sorted(machines, key=sortkey) d = dict(user=user, cant_add_vm=validation.cantAddVm(user), max_memory=max_memory, diff --git a/code/templates/list.tmpl b/code/templates/list.tmpl index ae0d564..88bab49 100644 --- a/code/templates/list.tmpl +++ b/code/templates/list.tmpl @@ -84,14 +84,12 @@ $errorRow('cdrom', $err) #slurp #if $machine.uptime $machine.uptime#slurp -#else -Off#slurp #end if #slurp #if $has_vnc[$machine] == True Console#slurp -#else +#else if $has_vnc[$machine] != 'Off' $has_vnc[$machine] #end if @@ -111,14 +109,15 @@ $has_vnc[$machine] #def machineList($machines) - - - - - - - - + + + + + + + + + #for $machine in $machines: $machineRow($machine) #end for
NameMemoryOwnerAdministratorIPUptimeVNCNameMemoryOwnerAdministratorIPUptimeVNC