From 3a5240e8529db9ba9eb002fba0cf24412965ee92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Thu, 23 Oct 2025 19:20:31 +0200 Subject: [PATCH] luci-mod-network: sort options in general/IPv4 tabs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No actual code changes. Signed-off-by: David Härdeman --- .../resources/view/network/interfaces.js | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index e4a7a72297..5d21dd0da0 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -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 DHCP'), _('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 (2m).')); 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 DHCP'), _('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 "6,192.168.2.1,192.168.2.2" 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', _('IPv4-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 "6,192.168.2.1,192.168.2.2" which advertises different DNS servers to clients (dnsmasq only).')); - } } -- 2.30.2