1 | #from skeleton import skeleton |
---|
2 | #extends skeleton |
---|
3 | |
---|
4 | #def title |
---|
5 | Info 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=100> |
---|
24 | #if $on |
---|
25 | #if not $machine.type.hvm |
---|
26 | Console access: type |
---|
27 | <tt>ssh $machine.name@$config.console.hostname</tt> |
---|
28 | on Athena. <a href="https://xvm.scripts.mit.edu/wiki/SerialConsole">(more info)</a> |
---|
29 | #elif $has_vnc |
---|
30 | <strong><a href="vnc?machine_id=$machine.machine_id">Get Console</a></strong> |
---|
31 | #else |
---|
32 | VNC console not enabled; still booting? |
---|
33 | #end if |
---|
34 | #else |
---|
35 | |
---|
36 | #end if |
---|
37 | </td></tr> |
---|
38 | <tr> |
---|
39 | #if $on |
---|
40 | <td><button type="submit" class="button" name="action" value="Power off">Power off (hard)</button></td> |
---|
41 | <td><button type="submit" class="button" name="action" value="Shutdown">Shut down</button></td> |
---|
42 | <td><input type="submit" class="button" name="action" value="Reboot"/></td> |
---|
43 | #else |
---|
44 | <td><input type="submit" class="button" name="action" value="Power on"/></td> |
---|
45 | #end if |
---|
46 | <td>Boot CD:</td> |
---|
47 | <td>#slurp |
---|
48 | #filter None |
---|
49 | $cdromList()#slurp |
---|
50 | #end filter |
---|
51 | </td> |
---|
52 | </tr> |
---|
53 | <tr> |
---|
54 | <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> |
---|
55 | </tr> |
---|
56 | </table> |
---|
57 | </form> |
---|
58 | #end def |
---|
59 | |
---|
60 | #def modifyForm() |
---|
61 | #if $err |
---|
62 | <p class="error">We had a problem with your request:</p> |
---|
63 | #else if $varExists('new_machine') |
---|
64 | <p>Successfully modified.</p> |
---|
65 | #end if |
---|
66 | #if $on |
---|
67 | (To edit ram, disk size, or machine name, turn off the machine first.) |
---|
68 | #end if |
---|
69 | <form action="modify" method="POST"> |
---|
70 | <input type="hidden" name="machine_id" value="$defaults.machine_id"/> |
---|
71 | <table> |
---|
72 | <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td></tr> |
---|
73 | <tr><td>Owner#slurp |
---|
74 | #filter None |
---|
75 | $helppopup("Owner")#slurp |
---|
76 | #end filter |
---|
77 | :</td><td><input type="text" name="owner", value="$defaults.owner"/></td></tr> |
---|
78 | #filter None |
---|
79 | $errorRow('owner', $err) |
---|
80 | #end filter |
---|
81 | <tr><td>Administrator#slurp |
---|
82 | #filter None |
---|
83 | $helppopup("Administrator")#slurp |
---|
84 | #end filter |
---|
85 | :</td><td><input type="text" name="admin", value="$defaults.administrator"/></td></tr> |
---|
86 | #filter None |
---|
87 | $errorRow('administrator', $err) |
---|
88 | #end filter |
---|
89 | <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr> |
---|
90 | #filter None |
---|
91 | $errorRow('contact', $err) |
---|
92 | #end filter |
---|
93 | #if not $on |
---|
94 | <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/>.${config.dns.domains[0]}</td></tr> |
---|
95 | #filter None |
---|
96 | $errorRow('name', $err) |
---|
97 | #end filter |
---|
98 | <tr> |
---|
99 | <td>HVM/ParaVM#slurp |
---|
100 | #filter None |
---|
101 | $helppopup('HVM/ParaVM')#slurp |
---|
102 | #end filter |
---|
103 | </td> |
---|
104 | <td>#slurp |
---|
105 | #filter None |
---|
106 | $vmTypeList($defaults.type)#slurp |
---|
107 | #end filter |
---|
108 | </td> |
---|
109 | </tr> |
---|
110 | <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr> |
---|
111 | #filter None |
---|
112 | $errorRow('memory', $err) |
---|
113 | #end filter |
---|
114 | <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> |
---|
115 | #filter None |
---|
116 | $errorRow('disk', $err) |
---|
117 | #end filter |
---|
118 | #else |
---|
119 | #filter None |
---|
120 | $errorRow('name', $err) |
---|
121 | $errorRow('memory', $err) |
---|
122 | $errorRow('disk', $err) |
---|
123 | #end filter |
---|
124 | #end if |
---|
125 | <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr> |
---|
126 | </table> |
---|
127 | </form> |
---|
128 | #end def |
---|
129 | |
---|
130 | #def body |
---|
131 | <div id="info"> |
---|
132 | #filter None |
---|
133 | $infoTable() |
---|
134 | #end filter |
---|
135 | </div> |
---|
136 | |
---|
137 | <h2>Commands</h2> |
---|
138 | <div id="commands"> |
---|
139 | #filter None |
---|
140 | $commands() |
---|
141 | #end filter |
---|
142 | </div> |
---|
143 | <h2>Settings</h2> |
---|
144 | <div id="modify"> |
---|
145 | #filter None |
---|
146 | $modifyForm() |
---|
147 | #end filter |
---|
148 | </div> |
---|
149 | #end def |
---|