summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorPaul Donald <newtwen@gmail.com>2023-12-07 01:06:16 +0100
committerPaul Donald <newtwen@gmail.com>2023-12-28 18:34:25 +0000
commitd5db17361a556f9c7eda8fa1a0b0c59d57034633 (patch)
tree4d7d47eec190983d1bbff8dc613a6bfd36eb5e7c /modules/luci-mod-network/htdocs
parentbcaa445f088ad901da693a29b55e80295cb8f093 (diff)
luci-mod-network: Rework the (multi) mac for static leases
+i18n Removed Jows widget which hindered management of multi mac entries. Signed-off-by: Paul Donald <newtwen@gmail.com>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js28
1 files changed, 3 insertions, 25 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
index 074bfbc71b..c78738b9cc 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
@@ -913,7 +913,8 @@ return view.extend({
uci.unset('dhcp', section, 'dns');
};
- so = ss.option(form.Value, 'mac',
+ //this can be a .DynamicList or a .Value with a widget and dnsmasq handles multimac OK.
+ so = ss.option(form.DynamicList, 'mac',
_('MAC address(es)'),
_('The hardware address(es) of this entry/host.') + '<br /><br />' +
_('In DHCPv4, it is possible to include more than one mac address. This allows an IP address to be associated with multiple macaddrs, and dnsmasq abandons a DHCP lease to one of the macaddrs when another asks for a lease. It only works reliably if only one of the macaddrs is active at any time.'));
@@ -923,30 +924,7 @@ return view.extend({
var macs = L.toArray(uci.get('dhcp', section, 'mac'));
return expandAndFormatMAC(macs);
};
- so.renderWidget = function(section_id, option_index, cfgvalue) {
- var node = form.Value.prototype.renderWidget.apply(this, [section_id, option_index, cfgvalue]),
- ipopt = this.section.children.filter(function(o) { return o.option == 'ip' })[0];
-
- node.addEventListener('cbi-dropdown-change', L.bind(function(ipopt, section_id, ev) {
- var mac = ev.detail.value.value;
- if (mac == null || mac == '' || !hosts[mac])
- return;
-
- var iphint = L.toArray(hosts[mac].ipaddrs || hosts[mac].ipv4)[0];
- if (iphint == null)
- return;
-
- var ip = ipopt.formvalue(section_id);
- if (ip != null && ip != '')
- return;
-
- var node = ipopt.map.findElement('id', ipopt.cbid(section_id));
- if (node)
- dom.callClassMethod(node, 'setValue', iphint);
- }, this, ipopt, section_id));
-
- return node;
- };
+ //removed jows renderwidget function which hindered multi-mac entry
so.validate = validateMACAddr.bind(so, pools);
Object.keys(hosts).forEach(function(mac) {
var hint = hosts[mac].name || L.toArray(hosts[mac].ipaddrs || hosts[mac].ipv4)[0];