luci-app-keepalived: fix nopreempt value handling
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 10 May 2024 07:27:50 +0000 (09:27 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Fri, 10 May 2024 07:27:56 +0000 (09:27 +0200)
The 'nopreempt' option is marked with the prefix 'no_value_' in the
keepalived init script. This means that if the value is not set in the
keepalived configuration, it must be removed from the uci configuration.

To get this behavior, the rmempty flag in the LuCI must be removed.

fixes #7114

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-keepalived/htdocs/luci-static/resources/view/keepalived/vrrp_instance.js

index f9293d6c2073752e0f800bd22d1d5ce24b734af9..c6db62d2b1f769f0772d0e1268f48fdc67d49fce 100644 (file)
@@ -64,8 +64,8 @@ return view.extend({
                        _('Allows the lower priority machine to maintain the master role,') +
                        _('even when a higher priority machine comes back online.') + ' ' +
                        _('For this to work, the initial state of this entry must be BACKUP.'));
+               o.optional = true;
                o.default = false;
-               o.rmempty = false;
 
                ipaddress = uci.sections('keepalived', 'ipaddress');
                o = s.taboption('general', form.DynamicList, 'virtual_ipaddress', _('Virtual IP Address'),