luci-mod-network: move max_{preferred,valid}_lifetime to IPv6-RA tab
authorTianling Shen <[email protected]>
Tue, 28 Oct 2025 08:50:57 +0000 (16:50 +0800)
committerPaul Donald <[email protected]>
Wed, 29 Oct 2025 14:52:52 +0000 (15:52 +0100)
These options are RA configuration so they should be put under the
IPv6-RA tab instead of the "generic" IPv6 tab.
Also make them depend on RA server/hybrid mode as these values are
pointless without RA server enabled.

Signed-off-by: Tianling Shen <[email protected]>
(cherry picked from commit 4b17392e5fe5dfcd742a7dc0b26322690a61b636)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index e94dd4359b47f5f8a372436db69613bb4b649e0a..69e6edfbc586e567c3ca6125f04fdc890d8a454e 100644 (file)
@@ -932,6 +932,27 @@ return view.extend({
                                                }, this));
                                        };
 
+                                       so = ss.taboption('ipv6-ra', form.Value, 'max_preferred_lifetime', _('IPv6 Preferred Prefix Lifetime'), _('Maximum preferred lifetime for a prefix.'));
+                                       so.optional = true;
+                                       so.placeholder = '45m';
+                                       so.value('5m', _('5m (5 minutes)'));
+                                       so.value('45m', _('45m (45 minutes - default)'));
+                                       so.value('3h', _('3h (3 hours)'));
+                                       so.value('12h', _('12h (12 hours)'));
+                                       so.value('7d', _('7d (7 days)'));
+                                       so.depends('ra', 'server');
+                                       so.depends({ ra: 'hybrid', master: '0' });
+
+                                       so = ss.taboption('ipv6-ra', form.Value, 'max_valid_lifetime', _('IPv6 Valid Prefix Lifetime'), _('Maximum valid lifetime for a prefix.'));
+                                       so.optional = true;
+                                       so.placeholder = '90m';
+                                       so.value('5m', _('5m (5 minutes)'));
+                                       so.value('90m', _('90m (90 minutes - default)'));
+                                       so.value('3h', _('3h (3 hours)'));
+                                       so.value('12h', _('12h (12 hours)'));
+                                       so.value('7d', _('7d (7 days)'));
+                                       so.depends('ra', 'server');
+                                       so.depends({ ra: 'hybrid', master: '0' });
 
                                        so = ss.taboption('ipv6', form.RichListValue, 'dhcpv6', _('DHCPv6-Service'),
                                                _('Configures the operation mode of the DHCPv6 service on this interface.'));
@@ -1031,24 +1052,6 @@ return view.extend({
                                        so = ss.taboption('ipv6', form.Flag, 'ndproxy_slave', _('NDP-Proxy slave'), _('Set interface as NDP-Proxy external slave. Default is off.'));
                                        so.depends({ ndp: 'relay', master: '0' });
                                        so.depends({ ndp: 'hybrid', master: '0' });
-
-                                       so = ss.taboption('ipv6', form.Value, 'max_preferred_lifetime', _('IPv6 Preferred Prefix Lifetime'), _('Maximum preferred lifetime for a prefix.'));
-                                       so.optional = true;
-                                       so.placeholder = '45m';
-                                       so.value('5m', _('5m (5 minutes)'));
-                                       so.value('45m', _('45m (45 minutes - default)'));
-                                       so.value('3h', _('3h (3 hours)'));
-                                       so.value('12h', _('12h (12 hours)'));
-                                       so.value('7d', _('7d (7 days)'));
-
-                                       so = ss.taboption('ipv6', form.Value, 'max_valid_lifetime', _('IPv6 Valid Prefix Lifetime'), _('Maximum valid lifetime for a prefix.'));
-                                       so.optional = true;
-                                       so.placeholder = '90m';
-                                       so.value('5m', _('5m (5 minutes)'));
-                                       so.value('90m', _('90m (90 minutes - default)'));
-                                       so.value('3h', _('3h (3 hours)'));
-                                       so.value('12h', _('12h (12 hours)'));
-                                       so.value('7d', _('7d (7 days)'));
                                }
 
                                ifc.renderFormOptions(s);