summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-10-20 00:25:39 +0200
committerJo-Philipp Wich <jo@mein.io>2023-10-20 00:25:39 +0200
commit88326b809ba9388a1b11b1c4226ccb07e5911261 (patch)
tree102b2b046b4fe7d2c734a0168bde1752adef0c5d /modules/luci-mod-network/htdocs/luci-static
parent603992560c5ca4b5929047e8e8c70f901f75d7f7 (diff)
luci-mod-network: rework DHCP relay settings
- Drop completely bogus 'ID' option, it's not handled by anything - Clarify relay from / relay to / accept from options Fixes: #6639 Fixes: a627744bb5 ("luci-mod-network: 'relay' tab added") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs/luci-static')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js42
1 files changed, 23 insertions, 19 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 82d7ae42e4..04b57a277d 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
@@ -234,7 +234,7 @@ return view.extend({
callHostHints(),
callDUIDHints(),
getDHCPPools(),
- network.getDevices()
+ network.getNetworks()
]);
},
@@ -243,7 +243,7 @@ return view.extend({
hosts = hosts_duids_pools[0],
duids = hosts_duids_pools[1],
pools = hosts_duids_pools[2],
- ndevs = hosts_duids_pools[3],
+ networks = hosts_duids_pools[3],
m, s, o, ss, so;
m = new form.Map('dhcp', _('DHCP and DNS'),
@@ -364,28 +364,27 @@ return view.extend({
ss.rowcolors = true;
ss.nodescriptions = true;
- so = ss.option(form.Value, 'id', _('ID'));
- so.rmempty = false;
- so.optional = true;
-
- so = ss.option(widgets.NetworkSelect, 'interface', _('Interface'));
- so.optional = true;
- so.rmempty = false;
- so.placeholder = 'lan';
-
- so = ss.option(form.Value, 'local_addr', _('Listen address'));
+ so = ss.option(form.Value, 'local_addr', _('Relay from'));
so.rmempty = false;
so.datatype = 'ipaddr';
for (var family = 4; family <= 6; family += 2) {
- for (var i = 0; i < ndevs.length; i++) {
- var addrs = (family == 6) ? ndevs[i].getIP6Addrs() : ndevs[i].getIPAddrs();
- for (var j = 0; j < addrs.length; j++)
- so.value(addrs[j].split('/')[0]);
+ for (var i = 0; i < networks.length; i++) {
+ if (networks[i].getName() != 'loopback') {
+ var addrs = (family == 6) ? networks[i].getIP6Addrs() : networks[i].getIPAddrs();
+ for (var j = 0; j < addrs.length; j++) {
+ var addr = addrs[j].split('/')[0];
+ so.value(addr, E([], [
+ addr, ' (',
+ widgets.NetworkSelect.prototype.renderIfaceBadge(networks[i]),
+ ')'
+ ]));
+ }
+ }
}
}
- so = ss.option(form.Value, 'server_addr', _('Relay To address'));
+ so = ss.option(form.Value, 'server_addr', _('Relay to address'));
so.rmempty = false;
so.optional = false;
so.placeholder = '192.168.10.1#535';
@@ -402,15 +401,20 @@ return view.extend({
n = p[0];
if ((m == null || m == '') && (n == null || n == ''))
- return _('Both Listen addr and Relay To must be specified.');
+ return _('Both "Relay from" and "Relay to address" must be specified.');
if ((validation.parseIPv6(m) && validation.parseIPv6(n)) ||
validation.parseIPv4(m) && validation.parseIPv4(n))
return true;
else
- return _('Listen and Relay To IP family must be homogeneous.')
+ return _('Address families of "Relay from" and "Relay to address" must match.')
};
+ so = ss.option(widgets.NetworkSelect, 'interface', _('Only accept replies via'));
+ so.optional = true;
+ so.rmempty = false;
+ so.placeholder = 'lan';
+
s.taboption('files', form.Flag, 'readethers',
_('Use <code>/etc/ethers</code>'),
_('Read <code>/etc/ethers</code> to configure the DHCP server.'));