Repository navigation
mactrack: single scrollable scan dialog, i18n interface counters, Show Totals tooltip - #407
Merged
Merged
Conversation
…w Totals tooltip Show scan results in one dialog only: drop the stacked completion toast and append the completion/timing line to the detailed results dialog instead, and give that dialog a vertical scrollbar via a .mactrackScanResults wrapper so long scanner output no longer overflows. Timeouts (no response body) now render in the same dialog rather than clearing the spinner silently. Format the interface Errors, Discards and Unknown Protocol columns (both the per-poll and Show Totals views) with number_format_i18n(), and add a tooltip to the Show Totals control explaining that it switches those columns to cumulative SNMP counter totals. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The formatting test cannot detect removal of number formatting, and the tooltips incorrectly describe average per-second rates as counter changes.
2 open issues
What changed in this PR
This follow-up to #406 simplifies MacTrack scan feedback and improves readability in the interfaces report.
Changes:
- Consolidates scan output and completion timing into one scrollable dialog, including feedback for timeouts without a response body.
- Applies locale-aware formatting to interface counters and adds a Show Totals tooltip.
- Updates scan-response tests, totals-view coverage, translations, and the changelog.
| File | Description |
|---|---|
| tests/Unit/MactrackStatusPillsTest.php | Adds totals-view rendering coverage and resets request state. |
| tests/Unit/AdminActionsRequirePostTest.php | Covers successful and failed scan responses without toast messages. |
| tests/bootstrap-unit.php | Supports configurable request values in unit tests. |
| mactrack_view_interfaces.php | Adds tooltips to the Show Totals control. |
| locales/po/cacti.pot | Adds the tooltip translation entry. |
| lib/mactrack_functions.php | Formats counters and appends completion timing to scan output. |
| js/mactrack.js | Removes scan toasts and routes empty-response failures to the results dialog. |
| css/cards.css | Adds a scrollable scan-results container. |
| CHANGELOG.md | Records the scan-dialog and interface-report updates. |
Review effort: Balanced
xmacan
previously approved these changes
Nov 5, 2026
…-dup) Reword the Show Totals tooltip to say the unchecked columns are an average per-second rate (get_link_int_value divides the delta by elapsed seconds), not a raw counter change, and regenerate the POT. Make the interface totals test meaningful: record number_format_i18n() calls in the shared stub and assert the five total counters are routed through it at integer precision, so dropping the formatter now fails the test. Cut SonarCloud new-code duplication: fold the per-endpoint scan tests into one data-driven test and share an interface-row fixture helper between the interface-row tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
xmacan
approved these changes
Nov 5, 2026
xmacan
approved these changes
Nov 5, 2026
somethingwithproof
approved these changes
Nov 6, 2026
somethingwithproof
left a comment
Member
There was a problem hiding this comment.
Reviewed: scan-dialog output is escaped, no SQLi/XSS in the changed paths, i18n counters correct, $elapsed defined on all paths. Only nit: css/cards.css is missing a trailing newline.
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.




Description
Follow-up to #406 that cleans up the scan-results UX and improves the interfaces
report:
separate Cacti toast ("Operation successful") on top of the detailed
"Device Scan Results" dialog. The toast is removed; the completion/timing line
is now appended to the single detailed dialog (
Device '…' rescan completed in N.NN seconds), so there is exactly one dialog.dialog — results are wrapped in a
.mactrackScanResultscontainer (defined inthe always-loaded
css/cards.css) withoverflow-y: auto, giving a verticalscrollbar.
the 5-minute timeout) now renders an error line in the same results dialog
instead of clearing the spinner with no feedback.
Protocol columns (both the per-poll view and the Show Totals view) now render
through
number_format_i18n().titletooltip explaining that it switches those columns to each interface'scumulative SNMP counter totals instead of the change since the previous poll.
The admin scan endpoints still return UTF-8-safe JSON and remain POST + CSRF +
realm gated; this change only adjusts how the client renders the result.
Related Issue
N/A — direct follow-up to the merged #406: the stacked toast + results dialog
was redundant, and the interface counter columns were hard to read.
Motivation and Context
The toast and the detailed dialog conveyed the same completion event twice and
stacked on top of each other, and the detailed dialog clipped long scanner
output. Collapsing to one scrollable dialog is clearer, and formatting the
interface counters plus explaining "Show Totals" improves the interfaces report.
How Has This Been Tested?
plugins/mactrack):include/vendor/bin/pest --configuration=plugins/mactrack/phpunit.xml→267 passed (2066 assertions).
php tests/bin/patch-coverage.php coverage/clover.xml origin/develop 100→ 100.00% (12/12 lines) (added success/failurecoverage for both scan endpoints and a Show-Totals branch test for the
interface row).
php tests/bin/validate-manifest.php→ OK.php tests/bin/check-i18n-pot.php origin/develop→ OK (regeneratedlocales/po/cacti.potonly — added the Show Totals tooltip string;.po/.moleft to Weblate).
php -lon changed PHP andnode --check js/mactrack.js→ clean.Screenshots (if appropriate):
N/A
Types of changes
Checklist: