Tomato 1.28
[tomato.git] / release / src / router / www / admin-config.asp
blob672b5cccfc2d18a439639a67ed54baed9c1c9d8d
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"); %>
27 function fix(name)
29 var i;
30 if (((i = name.lastIndexOf('/')) > 0) || ((i = name.lastIndexOf('\\')) > 0))
31 name = name.substring(i + 1, name.length);
32 return name;
35 function backupNameChanged()
37 var name = fix(E('backup-name').value);
38 if (name.length > 1) {
39 E('backup-link').href = 'cfg/' + name + '.cfg?_http_id=' + nvram.http_id;
41 else {
42 E('backup-link').href = '?';
46 function backupButton()
48 var name = fix(E('backup-name').value);
49 if (name.length <= 1) {
50 alert('Invalid filename');
51 return;
53 location.href = 'cfg/' + name + '.cfg?_http_id=' + nvram.http_id;
56 function restoreButton()
58 var name, i, f;
60 name = fix(E('restore-name').value);
61 name = name.toLowerCase();
62 if ((name.indexOf('.cfg') != (name.length - 4)) && (name.indexOf('.cfg.gz') != (name.length - 7))) {
63 alert('Incorrect filename. Expecting a ".cfg" file.');
64 return;
66 if (!confirm('Are you sure?')) return;
67 E('restore-button').disabled = 1;
69 f = E('restore-form');
70 form.addIdAction(f);
71 f.submit();
74 function resetButton()
76 var i;
78 i = E('restore-mode').value;
79 if (i == 0) return;
80 if ((i == 2) && (features('!nve'))) {
81 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;
83 if (!confirm('Are you sure?')) return;
84 E('reset-button').disabled = 1;
85 form.submit('aco-reset-form');
87 </script>
88 </head>
89 <body onload='backupNameChanged()'>
90 <table id='container' cellspacing=0>
91 <tr><td colspan=2 id='header'>
92 <div class='title'>Tomato</div>
93 <div class='version'>Version <% version(); %></div>
94 </td></tr>
95 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
96 <td id='content'>
97 <div id='ident'><% ident(); %></div>
99 <!-- / / / -->
101 <div class='section-title'>Backup Configuration</div>
102 <div class='section'>
103 <form>
104 <script type='text/javascript'>
105 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) + "'>");
106 </script>
107 .cfg &nbsp;
108 <input type='button' name='f_backup_button' onclick='backupButton()' value='Backup'><br>
109 <a href='' id='backup-link'>Link</a>
110 </form>
111 </div>
113 <br><br>
115 <div class='section-title'>Restore Configuration</div>
116 <div class='section'>
117 <form id='restore-form' method='post' action='cfg/restore.cgi' encType='multipart/form-data'>
118 Select the configuration file to restore:<br>
119 <input type='file' size='40' id='restore-name' name='filename'> <input type='button' name='f_restore_button' id='restore-button' value='Restore' onclick='restoreButton()'>
120 <br>
121 </form>
122 </div>
124 <br><br>
126 <div class='section-title'>Restore Default Configuration</div>
127 <div class='section'>
128 <form id='aco-reset-form' method='post' action='cfg/defaults.cgi'>
129 <select name='mode' id='restore-mode'>
130 <option value=0>Select...</option>
131 <option value=1>Restore default router settings (normal)</option>
132 <option value=2>Erase all data in NVRAM memory (thorough)</option>
133 </select>
134 <input type='button' value='OK' onclick='resetButton()' id='reset-button'>
135 </form>
136 </div>
138 <!-- / / / -->
140 </td></tr>
141 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
142 </table>
143 <br><br>
144 </body>
145 </html>