source: package_branches/invirt-web/ajaxterm-rebased/code/templates/info.mako @ 2820

Last change on this file since 2820 was 2751, checked in by broder, 15 years ago

Add terminal page

File size: 3.5 KB
RevLine 
[2678]1<%page expression_filter="h"/>
2<%inherit file="skeleton.mako" />
3
4<%def name="title()">
5Info on ${machine.name}
6</%def>
7
8<%def name="infoTable()">
9<h2>Info</h2>
10<table>
11  % for key, value in fields:
12  <tr><td>${key}:</td><td>${value}</td></tr>
13  % endfor
14</table>
15</%def>
16
17<%def name="commands()">
18% if on:
19 % if not machine.type.hvm:
[2751]20  Console access: <a href="machine/${machine.machine_id}/terminal">Web Terminal</a> or type
[2678]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:
[2751]24  <strong><a href="machine/${machine.machine_id}/vnc">Get Console</a> or <a href="machine/${machine.machine_id}/terminal">Web Terminal</a></strong>
[2678]25 % else:
26  VNC console not enabled; still booting?
27 % endif
28% endif
[2683]29<%def name="command_button(title, value, cdrom=False, extra='')">
30<form action="machine/${machine.machine_id}/command/${value}" method="POST">
[2684]31  <input type="hidden" name="back" value="info" />
[2683]32  <input type="submit" class="button" name="action" value="${title}" ${extra | n}/>
33% if cdrom:
34  Boot CD: ${self.fn.cdromList()}
35% endif
36</form>
37</%def>
[2678]38  <div>
39        % if on:
[2683]40        ${command_button("Power off", "destroy")}
41        ${command_button("Shutdown", "shutdown")}
42        ${command_button("Reboot", "reboot", cdrom=True)}
[2678]43        % else:
[2683]44        ${command_button("Power on", "create", cdrom=True)}
[2678]45        % endif
46  </div>
47  <div>
[2683]48        ${command_button("Delete VM", "delete", extra='''onclick="return confirm('Are you sure that you want to delete this VM?');"''')}
[2678]49  </div>
50</form>
51</%def>
52
53<%def name="modifyForm()">
54% if err:
55<p class="error">We had a problem with your request:</p>
56% elif new_machine:
57<p>Successfully modified.</p>
58% endif
59% if on:
60(To edit ram, disk size, or machine name, turn off the machine first.)
61% endif
[2691]62<form action="machine/${machine.machine_id}/modify" method="POST">
[2678]63  <table>
64    <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">${defaults.description}</textarea></td></tr>
65    <tr><td>Owner${self.fn.helppopup("Owner")}:</td><td><input type="text" name="owner", value="${defaults.owner}"/></td></tr>
66${self.fn.errorRow('owner', err)}
67    <tr><td>Administrator${self.fn.helppopup("Administrator")}:</td><td><input type="text" name="admin", value="${defaults.administrator}"/></td></tr>
68${self.fn.errorRow('administrator', err)}
69    <tr><td>Contact email:</td><td><input type="text" name="contact" value="${defaults.contact}"/></td></tr>
70${self.fn.errorRow('contact', err)}
71% if not on:
72    <tr><td>Machine Name:</td><td><input type="text" name="name" value="${defaults.name}"/>.${config.dns.domains[0]}</td></tr>
73${self.fn.errorRow('name', err)}
74    <tr>
75      <td>HVM/ParaVM${self.fn.helppopup('HVM/ParaVM')}</td>
76      <td>${self.fn.vmTypeList(defaults.type)}</td>
77    </tr>
78    <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="${defaults.memory}"/>MiB (max ${max_mem})</td></tr>
79${self.fn.errorRow('memory', err)}
80    <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>
81${self.fn.errorRow('disk', err)}
82% else:
83${self.fn.errorRow('name', err)}
84${self.fn.errorRow('memory', err)}
85${self.fn.errorRow('disk', err)}
86% endif
87    <tr><td><input type="submit" class="button" name="action" value="Change"/></td></tr>
88  </table>
89</form>
90</%def>
91
92<div id="info">
93  ${infoTable()}
94</div>
95
96<h2>Commands</h2>
97<div id="commands">
98  ${commands()}
99</div>
100<h2>Settings</h2>
101<div id="modify">
102  ${modifyForm()}
103</div>
Note: See TracBrowser for help on using the repository browser.