Repository navigation
Scale Device Dashboard host picker via AJAX callback; stop card header hover reflow - #70
Merged
Merged
Conversation
… header hover reflow - Device picker: replace the <select> that materialized every Host MIB host as an <option> with a Cacti drop_callback (select2 AJAX) that searches devices server-side through the existing ?action=ajax_hosts endpoint. Installs with 60k+ hosts no longer render tens of thousands of options into the page. The endpoint drops the 'Any' entry (a dashboard always targets one device). - Card header hover reflow: the drag handle and tool buttons used border:0, so an inherited button:hover border reflowed the header. Reserve a transparent 1px border with box-sizing:border-box, keep border-color transparent on hover/focus, and give the card header a min-height (same fix landed in plugin_syslog/plugin_intropage).
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 10, 2026 21:09
There was a problem hiding this comment.
🟡 Changes recommended
The picker cannot switch devices in supported callback fallback modes, and the header sizing omits border-box sizing.
3 open findings
What changed in this PR
Improves Host Dashboard scalability and card-header stability.
Changes:
- Replaces the full device list with an AJAX-backed picker.
- Prevents hover borders from resizing card controls.
| File | Description |
|---|---|
hmib.php |
Adds the callback-based device picker. |
css/hmib.css |
Stabilizes card-header dimensions. |
locales/po/cacti.pot |
Adds picker help text. |
CHANGELOG.md |
Documents both fixes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3 of 6 tasks
…ce-callback # Conflicts: # CHANGELOG.md # locales/po/cacti.pot
bmfmancini
approved these changes
Oct 12, 2026
xmacan
approved these changes
Oct 12, 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.


Description
Two targeted fixes to the merged per-device Host Dashboard.
1. Device picker now uses an AJAX callback (scales to very large installs)
The Dashboard's Device dropdown rendered every Host MIB host as an
<option>. On installs with tens of thousands of devices (60k+ reported) that bloats the page and the DOM. It now uses a Cactidrop_callback(select2 AJAX) that searches devices server-side through the existing?action=ajax_hostsendpoint — only the current device is materialized, and matches are fetched as you type. The endpoint now omits the "Any" entry (a dashboard always targets one real device).2. Card header no longer resizes on hover
Hovering the drag handle (hamburger) or the header tool buttons reflowed/resized the card header: the buttons used
border: 0, so an inheritedbutton:hoverborder changed their box size. Fixed the same way as inplugin_syslog/plugin_intropage— reserve a transparent1pxborder withbox-sizing: border-box, keepborder-color: transparenton hover/focus, and give the card header amin-height.Related Issue
Follow-up to the per-device Host Dashboard (#68) and its fixes (#69). The 60k-host dropdown concern and the header-hover reflow were both reported after merge.
Motivation and Context
The materialized host dropdown is a real scalability problem on large installs, and the header jitter on hover was a visible UI defect that was already solved elsewhere in the fleet.
How Has This Been Tested?
php -lclean onhmib.php;tests/bin/validate-manifest.phppasses;locales/po/cacti.potregenerated. The device picker follows the samedrop_callback/ajax_hostspatternplugin_sysloguses for its device rules. Needs a quick browser check on a themed install to confirm the select2 AJAX dropdown and the (now steady) header hover.Types of changes
Checklist: