luci-mod-network: add an "IPv4 Settings" tab to interfaces
authorDavid Härdeman <[email protected]>
Thu, 23 Oct 2025 17:02:33 +0000 (19:02 +0200)
committerPaul Donald <[email protected]>
Sat, 25 Oct 2025 13:31:08 +0000 (15:31 +0200)
And add one option to disable/enable odhcpd's DHCPv4 support.

Signed-off-by: David Härdeman <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index 8b49f5a7205d8bcde083b8c0bdb03b4b0cc0bd23..29fe309828f4436d31c2203c32b0dc746802a5e4 100644 (file)
@@ -669,6 +669,7 @@ return view.extend({
 
                                        ss.tab('general',  _('General Setup'));
                                        ss.tab('advanced', _('Advanced Settings'));
+                                       ss.tab('ipv4', _('IPv4 Settings'));
                                        ss.tab('ipv6', _('IPv6 Settings'));
                                        ss.tab('ipv6-ra', _('IPv6 RA Settings'));
 
@@ -704,6 +705,16 @@ return view.extend({
                                        ss.taboption('general', form.Flag, 'ignore', _('Ignore interface'), _('Disable <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr> for this interface.'));
 
                                        if (protoval == 'static') {
+                                               if (L.hasSystemFeature('odhcpd')) {
+                                                       so = ss.taboption('ipv4', form.RichListValue, 'dhcpv4', _('DHCPv4 Service'),
+                                                                         _('Enable or disable DHCPv4 services on this interface (odhcpd only).'));
+                                                       so.optional = true;
+                                                       so.value('', _('disabled'),
+                                                                _('Do not provide DHCPv4 services on this interface.'));
+                                                       so.value('server', _('enabled'),
+                                                                _('Provide DHCPv4 services on this interface.'));
+                                               }
+
                                                so = ss.taboption('general', form.Value, 'start', _('Start', 'DHCP IP range start address'), _('Lowest leased address as offset from the network address.'));
                                                so.optional = true;
                                                so.datatype = 'or(uinteger,ip4addr("nomask"))';