feat(web): add delete functionality to agent components
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m59s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped

- Introduced delete functionality across multiple agent components, including AgentCard, AgentCardsGrid, AgentDetailSheet, and AgentDetailView, allowing users to remove agents directly from the UI.
- Integrated a confirmation dialog to prevent accidental deletions, enhancing user experience and safety.
- Updated relevant props and handlers to manage delete actions consistently across components.

These changes improve the overall management of agents, providing users with the ability to easily delete agents while ensuring confirmation for critical actions.
This commit is contained in:
Denozordec
2026-07-25 16:59:05 +07:00
parent 837b29735f
commit fb95ef22b3
6 changed files with 186 additions and 86 deletions
@@ -11,6 +11,7 @@ import {
MoreHorizontalIcon,
ShieldPlusIcon,
TerminalIcon,
Trash2,
} from 'lucide-react'
import { DetailPanel } from '@/components/reui-kit'
import {
@@ -48,6 +49,7 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@evofw/ui/components/dropdown-menu'
@@ -60,9 +62,10 @@ import {
type AgentDetailViewProps = {
agentId: string
onDelete?: (id: string) => void
}
export function AgentDetailView({ agentId }: AgentDetailViewProps) {
export function AgentDetailView({ agentId, onDelete }: AgentDetailViewProps) {
const qc = useQueryClient()
const { copyToClipboard } = useCopyToClipboard()
const agentQ = useQuery(agentQueryOptions(agentId))
@@ -229,6 +232,18 @@ export function AgentDetailView({ agentId }: AgentDetailViewProps) {
Install curl
</DropdownMenuItem>
) : null}
{onDelete ? (
<>
<DropdownMenuSeparator />
<DropdownMenuItem
variant="destructive"
onClick={() => onDelete(agentId)}
>
<Trash2 className="size-4" />
Удалить агента
</DropdownMenuItem>
</>
) : null}
</DropdownMenuContent>
</DropdownMenu>
</>