Revert mtdow
[project/luci.git] / modules / admin-full / luasrc / view / admin_system / upgrade.htm
index 8fe658a4278f938bb47d3764472e6f3524f39b65..a3d97d6497c5872fb051fe4b2187ef3837e4d4b5 100644 (file)
@@ -17,13 +17,12 @@ $Id$
 <h2><%:a_s_flash%></h2>
 <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" />
@@ -34,28 +33,20 @@ $Id$
                <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 i, entry in ipairs(flash) do 
-               local name, func = entry.name, entry.func %>
-               <%:a_s_flash_inprogress%> <%=name%>...
-               <%=string.rep(" ", 32*1024)%>
-               <%
-                local stat, code = func()
-                reboot.exec = reboot.exec or stat 
-               if stat and code then %>
-                       <%:ok%><br />
-               <% else %>
-                       <%:a_s_flash_flasherr%>! (<%:code%> <%=code%>)<br />    
-               <% end %>
-               <% if reboot.exec then %>
-                       <br />
-                       <div><%:a_s_flash_flashed%></div>
-               <% 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 %>