Skip to content

Add clickable status pills + zebra rows to Device Status and Threshold Log pages - #853

Merged
TheWitness merged 2 commits into
developfrom
feature/status-pills-hoststat-log
Oct 9, 2026
Merged

TheWitness merged 2 commits into
developfrom
feature/status-pills-hoststat-log

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Extends the clickable status-pill treatment (shipped for the Thresholds page in #851) to the two remaining thold_graph.php sub-views: Device Status (action=hoststat) and Threshold Log (action=log).

Device Status page

  • Each device's status now renders as a .thold-pill in the existing Status column instead of colouring the whole row; rows now zebra-stripe.
  • The "Not Monitored" rows are zebra-striped and pilled the same way.
  • Clicking a pill sets the page's Status filter to that state and auto-applies (keyboard accessible: tabindex/role=button, Enter/Space).
  • form_host_status_row_color() (printed a colour-classed <tr>) is replaced by thold_device_status_pill(), which reuses the same failure-count override logic and get_uncolored_device_status() label.

Threshold Log page

  • New Status pill column added right after Type; rows now zebra-stripe instead of full-row colouring.
  • Clicking a pill sets the log Status filter and auto-applies.
  • Empty-state and nav colspans bumped for the new column.

Theme / colours

  • No new CSS: the pills reuse each theme's existing .device<State>Full / log-state background classes, and the shared shape-only css/pills.css already loads globally via thold_page_head(). Colours stay fully theme-aware.

Testing / CI

  • php -l thold_graph.php - clean.
  • tests/bin/validate-manifest.php - passes (no file-set change).
  • tests/bin/check-i18n-pot.php - passes; regenerated locales/po/cacti.pot for the new Status log header.
  • No changes to coverage-measured files (functions.php/polling.php/setup.php); no test loads thold_graph.php, so Pest/patch-coverage are unaffected.

…d Log pages

Mirror the Thresholds-page pill treatment on the two remaining thold_graph.php sub-views: the Device Status (hoststat) list now renders each device's status as a clickable pill and zebra-stripes its rows instead of colouring the whole row, and the Threshold Log gains a clickable Status pill column right after Type (rows zebra-striped). Clicking a pill sets the page's Status filter and auto-applies. Regenerated cacti.pot for the new Log Status header.
@TheWitness
TheWitness requested review from bmfmancini and xmacan and a balanced review from Copilot October 8, 2026 20:07

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.

🟡 Changes recommended

Device-status pill values do not consistently map to exact filter semantics, producing incorrect or disappearing results.

1 open finding
What changed in this PR

Adds clickable, theme-aware status pills and zebra striping to Device Status and Threshold Log views.

Changes:

  • Replaces row coloring with clickable status pills.
  • Adds a Status column to Threshold Log.
  • Updates translations and changelog.
File Description
thold_graph.php Implements status pills, filtering, and zebra rows.
locales/​po/​cacti.pot Regenerates translation metadata.
CHANGELOG.md Documents the UI enhancements.

🧠 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 thold_graph.php
bmfmancini
bmfmancini previously approved these changes Oct 8, 2026
Address review feedback on PR #853: the clicked status pills did not consistently filter to the state shown on the device row.

- Map the Error pill to an exact Error filter (host_status=4) instead of the aggregate Not Up (-4), and add an Error option to the Status dropdown.

- Rework the host_status WHERE clause so each state reuses the same failure-count override classification as thold_device_status_pill(): the override now uses >= (matching the pill, was >) and only reclassifies hosts to Down, so the Down filter includes overridden hosts and the Up/Unknown/Error filters exclude them.
@TheWitness
TheWitness merged commit 273d51c into develop Oct 9, 2026
3 checks passed
@TheWitness
TheWitness deleted the feature/status-pills-hoststat-log branch October 9, 2026 00:40
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.

3 participants