diff options
author | Steven Barth <steven@midlink.org> | 2008-09-06 15:15:38 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-09-06 15:15:38 +0000 |
commit | 9ce58c0339f2b570c049c7bee04af66c3d695a39 (patch) | |
tree | 616201d00027969fa0508ac0691f3629e30d07a6 /modules/admin-full/luasrc | |
parent | 9befed193ae828c2b58390e8c0efafdab37f45b8 (diff) |
Made flashing more responsive as well
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/system.lua | 6 | ||||
-rw-r--r-- | modules/admin-full/luasrc/view/admin_system/upgrade.htm | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua index 6cf951a154..bbe202d9d3 100644 --- a/modules/admin-full/luasrc/controller/admin/system.lua +++ b/modules/admin-full/luasrc/controller/admin/system.lua @@ -182,7 +182,7 @@ end function action_upgrade() require("luci.model.uci") - local ret = nil + local ret local plat = luci.fs.mtime("/lib/upgrade/platform.sh") local tmpfile = "/tmp/firmware.img" local broadcom = os.execute('grep brcm_ /lib/upgrade/platform.sh >/dev/null 2>&1') == 0 @@ -208,7 +208,9 @@ function action_upgrade() local keepcfg = keep_avail and luci.http.formvalue("keepcfg") if plat and fname then - ret = luci.sys.flash(tmpfile, keepcfg and _keep_pattern()) + ret = function() + return luci.sys.flash(tmpfile, keepcfg and _keep_pattern()) + end end luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) diff --git a/modules/admin-full/luasrc/view/admin_system/upgrade.htm b/modules/admin-full/luasrc/view/admin_system/upgrade.htm index e0fbb93326..03cd555c75 100644 --- a/modules/admin-full/luasrc/view/admin_system/upgrade.htm +++ b/modules/admin-full/luasrc/view/admin_system/upgrade.htm @@ -34,7 +34,10 @@ $Id$ </div> </form> <% elseif ret then %> - <% if ret == 0 then %> + <p><%:a_s_flash_received%></p> + <p><%:a_s_flash_inprogress%></p> + <% 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> |