diff options
author | Steven Barth <steven@midlink.org> | 2008-07-29 15:33:28 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-07-29 15:33:28 +0000 |
commit | f8f4fe752307e1d0c042496b642aa691589c2a5f (patch) | |
tree | f538b93456733a1b8e2d0cfc08a84c72a6d49694 /modules | |
parent | 43ffb3aacbe78fd7ed19217c23438f14acaa27f5 (diff) |
modules: Redesigned configuration save, apply, save & apply menu options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/uci.lua | 16 | ||||
-rw-r--r-- | modules/admin-full/luasrc/view/admin_uci/changes.htm | 3 | ||||
-rw-r--r-- | modules/admin-mini/luasrc/controller/mini/uci.lua | 6 |
3 files changed, 16 insertions, 9 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/uci.lua b/modules/admin-full/luasrc/controller/admin/uci.lua index 215a13a34..d2acdeca1 100644 --- a/modules/admin-full/luasrc/controller/admin/uci.lua +++ b/modules/admin-full/luasrc/controller/admin/uci.lua @@ -17,9 +17,10 @@ function index() local i18n = luci.i18n.translate entry({"admin", "uci"}, nil, i18n("config")) - entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes")) - entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert")) - entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply")) + entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes"), 40) + entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert"), 30) + entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply"), 20) + entry({"admin", "uci", "saveapply"}, call("action_apply"), i18n("saveapply"), 10) end function convert_changes(changes) @@ -52,6 +53,7 @@ function action_changes() end function action_apply() + local path = luci.dispatcher.context.path local changes = luci.model.uci.changes() local output = "" @@ -62,9 +64,11 @@ function action_apply() -- Collect files to be applied and commit changes for r, tbl in pairs(changes) do if r then - luci.model.uci.load(r) - luci.model.uci.commit(r) - luci.model.uci.unload(r) + if path[#path] ~= "apply" then + luci.model.uci.load(r) + luci.model.uci.commit(r) + luci.model.uci.unload(r) + end if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then run[luci.config.uci_oncommit[r]] = true end diff --git a/modules/admin-full/luasrc/view/admin_uci/changes.htm b/modules/admin-full/luasrc/view/admin_uci/changes.htm index 09d8d3e7e..ab66b78ef 100644 --- a/modules/admin-full/luasrc/view/admin_uci/changes.htm +++ b/modules/admin-full/luasrc/view/admin_uci/changes.htm @@ -20,6 +20,9 @@ $Id$ <form class="inline" method="get" action="<%=controller%>/admin/uci/apply"> <input type="submit" value="<%:apply%>" /> </form> +<form class="inline" method="get" action="<%=controller%>/admin/uci/saveapply"> + <input type="submit" value="<%:saveapply%>" /> +</form> <form class="inline" method="get" action="<%=controller%>/admin/uci/revert"> <input type="submit" value="<%:revert%>" /> </form> diff --git a/modules/admin-mini/luasrc/controller/mini/uci.lua b/modules/admin-mini/luasrc/controller/mini/uci.lua index eabc89540..b56a70287 100644 --- a/modules/admin-mini/luasrc/controller/mini/uci.lua +++ b/modules/admin-mini/luasrc/controller/mini/uci.lua @@ -18,9 +18,9 @@ function index() local i18n = luci.i18n.translate entry({"mini", "uci"}, nil, i18n("config")) - entry({"mini", "uci", "changes"}, call("action_changes"), i18n("changes")) - entry({"mini", "uci", "revert"}, call("action_revert"), i18n("revert")) - entry({"mini", "uci", "apply"}, call("action_apply"), i18n("apply")) + entry({"mini", "uci", "changes"}, call("action_changes"), i18n("changes"), 30) + entry({"mini", "uci", "revert"}, call("action_revert"), i18n("revert"), 20) + entry({"mini", "uci", "apply"}, call("action_apply"), i18n("saveapply"), 10) end function convert_changes(changes) |