Skip to content

feat(settings): add configurable timeout settings page#109

Open
JanZachmann wants to merge 3 commits intoomnect:mainfrom
JanZachmann:feat/configurable-timeouts
Open

feat(settings): add configurable timeout settings page#109
JanZachmann wants to merge 3 commits intoomnect:mainfrom
JanZachmann:feat/configurable-timeouts

Conversation

@JanZachmann
Copy link
Contributor

Summary

  • Adds a Settings page allowing users to view and modify operation timeouts (reboot, factory reset, firmware update, network rollback)
  • Backend persists settings to a JSON file (/data/omnect-ui/settings.json) and exposes GET /settings / POST /settings endpoints
  • Core loads timeout settings on startup and carries them in the model; a SaveSettings event dispatches the POST and applies an optimistic update to prevent form revert on re-render
  • TypeScript bindings updated; Settings route added to the sidebar navigation

Reason

Operation timeouts were previously hardcoded constants. Devices in different environments (slow networks, large firmware images) need tunable timeouts without requiring a firmware rebuild.

Verification

  • All Rust unit tests pass (cargo test --features mock)
  • Frontend builds cleanly (scripts/build-frontend.sh)
  • 4 new Playwright e2e tests cover: load from backend, save with POST capture + form retention after re-render, reset to defaults, and save failure error display (scripts/run-e2e-tests.sh settings.spec.ts)

- Add scanning, connecting, disconnecting, and saved-network management
  through the wifi-commissioning-service (unix domain socket)
- E2E coverage: auth flow, WiFi operations, form interaction edge cases

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
…frastructure

- **Model & Synchronization:** Moved  and  from the persistent  state to ephemeral . This ensures that these one-time notification flags do not persist across device reboots or accidental state synchronization cycles, preventing redundant modal popups.
- **Core Logic:** Implemented  in the Crux Core to decouple the initial application hydration from subsequent polling cycles. This allows for a deterministic startup sequence where the UI can react to the device state immediately after WASM initialization.
- **Test Infrastructure:**
    - Refactored  and  to utilize  for modal suppression, replacing the fragile  injection pattern.
    - Introduced  and  in the harness to reduce boilerplate and improve reliability of complex network redirection tests.
    - Standardized healthcheck mocking across all E2E tests to ensure consistent behavior during version-mismatch and rollback scenarios.
- **Backend & Utilities:** Added  to handle cases where the backend returns valid JSON alongside non-2xx status codes (e.g., 503 during version mismatch).

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Adds a Settings page that allows users to view and modify the timeout
values for device operations (reboot, factory reset, firmware update,
network rollback). Settings are persisted on the backend via a JSON
file and loaded on startup.

- Backend: new settings service with get/save endpoints (`/settings`)
- Core: new `TimeoutSettings` type, `SaveSettings` event and handler;
  model carries `timeout_settings` loaded from backend on init
- Shell: Settings.vue page with number inputs and save/reset actions;
  TypeScript bindings updated; route added to sidebar nav
- Optimistic update in Core prevents the form from reverting to old
  values after the POST response triggers a re-render
- E2E tests cover: load from backend, save with POST capture, reset
  to defaults, and save failure error display

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant