feat(web): filter domains by template and status
The domains list had no way to narrow itself down, so an operator with dozens of zones had to scan the whole table to find the drifted ones. Add two client-side filters above the table (the full list already arrives in one request, so server-side filtering would only add contract surface). The status filter compares against the same derived value the row's badge renders — a domain with no template shows "без шаблона" and must not match "drift" just because it kept a stale last_check_status from before its template was detached, so that derivation lives in one function used by both. Sorting is now decided in the store: ListDomains orders by zone_name instead of created_at, so every consumer of the list gets the same order and the filters never reorder anything. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Yr8frsaxBgab1Aa7yfPuU
This commit is contained in:
@@ -17,7 +17,7 @@ RETURNING *;
|
||||
SELECT * FROM domains WHERE id = $1 AND project_id = $2;
|
||||
|
||||
-- name: ListDomains :many
|
||||
SELECT * FROM domains WHERE project_id = $1 ORDER BY created_at;
|
||||
SELECT * FROM domains WHERE project_id = $1 ORDER BY zone_name;
|
||||
|
||||
-- name: DeleteDomain :exec
|
||||
DELETE FROM domains WHERE id = $1 AND project_id = $2;
|
||||
|
||||
Reference in New Issue
Block a user