modules/admin-full: remove duplicate fallback translation in opkg error reporting
[project/luci.git] / modules / admin-full / luasrc / view / admin_system / upgrade.htm
index 693022f..bbc5215 100644 (file)
@@ -13,17 +13,16 @@ $Id$
 
 -%>
 <%+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" />
@@ -34,23 +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 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 %>