source: trunk/web/templates/list.tmpl @ 134

Last change on this file since 134 was 133, checked in by ecprice, 17 years ago

Update

File size: 2.1 KB
Line 
1#from skeleton import skeleton
2#extends skeleton
3
4#def title
5List of your VMs
6#end def
7
8#def body
9#if not $machines
10   
11#else
12    <p>You have the following VMs:</p>
13    <table>
14      <tr>
15        <td>Name</td>
16        <td>Memory</td>
17        <td>owner</td>
18        <td>IP</td>
19        <td>MAC Address</td>
20        <td>Hostname</td>
21        <td>Uptime</td>
22        <td>VNC</td>
23        <td>Restart?</td>
24      #for $machine in $machines:
25      <tr>
26        <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
27        <td>${machine.memory}M</td>
28        <td>$machine.owner</td>
29#if $machine.nics
30#set $nic = $machine.nics[0]
31        <td>$nic.ip</td>
32        <td>$nic.mac_addr</td>
33        <td>$nic.hostname</td>
34#else
35        <td></td>
36        <td></td>
37        <td></td>
38#end if
39<td>#slurp
40#if $uptimes.get($machine.name)
41$uptimes[$machine.name]#slurp
42#else
43Off#slurp
44#end if
45</td>
46        <td>#slurp
47#if $has_vnc.get($machine.name)
48<a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
49#else
50off#slurp
51#end if
52</td>
53        <td>
54          <form action="command">
55            <input type="hidden" name="machine_id"
56                   value="$machine.machine_id"/>
57            <input type="submit" class="button"
58                   value="Reboot"/>
59          </form>
60        </td>
61      </tr>
62      #end for
63    </table>
64#end if
65
66    <p>Create a new VM:</p>
67    <form action="create" method="POST">
68      <table>
69        <tr>
70          <td>Name</td>
71          <td>${user.username}_<input type="text" name="name" value=""/></td>
72        </tr>
73        <tr>
74          <td>Memory</td>
75          <td><input type="text" name="memory" value="$maxmem" size=3/> megabytes ($maxmem max)</td>
76        </tr>
77        <tr>
78          <td>Disk</td>
79          <td><input type="text" name="disk" value="$maxdisk" size=3/> gigabytes ($maxdisk max)</td>
80        </tr>
81        <tr>
82          <td>HVM/ParaVM</td>
83          <td>
84            <input checked type="radio" name="vmtype" value="hvm">HVM</input>
85            <input type="radio" name="vmtype" value="paravm">ParaVM</input>
86          </td>
87        </tr>
88        <tr>
89          <td>Boot CD</td>
90          <td>
91            <select name="cdrom">
92              <option selected value="">None</option>
93              #for $cdrom in $cdroms
94              <option value="$cdrom.cdrom_id">
95                $cdrom.description
96              </option>
97              #end for
98            </select>
99          </td>
100        </tr>
101      </table>
102      <input type="submit" class="button" value="Create it!"/>
103    </form>
104
105#end def
Note: See TracBrowser for help on using the repository browser.