From bee5d6b79f93e627eb105cd443701ac1975fd927 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 16 Apr 2008 23:13:41 -0400 Subject: [PATCH] improve display of VM list svn path=/trunk/packages/sipb-xen-www/; revision=424 --- code/main.py | 3 +++ code/templates/list.tmpl | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) 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 -- 1.7.9.5
NameMemoryOwnerAdministratorIPUptimeVNCNameMemoryOwnerAdministratorIPUptimeVNC