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"); %>
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
;
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');
46 location
.href
= 'cfg/' + name
+ '.cfg?_http_id=' + nvram
.http_id
;
49 function restoreButton()
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.');
59 if (!confirm('Are you sure?')) return;
60 E('restore-button').disabled
= 1;
62 f
= E('restore-form');
67 function resetButton()
71 i
= E('restore-mode').value
;
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');
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>
88 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
90 <div id='ident'
><%
ident(); %></div>
94 <div class='section-title'
>Backup Configuration
</div>
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) + "'>");
101 <input type='button' name='f_backup_button' onclick='backupButton()' value='Backup'
><br>
102 <a href='' id='backup-link'
>Link
</a>
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()'
>
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>
127 <input type='button' value='OK' onclick='resetButton()' id='reset-button'
>
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>' }
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">');
154 <tr><td id='footer' colspan=
2> </td></tr>