summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini/luasrc/model/cbi/mini
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-17 10:20:36 +0000
committerSteven Barth <steven@midlink.org>2008-08-17 10:20:36 +0000
commit75d4cca7ae10a39d9787afd5f1c2f14800491acd (patch)
treed78aa1fec1690510ed723f6c8433f71fda709e28 /modules/admin-mini/luasrc/model/cbi/mini
parent746fa9df8f3d3443d82cd26d6717e7b5cf3dc8c1 (diff)
Fixed a design flaw in luci.model.uci
Diffstat (limited to 'modules/admin-mini/luasrc/model/cbi/mini')
-rw-r--r--modules/admin-mini/luasrc/model/cbi/mini/index.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/index.lua b/modules/admin-mini/luasrc/model/cbi/mini/index.lua
index eb7d77eb17..5ce9dfcd99 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]