[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() |
---|
[301] | 18 | <form action="command" method="POST"> |
---|
[207] | 19 | <input type="hidden" name="back" value="info"/> |
---|
[133] | 20 | <input type="hidden" name="machine_id" value="$machine.machine_id"/> |
---|
| 21 | <table> |
---|
| 22 | |
---|
[1789] | 23 | <tr><td colspan=100> |
---|
[133] | 24 | #if $on |
---|
[1789] | 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 |
---|
[430] | 30 | <strong><a href="vnc?machine_id=$machine.machine_id">Get Console</a></strong> |
---|
[133] | 31 | #else |
---|
[430] | 32 | VNC console not enabled; still booting? |
---|
[133] | 33 | #end if |
---|
| 34 | #else |
---|
| 35 | |
---|
| 36 | #end if |
---|
| 37 | </td></tr> |
---|
| 38 | <tr> |
---|
| 39 | #if $on |
---|
[430] | 40 | <td><button type="submit" class="button" name="action" value="Power off">Power off (hard)</button></td> |
---|
[436] | 41 | <td><button type="submit" class="button" name="action" value="Shutdown">Shut down</button></td> |
---|
[207] | 42 | <td><input type="submit" class="button" name="action" value="Reboot"/></td> |
---|
[133] | 43 | #else |
---|
[207] | 44 | <td><input type="submit" class="button" name="action" value="Power on"/></td> |
---|
[133] | 45 | #end if |
---|
| 46 | <td>Boot CD:</td> |
---|
[447] | 47 | <td>#slurp |
---|
| 48 | #filter None |
---|
| 49 | $cdromList()#slurp |
---|
| 50 | #end filter |
---|
| 51 | </td> |
---|
[133] | 52 | </tr> |
---|
| 53 | <tr> |
---|
[205] | 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> |
---|
[133] | 55 | </tr> |
---|
| 56 | </table> |
---|
| 57 | </form> |
---|
[205] | 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 |
---|
[133] | 66 | #if $on |
---|
[166] | 67 | (To edit ram, disk size, or machine name, turn off the machine first.) |
---|
[133] | 68 | #end if |
---|
[207] | 69 | <form action="modify" method="POST"> |
---|
[205] | 70 | <input type="hidden" name="machine_id" value="$defaults.machine_id"/> |
---|
[133] | 71 | <table> |
---|
[609] | 72 | <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td></tr> |
---|
[447] | 73 | <tr><td>Owner#slurp |
---|
| 74 | #filter None |
---|
[539] | 75 | $helppopup("Owner")#slurp |
---|
[447] | 76 | #end filter |
---|
| 77 | :</td><td><input type="text" name="owner", value="$defaults.owner"/></td></tr> |
---|
| 78 | #filter None |
---|
[205] | 79 | $errorRow('owner', $err) |
---|
[447] | 80 | #end filter |
---|
| 81 | <tr><td>Administrator#slurp |
---|
| 82 | #filter None |
---|
[539] | 83 | $helppopup("Administrator")#slurp |
---|
[447] | 84 | #end filter |
---|
[572] | 85 | :</td><td><input type="text" name="admin", value="$defaults.administrator"/></td></tr> |
---|
[447] | 86 | #filter None |
---|
[205] | 87 | $errorRow('administrator', $err) |
---|
[447] | 88 | #end filter |
---|
[205] | 89 | <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr> |
---|
[447] | 90 | #filter None |
---|
[205] | 91 | $errorRow('contact', $err) |
---|
[447] | 92 | #end filter |
---|
[133] | 93 | #if not $on |
---|
[866] | 94 | <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/>.${config.dns.domains[0]}</td></tr> |
---|
[447] | 95 | #filter None |
---|
[205] | 96 | $errorRow('name', $err) |
---|
[447] | 97 | #end filter |
---|
[440] | 98 | <tr> |
---|
[447] | 99 | <td>HVM/ParaVM#slurp |
---|
| 100 | #filter None |
---|
[539] | 101 | $helppopup('HVM/ParaVM')#slurp |
---|
[447] | 102 | #end filter |
---|
| 103 | </td> |
---|
| 104 | <td>#slurp |
---|
| 105 | #filter None |
---|
| 106 | $vmTypeList($defaults.type)#slurp |
---|
| 107 | #end filter |
---|
| 108 | </td> |
---|
[440] | 109 | </tr> |
---|
[211] | 110 | <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr> |
---|
[447] | 111 | #filter None |
---|
[205] | 112 | $errorRow('memory', $err) |
---|
[447] | 113 | #end filter |
---|
[572] | 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> |
---|
[447] | 115 | #filter None |
---|
[205] | 116 | $errorRow('disk', $err) |
---|
[447] | 117 | #end filter |
---|
[205] | 118 | #else |
---|
[447] | 119 | #filter None |
---|
[205] | 120 | $errorRow('name', $err) |
---|
| 121 | $errorRow('memory', $err) |
---|
| 122 | $errorRow('disk', $err) |
---|
[447] | 123 | #end filter |
---|
[133] | 124 | #end if |
---|
| 125 | <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr> |
---|
| 126 | </table> |
---|
| 127 | </form> |
---|
[205] | 128 | #end def |
---|
[133] | 129 | |
---|
[205] | 130 | #def body |
---|
| 131 | <div id="info"> |
---|
[447] | 132 | #filter None |
---|
[205] | 133 | $infoTable() |
---|
[447] | 134 | #end filter |
---|
[205] | 135 | </div> |
---|
| 136 | |
---|
[430] | 137 | <h2>Commands</h2> |
---|
[205] | 138 | <div id="commands"> |
---|
[447] | 139 | #filter None |
---|
[205] | 140 | $commands() |
---|
[447] | 141 | #end filter |
---|
[205] | 142 | </div> |
---|
[430] | 143 | <h2>Settings</h2> |
---|
[205] | 144 | <div id="modify"> |
---|
[447] | 145 | #filter None |
---|
[205] | 146 | $modifyForm() |
---|
[447] | 147 | #end filter |
---|
[205] | 148 | </div> |
---|
[113] | 149 | #end def |
---|