summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorVladislav Grigoryev <vg.aetera@gmail.com>2021-10-05 12:36:16 +0300
committerVladislav Grigoryev <vg.aetera@gmail.com>2021-10-12 00:25:01 +0300
commit6ee3482af2ff6e947f5afd3f1898cdefb18f3c68 (patch)
tree9fe4fd8b8876b807bdc13b4825763c6f4aa58224 /modules/luci-mod-network/htdocs
parente4d24f07c9e641a18aede2f556bee4361b7a7af6 (diff)
luci-mod-network: support dhcp.ipset as section
Allow configuring ipset sections in the dhcp config: https://openwrt.org/docs/guide-user/base-system/dhcp#ip_sets This can also be combined with instance-specific IP sets: https://github.com/openwrt/luci/pull/5402 However, it makes easier to assign domains to IP sets. Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js22
1 files changed, 20 insertions, 2 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 d7f6910787..a04052121e 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
@@ -254,6 +254,7 @@ return view.extend({
s.tab('advanced', _('Advanced Settings'));
s.tab('leases', _('Static Leases'));
s.tab('hosts', _('Hostnames'));
+ s.tab('ipsets', _('IP Sets'));
s.taboption('general', form.Flag, 'domainneeded',
_('Domain required'),
@@ -501,12 +502,12 @@ return view.extend({
ss.sortable = true;
so = ss.option(form.Value, 'name', _('Hostname'));
+ so.rmempty = false;
so.datatype = 'hostname';
- so.rmempty = true;
so = ss.option(form.Value, 'ip', _('IP address'));
+ so.rmempty = false;
so.datatype = 'ipaddr';
- so.rmempty = true;
var ipaddrs = {};
@@ -521,6 +522,23 @@ return view.extend({
so.value(ipv4, '%s (%s)'.format(ipv4, ipaddrs[ipv4]));
});
+ o = s.taboption('ipsets', form.SectionValue, '__ipsets__', form.GridSection, 'ipset', null,
+ _('List of IP sets to populate with the specified domain IPs.'));
+
+ ss = o.subsection;
+
+ ss.addremove = true;
+ ss.anonymous = true;
+ ss.sortable = true;
+
+ so = ss.option(form.DynamicList, 'name', _('IP set'));
+ so.rmempty = false;
+ so.datatype = 'string';
+
+ so = ss.option(form.DynamicList, 'domain', _('Domain'));
+ so.rmempty = false;
+ so.datatype = 'hostname';
+
o = s.taboption('leases', form.SectionValue, '__leases__', form.GridSection, 'host', null,
_('Static leases are used to assign fixed IP addresses and symbolic hostnames to DHCP clients. They are also required for non-dynamic interface configurations where only hosts with a corresponding lease are served.') + '<br />' +
_('Use the <em>Add</em> Button to add a new lease entry. The <em>MAC address</em> identifies the host, the <em>IPv4 address</em> specifies the fixed address to use, and the <em>Hostname</em> is assigned as a symbolic name to the requesting host. The optional <em>Lease time</em> can be used to set non-standard host-specific lease time, e.g. 12h, 3d or infinite.'));