usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / www / admin-config.asp
blob795ab76b955d70af1485abd619d3d0d325f56626
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: Configuration</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 <script type='text/javascript' src='debug.js'></script>
23 <script type='text/javascript'>
25 // <% nvram("et0macaddr,t_features,t_model_name"); %>
26 // <% nvstat(); %>
28 function backupNameChanged()
30 var name = fixFile(E('backup-name').value);
31 if (name.length > 1) {
32 E('backup-link').href = 'cfg/' + name + '.cfg?_http_id=' + nvram.http_id;
34 else {
35 E('backup-link').href = '?';
39 function backupButton()
41 var name = fixFile(E('backup-name').value);
42 if (name.length <= 1) {
43 alert('Invalid filename');
44 return;
46 location.href = 'cfg/' + name + '.cfg?_http_id=' + nvram.http_id;
49 function restoreButton()
51 var name, i, f;
53 name = fixFile(E('restore-name').value);
54 name = name.toLowerCase();
55 if ((name.indexOf('.cfg') != (name.length - 4)) && (name.indexOf('.cfg.gz') != (name.length - 7))) {
56 alert('Incorrect filename. Expecting a ".cfg" file.');
57 return;
59 if (!confirm('Are you sure?')) return;
60 E('restore-button').disabled = 1;
62 f = E('restore-form');
63 form.addIdAction(f);
64 f.submit();
67 function resetButton()
69 var i;
71 i = E('restore-mode').value;
72 if (i == 0) return;
73 if ((i == 2) && (features('!nve'))) {
74 if (!confirm('WARNING: Erasing the NVRAM on a ' + nvram.t_model_name + ' router may be harmful. It may not be able to re-setup the NVRAM correctly after a complete erase. Proceeed anyway?')) return;
76 if (!confirm('Are you sure?')) return;
77 E('reset-button').disabled = 1;
78 form.submit('aco-reset-form');
80 </script>
81 </head>
82 <body onload='backupNameChanged()'>
83 <table id='container' cellspacing=0>
84 <tr><td colspan=2 id='header'>
85 <div class='title'>Tomato</div>
86 <div class='version'>Version <% version(); %></div>
87 </td></tr>
88 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
89 <td id='content'>
90 <div id='ident'><% ident(); %></div>
92 <!-- / / / -->
94 <div class='section-title'>Backup Configuration</div>
95 <div class='section'>
96 <form>
97 <script type='text/javascript'>
98 W("<input type='text' size='40' maxlength='64' id='backup-name' onchange='backupNameChanged()' value='tomato_v" + ('<% version(); %>'.replace(/\./g, '')) + "_m" + nvram.et0macaddr.replace(/:/g, '').substring(6, 12) + "'>");
99 </script>
100 .cfg &nbsp;
101 <input type='button' name='f_backup_button' onclick='backupButton()' value='Backup'><br>
102 <a href='' id='backup-link'>Link</a>
103 </form>
104 </div>
106 <br><br>
108 <div class='section-title'>Restore Configuration</div>
109 <div class='section'>
110 <form id='restore-form' method='post' action='cfg/restore.cgi' encType='multipart/form-data'>
111 Select the configuration file to restore:<br>
112 <input type='file' size='40' id='restore-name' name='filename'> <input type='button' name='f_restore_button' id='restore-button' value='Restore' onclick='restoreButton()'>
113 <br>
114 </form>
115 </div>
117 <br><br>
119 <div class='section-title'>Restore Default Configuration</div>
120 <div class='section'>
121 <form id='aco-reset-form' method='post' action='cfg/defaults.cgi'>
122 <select name='mode' id='restore-mode'>
123 <option value=0>Select...</option>
124 <option value=1>Restore default router settings (normal)</option>
125 <option value=2>Erase all data in NVRAM memory (thorough)</option>
126 </select>
127 <input type='button' value='OK' onclick='resetButton()' id='reset-button'>
128 </form>
129 </div>
131 <br>
133 <div class='section-title'></div>
134 <div class='section'>
135 <script type='text/javascript'>
136 var a = nvstat.free / nvstat.size * 100.0;
137 createFieldTable('', [
138 { title: 'Total / Free NVRAM:', text: scaleSize(nvstat.size) + ' / ' + scaleSize(nvstat.free) + ' <small>(' + (a).toFixed(2) + '%)</small>' }
141 if (a <= 5) {
142 document.write('<br><div id="notice1">' +
143 'The NVRAM free space is very low. It is strongly recommended to ' +
144 'erase all data in NVRAM memory, and reconfigure the router manually ' +
145 'in order to clean up all unused and obsolete entries.' +
146 '</div><br style="clear:both">');
148 </script>
149 </div>
151 <!-- / / / -->
153 </td></tr>
154 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
155 </table>
156 <br><br>
157 </body>
158 </html>