1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
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.
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>
21 <script type='text/javascript' src='debug.js'
></script>
23 <script type='text/javascript'
>
25 // <% nvram("et0macaddr,t_features,t_model_name"); %>
30 if (((i
= name
.lastIndexOf('/')) > 0) || ((i
= name
.lastIndexOf('\\')) > 0))
31 name
= name
.substring(i
+ 1, name
.length
);
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
;
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');
53 location
.href
= 'cfg/' + name
+ '.cfg?_http_id=' + nvram
.http_id
;
56 function restoreButton()
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.');
66 if (!confirm('Are you sure?')) return;
67 E('restore-button').disabled
= 1;
69 f
= E('restore-form');
74 function resetButton()
78 i
= E('restore-mode').value
;
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');
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>
95 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
97 <div id='ident'
><%
ident(); %></div>
101 <div class='section-title'
>Backup Configuration
</div>
102 <div class='section'
>
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) + "'>");
108 <input type='button' name='f_backup_button' onclick='backupButton()' value='Backup'
><br>
109 <a href='' id='backup-link'
>Link
</a>
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()'
>
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>
134 <input type='button' value='OK' onclick='resetButton()' id='reset-button'
>
141 <tr><td id='footer' colspan=
2> </td></tr>