-%>
<%+header%>
-<h1><%:system%></h1>
-<h2><%:a_s_flash%></h2>
+<h2><a id="content" name="content"><%:system%></a></h2>
+<h3><%:a_s_flash%></h3>
<p><%:a_s_flash_upgrade1%></p>
<br />
-<% if next(blocks) and not next(flash) then %>
+<% if sysupgrade and not ret then %>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<div class="left"><%:a_s_flash_fwimage%>:</div>
<div>
- <% for name, v in pairs(blocks) do %>
- <%=name%>: <input type="file" size="30" name="<%=name%>" /><br />
- <% end %>
+ <input type="file" size="30" name="image" />
+ <br />
<br />
<% if keep_avail then -%>
<input type="checkbox" name="keepcfg" value="1" checked="checked" />
<input type="submit" value="<%:a_s_flash_fwupgrade%>" />
</div>
</form>
-<% elseif next(flash) then %>
+<% elseif ret then %>
<p><%:a_s_flash_received%></p>
+ <p><%:a_s_flash_inprogress%></p>
- <% reboot.exec = false
- for name, func in pairs(flash) do %>
- <%:a_s_flash_inprogress%> <%=name%>...
- <%=string.rep(" ", 2048)%>
- <%
- local stat, code = func()
- reboot.exec = reboot.exec or stat
- if stat and code then %>
- <%:a_s_flash_flashed%><br />
- <% else %>
- <%:a_s_flash_flasherr%>! (<%:code%> <%=code%>)<br />
- <% end %>
+<!-- <%=string.rep(" ", 2048)%> -->
+ <% %>
+ <% local ret = ret()
+ if ret == 0 then %>
+<div class="ok"><%:a_s_flash_flashed%></div>
+ <% else %>
+<div class="error"><%:a_s_flash_flasherr%>! (<%:code%> <%=ret%>)</div>
<% end %>
<% else %>
<div class="error"><%:a_s_flash_notimplemented%></div>
<% end %>
-<%+footer%>
\ No newline at end of file
+<%+footer%>
+<% if ret == 0 then luci.sys.reboot() end %>