Skip to content

dashboard: shared layout, hide N/A info rows, Cable/Driver, Estimated Power card - #51

Merged
TheWitness merged 4 commits into
developfrom
feature/dashboard-shared-layout-est-power
Oct 16, 2026
Merged

TheWitness merged 4 commits into
developfrom
feature/dashboard-shared-layout-est-power

Conversation

@TheWitness

@TheWitness TheWitness commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Scope (revised after #54) #54 already added the fleet-level estimated power (apcupsd_estimate_watts(), Est. Power tile, Fleet Power gauge, sortable table). This PR is rebased onto it and now covers only the per-UPS drilldown changes: - Shared layout: the fixed-card arrangement and expanded state are shared across every UPS. Graph cards (keyed by local_graph_id) stay per UPS, with one graphs_slot marker per run of graphs in the shared order, so each UPS places its own graphs in the same spots. A UPS with no graphs keeps the shared slots, and a UPS's own legacy graph selection is migrated even when the shared row already exists. - Legacy migration: a layout from the earlier per-UPS row or the pre-release combined map is persisted to the shared row on first read (4096-char guard retained). - UPS Information card: hide N/A rows and combine Cable / Driver on one row. - Estimated Power gauge card (per UPS): uses the shared apcupsd_estimate_watts() from #54 rather than a second copy of the formula. - Tests (DashboardLayoutTest), CHANGELOG and cacti.pot updated.

@TheWitness
TheWitness requested review from bmfmancini and xmacan and a balanced review from Copilot October 15, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Shared layouts lose device-specific graph selections, and first-read migration does not persist the shared preference.

2 open findings
What changed in this PR

Refines the Cacti UPS dashboard with shared layout preferences and clearer power and device information.

Changes:

  • Shares dashboard layouts across UPSes, with legacy-layout fallback.
  • Hides empty information rows and combines Cable / Driver.
  • Adds an Estimated Power gauge and min/avg/max captions.
File Description
locales/​po/​cacti.pot Adds translation strings for dashboard refinements.
includes/​dashboard.php Updates layout storage, information rows, and gauge rendering.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread includes/dashboard.php
Comment thread includes/dashboard.php Outdated
bmfmancini
bmfmancini previously approved these changes Oct 15, 2026
TheWitness and others added 2 commits October 16, 2026 12:51
… reuse apcupsd_estimate_watts()

- Share only the fixed-card arrangement across UPSes; store each UPS's graph
  cards (local_graph_id keys) in their own row with a graphs_slot marker so
  saving from one UPS no longer overwrites or hides another UPS's graphs.
- Persist a layout migrated from the per-UPS row or the pre-release combined
  map to the shared row on first read, with the existing 4096-char guard.
- Compute the per-UPS Estimated Power card with the shared
  apcupsd_estimate_watts() added in #54 instead of duplicating the formula.
- Add DashboardLayoutTest and a CHANGELOG entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Layout persistence can unexpectedly move graph cards and discard legacy graph preferences for other UPSes.

3 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread includes/dashboard.php Outdated
Comment thread includes/dashboard.php
Comment thread includes/dashboard.php Outdated
TheWitness and others added 2 commits October 16, 2026 13:07
A slave's draw is already part of its master's, so leave it out of the
fleet power total, capacity and count, and show N/A for its Est. Power in the
Fleet Dashboard table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aphless UPSes, migrate each UPS's legacy graphs

- Store one graphs_slot marker per run of consecutive graph cards and one
  graph run per marker, so graphs interleaved with fixed cards keep their
  placement across a save/reload.
- When a UPS with no graphs saves, re-anchor the existing shared slots to the
  nearest surviving fixed card instead of dropping them.
- When the shared row already exists but a UPS has no graph row, migrate and
  persist that UPS's own legacy graph selection (per-UPS row, then combined
  map) before defaulting to all graphs; the shared fixed layout is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TheWitness
TheWitness merged commit 5a6f254 into develop Oct 16, 2026
3 checks passed
@TheWitness
TheWitness deleted the feature/dashboard-shared-layout-est-power branch October 16, 2026 17:20
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.

4 participants