Tomato 1.28
[tomato.git] / release / src / router / www / admin-buttons.asp
blob6563562d3ea703d154824e17dad8c5625c5fcb32
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] Admin: Buttons</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <link rel='stylesheet' type='text/css' href='color.css'>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
21 <style type='text/css'>
22 textarea {
23 width: 98%;
24 height: 15em;
26 </style>
28 <script type='text/javascript' src='debug.js'></script>
30 <script type='text/javascript'>
31 // <% nvram("sesx_led,sesx_b0,sesx_b1,sesx_b2,sesx_b3,sesx_script,script_brau,t_model,t_features"); %>
33 var ses = features('ses');
34 var brau = features('brau');
35 var aoss = features('aoss');
36 var wham = features('wham');
38 function verifyFields(focused, quiet)
40 return 1;
43 function save()
45 var n;
46 var fom;
48 fom = E('_fom');
49 n = 0;
50 if (fom._led0.checked) n |= 1;
51 if (fom._led1.checked) n |= 2;
52 if (fom._led2.checked) n |= 4;
53 if (fom._led3.checked) n |= 8;
54 fom.sesx_led.value = n;
55 form.submit(fom, 1);
58 function earlyInit()
60 if ((!brau) && (!ses)) {
61 E('save-button').disabled = 1;
62 return;
65 if (brau) E('braudiv').style.display = '';
66 E('sesdiv').style.display = '';
67 if ((wham) || (aoss) || (brau)) E('leddiv').style.display = '';
69 </script>
70 </head>
71 <body>
72 <form id='_fom' method='post' action='tomato.cgi'>
73 <table id='container' cellspacing=0>
74 <tr><td colspan=2 id='header'>
75 <div class='title'>Tomato</div>
76 <div class='version'>Version <% version(); %></div>
77 </td></tr>
78 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
79 <td id='content'>
80 <div id='ident'><% ident(); %></div>
82 <!-- / / / -->
84 <input type='hidden' name='_nextpage' value='admin-buttons.asp'>
85 <input type='hidden' name='sesx_led' value='0'>
87 <div id='sesdiv' style='display:none'>
88 <div class='section-title'>SES/AOSS Button</div>
89 <div class='section'>
90 <script type='text/javascript'>
91 a = [[0,'Do Nothing'],[1,'Toggle Wireless'],[2,'Reboot'],[3,'Shutdown'],[4,'Run Custom Script']];
92 createFieldTable('', [
93 { title: "When Pushed For..." },
94 { title: '0-2 Seconds', indent: 2, name: 'sesx_b0', type: 'select', options: a, value: nvram.sesx_b0 || 0 },
95 { title: '4-6 Seconds', indent: 2, name: 'sesx_b1', type: 'select', options: a, value: nvram.sesx_b1 || 0 },
96 { title: '8-10 Seconds', indent: 2, name: 'sesx_b2', type: 'select', options: a, value: nvram.sesx_b2 || 0 },
97 { title: '12+ Seconds', indent: 2, name: 'sesx_b3', type: 'select', options: a, value: nvram.sesx_b3 || 0 },
98 { title: 'Custom Script', indent: 2, name: 'sesx_script', type: 'textarea', value: nvram.sesx_script }
99 ]);
100 </script>
101 </div>
102 </div>
104 <div id='braudiv' style='display:none'>
105 <div class='section-title'>Bridge/Auto Switch</div>
106 <div class='section'>
107 <script type='text/javascript'>
108 createFieldTable('', [
109 { title: 'Custom Script', indent: 2, name: 'script_brau', type: 'textarea', value: nvram.script_brau }
111 </script>
112 </div>
113 </div>
115 <div id='leddiv' style='display:none'>
116 <div class='section-title'>Startup LED</div>
117 <div class='section'>
118 <script type='text/javascript'>
119 createFieldTable('', [
120 { title: 'Amber SES', name: '_led0', type: 'checkbox', value: nvram.sesx_led & 1, hidden: !wham },
121 { title: 'White SES', name: '_led1', type: 'checkbox', value: nvram.sesx_led & 2, hidden: !wham },
122 { title: 'AOSS', name: '_led2', type: 'checkbox', value: nvram.sesx_led & 4, hidden: !aoss },
123 { title: 'Bridge', name: '_led3', type: 'checkbox', value: nvram.sesx_led & 8, hidden: !brau }
125 </script>
126 </div>
127 </div>
129 <script type='text/javascript'>
130 if ((!ses) && (!brau)) W('<i>This feature is not supported on this router.</i>');
131 </script>
133 <!-- / / / -->
135 </td></tr>
136 <tr><td id='footer' colspan=2>
137 <span id='footer-msg'></span>
138 <input type='button' value='Save' id='save-button' onclick='save()'>
139 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
140 </td></tr>
141 </table>
142 </form>
143 <script type='text/javascript'>earlyInit()</script>
144 </body>
145 </html>