[205] | 1 | #from functions import functions |
---|
| 2 | #extends functions |
---|
| 3 | |
---|
| 4 | #def full_body |
---|
| 5 | <!DOCTYPE html |
---|
| 6 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
| 7 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
[113] | 8 | <html> |
---|
[139] | 9 | <head><title>$title</title> |
---|
[184] | 10 | <link href="static/favicon.ico" type="image/x-icon" rel="shortcut icon"> |
---|
| 11 | <link rel="stylesheet" href="static/style.css" type="text/css" /> |
---|
| 12 | <link rel="stylesheet" href="static/layout.css" type="text/css" media="screen" /> |
---|
[205] | 13 | <script type="text/javascript" src="static/prototype.js"></script> |
---|
[139] | 14 | <script type="text/javascript"> |
---|
| 15 | var helpWin = null; |
---|
| 16 | function closeWin(){ |
---|
| 17 | if (helpWin != null){ |
---|
| 18 | if(!helpWin.closed) |
---|
| 19 | helpWin.close(); |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | function helppopup(name){ |
---|
| 24 | closeWin() |
---|
[153] | 25 | helpWin = window.open("help?simple=true&subject="+encodeURIComponent(name), "Help", |
---|
[139] | 26 | "status, height = 300, width = 400"); |
---|
| 27 | if (window.focus){helpWin.focus();} |
---|
| 28 | return false; |
---|
| 29 | } |
---|
[205] | 30 | |
---|
| 31 | Ajax.Responders.register({ |
---|
| 32 | onCreate: function(){ |
---|
| 33 | if (Ajax.activeRequestCount > 0) { |
---|
| 34 | document.getElementById("loadingnotice").style.display = 'block'; |
---|
| 35 | } |
---|
| 36 | }, |
---|
| 37 | onComplete: function(){ |
---|
| 38 | if (Ajax.activeRequestCount == 0) { |
---|
| 39 | document.getElementById("loadingnotice").style.display = 'none'; |
---|
| 40 | } |
---|
| 41 | } |
---|
| 42 | }); |
---|
| 43 | function replaceFunc(transport) { |
---|
| 44 | try { |
---|
| 45 | d = transport.responseText.evalJSON(); |
---|
| 46 | } catch (e) { |
---|
| 47 | \$('body').innerHTML = '<pre>'+transport.responseText+'</pre>' |
---|
| 48 | return; |
---|
| 49 | } |
---|
| 50 | for(key in d) { |
---|
| 51 | \$(key).innerHTML = d[key]; |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | function jsFormSubmit(location, elt){ |
---|
| 56 | new Ajax.Request(location, {method: 'post', |
---|
| 57 | parameters: Form.serialize(elt)+'&js=true', |
---|
| 58 | onSuccess: replaceFunc, |
---|
| 59 | onComplete: function() {Form.enable(elt);} |
---|
| 60 | }); |
---|
| 61 | Form.disable(elt); |
---|
| 62 | return false; |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | function rowFormSubmit(elt, retpage){ |
---|
| 66 | new Ajax.Request('command', {method: 'post', |
---|
| 67 | parameters: Form.serialize(elt)+'&js='+retpage, |
---|
| 68 | onSuccess: replaceFunc |
---|
| 69 | }); |
---|
| 70 | return false; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | window.onload = { |
---|
| 74 | //Fix bug with disabled elements |
---|
| 75 | $$('form').each(Form.enable); |
---|
| 76 | } |
---|
| 77 | |
---|
[139] | 78 | </script> |
---|
| 79 | </head> |
---|
[205] | 80 | <body id="body"> |
---|
| 81 | |
---|
| 82 | <div id="err"> |
---|
| 83 | #if $varExists('error_text') |
---|
| 84 | <p>STDERR:</p><pre>$error_text</pre> |
---|
| 85 | #end if |
---|
| 86 | </div> |
---|
| 87 | |
---|
[139] | 88 | #if not $varExists('simple') or not $simple |
---|
[113] | 89 | <p>[You are logged in as $user.username.]</p> |
---|
[205] | 90 | |
---|
| 91 | <div class="navigation"> |
---|
[187] | 92 | <p><a href="list">List</a> |
---|
| 93 | #if $varExists('machine') |
---|
| 94 | <a href="info?machine_id=$machine.machine_id">Info</a> |
---|
| 95 | <a href="vnc?machine_id=$machine.machine_id">Console</a> |
---|
[139] | 96 | #end if |
---|
[187] | 97 | <a href="help">Help</a></p> |
---|
| 98 | #end if |
---|
[205] | 99 | </div> |
---|
| 100 | |
---|
| 101 | <div id="loadingnotice" class="loadingnotice">LOADING</div> |
---|
| 102 | <div id="result" class="result"></div> |
---|
| 103 | |
---|
[113] | 104 | $body |
---|
[139] | 105 | #if not $varExists('simple') or not $simple |
---|
[113] | 106 | <hr /> |
---|
| 107 | Questions? Contact <a href="mailto:sipb-xen-dev@mit.edu">sipb-xen-dev@mit.edu</a>. |
---|
[139] | 108 | #end if |
---|
[113] | 109 | </body> |
---|
| 110 | </html> |
---|
[205] | 111 | #end def |
---|