From a4041185f1bac4c65b4996f6042a2774e3f64de5 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Tue, 19 Aug 2025 00:14:50 -0600 Subject: [PATCH] feat(ui): add alert blocks for running services in delete confirmation dialogs --- .../dashboard/compose/delete-service.tsx | 15 ++++++++ .../pages/dashboard/project/[projectId].tsx | 36 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/compose/delete-service.tsx b/apps/dokploy/components/dashboard/compose/delete-service.tsx index cae27c264..438af954a 100644 --- a/apps/dokploy/components/dashboard/compose/delete-service.tsx +++ b/apps/dokploy/components/dashboard/compose/delete-service.tsx @@ -7,6 +7,7 @@ import { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; @@ -114,6 +115,12 @@ export const DeleteService = ({ id, type }: Props) => { } }; + const isDisabled = + (data && + "applicationStatus" in data && + data?.applicationStatus === "running") || + (data && "composeStatus" in data && data?.composeStatus === "running"); + return ( @@ -202,6 +209,12 @@ export const DeleteService = ({ id, type }: Props) => { + {isDisabled && ( + + Cannot delete the service while it is running. Please wait for the + build to finish and then try again. + + )} +