diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-06-25 21:50:30 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-07-06 20:37:23 +0200 |
commit | ef48c52384587df3668c72cc4c66ab772cdf32e3 (patch) | |
tree | f17f0e2d29f623bb10d5b1b5508b345306e1f7f8 | |
parent | cade07781dd09dc749b6da0a207309e250a538f5 (diff) | |
download | luci2-ui-ef48c52384587df3668c72cc4c66ab772cdf32e3.tar.gz |
luci2: early wireless configuration
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
-rw-r--r-- | luci2/htdocs/luci2/template/network.wireless.htm | 1 | ||||
-rw-r--r-- | luci2/htdocs/luci2/view/network.wireless.js | 89 | ||||
-rw-r--r-- | luci2/share/menu.d/network.json | 6 |
3 files changed, 96 insertions, 0 deletions
diff --git a/luci2/htdocs/luci2/template/network.wireless.htm b/luci2/htdocs/luci2/template/network.wireless.htm new file mode 100644 index 0000000..a16cde4 --- /dev/null +++ b/luci2/htdocs/luci2/template/network.wireless.htm @@ -0,0 +1 @@ +<div id="map"></div>
\ No newline at end of file diff --git a/luci2/htdocs/luci2/view/network.wireless.js b/luci2/htdocs/luci2/view/network.wireless.js new file mode 100644 index 0000000..ab006a0 --- /dev/null +++ b/luci2/htdocs/luci2/view/network.wireless.js @@ -0,0 +1,89 @@ +L.ui.view.extend({ + execute: function() { + var self = this; + + var m = new L.cbi.Map('wireless', { + caption: L.tr('Wireless configuration') + }); + + var s = m.section(L.cbi.TypedSection, 'wifi-device', { + caption: L.tr('WiFi devices'), + collabsible: true + }); + + (s.option(L.cbi.DummyValue, '__name', { + caption: L.tr('Device') + })).ucivalue = function(sid) + { + return sid; + }; + + s.option(L.cbi.CheckboxValue, 'disabled', { + caption: L.tr('Disabled') + }); + + s.option(L.cbi.InputValue, 'channel', { + caption: L.tr('Channel') + }); + + var s_1 = s.subsection(L.cbi.TypedSection, 'wifi-iface', { + caption: L.tr('Device interfaces'), + addremove: true, + add_caption: L.tr('Add interface …') + }); + + s_1.filter = function(section, parent_sid) { + return section.device == parent_sid; + }; + + s_1.add = function(name, sid) { + var iface = this.ownerMap.add('wireless', 'wifi-iface'); + this.ownerMap.set('wireless', iface, 'device', sid); + }; + + s_1.tab({ + id: 'general', + caption: L.tr('General Settings') + }); + + s_1.taboption('general', L.cbi.CheckboxValue, 'disabled', { + caption: L.tr('Disabled') + }); + + s_1.taboption('general', L.cbi.ListValue, 'mode', { + caption: L.tr('Mode'), + initial: 'ap' + }) + .value('ap', L.tr('Access Point')) + .value('sta', L.tr('Client')) + .value('adhoc', L.tr('Ad-Hoc')) + .value('wds', L.tr('WDS (Wireless Distribution System)')) + .value('monitor', L.tr('Monitor')) + .value('mesh', L.tr('Mesh')); + + s_1.taboption('general', L.cbi.InputValue, 'ssid', { + caption: 'SSID' + }); + + s_1.tab({ + id: 'security', + caption: L.tr('Security') + }); + + s_1.taboption('security', L.cbi.ListValue, 'encryption', { + caption: L.tr('Encryption'), + initial: 'none' + }) + .value('none', L.tr('No encryption')) + .value('psk', L.tr('WPA Personal (PSK)')) + .value('psk2', L.tr('WPA2 Personal (PSK)')) + .value('mixed-psk', L.tr('WPA/WPA2 Personal (PSK) mixed')); + + s_1.taboption('security', L.cbi.PasswordValue, 'key', { + caption: L.tr('Passphrase'), + optional: true + }); + + return m.insertInto('#map'); + } +}); diff --git a/luci2/share/menu.d/network.json b/luci2/share/menu.d/network.json index 25ffeee..99b826b 100644 --- a/luci2/share/menu.d/network.json +++ b/luci2/share/menu.d/network.json @@ -9,6 +9,12 @@ "view": "network/interfaces", "index": 10 }, + "network/wireless": { + "title": "Wireless", + "acls": [ "network" ], + "view": "network/wireless", + "index": 20 + }, "network/switch": { "title": "Switch", "acls": [ "network" ], |