Repository navigation
mactrack: show MAC authorization as a themed status pill - #390
Merged
Merged
Conversation
On the MAC Addresses tab, render the authorized column as a status pill consistent with the interface/802.1x pills: green 'Authorized' / red 'Unauthorized' via new .mactrackPill.mac_authorized/.mac_unauthorized colors in all 8 theme stylesheets. Markup is produced by a unit-tested mactrack_mac_auth_pill() helper; the two view call sites are view glue. POT + CHANGELOG updated.
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 10, 2026 21:28
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new status button is focusable and styled as interactive but has no action.
1 open finding
What changed in this PR
Adds themed authorization status pills to MAC address views.
Changes:
- Adds reusable authorization-pill markup and unit tests.
- Adds green/red styling across all eight themes.
- Updates translations and changelog.
| File | Description |
|---|---|
lib/mactrack_functions.php |
Adds authorization-pill helper. |
mactrack_view_macs.php |
Uses pills in both MAC views. |
tests/Unit/MactrackStatusPillsTest.php |
Tests authorized and unauthorized output. |
locales/po/cacti.pot |
Updates translatable labels. |
css/classic.css |
Adds theme colors. |
css/dark.css |
Adds theme colors. |
css/deepness.css |
Adds theme colors. |
css/mactrack.css |
Adds fallback theme colors. |
css/modern.css |
Adds theme colors. |
css/paper-plane.css |
Adds theme colors. |
css/paw.css |
Adds theme colors. |
css/sunrise.css |
Adds theme colors. |
CHANGELOG.md |
Documents the feature. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
New first MacTrack tab presenting admin metrics as a draggable, add/remove card grid in the same layout as the syslog Status tab (self-contained bundled css/cards.css + js/cards.js, no cross-plugin dependency; theme-adaptive via currentColor). Cards: inventory, device status (bars), address/port totals, collection settings, scan runtimes + slowest devices, database table sizes, MacWatch activity, vendor breakdown. Layout persists per user (settings_user) via AJAX dash_card/dash_layout endpoints. Registers the page (Viewer realm), prepends the Dashboard tab, loads assets in page_head, adds a breadcrumb. mactrack_tabs() unit-tested; POT/manifest/CHANGELOG updated.
Fold the inventory count queries into one row query (6 raw literal admin queries, recorded in the prepared-statement baseline since they take no user input); add read_user_setting/sanitize_search_string unit-test stubs so MactrackTabsTest can exercise mactrack_tabs().
The dashboard view page runs under a live Cacti (auth + general_header) so it is not loaded by the unit suite; add it to the patch-coverage unmeasured allowlist alongside the other view pages.
Address PR review: the pill was a focusable button with no action. It now carries data-mac-authorized and, like the interface/802.1x pills, clicking it sets the Authorized filter (#authorized) to that state and re-applies the filter, so it is no longer a no-op control.
bmfmancini
approved these changes
Oct 10, 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.

On the MacTrack MAC Addresses tab, the authorization column was plain
coloured text (
<span class="deviceUp">Authorized</span>/deviceDown"Not Authorized"). This converts it to a themed status pillconsistent with the interface and 802.1x pills:
.mactrackPill.mac_authorized/.mactrackPill.mac_unauthorizedentries in all 8 theme stylesheets, reusing each theme's existing pill
green/red (deepness keeps its own green), so it follows the active theme.
mactrack_mac_auth_pill()helper (mirrorsmactrack_dot1x_status_pill()); both view call sites (mactrack_view_macs()and
mactrack_view_aggregated_macs()) now call it.The helper is unit-tested (
MactrackStatusPillsTest); the two view call sitesare view glue. POT regenerated (adds "Unauthorized", drops the now-unused
"Not Authorized"); CHANGELOG updated.
Reviewers: @bmfmancini @xmacan