From 75d4cca7ae10a39d9787afd5f1c2f14800491acd Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 17 Aug 2008 10:20:36 +0000 Subject: Fixed a design flaw in luci.model.uci --- modules/admin-mini/luasrc/model/cbi/mini/index.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/admin-mini/luasrc/model/cbi/mini') 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] -- cgit v1.2.3