source: trunk/packages/invirt-web/code/templates/info.tmpl @ 2180

Last change on this file since 2180 was 2077, checked in by ezyang, 16 years ago
File size: 3.7 KB
RevLine 
[113]1#from skeleton import skeleton
2#extends skeleton
3
4#def title
[133]5Info 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"/>
[2077]32  <div>
[133]33        #if $on
[2077]34        <button type="submit" class="button" name="action" value="Power off">Power off (hard)</button>
35        <button type="submit" class="button" name="action" value="Shutdown">Shut down</button>
36        <input type="submit" class="button" name="action" value="Reboot"/>
[133]37        #else
[2077]38        <input type="submit" class="button" name="action" value="Power on"/>
[133]39        #end if
[2077]40  </div>
41  <div>
42    Boot CD:
[447]43#filter None
44$cdromList()#slurp
45#end filter
[2077]46  </div>
47  <div>
48      <input type="submit" class="button" name="action" value="Delete VM" onclick="return confirm('Are you sure that you want to delete this VM?');"/>
49  </div>
[133]50</form>
[205]51#end def
52
53#def modifyForm()
54#if $err
55<p class="error">We had a problem with your request:</p>
56#else if $varExists('new_machine')
57<p>Successfully modified.</p>
58#end if
[133]59#if $on
[166]60(To edit ram, disk size, or machine name, turn off the machine first.)
[133]61#end if
[207]62<form action="modify" method="POST">
[205]63  <input type="hidden" name="machine_id" value="$defaults.machine_id"/>
[133]64  <table>
[609]65    <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td></tr>
[447]66    <tr><td>Owner#slurp
67#filter None
[539]68$helppopup("Owner")#slurp
[447]69#end filter
70:</td><td><input type="text" name="owner", value="$defaults.owner"/></td></tr>
71#filter None
[205]72$errorRow('owner', $err)
[447]73#end filter
74    <tr><td>Administrator#slurp
75#filter None
[539]76$helppopup("Administrator")#slurp
[447]77#end filter
[572]78:</td><td><input type="text" name="admin", value="$defaults.administrator"/></td></tr>
[447]79#filter None
[205]80$errorRow('administrator', $err)
[447]81#end filter
[205]82    <tr><td>Contact email:</td><td><input type="text" name="contact" value="$defaults.contact"/></td></tr>
[447]83#filter None
[205]84$errorRow('contact', $err)
[447]85#end filter
[133]86#if not $on
[866]87    <tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/>.${config.dns.domains[0]}</td></tr>
[447]88#filter None
[205]89$errorRow('name', $err)
[447]90#end filter
[440]91    <tr>
[447]92      <td>HVM/ParaVM#slurp
93#filter None
[539]94$helppopup('HVM/ParaVM')#slurp
[447]95#end filter
96</td>
97      <td>#slurp
98#filter None
99$vmTypeList($defaults.type)#slurp
100#end filter
101</td>
[440]102    </tr>
[211]103    <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr>
[447]104#filter None
[205]105$errorRow('memory', $err)
[447]106#end filter
[572]107    <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]108#filter None
[205]109$errorRow('disk', $err)
[447]110#end filter
[205]111#else
[447]112#filter None
[205]113$errorRow('name', $err)
114$errorRow('memory', $err)
115$errorRow('disk', $err)
[447]116#end filter
[133]117#end if
118    <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr>
119  </table>
120</form>
[205]121#end def
[133]122
[205]123#def body
124<div id="info">
[447]125#filter None
[205]126  $infoTable()
[447]127#end filter
[205]128</div>
129
[430]130<h2>Commands</h2>
[205]131<div id="commands">
[447]132#filter None
[205]133  $commands()
[447]134#end filter
[205]135</div>
[430]136<h2>Settings</h2>
[205]137<div id="modify">
[447]138#filter None
[205]139  $modifyForm()
[447]140#end filter
[205]141</div>
[113]142#end def
Note: See TracBrowser for help on using the repository browser.