2 Copyright 2008 Steven Barth <steven@midlink.org>
3 Copyright 2008-2009 Jo-Philipp Wich <jow@openwrt.org>
4 Licensed to the public under the Apache License 2.0.
9 <h2><a id="content" name="content"><%:System%></a></h2>
10 <h3><%:Flash Firmware%></h3>
12 <% if step == 1 then %>
13 <% if supported then %>
14 <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
16 <%:Upload an OpenWrt image file to reflash the device.%>
17 <% if bad_image then %>
19 <div class="error"><%:The uploaded image file does not
20 contain a supported format. Make sure that you choose the generic
21 image format for your platform. %></div>
25 <%:Firmware image%>:<br />
26 <input type="hidden" name="step" value="2" />
27 <input type="file" size="30" name="image" />
30 <% if keepavail then -%>
31 <input type="checkbox" name="keepcfg" value="1" checked="checked" />
32 <span class="bold"><%:Keep configuration files%></span>
36 <input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
40 <div class="error"><%_ Sorry.
41 OpenWrt does not support a system upgrade on this platform.<br />
42 You need to manually flash your device. %></div>
44 <% elseif step == 2 then %>
46 <%_ The flash image was uploaded.
47 Below is the checksum and file size listed,
48 compare them with the original file to ensure data integrity.<br />
49 Click "Proceed" below to start the flash procedure. %>
51 <% if flashsize > 0 and filesize > flashsize then %>
53 <div class="error"><%:It appears that you are trying to
54 flash an image that does not fit into the flash memory, please verify
55 the image file! %></div>
60 <li><%:Checksum%>: <code><%=checksum%></code></li>
62 local w = require "luci.tools.webadmin"
63 write(w.byte_format(filesize))
66 write(luci.i18n.translatef(
68 w.byte_format(flashsize)
74 <div class="cbi-page-actions right">
75 <form style="display:inline">
76 <input type="hidden" name="step" value="3" />
77 <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
78 <input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
80 <form style="display:inline">
81 <input type="hidden" name="step" value="1" />
82 <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
83 <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
86 <% elseif step == 3 then %>
87 <p><%_ The system is flashing now.<br />
88 DO NOT POWER OFF THE DEVICE!<br />
89 Wait a few minutes before you try to reconnect.
90 It might be necessary to renew the address of your computer to reach the device
91 again, depending on your settings. %></p>
93 <iframe src="<%=REQUEST_URI%>?step=4&keepcfg=<%=keepconfig and "1" or "0"%>" style="border:1px solid black; width:100%; height:150px"></iframe>