From e558edee0bb7989c7386e1a9bf64bad24d11926e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 24 Jan 2011 07:40:39 +0000 Subject: [PATCH] luci-0.10: merge r6786 and r6787 (#188) --- .../luasrc/model/cbi/luci_fw/trule.lua | 1 + .../luasrc/model/cbi/admin_network/wifi.lua | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/applications/luci-firewall/luasrc/model/cbi/luci_fw/trule.lua b/applications/luci-firewall/luasrc/model/cbi/luci_fw/trule.lua index 99011fea7..dc985d8a3 100644 --- a/applications/luci-firewall/luasrc/model/cbi/luci_fw/trule.lua +++ b/applications/luci-firewall/luasrc/model/cbi/luci_fw/trule.lua @@ -136,6 +136,7 @@ jump.default = "ACCEPT" jump:value("DROP", translate("drop")) jump:value("ACCEPT", translate("accept")) jump:value("REJECT", translate("reject")) +jump:value("NOTRACK", translate("don't track")) smac = s:taboption("advanced", Value, "src_mac", translate("Source MAC address")) diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua index fdeea99e9..62576ba1d 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua @@ -51,9 +51,12 @@ m.title = luci.util.pcdata(wnet:get_i18n()) local iw = luci.sys.wifi.getiwinfo(arg[1]) -local tx_powers = iw.txpwrlist or { } local hw_modes = iw.hwmodelist or { } - +local tx_powers = iw.txpwrlist or { } +local tx_power = tostring( + (iw.txpower and iw.txpower > 0 and iw.txpower) or + (#tx_powers > 0 and tx_powers[#tx_powers].dbm) +) s = m:section(NamedSection, wdev:name(), "wifi-device", translate("Device Configuration")) s.addremove = false @@ -105,7 +108,7 @@ if hwtype == "mac80211" then "txpower", translate("Transmit Power"), "dBm") tp.rmempty = true - tp.default = tostring(iw and iw.txpower or tx_powers[#tx_powers]) + tp.default = tx_power for _, p in ipairs(tx_powers or {}) do tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw }) end @@ -156,7 +159,8 @@ if hwtype == "atheros" then "txpower", translate("Transmit Power"), "dBm") tp.rmempty = true - for _, p in ipairs(iw.txpwrlist) do + tp.default = tx_power + for _, p in ipairs(tx_powers or {}) do tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw }) end @@ -216,7 +220,8 @@ if hwtype == "broadcom" then "txpower", translate("Transmit Power"), "dBm") tp.rmempty = true - for _, p in ipairs(iw.txpwrlist) do + tp.default = tx_power + for _, p in ipairs(tx_powers or {}) do tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw }) end -- 2.25.1