diff options
author | Manas Sambhus <manas.sambhus+github@gmail.com> | 2023-06-19 23:49:19 +0530 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2023-06-25 00:20:54 +0200 |
commit | fd5440a7be5506fa39c3993f10f754dedb5e8888 (patch) | |
tree | c53e2e0e29cd0818f0d500803bd95b998ed294eb /modules/luci-mod-network/htdocs/luci-static/resources/view | |
parent | 7e50256f70e305bd635ed86adc54ed8cf10d0d70 (diff) |
luci-mod-network: wireless.js: add wifi-iface macaddr random support
Add ability to choose random or custom mac address for wifi-iface.
By default the driver mac address is used and this special feature needs
to be supported by the wireless driver.
Signed-off-by: Manas Sambhus <manas.sambhus+github@gmail.com>
[ drop redundant tags and improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'modules/luci-mod-network/htdocs/luci-static/resources/view')
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 6b1bd262fb..5eb07ae41e 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -1157,10 +1157,11 @@ return view.extend({ if (/^radio\d+\.network/.test(o.placeholder)) o.placeholder = ''; + var macaddr = uci.get('wireless', radioNet.getName(), 'macaddr'); o = ss.taboption('advanced', form.Value, 'macaddr', _('MAC address'), _('Override default MAC address - the range of usable addresses might be limited by the driver')); - o.optional = true; - o.placeholder = radioNet.getActiveBSSID(); - o.datatype = 'macaddr'; + o.value('', _('driver default (%s)').format(!macaddr ? radioNet.getActiveBSSID() : _('no override'))); + o.value('random', _('randomly generated')); + o.datatype = "or('random',macaddr)"; o = ss.taboption('advanced', form.Flag, 'short_preamble', _('Short Preamble')); o.default = o.enabled; |