source: trunk/packages/sipb-xen-www/code/templates/info.tmpl @ 580

Last change on this file since 580 was 572, checked in by ecprice, 17 years ago

Put validation behind more abstraction.

File size: 3.5 KB
Line 
1#from skeleton import skeleton
2#extends skeleton
3
4#def title
5Info on $machine.name
6#end def
7
8#def infoTable()
9<h2>Info</h2>
10<table>
11  #for $key, $value in $fields
12  <tr><td>$key:</td><td>$value</td></tr>
13  #end for
14</table>
15#end def
16
17#def commands()
18<form action="command" method="POST">
19  <input type="hidden" name="back" value="info"/>
20  <input type="hidden" name="machine_id" value="$machine.machine_id"/>
21  <table>
22   
23    <tr><td colspan=3>
24        #if $on
25        #if $has_vnc
26        <strong><a href="vnc?machine_id=$machine.machine_id">Get Console</a></strong>
27        #else
28        VNC console not enabled; still booting?
29        #end if
30        #else
31
32        #end if
33    </td></tr>
34      <tr>
35        #if $on
36        <td><button type="submit" class="button" name="action" value="Power off">Power off (hard)</button></td>
37        <td><button type="submit" class="button" name="action" value="Shutdown">Shut down</button></td>
38        <td><input type="submit" class="button" name="action" value="Reboot"/></td>
39        #else
40        <td><input type="submit" class="button" name="action" value="Power on"/></td>
41        #end if
42      <td>Boot CD:</td>
43      <td>#slurp
44#filter None
45$cdromList()#slurp
46#end filter
47</td>
48  </tr>
49    <tr>
50      <td><input type="submit" class="button" name="action" value="Delete VM" onclick="return confirm('Are you sure that you want to delete this VM?');"/></td>
51    </tr>
52  </table>
53</form>
54#end def
55
56#def modifyForm()
57#if $err
58<p class="error">We had a problem with your request:</p>
59#else if $varExists('new_machine')
60<p>Successfully modified.</p>
61#end if
62#if $on
63(To edit ram, disk size, or machine name, turn off the machine first.)
64#end if
65<form action="modify" method="POST">
66  <input type="hidden" name="machine_id" value="$defaults.machine_id"/>
67  <table>
68    <tr><td>Owner#slurp
69#filter None
70$helppopup("Owner")#slurp
71#end filter
72:</td><td><input type="text" name="owner", value="$defaults.owner"/></td></tr>
73#filter None
74$errorRow('owner', $err)
75#end filter
76    <tr><td>Administrator#slurp
77#filter None
78$helppopup("Administrator")#slurp
79#end filter
80:</td><td><input type="text" name="admin", value="$defaults.administrator"/></td></tr>
81#filter None
82$errorRow('administrator', $err)
83#end filter
84    <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr>
85#filter None
86$errorRow('contact', $err)
87#end filter
88#if not $on
89    <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/></td></tr>
90#filter None
91$errorRow('name', $err)
92#end filter
93    <tr>
94      <td>HVM/ParaVM#slurp
95#filter None
96$helppopup('HVM/ParaVM')#slurp
97#end filter
98</td>
99      <td>#slurp
100#filter None
101$vmTypeList($defaults.type)#slurp
102#end filter
103</td>
104    </tr>
105    <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr>
106#filter None
107$errorRow('memory', $err)
108#end filter
109    <tr><td>Disk:</td><td><input type="text" size=3 name="disksize" value="$defaults.disk"/>GiB (max $max_disk)</td><td>WARNING: Modifying disk size may corrupt your data.</td></tr>
110#filter None
111$errorRow('disk', $err)
112#end filter
113#else
114#filter None
115$errorRow('name', $err)
116$errorRow('memory', $err)
117$errorRow('disk', $err)
118#end filter
119#end if
120    <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr>
121  </table>
122</form>
123#end def
124
125#def body
126<div id="info">
127#filter None
128  $infoTable()
129#end filter
130</div>
131
132<h2>Commands</h2>
133<div id="commands">
134#filter None
135  $commands()
136#end filter
137</div>
138<h2>Settings</h2>
139<div id="modify">
140#filter None
141  $modifyForm()
142#end filter
143</div>
144#end def
Note: See TracBrowser for help on using the repository browser.