diff options
-rw-r--r-- | applications/luci-fw/luasrc/model/cbi/luci_fw/zones.lua | 10 | ||||
-rw-r--r-- | libs/core/luasrc/model/network/wireless.lua | 10 | ||||
-rw-r--r-- | libs/core/luasrc/model/wireless.lua | 36 | ||||
-rw-r--r-- | modules/admin-full/luasrc/view/admin_index/index.htm | 4 |
4 files changed, 35 insertions, 25 deletions
diff --git a/applications/luci-fw/luasrc/model/cbi/luci_fw/zones.lua b/applications/luci-fw/luasrc/model/cbi/luci_fw/zones.lua index d9f5ce6d89..7dc48774fc 100644 --- a/applications/luci-fw/luasrc/model/cbi/luci_fw/zones.lua +++ b/applications/luci-fw/luasrc/model/cbi/luci_fw/zones.lua @@ -11,9 +11,16 @@ You may obtain a copy of the License at $Id$ ]]-- + +local nw = require "luci.model.network" +local fw = require "luci.model.firewall" + require("luci.tools.webadmin") m = Map("firewall", translate("Firewall"), translate("The firewall creates zones over your network interfaces to control network traffic flow.")) +fw.init(m.uci) +nw.init(m.uci) + s = m:section(TypedSection, "defaults") s.anonymous = true @@ -59,7 +66,8 @@ end s:option(Flag, "masq") net = s:option(MultiValue, "network") -net.widget = "select" +net.template = "cbi/network_netlist" +net.widget = "checkbox" net.rmempty = true luci.tools.webadmin.cbi_add_networks(net) diff --git a/libs/core/luasrc/model/network/wireless.lua b/libs/core/luasrc/model/network/wireless.lua index 1225325232..1dfc70e88e 100644 --- a/libs/core/luasrc/model/network/wireless.lua +++ b/libs/core/luasrc/model/network/wireless.lua @@ -66,8 +66,9 @@ end function shortname(self, iface) if iface.dev and iface.dev.wifi then return "%s %q" %{ - i18n.translate("a_s_if_iwmode_" .. (iface.dev.wifi.mode or "ap")), - iface.dev.wifi.ssid or iface.dev.wifi.bssid or "(hidden)" + i18n.translate(iface.dev.wifi.mode or "Client"), + iface.dev.wifi.ssid or iface.dev.wifi.bssid + or i18n.translate("(hidden)") } else return iface:name() @@ -78,8 +79,9 @@ function get_i18n(self, iface) if iface.dev and iface.dev.wifi then return "%s: %s %q" %{ i18n.translate("Wireless Network"), - i18n.translate("a_s_if_iwmode_" .. (iface.dev.wifi.mode or "ap"), iface.dev.wifi.mode or "AP"), - iface.dev.wifi.ssid or iface.dev.wifi.bssid or "(hidden)" + i18n.translate(iface.dev.wifi.mode or "Client"), + iface.dev.wifi.ssid or iface.dev.wifi.bssid + or i18n.translate("(hidden)") } else return "%s: %q" %{ i18n.translate("Wireless Network"), iface:name() } diff --git a/libs/core/luasrc/model/wireless.lua b/libs/core/luasrc/model/wireless.lua index 2a463dbad0..8533fb934a 100644 --- a/libs/core/luasrc/model/wireless.lua +++ b/libs/core/luasrc/model/wireless.lua @@ -89,8 +89,8 @@ end function shortname(self, iface) if iface.wdev and iface.winfo then return "%s %q" %{ - i18n.translate("a_s_if_iwmode_" .. iface:active_mode(), iface.winfo.mode(iface.wdev)), - iface:active_ssid() or "(hidden)" + i18n.translate(iface:active_mode()), + iface:active_ssid() or i18n.translate("(hidden)") } else return iface:name() @@ -101,8 +101,8 @@ function get_i18n(self, iface) if iface.wdev and iface.winfo then return "%s: %s %q (%s)" %{ i18n.translate("Wireless Network"), - i18n.translate("a_s_if_iwmode_" .. iface:active_mode(), iface.winfo.mode(iface.wdev)), - iface:active_ssid() or "(hidden)", iface.wdev + i18n.translate(iface:active_mode()), + iface:active_ssid() or i18n.translate("(hidden)"), iface.wdev } else return "%s: %q" %{ i18n.translate("Wireless Network"), iface:name() } @@ -212,12 +212,14 @@ function network._init(self, sid) count = count + 1 return s['.name'] ~= sid end) - + + local parent_dev = st:get("wireless", sid, "device") + local dev = st:get("wireless", sid, "ifname") - or st:get("wireless", sid, "device") + or parent_dev if dev then - self.id = "%s.network%d" %{ dev, count } + self.id = "%s.network%d" %{ parent_dev, count } local wtype = iwi.type(dev) if dev and wtype then @@ -247,22 +249,20 @@ end function network.active_mode(self) local m = self.winfo and self.winfo.mode(self.wdev) - if m == "Master" or m == "Auto" then - m = "ap" - elseif m == "Ad-Hoc" then - m = "adhoc" - elseif m == "Client" then - m = "sta" - elseif m then - m = m:lower() - else + if not m then m = self:mode() + if m == "ap" then m = "AP" + elseif m == "sta" then m = "Client" + elseif m == "adhoc" then m = "Ad-Hoc" + elseif m == "mesh" then m = "Mesh" + elseif m == "monitor" then m = "Monitor" + end end - return m or "ap" + return m or "Client" end function network.active_mode_i18n(self) - return i18n.translate("a_s_if_iwmode_" .. self:active_mode()) + return i18n.translate(self:active_mode()) end function network.active_ssid(self) diff --git a/modules/admin-full/luasrc/view/admin_index/index.htm b/modules/admin-full/luasrc/view/admin_index/index.htm index 2b2dbdd8fe..3bedd599fb 100644 --- a/modules/admin-full/luasrc/view/admin_index/index.htm +++ b/modules/admin-full/luasrc/view/admin_index/index.htm @@ -17,8 +17,8 @@ $Id$ <p><%_This is the administration area of <abbr title="Lua Configuration Interface">LuCI</abbr>.%></p> <p><%_<abbr title="Lua Configuration Interface">LuCI</abbr> is a free, flexible, and user friendly graphical interface for configuring OpenWrt Kamikaze.%><br /> <%:On the following pages you can adjust all important settings of your router.%></p> -<p><%_Notice: In <abbr title="Lua Configuration Interface">LuCI</abbr> changes have to be confirmed by clicking Changes - Save & Apply before being applied.%></p> +<p><%_Notice: In <abbr title="Lua Configuration Interface">LuCI</abbr> changes have to be confirmed by clicking Changes - Save & Apply before being applied.%></p> <p><%:As we always want to improve this interface we are looking forward to your feedback and suggestions.%></p> <p><%:And now have fun with your router!%></p> <p><em><strong><a href="<%=controller%>/about"><%_The <abbr title="Lua Configuration Interface">LuCI</abbr> Team%></a></strong></em></p> -<%+footer%>
\ No newline at end of file +<%+footer%> |