treewide: rework uci apply workflow
[project/luci.git] / modules / luci-base / luasrc / dispatcher.lua
index 38d9194..baaa95a 100644 (file)
@@ -883,6 +883,8 @@ local function _cbi(self, ...)
        local pageaction = true
        local parsechain = { }
 
        local pageaction = true
        local parsechain = { }
 
+       local is_rollback, time_remaining = uci:rollback_pending()
+
        for i, res in ipairs(maps) do
                if res.apply_needed and res.parsechain then
                        local c
        for i, res in ipairs(maps) do
                if res.apply_needed and res.parsechain then
                        local c
@@ -910,6 +912,7 @@ local function _cbi(self, ...)
                res:render({
                        firstmap   = (i == 1),
                        applymap   = applymap,
                res:render({
                        firstmap   = (i == 1),
                        applymap   = applymap,
+                       confirmmap = (is_rollback and time_remaining or nil),
                        redirect   = redirect,
                        messages   = messages,
                        pageaction = pageaction,
                        redirect   = redirect,
                        messages   = messages,
                        pageaction = pageaction,