New routers supported
[tomato.git] / release / src / router / www / nas-ups.asp
blob950e4dfb9ae8383bef7315545cfcf18b1d8e99b7
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 For use with Tomato Firmware only.
5 No part of this file may be used without permission.
6 -->
7 <html>
8 <head>
9 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
10 <meta name='robots' content='noindex,nofollow'>
11 <title>[<% ident(); %>] NAS: UPS Monitor</title>
12 <link rel='stylesheet' type='text/css' href='tomato.css'>
13 <% css(); %>
14 <script type='text/javascript' src='tomato.js'></script>
15 <style type='text/css'>
16 textarea {
17 width: 98%;
18 height: 5em;
20 </style>
21 <style type='text/css'>
22 #dev-grid .co1 {
23 width: 10%;
25 #dev-grid .co2 {
26 width: 9%;
28 #dev-grid .co3 {
29 width: 65%;
31 #dev-grid .co4 {
32 width: 16%;
33 text-align: center;
35 #dev-grid .header {
36 text-align: left;
38 </style>
39 <script type='text/javascript'>
41 // <% nvram(""); %>
43 function init()
45 clientSideInclude('ups-status', '/ext/cgi-bin/tomatoups.cgi');
46 clientSideInclude('ups-data', '/ext/cgi-bin/tomatodata.cgi');
48 function clientSideInclude(id, url) {
49 var req = false;
50 // For Safari, Firefox, and other non-MS browsers
51 if (window.XMLHttpRequest) {
52 try {
53 req = new XMLHttpRequest();
54 } catch (e) {
55 req = false;
57 } else if (window.ActiveXObject) {
58 // For Internet Explorer on Windows
59 try {
60 req = new ActiveXObject("Msxml2.XMLHTTP");
61 } catch (e) {
62 try {
63 req = new ActiveXObject("Microsoft.XMLHTTP");
64 } catch (e) {
65 req = false;
69 var element = document.getElementById(id);
70 if (!element) {
71 alert("Bad id " + id +
72 "passed to clientSideInclude." +
73 "You need a div or span element " +
74 "with this id in your page.");
75 return;
77 if (req) {
78 // Synchronous request, wait till we have it all
79 req.open('GET', url, false);
80 req.send(null);
81 element.innerHTML = req.responseText;
82 } else {
83 element.innerHTML =
84 "Sorry, your browser does not support " +
85 "XMLHTTPRequest objects. This page requires " +
86 "Internet Explorer 5 or better for Windows, " +
87 "or Firefox for any system, or Safari. Other " +
88 "compatible browsers may also exist.";
91 </script>
92 </head>
93 <body onload='init()'>
94 <form id='_fom' method='post' action='tomato.cgi'>
95 <table id='container' cellspacing=0>
96 <tr><td colspan=2 id='header'>
97 <div class='title'>Tomato</div>
98 <div class='version'>Version <% version(); %></div>
99 </td></tr>
100 <tr id='body'><td id='navi' style="height: 188px"><script type='text/javascript'>navi()</script></td>
101 <td id='content' style="height: 188px">
102 <div id='ident'><% ident(); %></div>
103 <input type='hidden' name='_nextpage' value='nas-ups.asp'>
104 <div class='section-title'>APC UPS Status</div>
105 <div class='section'>
106 <span id="ups-status"></span>
107 </div>
108 <div class='section-title'>APC UPS Response</div>
109 <div class='section'>
110 <span id="ups-data"></span>
111 </div>
112 </td></tr>
113 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
114 </table>
115 </form>
116 </body>
117 </html>