diff options
author | Steven Barth <steven@midlink.org> | 2008-08-26 23:00:44 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-26 23:00:44 +0000 |
commit | 91ba7c42f5b45614c9f4c803d09399f08a8e27b1 (patch) | |
tree | 21d1e1d67b3bee82eb123c0c5dbb274f2fcb6b59 /modules/admin-mini/luasrc/model/cbi | |
parent | 43b3217e5595acc91ff6d7614a5c21c88696fbcc (diff) |
UCI API changes
Diffstat (limited to 'modules/admin-mini/luasrc/model/cbi')
-rw-r--r-- | modules/admin-mini/luasrc/model/cbi/mini/dhcp.lua | 2 | ||||
-rw-r--r-- | modules/admin-mini/luasrc/model/cbi/mini/network.lua | 4 | ||||
-rw-r--r-- | modules/admin-mini/luasrc/model/cbi/mini/wifi.lua | 23 |
3 files changed, 12 insertions, 17 deletions
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/dhcp.lua b/modules/admin-mini/luasrc/model/cbi/mini/dhcp.lua index 85b2c86aad..e01890f0a3 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/dhcp.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/dhcp.lua @@ -58,7 +58,7 @@ time.rmempty = true m2 = Map("luci_ethers", translate("dhcp_leases")) local leasefn, leasefp, leases -luci.model.uci.foreach("dhcp", "dnsmasq", +luci.model.uci.cursor():foreach("dhcp", "dnsmasq", function(section) leasefn = section.leasefile end diff --git a/modules/admin-mini/luasrc/model/cbi/mini/network.lua b/modules/admin-mini/luasrc/model/cbi/mini/network.lua index 692f7c456a..4289f35a92 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/network.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/network.lua @@ -15,9 +15,7 @@ $Id$ require("luci.tools.webadmin") require("luci.sys") -luci.model.uci.load_state("network") -local network = luci.model.uci.get_all("network") -luci.model.uci.unload("network") +local network = luci.model.uci.cursor_state():get_all("network") local netstat = luci.sys.net.deviceinfo() local ifaces = {} diff --git a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua index 95407be85f..64e7400ca0 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua @@ -15,10 +15,7 @@ $Id$ -- Data init -- -luci.model.uci.load_state("wireless") -local wireless = luci.model.uci.get_all("wireless") -luci.model.uci.unload("wireless") - +local wireless = luci.model.uci.cursor_state():get_all("wireless") local wifidata = luci.sys.wifi.getiwconfig() local ifaces = {} @@ -148,7 +145,7 @@ s.anonymous = true s:option(Value, "ssid", translate("a_w_netid")).maxlength = 32 local devs = {} -luci.model.uci.foreach("wireless", "wifi-device", +luci.model.uci.cursor():foreach("wireless", "wifi-device", function (section) table.insert(devs, section[".name"]) end) @@ -167,21 +164,21 @@ mode:value("sta", translate("m_w_client")) function mode.write(self, section, value) if value == "sta" then -- ToDo: Move this away - if not luci.model.uci.get("network", "wan") then - luci.model.uci.set("network", "wan", "proto", "none") - luci.model.uci.set("network", "wan", "ifname", " ") + if not m.uci:get("network", "wan") then + m.uci:set("network", "wan", "proto", "none") + m.uci:set("network", "wan", "ifname", " ") end - local oldif = luci.model.uci.get("network", "wan", "ifname") + local oldif = m.uci:get("network", "wan", "ifname") if oldif and oldif ~= " " then - luci.model.uci.set("network", "wan", "_ifname", oldif) + m.uci:set("network", "wan", "_ifname", oldif) end - luci.model.uci.set("network", "wan", "ifname", " ") + m.uci:set("network", "wan", "ifname", " ") self.map:set(section, "network", "wan") else - if luci.model.uci.get("network", "wan", "_ifname") then - luci.model.uci.set("network", "wan", "ifname", luci.model.uci.get("network", "wan", "_ifname")) + if m.uci:get("network", "wan", "_ifname") then + m.uci:set("network", "wan", "ifname", m.uci:get("network", "wan", "_ifname")) end self.map:set(section, "network", "lan") end |