webapp: add Search field to Zones tab#1974
Open
Zebble wants to merge 2 commits into
Open
Conversation
…nsensitive substring match. WebServiceZonesApi: Updated ListZones() to accept new optional `filter` query parameter that matches against the zone name and its IDN-decoded form. Filtering is applied before pagination so totalZones/totalPages reflect the filtered set. zone.js: Wired the search input with a 300ms debounce, Enter-key submit, and Clear button. The filter is passed to api/zones/list and resets pagination to page 1 on change. APIDOCS and CHANGELOG updated.
refreshZones() hides divViewZones (which contains the search input) while loading, which drops focus from the input. Capture whether txtZonesSearch had focus along with its caret position before hiding, and restore both after the table is re-shown. Applied in both success and error paths so users can keep typing without re-clicking the input.
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.
Summary
Adds a Search field to the Zones tab that filters zones by a case-insensitive substring match. The filter applies to both the wire-format zone name and its IDN-decoded Unicode form, and is applied server-side before pagination so that page counts and totals stay consistent as the user types.
Changes
WebServiceZonesApi.ListZones()— accepts a new optionalfilterquery parameter. When set, the zone list is filtered before pagination, sopageNumber,totalPagesandtotalZonesreflect the filtered set.www/index.html— adds aSearch zones...input and a Clear button next to the existing Edit form on the Zones tab.www/js/zone.js— wires the input with a 300 ms debounce, Enter-key submit, and Clear button.refreshZones()reads the value and passes it to/api/zones/list. Page resets to 1 on every filter change.APIDOCS.md— documents the newfilterparameter on/api/zones/list.CHANGELOG.md— added anUnreleasedsection with a bullet for this change. Feel free to fold it into the next release section in whatever style you prefer.Why
On servers with many zones, paging through to find a specific one is tedious. Substring search makes the UI usable at scale and keeps the existing pagination, sorting, and cluster-node selector working unchanged.
Notes
filterparameter is fully backward compatible — when absent, behaviour is identical to before.StringComparison.OrdinalIgnoreCaseonzoneInfo.Name, and falls back to checking the IDN-decoded Unicode form viaDnsClient.TryConvertDomainNameToUnicodeso users can search internationalised zone names by their displayed text.CONTRIBUTING.md.Test plan
GET /api/zones/listwithoutfilterreturns identical results to the prior release.Future work (not in this PR)
A future enhancement could add a top-level Search tab that fans out across zones, records and other entities. The records side would need a new endpoint that enumerates RRs across all zones with a substring match on name / RDATA / comments — happy to follow up with that in a separate PR if there's interest.