From 7514604860540ad30bbe82aabc6692f89f301b92 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 6 Sep 2008 15:59:18 +0000 Subject: [PATCH] Fixed responsiveness for flashing process --- modules/admin-full/luasrc/view/admin_system/upgrade.htm | 3 +++ modules/admin-mini/luasrc/controller/mini/system.lua | 4 +++- modules/admin-mini/luasrc/view/mini/upgrade.htm | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/admin-full/luasrc/view/admin_system/upgrade.htm b/modules/admin-full/luasrc/view/admin_system/upgrade.htm index 03cd555c7..569a0bbd2 100644 --- a/modules/admin-full/luasrc/view/admin_system/upgrade.htm +++ b/modules/admin-full/luasrc/view/admin_system/upgrade.htm @@ -36,6 +36,9 @@ $Id$ <% elseif ret then %>

<%:a_s_flash_received%>

<%:a_s_flash_inprogress%>

+ + + <% %> <% local ret = ret() if ret == 0 then %>
<%:a_s_flash_flashed%>
diff --git a/modules/admin-mini/luasrc/controller/mini/system.lua b/modules/admin-mini/luasrc/controller/mini/system.lua index c3910a302..265443bd3 100644 --- a/modules/admin-mini/luasrc/controller/mini/system.lua +++ b/modules/admin-mini/luasrc/controller/mini/system.lua @@ -105,7 +105,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("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) diff --git a/modules/admin-mini/luasrc/view/mini/upgrade.htm b/modules/admin-mini/luasrc/view/mini/upgrade.htm index e0fbb9332..569a0bbd2 100644 --- a/modules/admin-mini/luasrc/view/mini/upgrade.htm +++ b/modules/admin-mini/luasrc/view/mini/upgrade.htm @@ -34,7 +34,13 @@ $Id$ <% elseif ret then %> - <% if ret == 0 then %> +

<%:a_s_flash_received%>

+

<%:a_s_flash_inprogress%>

+ + + <% %> + <% local ret = ret() + if ret == 0 then %>
<%:a_s_flash_flashed%>
<% else %>
<%:a_s_flash_flasherr%>! (<%:code%> <%=ret%>)
-- 2.11.0