luci-mod-network: sort options in general/IPv4 tabs
authorDavid Härdeman <[email protected]>
Thu, 23 Oct 2025 17:20:31 +0000 (19:20 +0200)
committerPaul Donald <[email protected]>
Sat, 25 Oct 2025 13:31:08 +0000 (15:31 +0200)
No actual code changes.

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

index e4a7a7229756e23c472d65b12ceccb520cfc61eb..5d21dd0da0573c9db94f396dbb1c8741cedbc9cb 100644 (file)
@@ -707,25 +707,8 @@ return view.extend({
                                        }
 
                                        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('ipv4', 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"))';
-                                               so.default = '100';
-
-                                               so = ss.taboption('ipv4', form.Value, 'limit', _('Limit'), _('Maximum number of leased addresses.'));
-                                               so.optional = true;
-                                               so.datatype = 'uinteger';
-                                               so.default = '150';
+                                               so = ss.taboption('general', form.Flag, 'dynamicdhcp', _('Dynamic <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr>'), _('Dynamically allocate DHCP addresses for clients. If disabled, only clients having static leases will be served.'));
+                                               so.default = so.enabled;
 
                                                so = ss.taboption('general', form.Value, 'leasetime', _('Lease time'), _('Expiry time of leased addresses, minimum is 2 minutes (<code>2m</code>).'));
                                                so.optional = true;
@@ -742,16 +725,35 @@ return view.extend({
                                                        return _("Invalid DHCP lease time format. Use integer values optionally followed by s, m, h, d, or w.");
                                                }
 
-                                               so = ss.taboption('general', form.Flag, 'dynamicdhcp', _('Dynamic <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr>'), _('Dynamically allocate DHCP addresses for clients. If disabled, only clients having static leases will be served.'));
-                                               so.default = so.enabled;
-
                                                if (L.hasSystemFeature('dnsmasq')) {
                                                        ss.taboption('general', form.Flag, 'force', _('Force'),
                                                                _('Force DHCP on this network even if another server is detected (dnsmasq only).'));
                                                }
 
-                                               // XXX: is this actually useful?
-                                               //ss.taboption('advanced', form.Value, 'name', _('Name'), _('Define a name for this network.'));
+                                               if (L.hasSystemFeature('dnsmasq')) {
+                                                       ss.taboption('general', form.DynamicList, 'dhcp_option', _('DHCP-Options'),
+                                                               _('Define additional DHCP options,  for example "<code>6,192.168.2.1,192.168.2.2</code>" which advertises different DNS servers to clients (dnsmasq only).'));
+                                               }
+
+                                               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('ipv4', 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"))';
+                                               so.default = '100';
+
+                                               so = ss.taboption('ipv4', form.Value, 'limit', _('Limit'), _('Maximum number of leased addresses.'));
+                                               so.optional = true;
+                                               so.datatype = 'uinteger';
+                                               so.default = '150';
 
                                                if (L.hasSystemFeature('dnsmasq')) {
                                                        so = ss.taboption('ipv4', form.Value, 'netmask', _('<abbr title="Internet Protocol Version 4">IPv4</abbr>-Netmask'),
@@ -769,11 +771,6 @@ return view.extend({
                                                                return form.Value.prototype.validate.apply(this, [ section_id, value ]);
                                                        };
                                                }
-
-                                               if (L.hasSystemFeature('dnsmasq')) {
-                                                       ss.taboption('general', form.DynamicList, 'dhcp_option', _('DHCP-Options'),
-                                                               _('Define additional DHCP options,  for example "<code>6,192.168.2.1,192.168.2.2</code>" which advertises different DNS servers to clients (dnsmasq only).'));
-                                               }
                                        }