fix(ui): учитывать готовность устройства в действиях IPsec

This commit is contained in:
Denozordec committed 2026-09-30 14:48:21 +07:00
1 parent b8923d075d
commit f0071a495c
7 files changed
+97 -12

No files matched your search

+6 -1
View File
@@ -28,6 +28,7 @@ import {
} from "lucide-react"
export interface IpsecUsersGridProps {
canManage?: (serverId: string) => boolean
clients: IpsecClientDto[]
compactServer?: boolean
emptyAction?: ReactNode
@@ -40,6 +41,7 @@ export interface IpsecUsersGridProps {
function IpsecUsersGrid({
clients,
canManage,
compactServer = false,
emptyAction,
emptyTitle = "Нет клиентов IKEv2",
@@ -63,6 +65,7 @@ function IpsecUsersGrid({
<UsersIcon className="size-3.5 shrink-0 text-muted-foreground" />
<button
type="button"
disabled={!onEdit || (canManage && !canManage(c.serverId))}
className="truncate text-left font-medium hover:underline"
onClick={() => onEdit?.(c)}
>
@@ -198,6 +201,7 @@ function IpsecUsersGrid({
className="size-7"
aria-label="Скачать сертификат"
title="Скачать .p12"
disabled={canManage && !canManage(c.serverId)}
onClick={() => onDownloadCert(c)}
>
<WifiIcon className="size-3.5" />
@@ -210,6 +214,7 @@ function IpsecUsersGrid({
size="icon"
className="size-7 text-destructive"
aria-label="Удалить клиента"
disabled={canManage && !canManage(c.serverId)}
onClick={() => onDelete(c)}
>
<Trash2Icon className="size-3.5" />
@@ -226,7 +231,7 @@ function IpsecUsersGrid({
)
return cols
}, [compactServer, onDownloadCert, onEdit, onDelete])
}, [compactServer, onDownloadCert, onEdit, onDelete, canManage])
const table = useTable({
features: dataGridFeatures,