feat(web): view zone without template, snapshot button, no-template status, drop delete

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
2026-07-05 12:19:50 +07:00
co-authored by Claude Opus 4.8
parent 5662334799
commit c2832348f8
8 changed files with 217 additions and 45 deletions
+2 -25
View File
@@ -1,6 +1,6 @@
import { useState } from "react"
import { Link } from "react-router-dom"
import { Inbox, Loader2, Trash2, Upload } from "lucide-react"
import { Inbox, Loader2, Upload } from "lucide-react"
import { Button } from "@/components/ui/button"
import { StatusBadge } from "@/components/StatusBadge"
import {
@@ -20,7 +20,6 @@ import {
} from "@/components/ui/table"
import {
useAccounts,
useDeleteDomain,
useDomains,
useImportZones,
useSetDomainTemplate,
@@ -35,7 +34,6 @@ export function DomainsPage() {
const templates = useTemplates()
const importZones = useImportZones()
const setTemplate = useSetDomainTemplate()
const deleteDomain = useDeleteDomain()
const accountList = accounts.data ?? []
const templateList = templates.data ?? []
@@ -64,12 +62,6 @@ export function DomainsPage() {
setTemplate.mutate({ id: domainId, templateId })
}
function onDelete(domainId: string, zoneName: string) {
if (window.confirm(`Удалить домен ${zoneName}? Действие необратимо.`)) {
deleteDomain.mutate(domainId)
}
}
return (
<div className="mx-auto flex max-w-5xl flex-col gap-6 px-6 py-8">
<header className="flex flex-col gap-1">
@@ -117,12 +109,6 @@ export function DomainsPage() {
{setTemplate.error?.message}
</span>
)}
{deleteDomain.isError && (
<span role="alert" className="font-dns text-xs text-destructive">
{deleteDomain.error?.message}
</span>
)}
{domainList.length === 0 ? (
<div className="flex flex-col items-center gap-2 rounded-xl border border-dashed border-border px-4 py-12 text-center text-sm text-muted-foreground">
<Inbox className="size-6" strokeWidth={1.5} />
@@ -170,22 +156,13 @@ export function DomainsPage() {
</Select>
</TableCell>
<TableCell>
<StatusBadge status={d.lastCheckStatus} />
<StatusBadge status={d.templateId ? d.lastCheckStatus : "no_template"} />
</TableCell>
<TableCell className="text-right">
<div className="flex justify-end gap-1.5">
<Button variant="outline" size="sm" render={<Link to={`/domains/${d.id}`} />}>
Diff
</Button>
<Button
variant="destructive"
size="icon-sm"
aria-label={`Удалить ${d.zoneName}`}
onClick={() => onDelete(d.id, d.zoneName)}
disabled={deleteDomain.isPending}
>
<Trash2 className="size-3.5" strokeWidth={1.75} />
</Button>
</div>
</TableCell>
</TableRow>