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: Upgrade
</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>
20 <style type='text/css'
>
31 <script type='text/javascript' src='debug.js'
></script>
33 <script type='text/javascript'
>
35 // <% nvram("jffs2_on"); %>
39 var t
= ((new Date()).getTime() - startTime
) / 1000;
40 elem
.setInnerHTML('afu-time', Math
.floor(t
/ 60) + ':' + Number(Math
.floor(t
% 60)).pad(2));
47 var fom
= document
.form_upgrade
;
50 name
= fixFile(fom
.file
.value
);
51 if (name
.search(/\.(bin|trx|chk)$/i) == -1) {
52 alert('Expecting a ".bin" or ".trx" file.');
55 if (!confirm('Are you sure you want to upgrade using ' + name
+ '?')) return;
57 E('afu-upgrade-button').disabled
= true;
59 elem
.display('afu-input', false);
60 E('content').style
.verticalAlign
= 'middle';
61 elem
.display('afu-progress', true);
62 elem
.display('navi', false)
63 elem
.display('ident', false)
65 startTime
= (new Date()).getTime();
66 setInterval('clock()', 800);
68 fom
.action
+= '?_reset=' + (E('f_reset').checked
? "1" : "0");
69 form
.addIdAction(fom
);
76 <table id='container' cellspacing=
0>
77 <tr><td colspan=
2 id='header'
>
78 <div class='title'
>Tomato
</div>
79 <div class='version'
>Version <%
version(); %></div>
81 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
83 <div id='ident'
><%
ident(); %></div>
88 <div class='section-title'
>Upgrade Firmware
</div>
90 <form name='form_upgrade' method='post' action='upgrade.cgi' encType='multipart/form-data'
>
92 Select the file to use:
<br>
93 <input type='file' name='file' size='
50' style='height:
20px'
> <input type='button' value='Upgrade' id='afu-upgrade-button' onclick='upgrade()' style='height:
20px'
>
96 <br><form name='form_reset' action='javascript:{}'
>
97 <div id='reset-input'
>
98 <input type='checkbox' id='f_reset'
> After flashing, erase all data in NVRAM memory
104 <tr><td>Current Version:
</td><td> <%
version(1); %></td></tr>
105 <script type='text/javascript'
>
107 W('<tr><td>Free Memory:</td><td> ' + scaleSize(sysinfo
.totalfreeram
) + ' <small>(aprox. size that can be buffered completely in RAM)</small></td></tr>');
115 <div class='note-disabledw' style='display:none' id='jwarn'
>
116 <b>Cannot upgrade if JFFS is enabled.
</b><br><br>
117 An upgrade may overwrite the JFFS partition currently in use. Before upgrading,
118 please backup the contents of the JFFS partition, disable it, then reboot the router.
<br><br><br>
119 <a href='admin-jffs2.asp'
>Disable
»</a>
123 <div id='afu-progress' style='display:none;margin:auto'
>
124 <img src='spin.gif' style='vertical-align:baseline'
> <span id='afu-time'
>0:
00</span><br>
125 Please wait while the firmware is uploaded
& flashed.
<br>
126 <b>Warning:
</b> Do not interrupt this browser or the router!
<br>
132 <tr><td id='footer' colspan=
2> </td></tr>
135 <script type='text/javascript'
>
136 if (nvram
.jffs2_on
!= '0') {
137 E('jwarn').style
.display
= '';
138 E('afu-input').style
.display
= 'none';