summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini/luasrc/controller
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-26 23:00:44 +0000
committerSteven Barth <steven@midlink.org>2008-08-26 23:00:44 +0000
commit91ba7c42f5b45614c9f4c803d09399f08a8e27b1 (patch)
tree21d1e1d67b3bee82eb123c0c5dbb274f2fcb6b59 /modules/admin-mini/luasrc/controller
parent43b3217e5595acc91ff6d7614a5c21c88696fbcc (diff)
UCI API changes
Diffstat (limited to 'modules/admin-mini/luasrc/controller')
-rw-r--r--modules/admin-mini/luasrc/controller/mini/system.lua2
-rw-r--r--modules/admin-mini/luasrc/controller/mini/uci.lua20
2 files changed, 12 insertions, 10 deletions
diff --git a/modules/admin-mini/luasrc/controller/mini/system.lua b/modules/admin-mini/luasrc/controller/mini/system.lua
index be6cdb6b5e..c3910a3020 100644
--- a/modules/admin-mini/luasrc/controller/mini/system.lua
+++ b/modules/admin-mini/luasrc/controller/mini/system.lua
@@ -113,7 +113,7 @@ end
function _keep_pattern()
local kpattern = ""
- local files = luci.model.uci.get_all("luci", "flash_keep")
+ local files = luci.model.uci.cursor():get_all("luci", "flash_keep")
if files then
kpattern = ""
for k,v in pairs(files) do
diff --git a/modules/admin-mini/luasrc/controller/mini/uci.lua b/modules/admin-mini/luasrc/controller/mini/uci.lua
index 9b57fe31ab..31e04051b4 100644
--- a/modules/admin-mini/luasrc/controller/mini/uci.lua
+++ b/modules/admin-mini/luasrc/controller/mini/uci.lua
@@ -48,12 +48,13 @@ function convert_changes(changes)
end
function action_changes()
- local changes = convert_changes(luci.model.uci.changes())
+ local changes = convert_changes(luci.model.uci.cursor():changes())
luci.template.render("mini/uci_changes", {changes=changes})
end
function action_apply()
- local changes = luci.model.uci.changes()
+ local uci = luci.model.uci.cursor()
+ local changes = uci:changes()
local output = ""
if changes then
@@ -63,9 +64,9 @@ 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_config(r)
- luci.model.uci.commit(r)
- luci.model.uci.unload(r)
+ uci:load(r)
+ uci:commit(r)
+ uci:unload(r)
if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then
run[luci.config.uci_oncommit[r]] = true
end
@@ -84,15 +85,16 @@ end
function action_revert()
- local changes = luci.model.uci.changes()
+ local uci = luci.model.uci.cursor()
+ local changes = uci:changes()
if changes then
local revert = {}
-- Collect files to be reverted
for r, tbl in pairs(changes) do
- luci.model.uci.load_config(r)
- luci.model.uci.revert(r)
- luci.model.uci.unload(r)
+ uci:load(r)
+ uci:revert(r)
+ uci:unload(r)
end
end