Skip to content

webapp: add Search field to Zones tab#1974

Open
Zebble wants to merge 2 commits into
TechnitiumSoftware:masterfrom
Zebble:feat/zones-search
Open

webapp: add Search field to Zones tab#1974
Zebble wants to merge 2 commits into
TechnitiumSoftware:masterfrom
Zebble:feat/zones-search

Conversation

@Zebble

@Zebble Zebble commented Jun 6, 2026

Copy link
Copy Markdown

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 optional filter query parameter. When set, the zone list is filtered before pagination, so pageNumber, totalPages and totalZones reflect the filtered set.
  • www/index.html — adds a Search 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 new filter parameter on /api/zones/list.
  • CHANGELOG.md — added an Unreleased section 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

  • The filter parameter is fully backward compatible — when absent, behaviour is identical to before.
  • Filtering is StringComparison.OrdinalIgnoreCase on zoneInfo.Name, and falls back to checking the IDN-decoded Unicode form via DnsClient.TryConvertDomainNameToUnicode so users can search internationalised zone names by their displayed text.
  • I confirm I am the original author and agree with the IPR / CLA terms in CONTRIBUTING.md.

Test plan

  • Build and run the DNS server.
  • Open the Zones tab with multiple zones present; confirm the new Search box appears next to Edit.
  • Type a substring; results filter live (300 ms debounce); status line shows the filtered totals; pagination works against the filtered set.
  • Press Enter — filter applies immediately.
  • Click Clear — input empties, full zone list returns.
  • With an IDN zone present, type the Unicode form — zone is matched.
  • Confirm the cluster-node dropdown still works with the filter applied (filter forwards through cluster proxy).
  • Confirm calling GET /api/zones/list without filter returns 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.

Zebble added 2 commits June 6, 2026 12:52
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant