diff --git a/CHANGELOG.md b/CHANGELOG.md index d0dbb6bd..07233889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## ChangeLog --- develop --- +* bug: Element-qualify the `.thold-pill` CSS so it outranks the single-class theme rules (e.g. `.deviceUpFull` `width:14%`) that were clipping the pill to a fixed width; status pills now size to their label on the Device Status page and everywhere else +* feature: Clicking an already-selected status pill now clears that filter (resets to All) instead of re-applying it, on the Thresholds, Device Status and Threshold Log sub-tabs * bug: Pass a boolean (not the integer `1`) to `api_plugin_register_hook()`'s `$enable` argument so the hook registration stays type-correct under Cacti 1.3's strict `bool $enable` type-hint (the int only coerces while this file lacks `declare(strict_types=1)`) * feature: Show each threshold's status as a sortable, clickable pill in a new Status column (right of Name) on the Thresholds page instead of colouring the whole row; rows now zebra-stripe, clicking a pill filters the list to that status, and the Status filter gains per-severity options * feature: Extend the clickable status pills to the Device Status and Threshold Log pages (thold_graph.php) - device rows now show a status pill and zebra-stripe instead of full-row colouring, and the Threshold Log gains a Status pill column right after Type; clicking a pill filters that list to the chosen status, the Device Status filter gains an exact Error option, and each status filter now classifies the per-host failure-count override the same way as the pill so a clicked pill returns exactly the rows showing that state diff --git a/css/pills.css b/css/pills.css index 1f18fd14..eb09fcf2 100644 --- a/css/pills.css +++ b/css/pills.css @@ -22,7 +22,8 @@ */ /* Threshold status pills - shape only; per-theme .thold rules supply the colours */ -.thold-pill { +/* Element-qualified to outrank single-class theme rules (e.g. .deviceUpFull width:14%) so the pill hugs its label. */ +span.thold-pill { display: inline-block; width: auto; padding: 1px 9px; diff --git a/thold.php b/thold.php index 18ea0d09..c4e5338f 100644 --- a/thold.php +++ b/thold.php @@ -870,7 +870,8 @@ function clearFilter() { } e.preventDefault(); - $('#state').val($(this).attr('data-state')); + var state = $(this).attr('data-state'); + $('#state').val($('#state').val() === state ? '-1' : state); applyFilter(); }); diff --git a/thold_graph.php b/thold_graph.php index af2090c7..86562c8e 100644 --- a/thold_graph.php +++ b/thold_graph.php @@ -305,7 +305,8 @@ function clearFilter() { } e.preventDefault(); - $('#state').val($(this).attr('data-state')); + var state = $(this).attr('data-state'); + $('#state').val($('#state').val() === state ? '-1' : state); applyFilter(); }); @@ -1443,7 +1444,8 @@ function clearFilter() { } e.preventDefault(); - $('#host_status').val($(this).attr('data-state')); + var state = $(this).attr('data-state'); + $('#host_status').val($('#host_status').val() === state ? '-1' : state); applyFilter(); }); @@ -2007,7 +2009,8 @@ function exportLog() { } e.preventDefault(); - $('#status').val($(this).attr('data-state')); + var state = $(this).attr('data-state'); + $('#status').val($('#status').val() === state ? '-1' : state); applyFilter(); });