75 lines
4.0 KiB
Markdown
75 lines
4.0 KiB
Markdown
# Factory Overview dashboard preset (0.33.3)
|
||
|
||
`src/admin/web/dashboard-defaults.json` is the single factory configuration
|
||
for the Rust admin preference API and the authenticated JavaScript panel.
|
||
|
||
The preset contains:
|
||
|
||
- `dashboard_widgets`: complete card identifier order, including hidden cards;
|
||
- `dashboard_hidden_widgets`: identifiers hidden in the factory Overview;
|
||
- `dashboard_density`: `normal`, `compact` or `ultra`;
|
||
- `overview_samples`: `60`, `120`, `300` or `600` samples for first use in a browser.
|
||
|
||
Card IDs and labels are defined in `src/admin/web/dashboard-widgets.json`.
|
||
The preset may omit newly registered card IDs: the server/client will append
|
||
those cards and apply the registry's `default_hidden` flag. The preset must
|
||
not contain unknown or duplicate IDs, or hidden IDs absent from its order.
|
||
|
||
The bundled 0.33.1 preset reproduces the supplied operator layout: 78 ordered
|
||
cards, 51 hidden, compact density and 600 initial samples. The packaged
|
||
Web Server cards remain hidden by default.
|
||
|
||
## User-selected card widths (0.33.3)
|
||
|
||
The factory preset intentionally retains the original 0.33.1 widths and
|
||
legacy grouped presentation. Version 0.33.3 adds a separate nullable preference:
|
||
|
||
- `dashboard_widget_sizes: null` (including omitted in an old record): retain
|
||
previous size groups, so upgrades do not spontaneously rearrange cards.
|
||
- `dashboard_widget_sizes: {}`: freely order all card types, while leaving
|
||
their widths at the original values.
|
||
- `dashboard_widget_sizes: { "http_protocol": 4, "wide_transform_activity": 3 }`:
|
||
also override individual widths, in units of the 12-column Overview grid.
|
||
|
||
Permitted widths: 2, 3, 4, 6 and 12 columns; regular charts need at least 3,
|
||
full diagnostic panels at least 4, and the backend table at least 6. At the
|
||
largest canvas four 3-column charts fit alongside each other. On small screens
|
||
the renderer reduces to a six- or two-column grid; the saved dimensions do not
|
||
change. In **Unlock layout**, click − / + or drag cards across their old groups;
|
||
**Arrange cards visually** provides the same controls. Save persists order,
|
||
visibility and sizes in the administrator's current preference document.
|
||
|
||
**Cancel** restores the saved layout and sizes. **Restore defaults** restores
|
||
the original factory order/visibility and width defaults, but does not change
|
||
the independently saved Overview sample limit. Dense packing reduces gaps,
|
||
so when columns do not divide evenly, a later narrow tile may fill an earlier
|
||
free space without changing the saved DOM or keyboard traversal order.
|
||
|
||
## Deploying an edited preset
|
||
|
||
1. Edit `src/admin/web/dashboard-defaults.json` in the source tree.
|
||
2. Validate the JSON and identifiers (e.g. run
|
||
`python3 scripts/tests/dashboard_layout_0331_browser_test.py`).
|
||
3. Rebuild RustProxy (`./dev.sh check` / the normal release build) and deploy
|
||
the newly built binary. The preset is **embedded**; editing the installed
|
||
source JSON alone does not update a running binary.
|
||
|
||
## Existing installation and reset behavior
|
||
|
||
- Admin accounts with stored preferences in SQLite retain their chosen
|
||
ordering, card visibility and density on upgrade. The preset never rewrites
|
||
these saved records. Accounts without saved preferences receive the new
|
||
factory defaults, even on upgraded installations.
|
||
- In Overview, **Arrange cards visually → Restore defaults** restores the
|
||
factory card order/visibility after the user confirms; it does not reset
|
||
unrelated appearance or sample-history settings.
|
||
- The history selector uses browser-local storage key
|
||
`rustproxy.overview.liveChartSamples`. An explicitly saved choice (including
|
||
60) wins over the factory sample count. A browser without a saved choice
|
||
starts with 600. The sample limit does not change polling frequency.
|
||
- While layout is unlocked, hide/show/reorder changes are temporary and stay
|
||
effective during backend/Stream status refresh. **Cancel changes** restores
|
||
the saved layout; **Save and lock** persists the current draft.
|
||
|
||
No SQLite schema migration or additional HTTP endpoint is required.
|