diff options
author | Steven Barth <steven@midlink.org> | 2008-08-15 20:42:25 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-15 20:42:25 +0000 |
commit | 8e4afe121087c05833ee7d567fe45f2ba270e54d (patch) | |
tree | 20d64661cd0c2bb67b2e440886ae3bae55b31f07 /modules/admin-full/luasrc/model | |
parent | 1d4196b3ff1bceaa858ffbee637bf212d5b5d428 (diff) |
Several escaping fixes
Updated XML translation system
Use the new Table widget for DHCP leases
Diffstat (limited to 'modules/admin-full/luasrc/model')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua b/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua index 8ff1f5293b..25187ae90f 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua @@ -30,33 +30,19 @@ if leasefp then end if leases then - v = m2:section(TypedSection, "_virtual", translate("dhcp_leases_active")) + v = m2:section(Table, leases, translate("dhcp_leases_active")) v.anonymous = true v.rowcolors = true - v.template = "cbi/tblsection" - function v.cfgsections(self) - local sections = {} - for i=1,#leases do - table.insert(sections, i) - end - return sections - end - - ip = v:option(DummyValue, "ip", translate("ipaddress")) - function ip.cfgvalue(self, section) - return leases[section][3] - end + ip = v:option(DummyValue, 3, translate("ipaddress")) - mac = v:option(DummyValue, "mac", translate("macaddress")) - function mac.cfgvalue(self, section) - return leases[section][2] - end + mac = v:option(DummyValue, 2, translate("macaddress")) - ltime = v:option(DummyValue, "time", translate("dhcp_timeremain")) - function ltime.cfgvalue(self, section) + ltime = v:option(DummyValue, 1, translate("dhcp_timeremain")) + function ltime.cfgvalue(self, ...) + local value = DummyValue.cfgvalue(self, ...) return luci.tools.webadmin.date_format( - os.difftime(tonumber(leases[section][1]), os.time()) + os.difftime(tonumber(value), os.time()) ) end end |