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