Skip to content

Monitor 3.0 board: full-width grouping cards, Tree ordering, and the Status->Events filter model - #274

Merged
TheWitness merged 26 commits into
developfrom
fix/grouping-card-fullwidth-flexbox-develop
Oct 12, 2026
Merged

TheWitness merged 26 commits into
developfrom
fix/grouping-card-fullwidth-flexbox-develop

Conversation

@TheWitness

@TheWitness TheWitness commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Summary

The 3.0 refresh of the Monitor board. This is more than a CSS tweak — it covers the grouping-card layout fix and the Status→Events filter model, list columns/pills, service-check integration, and the per-user / per-dashboard persistence and tests that go with them.

Layout (grouping cards)

  • Flexbox instead of grid — .monitorGroupGrid is now a wrapping flexbox and each .monitorGroupCard grows via flex-grow/flex-basis keyed off data-span. Inside Cacti's shrink-to-fit html_start_box div.cactiTable nesting the old CSS grid mis-counted its tracks and clipped cards to ~half the page; flexbox fills the full width at 360 / 500 / 760 / 1100 / 1517px with no overflow.
  • Tree ordering — monitorRenderTreeCards() now default-orders tree cards by device count (busiest first); any saved drag order still wins via monitorRenderGroupCards().

Filtering model (Status → Events)

  • The single Status column/filter is replaced by a multi-select, additive Events filter and an Events column of short pills (Down, Recovering, Triggered, Down/Triggered M/A, Warn/Alert Ping, Failed Svc; 'None' when clean). The Status dropdown is now just a scope selector (All Monitored / All Devices / Not Monitored / Without Thresholds / Without Service Checks).
  • Clickable List-view pills — Thresholds (breached / triggered / total), Service Checks (failed / total), Events, and Criticality (incl. a 'Not Set' pill) — toggle the matching filter. Pills are keyboard-operable (role=button, tabindex=0, Enter/Space).

Service checks (realm-gated)

  • The Without Service Checks scope (status=-5), the Failed Svc event option, and the List-view Service Checks column/cell are all gated by api_plugin_is_enabled('servcheck') && api_plugin_user_realm_auth('servcheck_test.php') — server-side, not just by hiding UI — so a user without the realm cannot probe service-check membership or see a misleading column.
  • failed_svc is evaluated independently of ping availability, so a Down+Failed-Svc host still shows the Failed Svc pill.

Persistence

  • plugin_monitor_dashboards stores filter state as a JSON properties object (legacy raw url migrated in and dropped on upgrade). Both per-user settings and named dashboards persist the new events and template selections; loadDashboardSettings() replays them. Legacy availability-status codes (0/1/2) saved in monitor_status are normalized to -1 on load so stale layouts don't silently broaden.

Validation

  • php -l clean across the touched PHP; unit tests added/updated in tests/Unit/DbFunctionsTest.php (including the realm-gated -5 scope). Browser-measured the layout before/after against a faithful reproduction of Cacti's html_start_box nesting (before: 49% clipped; after: 99% full width).

No schema change beyond the documented dashboard properties migration.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation is localized and sound, with only a non-blocking release-note inaccuracy.

1 open finding
What changed in this PR

Replaces the problematic card grid with a responsive flex layout and orders Tree cards by device count.

Changes:

  • Uses wrapping flexbox sizing for grouping cards.
  • Sorts Tree cards busiest-first while preserving saved order.
  • Documents both refinements.
File Description
includes/​render.php Adds Tree sorting and flex-oriented span metadata.
css/​monitor.css Replaces grid rules with responsive flexbox rules.
CHANGELOG.md Records the changes; one comparison needs correction.

🧠 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 CHANGELOG.md Outdated
bmfmancini
bmfmancini previously approved these changes Oct 11, 2026
- Add an "All" option to the Criticality filter. Its value (-1) matches the
  default and the pill "clear to default" action, which previously set the
  select to a non-existent option and submitted crit=null, tripping
  validate_store_request_vars.
- Convert the Device Template filter to a checkbox multi-select (like Events)
  and actually apply it: renderWhereJoin now adds
  h.host_template_id IN (...) for the template grouping (0 = Non-Templated).
  Previously the template selection was never applied, so all hosts returned.
- Persist the template selection as a user setting and serialize the
  multi-value for request/save payloads.
- Add a "Devices without Service Checks" scope to the Show filter, shown only
  when the servcheck plugin is installed and permitted.
- Tests + regenerated .pot.
- Left-align the List-view Actions column header and fa-layer-group glyph.
- Stack the detail panels as plain blocks and force the jQuery UI dialog
  content box to always fill the dialog width, so the panels can no longer
  collapse into a narrow right-hand strip.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread includes/functions.php Outdated
Comment thread includes/controller.php
Comment thread includes/functions.php Outdated
Comment thread includes/render.php
Comment thread includes/render.php Outdated
Comment thread monitor.php
Comment thread monitor.php Outdated
Comment thread CHANGELOG.md Outdated
Comment thread includes/functions.php Outdated
Comment thread monitor.php
The #monitorPanelDialog overflow override (higher specificity than the
theme's .ui-dialog .ui-dialog-content) turned the content into a fixed-height
scroll box that fought the theme's overflow:visible and squashed the panels.
Use height:auto (capped by maxHeight) and stop overriding overflow so the
dialog sizes to its content and the theme governs scrolling.
The Notes column consumed a lot of horizontal space in List view. Drop it
from the table and surface the notes in the Host Information panel of the
Device Detail Panels dialog instead (shown only when the device has notes).
List view: add a pen-square action icon linking to host.php?action=edit for
users with the host.php (device edit) realm, beside the detail-panels icon.
Filter bar: add a Devices button (right of Acknowledge) that opens the Cacti
Devices page, shown only to users with the same realm. Also move the detail
dialog anchor from top+300 to top+150.
Remove the Hostname column and add an orange fas fa-chart-line Graphs glyph
(.monitorGraph, matching HMIB's colour) to the Actions column, linking to the
device's graphs where the hostname hyperlink used to point.
- List columns reordered to Description, Location, Site, ID; add a Location
  column; Averages, Length in Status, Last Fail are now the last three
  columns, all right-aligned.
- rfilter Search now also matches the device location.
- Filter: move the Events multiselect to the second row (right of Search) and
  the Rows dropdown to the second row (left of Refresh); rename that dropdown
  from Devices to Rows.
- Add a renderWhereJoin test for the description/location rfilter search.
…te, legacy status reset, failed_svc independent, defer list counts, pill keyboard a11y, PHPDoc/changelog fixes
@TheWitness TheWitness changed the title Monitor: expand grouping cards to full width; order Tree cards by device count Monitor 3.0 board: full-width grouping cards, Tree ordering, and the Status->Events filter model Oct 12, 2026
@TheWitness
TheWitness merged commit 5f96b8b into develop Oct 12, 2026
5 checks passed
@TheWitness
TheWitness deleted the fix/grouping-card-fullwidth-flexbox-develop branch October 12, 2026 10:26
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