Tomato 1.26 beta(1766)
[tomato.git] / release / src / router / www / admin-upgrade.asp
blobe399aa33c9c987531c37aad0fda9c8dea384f860
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: 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>
19 <!-- / / / -->
20 <style type='text/css'>
21 #afu-progress {
22 text-align: center;
23 padding: 200px 0;
24 width: 890px;
26 #afu-time {
27 font-size: 26px;
29 </style>
31 <script type='text/javascript' src='debug.js'></script>
33 <script type='text/javascript'>
35 // <% nvram("jffs2_on"); %>
37 function clock()
39 var t = ((new Date()).getTime() - startTime) / 1000;
40 elem.setInnerHTML('afu-time', Math.floor(t / 60) + ':' + Number(Math.floor(t % 60)).pad(2));
43 function upgrade()
45 var name;
46 var i;
47 var fom = document.form_upgrade;
48 var ext;
50 name = fom.file.value;
51 if (name.search(/\.(bin|trx)$/i) == -1) {
52 alert('Expecting a ".bin" or ".trx" file.');
53 return;
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 += '?_http_id=' + nvram.http_id;
69 fom.submit();
71 </script>
73 </head>
74 <body>
75 <table id='container' cellspacing=0>
76 <tr><td colspan=2 id='header'>
77 <div class='title'>Tomato</div>
78 <div class='version'>Version <% version(); %></div>
79 </td></tr>
80 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
81 <td id='content'>
82 <div id='ident'><% ident(); %></div>
84 <!-- / / / -->
86 <div id='afu-input'>
87 <div class='section-title'>Upgrade Firmware</div>
88 <div class='section'>
89 <form name='form_upgrade' method='post' action='upgrade.cgi' encType='multipart/form-data'>
90 <div id='box-input'>
91 Select the file to use:<br>
92 <input type='file' name='file' size='50' style='height:20px'> <input type='button' value='Upgrade' id='afu-upgrade-button' onclick='upgrade()' style='height:20px'>
93 </div>
94 </form>
96 <br>
97 <table border=0>
98 <tr><td>Current Version:</td><td>&nbsp; <% version(1); %></td></tr>
99 <script type='text/javascript'>
100 // <% sysinfo(); %>
101 W('<tr><td>Free Memory:</td><td>&nbsp; ' + scaleSize(sysinfo.totalfreeram) + ' &nbsp; <small>(aprox. size that can be buffered completely in RAM)</small></td></tr>');
102 </script>
103 </table>
105 </div>
106 </div>
108 <div class='note-disabledw' style='display:none' id='jwarn'>
109 <b>Cannot upgrade if JFFS2 is enabled.</b><br><br>
110 An upgrade may overwrite the JFFS2 partition currently in use. Before upgrading,
111 please backup the contents of the JFFS2 partition, disable it, then reboot the router.<br><br><br>
112 <a href='admin-jffs2.asp'>Disable &raquo;</a>
113 </div>
115 <div id='afu-progress' style='display:none;margin:auto'>
116 <img src='spin.gif' style='vertical-align:baseline'> <span id='afu-time'>0:00</span><br>
117 Please wait while the firmware is uploaded &amp; flashed.<br>
118 <b>Warning:</b> Do not interrupt this browser or the router!<br>
119 </div>
121 <!-- / / / -->
123 </td></tr>
124 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
125 </table>
126 <script type='text/javascript'>
127 if (nvram.jffs2_on != '0') {
128 E('jwarn').style.display = '';
129 E('afu-input').style.display = 'none';
131 </script>
132 </body>
133 </html>