Add Network UPS Tools settings#3317
Conversation
|
Overall this is fairly well implemented, but may be a bit of an advanced feature for most users. A user may see this new tab and not understand why it's here or what to do with it. @MattDHill would like your input on the UX here. |
|
Heads up: this PR's NUT integration wires This depends on #3319, which adds the systemd ordering + |
Could/should this be a service? |
|
From the technical side — the part that constrains the packaging/UX call: The core value of UPS support is powering off the host on low battery, and a packaged service can't do that today:
So as-is, the host-poweroff behavior has to live in core. The path to "NUT as a service" would be to expose a privileged host-shutdown effect/permission that a NUT service calls on Net: it could become a service if we add a host-shutdown effect, but the privileged poweroff (and the graceful-shutdown work behind it) stays in core either way. Whether the config/status surface should be a core tab or a package is your and @dr-bonez's call — flagging the constraints so it's grounded; happy to support either direction. |
|
Not really. The purpose is being able to connect StartOS to a smart UPS such that it can shut down gracefully before the UPS battery runs out. Very OS-level feature, but not applicable to users that don't have the relevant hardware. And might raise questions in support about "what is this UPS thing and do I need it?" |
|
On the discoverability concern: one mechanism that squares "OS-level feature" with "don't confuse users who don't have a UPS" is hardware detection — The one caveat is client mode (monitoring a UPS hosted on another NUT server over the network) — there's no local device to detect, so that path would still need an explicit entry point, e.g. behind an "advanced" toggle rather than the default surface. Final UX call is yours and @MattDHill's — just flagging that auto-detection is available as a gate if you want the feature to stay out of the way until it's relevant. |
|
Would a different location or name (like "battery backup") or even a brief explanation make it more user-friendly? |
|
I think we should show it always and call it what it is, handling the explantion and instructions in documentation, as designed. I'm generally against hidden/conditional features. If they are actual good/useful features, we want people to say "what's that?" and discover something useful. It also works against the person who explicitly wants the feature but doesn't know it exists. Finally, the client aspect of this makes muddles the clean conditionality. The new frontend component needs some work. We'll want @waterplea to get in there and clean up a bit. |
|
Makes sense — agreed on always-visible and named for what it is, with the explanation in docs. Your point about it working against the user who wants the feature but doesn't know it exists is the convincing one, and the network-client mode does muddle any clean hardware gate. Withdrawing the auto-detection idea. Nothing further from me on the UX; the only remaining gate from the engineering side is the graceful-shutdown dependency (#3319) so the UPS-triggered |
I can jump on it after it's merged, is that ok? |
|
No, but it's not urgent either. This isn't going into beta.10, expected today/tomorrow. It will wait for the next release. |
|
@MattDHill @BeeJoe I'm not sure how to contribute here, I've made my edits to the UI but looks like I do not have the right to push into @BeeJoe fork. Should I make my own fork with a PR to this branch? For now I only refactored the UI a little bit, I think the config interaction should be reworked a bit, maybe into modal so that it does not take up space all the time, what do you think? I also talked to @dr-bonez a little – I think that making disabled a config option is not that great UX, there should be a toggle on/off and then configuration. For that, it would need some reworking on the back to not discard config when we disable the feature. |
|
@waterplea it looks like @BeeJoe has "allow edits from maintainers enabled on the PR so you should be able to push directly to his branch |
Encode NUT enable/disable as a top-level boolean separate from the
server/client settings, so toggling off no longer discards configured
values. NutConfig becomes { enabled, settings: NutSettings? }; the
former Disabled enum variant is gone. Disabling stops monitoring and
retains settings; re-enabling re-applies them.
Addresses @waterplea's review feedback on Start9Labs#3317.
|
Pushed a backend rework addressing @waterplea's point about not discarding config on disable (
I also updated the existing UI component to the new shape (an Maintainer-edits is enabled on this PR, so you should be able to push your UI work straight to this branch — point your remote at |
Encode NUT enable/disable as a top-level boolean separate from the
server/client settings, so toggling off no longer discards configured
values. NutConfig becomes { enabled, settings: NutSettings? }; the
former Disabled enum variant is gone. Disabling stops monitoring and
retains settings; re-enabling re-applies them.
Addresses @waterplea's review feedback on Start9Labs#3317.
Encode NUT enable/disable as a top-level boolean separate from the
server/client settings, so toggling off no longer discards configured
values. NutConfig becomes { enabled, settings: NutSettings? }; the
former Disabled enum variant is gone. Disabling stops monitoring and
retains settings; re-enabling re-applies them.
Addresses @waterplea's review feedback on Start9Labs#3317.
|
Rebased and pushed my changes |
Resolve i18n dictionary ID collision: master claimed IDs 882-885 for the Port Range strings, so renumber the four colliding NUT strings (Network UPS Tools, Configure, Direct UPS, Client) to 909-912 across all five locale dictionaries. All other conflicts auto-merged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Adds Network UPS Tools (NUT) support to StartOS settings.
Related docs
Also see the related PR on the
Start9Labs/start-docsrepository.Validation
npm --prefix web run check:uinpm --prefix web run check:i18ncheck:ui,check:shared, andcheck:i18ngit diff --check