Tomato 1.24
[tomato.git] / release / src / router / www / admin-config.asp
blobef704cfe5d139e4985427bd304fdeaf4dd2d36a9
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2009 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 backupButton()
37 var name;
39 name = fix(E('backup-name').value);
40 if (name.length <= 1) {
41 alert('Invalid filename');
42 return;
44 location.href = 'cfg/' + name + '.cfg?_http_id=' + nvram.http_id;
47 function restoreButton()
49 var name, i, f;
51 name = fix(E('restore-name').value);
52 name = name.toLowerCase();
53 if ((name.indexOf('.cfg') != (name.length - 4)) && (name.indexOf('.cfg.gz') != (name.length - 7))) {
54 alert('Incorrect filename. Expecting a ".cfg" file.');
55 return;
57 if (!confirm('Are you sure?')) return;
58 E('restore-button').disabled = 1;
60 f = E('restore-form');
61 form.addIdAction(f);
62 f.submit();
65 function resetButton()
67 var i;
69 i = E('restore-mode').value;
70 if (i == 0) return;
71 if ((i == 2) && (features('!nve'))) {
72 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;
74 if (!confirm('Are you sure?')) return;
75 E('reset-button').disabled = 1;
76 form.submit('aco-reset-form');
78 </script>
79 </head>
80 <body>
81 <table id='container' cellspacing=0>
82 <tr><td colspan=2 id='header'>
83 <div class='title'>Tomato</div>
84 <div class='version'>Version <% version(); %></div>
85 </td></tr>
86 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
87 <td id='content'>
88 <div id='ident'><% ident(); %></div>
90 <!-- / / / -->
92 <div class='section-title'>Backup Configuration</div>
93 <div class='section'>
94 <form>
95 <script type='text/javascript'>
96 W("<input type='text' size='40' maxlength='64' id='backup-name' value='tomato_v" + ('<% version(); %>'.replace(/\./g, '')) + "_m" + nvram.et0macaddr.replace(/:/g, '').substring(6, 12) + "'>");
97 </script>
98 .cfg &nbsp;
99 <input type='button' name='f_backup_button' onclick='backupButton()' value='Backup'>
100 </form>
101 </div>
103 <br><br>
105 <div class='section-title'>Restore Configuration</div>
106 <div class='section'>
107 <form id='restore-form' method='post' action='cfg/restore.cgi' encType='multipart/form-data'>
108 Select the configuration file to restore:<br>
109 <input type='file' size='40' id='restore-name' name='filename'> <input type='button' name='f_restore_button' id='restore-button' value='Restore' onclick='restoreButton()'>
110 <br>
111 </form>
112 </div>
114 <br><br>
116 <div class='section-title'>Restore Default Configuration</div>
117 <div class='section'>
118 <form id='aco-reset-form' method='post' action='cfg/defaults.cgi'>
119 <select name='mode' id='restore-mode'>
120 <option value=0>Select...</option>
121 <option value=1>Restore default router settings (normal)</option>
122 <option value=2>Erase all data in NVRAM memory (thorough)</option>
123 </select>
124 <input type='button' value='OK' onclick='resetButton()' id='reset-button'>
125 </form>
126 </div>
128 <!-- / / / -->
130 </td></tr>
131 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
132 </table>
133 <br><br>
134 </body>
135 </html>