Overview
Currently, the ServerHealthWidget hardcodes a check against data.status === "healthy" on the client side. This means any remote that doesn't return exactly that field/value will always appear unhealthy, regardless of its actual state.
Proposed Feature
Allow users to configure what a "healthy" response looks like for each widget, set via the widget's create/edit modal.
Changes Required
server/models/ServerHealthWidget.ts — Add fields for the expected status field name and expected healthy value (e.g. statusField: String, expectedStatus: String)
server/controllers/Widget.ts — Read and persist the new fields in createWidget and implement updateWidget to support editing them
client/ServerHealthWidget.jsx — Replace hardcoded "healthy" check with props-driven comparison
client/App.jsx — Pass the new fields as props when rendering <ServerHealthWidget />
- Create/Edit modal UI — Add inputs for the status field name and expected value
Example
A remote might return { state: "ok" } instead of { status: "healthy" }. The user should be able to configure:
- Status field:
state
- Expected value:
ok
Notes
- Consider whether to support only the expected value (assuming
status as the field), or both the field name and the expected value for full flexibility.
- The edit modal for widgets does not yet exist and would need to be built as part of this or a related issue.
Overview
Currently, the
ServerHealthWidgethardcodes a check againstdata.status === "healthy"on the client side. This means any remote that doesn't return exactly that field/value will always appear unhealthy, regardless of its actual state.Proposed Feature
Allow users to configure what a "healthy" response looks like for each widget, set via the widget's create/edit modal.
Changes Required
server/models/ServerHealthWidget.ts— Add fields for the expected status field name and expected healthy value (e.g.statusField: String,expectedStatus: String)server/controllers/Widget.ts— Read and persist the new fields increateWidgetand implementupdateWidgetto support editing themclient/ServerHealthWidget.jsx— Replace hardcoded"healthy"check with props-driven comparisonclient/App.jsx— Pass the new fields as props when rendering<ServerHealthWidget />Example
A remote might return
{ state: "ok" }instead of{ status: "healthy" }. The user should be able to configure:stateokNotes
statusas the field), or both the field name and the expected value for full flexibility.