mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-31 17:22:16 +00:00
feat(deployments): enhance deployment deletion logic and improve error handling
- Updated the deployment deletion process to include error handling for non-existent deployments. - Refactored the command execution to handle both remote and local execution based on server availability. - Simplified the logic for determining deletable deployments in the ShowDeployments component.
This commit is contained in:
@@ -259,16 +259,9 @@ export const ShowDeployments = ({
|
||||
const isExpanded = expandedDescriptions.has(
|
||||
deployment.deploymentId,
|
||||
);
|
||||
const lastSuccessfulDeployment = deployments?.find(
|
||||
(d) => d.status === "done",
|
||||
);
|
||||
const isLastSuccessfulDeployment =
|
||||
lastSuccessfulDeployment?.deploymentId ===
|
||||
deployment.deploymentId;
|
||||
const canDelete =
|
||||
deployments &&
|
||||
deployments.length > 1 &&
|
||||
!isLastSuccessfulDeployment;
|
||||
deployment.status === "done" || deployment.status === "error";
|
||||
|
||||
return (
|
||||
<div
|
||||
key={deployment.deploymentId}
|
||||
|
||||
Reference in New Issue
Block a user