summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini
diff options
context:
space:
mode:
Diffstat (limited to 'modules/admin-mini')
-rw-r--r--modules/admin-mini/luasrc/controller/mini/uci.lua4
-rw-r--r--modules/admin-mini/luasrc/model/cbi/mini/index.lua14
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/admin-mini/luasrc/controller/mini/uci.lua b/modules/admin-mini/luasrc/controller/mini/uci.lua
index 5ba4f2949..9b57fe31a 100644
--- a/modules/admin-mini/luasrc/controller/mini/uci.lua
+++ b/modules/admin-mini/luasrc/controller/mini/uci.lua
@@ -63,7 +63,7 @@ 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.load_config(r)
luci.model.uci.commit(r)
luci.model.uci.unload(r)
if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then
@@ -90,7 +90,7 @@ function action_revert()
-- Collect files to be reverted
for r, tbl in pairs(changes) do
- luci.model.uci.load(r)
+ luci.model.uci.load_config(r)
luci.model.uci.revert(r)
luci.model.uci.unload(r)
end
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/index.lua b/modules/admin-mini/luasrc/model/cbi/mini/index.lua
index eb7d77eb1..5ce9dfcd9 100644
--- a/modules/admin-mini/luasrc/model/cbi/mini/index.lua
+++ b/modules/admin-mini/luasrc/model/cbi/mini/index.lua
@@ -47,6 +47,7 @@ f:field(DummyValue, "_uptime", translate("m_i_uptime")).value =
m = Map("network", translate("interfaces"))
+m.stateful = true
local netstat = luci.sys.net.deviceinfo()
m.parse = function() end
@@ -60,21 +61,20 @@ end
hwaddr = s:option(DummyValue, "_hwaddr")
function hwaddr.cfgvalue(self, section)
- local ix = self.map:stateget(section, "ifname") or ""
+ local ix = self.map:get(section, "ifname") or ""
return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") or "n/a"
end
-ipaddr = s:option(DummyValue, "ipaddr", translate("ipaddress"))
-ipaddr.stateful = true
+s:option(DummyValue, "ipaddr", translate("ipaddress"))
+
+s:option(DummyValue, "netmask", translate("netmask"))
-ipaddr = s:option(DummyValue, "netmask", translate("netmask"))
-ipaddr.stateful = true
txrx = s:option(DummyValue, "_txrx")
function txrx.cfgvalue(self, section)
- local ix = self.map:stateget(section, "ifname")
+ local ix = self.map:get(section, "ifname")
local rx = netstat and netstat[ix] and netstat[ix][1]
rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-"
@@ -88,7 +88,7 @@ end
errors = s:option(DummyValue, "_err")
function errors.cfgvalue(self, section)
- local ix = self.map:stateget(section, "ifname")
+ local ix = self.map:get(section, "ifname")
local rx = netstat and netstat[ix] and netstat[ix][3]
local tx = netstat and netstat[ix] and netstat[ix][11]