projects
/
oweals
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed UCI Save/Apply cache from Essentials
[oweals/luci.git]
/
libs
/
web
/
luasrc
/
dispatcher.lua
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index 03e7c7d65928c183d470092cea8418bb503ce7f1..645ea972e622faefd09e478ceaff6dc4e3ab4392 100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-499,7
+499,8
@@
end
--- Create a CBI model dispatching target.
-- @param model CBI model tpo be rendered
--- Create a CBI model dispatching target.
-- @param model CBI model tpo be rendered
-function cbi(model)
+function cbi(model, config)
+ config = config or {}
return function(...)
require("luci.cbi")
require("luci.template")
return function(...)
require("luci.cbi")
require("luci.template")
@@
-510,6
+511,9
@@
function cbi(model)
local state = nil
for i, res in ipairs(maps) do
local state = nil
for i, res in ipairs(maps) do
+ if config.autoapply then
+ res.autoapply = config.autoapply
+ end
local cstate = res:parse()
if not state or cstate < state then
state = cstate
local cstate = res:parse()
if not state or cstate < state then
state = cstate
@@
-521,7
+525,7
@@
function cbi(model)
for i, res in ipairs(maps) do
res:render()
end
for i, res in ipairs(maps) do
res:render()
end
- luci.template.render("cbi/footer", {state = state})
+ luci.template.render("cbi/footer", {state = state
, autoapply = config.autoapply
})
end
end
end
end