Merge branch 'Tomato-RAF' into tomato-shibby
[tomato.git] / release / src / router / www / admin-buttons.asp
blob2bb0a1d5518bd42a84c17b9175112022e3e9ad13
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'],
92 /* USB-BEGIN */
93 [5,'Unmount all USB Drives'],
94 /* USB-END */
95 [4,'Run Custom Script']];
96 createFieldTable('', [
97 { title: "When Pushed For..." },
98 { title: '0-2 Seconds', indent: 2, name: 'sesx_b0', type: 'select', options: a, value: nvram.sesx_b0 || 0 },
99 { title: '4-6 Seconds', indent: 2, name: 'sesx_b1', type: 'select', options: a, value: nvram.sesx_b1 || 0 },
100 { title: '8-10 Seconds', indent: 2, name: 'sesx_b2', type: 'select', options: a, value: nvram.sesx_b2 || 0 },
101 { title: '12+ Seconds', indent: 2, name: 'sesx_b3', type: 'select', options: a, value: nvram.sesx_b3 || 0 },
102 { title: 'Custom Script', indent: 2, name: 'sesx_script', type: 'textarea', value: nvram.sesx_script }
104 </script>
105 </div>
106 </div>
108 <div id='braudiv' style='display:none'>
109 <div class='section-title'>Bridge/Auto Switch</div>
110 <div class='section'>
111 <script type='text/javascript'>
112 createFieldTable('', [
113 { title: 'Custom Script', indent: 2, name: 'script_brau', type: 'textarea', value: nvram.script_brau }
115 </script>
116 </div>
117 </div>
119 <div id='leddiv' style='display:none'>
120 <div class='section-title'>Startup LED</div>
121 <div class='section'>
122 <script type='text/javascript'>
123 createFieldTable('', [
124 { title: 'Amber SES', name: '_led0', type: 'checkbox', value: nvram.sesx_led & 1, hidden: !wham },
125 { title: 'White SES', name: '_led1', type: 'checkbox', value: nvram.sesx_led & 2, hidden: !wham },
126 { title: 'AOSS', name: '_led2', type: 'checkbox', value: nvram.sesx_led & 4, hidden: !aoss },
127 { title: 'Bridge', name: '_led3', type: 'checkbox', value: nvram.sesx_led & 8, hidden: !brau }
129 </script>
130 </div>
131 </div>
133 <script type='text/javascript'>
134 if ((!ses) && (!brau)) W('<i>This feature is not supported on this router.</i>');
135 </script>
137 <!-- / / / -->
139 </td></tr>
140 <tr><td id='footer' colspan=2>
141 <span id='footer-msg'></span>
142 <input type='button' value='Save' id='save-button' onclick='save()'>
143 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
144 </td></tr>
145 </table>
146 </form>
147 <script type='text/javascript'>earlyInit()</script>
148 </body>
149 </html>