gluon-packages/gluon/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade.htm

113 lines
3.2 KiB
HTML
Raw Normal View History

2013-09-30 18:42:47 +02:00
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
-%>
<%+header%>
<h2><a id="content" name="content">Flash Firmware</a></h2>
2013-09-30 18:42:47 +02:00
<% if step == 1 then %>
<% if supported then %>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<p>
Upload an OpenWrt image file to reflash the device.
2013-09-30 18:42:47 +02:00
<% if bad_image then %>
<br /><br />
<div class="error">The uploaded image file does not
2013-09-30 18:42:47 +02:00
contain a supported format. Make sure that you choose the generic
image format for your platform.</div>
2013-09-30 18:42:47 +02:00
<% end %>
</p>
<div>
Firmware image:<br />
2013-09-30 18:42:47 +02:00
<input type="hidden" name="step" value="2" />
<input type="file" size="30" name="image" />
<br />
<br />
<% if keepavail then -%>
<input type="checkbox" name="keepcfg" value="1" checked="checked" />
<span class="bold">Keep configuration files</span>
2013-09-30 18:42:47 +02:00
<% end -%>
<br />
<input class="cbi-button cbi-button-apply" type="submit" value="Upload image" />
2013-09-30 18:42:47 +02:00
</div>
</form>
<% else %>
<div class="error">Sorry.
2013-09-30 18:42:47 +02:00
OpenWrt does not support a system upgrade on this platform.<br />
You need to manually flash your device.</div>
2013-09-30 18:42:47 +02:00
<% end %>
<% elseif step == 2 then %>
<p>
The flash image was uploaded.
2013-09-30 18:42:47 +02:00
Below is the checksum and file size listed,
compare them with the original file to ensure data integrity.<br />
Click "Proceed" below to start the flash procedure.
2013-09-30 18:42:47 +02:00
<% if flashsize > 0 and filesize > flashsize then %>
<br /><br />
<div class="error">It appears that you try to
2013-09-30 18:42:47 +02:00
flash an image that does not fit into the flash memory, please verify
the image file!</div>
2013-09-30 18:42:47 +02:00
<% end %>
<br />
<ul>
<li>Checksum: <code><%=checksum%></code></li>
<li>Size: <%
function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do
if byte > 1024 and i < 5 then
byte = byte / 1024
else
return string.format("%.2f %s", byte, suff[i])
end
end
end
write(byte_format(filesize))
2013-09-30 18:42:47 +02:00
if flashsize > 0 then
write(luci.i18n.translatef(
" (%s available)",
w.byte_format(flashsize)
))
end
%></li>
</ul>
</p>
<div class="cbi-page-actions right">
<form style="display:inline">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-apply" type="submit" value="Proceed" />
2013-09-30 18:42:47 +02:00
</form>
<form style="display:inline">
<input type="hidden" name="step" value="1" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-reset" type="submit" value="Cancel" />
2013-09-30 18:42:47 +02:00
</form>
</div>
<% elseif step == 3 then %>
<p>The system is flashing now.<br />
2013-09-30 18:42:47 +02:00
DO NOT POWER OFF THE DEVICE!<br />
Wait a few minutes until you try to reconnect.
It might be necessary to renew the address of your computer to reach the device
again, depending on your settings.</p>
2013-09-30 18:42:47 +02:00
<% end %>
<%+footer%>