modules/admin-full: properly cover static wds mode on madwifi
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / wifi.lua
index bdb8235..67cb8a8 100644 (file)
@@ -196,7 +196,7 @@ if hwtype == "broadcom" then
        s:taboption("advanced", Flag, "frameburst", translate("Frame Bursting"))
 
        s:taboption("advanced", Value, "distance", translate("Distance Optimization"))
-       --s:option(Value, "slottime", translate("wifi_slottime"))
+       --s:option(Value, "slottime", translate("Slot time"))
 
        s:taboption("advanced", Value, "country", translate("Country Code"))
        s:taboption("advanced", Value, "maxassoc", translate("Connection Limit"))
@@ -292,6 +292,7 @@ if wnet then
                mode:value("monitor", translate("Monitor"))
                mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
                mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
+               mode:value("wds", translate("Static WDS"))
 
                function mode.write(self, section, value)
                        if value == "ap-wds" then
@@ -321,6 +322,7 @@ if wnet then
 
                bssid:depends({mode="adhoc"})
                bssid:depends({mode="ahdemo"})
+               bssid:depends({mode="wds"})
 
                wdssep = s:taboption("advanced", Flag, "wdssep", translate("Separate WDS"))
                wdssep:depends({mode="ap-wds"})
@@ -331,8 +333,8 @@ if wnet then
                hidden:depends({mode="adhoc"})
                hidden:depends({mode="ap-wds"})
                hidden:depends({mode="sta-wds"})
-               isolate = s:taboption("advanced", Flag, "isolate", translate("wifi_isolate"),
-                translate("wifi_isolate_desc"))
+               isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
+                translate("Prevents client-to-client communication"))
                isolate:depends({mode="ap"})
                s:taboption("advanced", Flag, "bgscan", translate("Background Scan"))
 
@@ -384,8 +386,8 @@ if wnet then
                hidden:depends({mode="adhoc"})
                hidden:depends({mode="wds"})
 
-               isolate = s:taboption("advanced", Flag, "isolate", translate("wifi_isolate"),
-                translate("wifi_isolate_desc"))
+               isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
+                translate("Prevents client-to-client communication"))
                isolate:depends({mode="ap"})
 
                s:taboption("advanced", Flag, "doth", "802.11h")
@@ -427,6 +429,7 @@ if wnet then
 
        encr = s:taboption("encryption", ListValue, "encryption", translate("Encryption"))
        encr.override_values = true
+       encr.override_depends = true
        encr:depends({mode="ap"})
        encr:depends({mode="sta"})
        encr:depends({mode="adhoc"})
@@ -436,7 +439,7 @@ if wnet then
        encr:depends({mode="mesh"})
 
        encr:value("none", "No Encryption")
-       encr:value("wep", "WEP")
+       encr:value("wep", "WEP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
 
        if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
                local supplicant = fs.access("/usr/sbin/wpa_supplicant")
@@ -454,16 +457,25 @@ if wnet then
                        encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
                        encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"})
                        encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="ap-wds"})
-                       encr.description = translate("wifi_wpareq")
+                       encr.description = translate(
+                               "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
+                               "and ad-hoc mode) to be installed."
+                       )
                elseif not hostapd and supplicant then
                        encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"})
                        encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"})
                        encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"})
                        encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
                        encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})
-                       encr.description = translate("wifi_wpareq")
+                       encr.description = translate(
+                               "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
+                               "and ad-hoc mode) to be installed."
+                       )
                else
-                       encr.description = translate("wifi_wpareq")
+                       encr.description = translate(
+                               "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
+                               "and ad-hoc mode) to be installed."
+                       )
                end
        elseif hwtype == "broadcom" then
                encr:value("psk", "WPA-PSK")
@@ -477,7 +489,7 @@ if wnet then
        encr:depends("mode", "sta-wds")
        encr:depends("mode", "wds")
 
-       server = s:taboption("encryption", Value, "server", translate("RadiusServer"))
+       server = s:taboption("encryption", Value, "server", translate("Radius-Server"))
        server:depends({mode="ap", encryption="wpa"})
        server:depends({mode="ap", encryption="wpa2"})
        server.rmempty = true