Conversation
1 task
Jackie264
marked this pull request as ready for review
September 23, 2026 00:54
Author
openwrt-ai
reviewed
Sep 23, 2026
openwrt-ai
left a comment
Collaborator
There was a problem hiding this comment.
Commit checks
- 2891ccb "luci-app-keepalived: default the enabled flag to match init script" — the body inverts which direction was broken.
CBIFlag.parse()removes the option only when the submitted value equals.default, so withdefault = o.disabledticking submitted'1'≠'0'and was written; it was unticking that submitted'0'=='0', got removed, and left the init script'senabled=1fallback in force. Reword so the removed-on-submit case is the untick (and drop "since the field started out already at its default value" — the initial state is not whatparse()compares). The same paragraph in the PR description needs the same correction.
Generated by Claude Code
stokito
reviewed
Sep 23, 2026
|
|
||
| o = s.option(form.Flag, 'enabled', _('Enabled')); | ||
| o.default = o.disabled; | ||
| o.default = o.enabled; |
Contributor
There was a problem hiding this comment.
It would be better to make it o.default = true;
See #7140 (comment)
stokito
approved these changes
Sep 23, 2026
Jackie264
force-pushed
the
fix-luci-app-keepalived
branch
from
September 23, 2026 23:14
d411553 to
34a108b
Compare
The "Enabled" Flag on the globals page defaulted to o.disabled,
but files/keepalived.init treats a missing globals.enabled
option as enabled:
config_get_bool enabled globals enabled 1
form.Flag omits an option from UCI whenever the submitted value
equals its .default. With the default set to disabled, ticking
the box (submitting '1') was treated as "back to default" and
the option was silently removed instead of being written, which
made the init script fall back to its own enabled=1 default
anyway. Unticking the box likewise never wrote '0', since the
field started out already at its (wrong) default value.
Net effect: the checkbox could tick and untick freely in the UI
but never actually changed whether the service would start,
because the option it controls was never written on either
side of the toggle in the direction that mattered.
Set the form default to o.enabled so it matches the init
script's assumption: ticking removes the option (falls back to
enabled=1), unticking explicitly writes enabled='0'.
Signed-off-by: Jackie Han <jackie.han@gmail.com>
Set default enabled flag to true in globals.js
Signed-off-by: Jackie Han <jackie.han@gmail.com>
Jackie264
force-pushed
the
fix-luci-app-keepalived
branch
from
September 23, 2026 23:47
34a108b to
061d423
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Enabled" Flag on the globals page defaulted to o.disabled,
but files/keepalived.init treats a missing globals.enabled
option as enabled:
config_get_bool enabled globals enabled 1
CBIFlag.parse() removes an option from UCI whenever the
submitted value equals the widget's .default, and writes it
explicitly otherwise. With the default set to disabled, ticking
the box submitted '1', which did not match the default, so it
was written explicitly -- that direction worked. Unticking the
box submitted '0', which matched the default, so the option was
removed instead of being written, and with it gone the init
script fell back to its own enabled=1 default. Unticking
"Enabled" therefore never actually disabled the service.
Set the form default to o.enabled so the comparison lines up
with the init script instead of fighting it: ticking now
matches the default and removes the option (falling back to the
init script's own enabled=1), while unticking no longer matches
the default and explicitly writes enabled='0'.
Depends on / companion fix: openwrt/packages#30582
Tested on
OpenWrt version: 25.12.5 r33051-f5dae5ece4
LuCI version: 26.263.44884~0834d09
Web browser(s): Safari 27.0 (22625.1.29.11.27)
Signed-off-by: Jackie Han jackie.han@gmail.com