From 526f249d0e937e7f9463ce8e42aa429ba267aefd Mon Sep 17 00:00:00 2001 From: DearTanker <1122669+DearTanker@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:54:45 +0800 Subject: [PATCH 1/5] Style: Make Node Applications more readable --- .../dashboard/settings/cluster/nodes/show-nodes-modal.tsx | 2 +- apps/dokploy/components/ui/badge.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx index 82e6e1f9a4..5f0b32fc3d 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx @@ -20,7 +20,7 @@ export const ShowNodesModal = ({ serverId }: Props) => { Show Swarm Nodes - +
diff --git a/apps/dokploy/components/ui/badge.tsx b/apps/dokploy/components/ui/badge.tsx index 9c41234d67..34c14dcdb1 100644 --- a/apps/dokploy/components/ui/badge.tsx +++ b/apps/dokploy/components/ui/badge.tsx @@ -4,7 +4,7 @@ import type * as React from "react"; import { cn } from "@/lib/utils"; const badgeVariants = cva( - "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold whitespace-nowrap transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { variant: { From 64293fce79fdb2c1e24df4785a076fb2164c3e31 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:08:51 -0600 Subject: [PATCH 2/5] feat: add kill process functionality to deployments - Implemented a new mutation to kill a running deployment process by its PID. - Updated the deployment schema to include a PID field. - Enhanced the deployment service to handle process termination and status updates. - Modified the deployment scripts to echo PID and schedule ID for better tracking. - Added error handling for the kill process operation. --- .../deployments/show-deployments.tsx | 28 + .../application/schedules/show-schedules.tsx | 16 +- apps/dokploy/drizzle/0098_conscious_chat.sql | 1 + apps/dokploy/drizzle/meta/0098_snapshot.json | 5832 +++++++++++++++++ apps/dokploy/drizzle/meta/_journal.json | 7 + apps/dokploy/server/api/routers/deployment.ts | 31 + packages/server/src/db/schema/deployment.ts | 1 + packages/server/src/services/deployment.ts | 1 + packages/server/src/services/schedule.ts | 7 +- packages/server/src/utils/schedules/utils.ts | 27 +- 10 files changed, 5940 insertions(+), 11 deletions(-) create mode 100644 apps/dokploy/drizzle/0098_conscious_chat.sql create mode 100644 apps/dokploy/drizzle/meta/0098_snapshot.json diff --git a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx index d095e0efb5..b8e773df7d 100644 --- a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx +++ b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx @@ -62,6 +62,8 @@ export const ShowDeployments = ({ const { mutateAsync: rollback, isLoading: isRollingBack } = api.rollback.rollback.useMutation(); + const { mutateAsync: killProcess, isLoading: isKillingProcess } = + api.deployment.killProcess.useMutation(); const [url, setUrl] = React.useState(""); useEffect(() => { @@ -170,6 +172,32 @@ export const ShowDeployments = ({
+ {deployment.pid && deployment.status === "running" && ( + { + await killProcess({ + deploymentId: deployment.deploymentId, + }) + .then(() => { + toast.success("Process killed successfully"); + }) + .catch(() => { + toast.error("Error killing process"); + }); + }} + > + + + )}