[fix] keep monitor selection across pages in monitor list#4170
Open
Duansg wants to merge 5 commits into
Open
Conversation
The batch-select checkboxes lost their checked state when paging: every table reload (pagination, auto-refresh, post-CRUD) eagerly cleared checkedMonitorIds, so selections made on a previous page disappeared. Persist the selection Set across reloads and only reset it when the result set actually changes (filter/app/label switch). The header "select all" is now a getter computed over the current page, toggling only this page's selectable monitors, and batch ops deselect just the ids they acted on.
…election With selection now persisting across pages, users could not tell how many monitors were selected or deselect them without paging back. Show a live "N selected" count and a one-click clear in the list header (i18n in 5 locales) so the cross-page selection stays visible and easy to reset.
The pager sat above the card list, so after scrolling through a page the user had to scroll back up to load the next one. Move it below the list and show page numbers plus the total count, matching the usual list pagination placement.
A bare checkbox sitting alone in the list header looked out of place when nothing was selected. Add a "Select this page" label (i18n in 5 locales) so it reads as a clear action.
Consolidate the select-all checkbox, selected count and clear action into the footer next to the pager, removing the near-empty top header. All list controls now live in one row at the bottom: selection on the left, pagination on the right.
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.
What's changed?
close #4164
Batch-selecting hosts across pages didn't work — paging cleared the previous page's checkboxes.
Fix
fix the selection set was wiped on every page load. Now it persists across pagination/refresh and only resets when the filter (app/label/search) changes.
Improve
Testing
The existing features have been tested and all passed: (cross-page) export, import, (cross-page) bulk pause, (cross-page) bulk resume, clear, etc
Checklist
Add or update API