Docker images / prepare-release (push) Successful in 12s
Docker images / backend-test (push) Successful in 4m9s
Docker images / frontend-image (push) Successful in 4m28s
Docker images / updater-image (push) Successful in 58s
Docker images / backend-image (push) Successful in 2m49s
Docker images / notify-webhook (push) Skipped
Docker images / publish-release (push) Successful in 11s
При старте backend накатывает схему PostgreSQL 18 и, если база пустая, один раз импортирует mikrotik.db с тома. Повторный старт не копирует данные. Бэкап в UI идёт через pg_dump. Co-authored-by: Cursor <cursoragent@cursor.com>
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
"use client"
|
|
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogHeader,
|
|
AlertDialogMedia,
|
|
AlertDialogTitle,
|
|
} from "@/components/ui/alert-dialog"
|
|
import type { FlowPurgeDto } from "@mmapp/contracts/traffic-flow"
|
|
import { AlertCircleIcon, LoaderCircleIcon } from "lucide-react"
|
|
|
|
export function formatFlowPurgeResult(result: FlowPurgeDto): string {
|
|
const rows =
|
|
result.deleted.buckets +
|
|
result.deleted.minuteStats +
|
|
result.deleted.minuteDims +
|
|
result.deleted.dailyDims
|
|
return `Удалено строк: ${rows}.`
|
|
}
|
|
|
|
export function NetflowPurgeConfirm({
|
|
open,
|
|
busy,
|
|
onConfirm,
|
|
onCancel,
|
|
}: {
|
|
open: boolean
|
|
busy?: boolean
|
|
onConfirm: () => void
|
|
onCancel: () => void
|
|
}) {
|
|
return (
|
|
<AlertDialog open={open} onOpenChange={(v) => { if (!v && !busy) onCancel() }}>
|
|
<AlertDialogContent size="default">
|
|
<AlertDialogHeader>
|
|
<AlertDialogMedia className="bg-destructive/10 text-destructive">
|
|
<AlertCircleIcon />
|
|
</AlertDialogMedia>
|
|
<AlertDialogTitle>Сбросить данные NetFlow?</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
Будут удалены сессии и агрегаты (minute/daily) в PostgreSQL.
|
|
Ключи WireGuard, пиры JH, настройки коллектора и кэш RIPE сохранятся.
|
|
На время операции приём IPFIX остановится.
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
<AlertDialogFooter>
|
|
<AlertDialogCancel disabled={busy} onClick={onCancel}>Отмена</AlertDialogCancel>
|
|
<AlertDialogAction
|
|
variant="destructive"
|
|
disabled={busy}
|
|
onClick={onConfirm}
|
|
>
|
|
{busy ? <LoaderCircleIcon className="size-4 animate-spin" /> : null}
|
|
{busy ? "Сброс…" : "Сбросить"}
|
|
</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
)
|
|
}
|