X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/e73cda9748a8726531dba4b309783dde1597549a..47b9cb0d87524e6598da025f3c49cd013f00606b:/code/templates/list.mako?ds=sidebyside
diff --git a/code/templates/list.mako b/code/templates/list.mako
index 176fe14..777134f 100644
--- a/code/templates/list.mako
+++ b/code/templates/list.mako
@@ -9,6 +9,12 @@
VM List
%def>
+%if os.path.exists("/etc/invirt/motd.html"):
+
+
${open('/etc/invirt/motd.html').read()|n}
+
+%endif
+
<%def name="createForm()">
% if cant_add_vm:
${cant_add_vm}
@@ -19,6 +25,7 @@ VM List
% elif new_machine:
Congratulations! You successfully created a new VM called ${new_machine}.
% endif
+
% endif
%def>
-<%def name="machineRow(machine)">
-
+<%def name="machineRow(machine, dark)">
+<%
+ on = (machine.uptime is not None)
+%>
+
-
+ % endif
|
${machine.name} |
${machine.memory}M |
${machine.owner} |
${machine.administrator} |
% if machine.nics:
- ${', '.join(map(lambda x: x.ip, machine.nics))} |
+ ${', '.join(nic.ip for nic in machine.nics)} |
% else:
|
% endif
\
-% if machine.uptime:
+% if on:
${datetime.timedelta(seconds=int(machine.uptime))}\
% endif
|
@@ -119,7 +142,11 @@ ${has_vnc[machine]}
% endif
-
+
${machine.description|self.fn.module.nl2br} |
%def>
@@ -136,17 +163,10 @@ ${has_vnc[machine]}
Uptime |
VNC |
-% for machine in machines:
- ${machineRow(machine)}
+% for n, machine in enumerate(machines):
+ ${machineRow(machine, (n%2)==0)}
% endfor
-
-
%def>
What is XVM?