UI cleanup, phase 2 (partially cosmetic)
[tomato.git] / release / src-rt-6.x.4708 / router / www / admin-upgrade.asp
blob2ff39ab6c50d87da83104cfa34ccd174149db048
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
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.
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 = fixFile(fom.file.value);
51 if (name.search(/\.(bin|trx|chk)$/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 += '?_reset=' + (E('f_reset').checked ? "1" : "0");
69 form.addIdAction(fom);
70 fom.submit();
72 </script>
74 </head>
75 <body>
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>
80 </td></tr>
81 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
82 <td id='content'>
83 <div id='ident'><% ident(); %></div>
85 <!-- / / / -->
87 <div id='afu-input'>
88 <div class='section-title'>Upgrade Firmware</div>
89 <div class='section'>
90 <form name='form_upgrade' method='post' action='upgrade.cgi' encType='multipart/form-data'>
91 <div id='box-input'>
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'>
94 </div>
95 </form>
96 <br><form name='form_reset' action='javascript:{}'>
97 <div id='reset-input'>
98 <input type='checkbox' id='f_reset'>&nbsp;&nbsp;After flashing, erase all data in NVRAM memory
99 </div>
100 </form>
102 <br>
103 <table border=0>
104 <tr><td>Current Version:</td><td><b><% version(1); %></b></td></tr>
105 <tr><td>Current Build Date:</td><td><% build_time(); %></td></tr>
106 <script type='text/javascript'>
107 // <% sysinfo(); %>
108 W('<tr><td>Free Memory:</td><td>' + scaleSize(sysinfo.totalfreeram) + ' &nbsp; <small>(approx. size that can be buffered completely in RAM)</small></td></tr>');
109 </script>
110 </table>
112 </div>
113 </div>
115 /* JFFS2-BEGIN */
116 <div class='note-disabledw' style='display:none' id='jwarn'>
117 <b>Cannot upgrade if JFFS is enabled.</b><br><br>
118 An upgrade may overwrite the JFFS partition currently in use. Before upgrading,
119 please backup the contents of the JFFS partition, disable it, then reboot the router.<br><br><br>
120 <a href='admin-jffs2.asp'>Disable &raquo;</a>
121 </div>
122 /* JFFS2-END */
124 <div id='afu-progress' style='display:none;margin:auto'>
125 <img src='spin.gif' style='vertical-align:baseline'> <span id='afu-time'>0:00</span><br>
126 Please wait while the firmware is uploaded &amp; flashed.<br>
127 <b>Warning:</b> Do not interrupt this browser or the router!<br>
128 </div>
130 <!-- / / / -->
132 </td></tr>
133 <tr><td id='footer' colspan=2>&nbsp;</td></tr>
134 </table>
135 /* JFFS2-BEGIN */
136 <script type='text/javascript'>
137 if (nvram.jffs2_on != '0') {
138 E('jwarn').style.display = '';
139 E('afu-input').style.display = 'none';
141 </script>
142 /* JFFS2-END */
143 </body>
144 </html>