Repository navigation
dashboard: shared layout, hide N/A info rows, Cable/Driver, Estimated Power card - #51
Merged
Merged
Conversation
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 15, 2026 03:09
There was a problem hiding this comment.
🟡 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.
bmfmancini
previously approved these changes
Oct 15, 2026
…, add Estimated Power card
… 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>
TheWitness
force-pushed
the
feature/dashboard-shared-layout-est-power
branch
from
October 16, 2026 16:54
b79620f to
b1a49f4
Compare
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>
xmacan
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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 bylocal_graph_id) stay per UPS, with onegraphs_slotmarker 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 sharedapcupsd_estimate_watts()from #54 rather than a second copy of the formula. - Tests (DashboardLayoutTest), CHANGELOG andcacti.potupdated.