mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refacto(#118): remove last toaster on start deployments
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
} from "@/components/ui/alert-dialog";
|
} from "@/components/ui/alert-dialog";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -51,18 +52,14 @@ export const DeployApplication = ({ applicationId }: Props) => {
|
|||||||
applicationId,
|
applicationId,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Application Deploying....");
|
toast.success("Deploying Application....");
|
||||||
|
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
applicationId,
|
applicationId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Application");
|
||||||
toast.success("Application Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Application");
|
|
||||||
});
|
|
||||||
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -49,18 +49,14 @@ export const DeployCompose = ({ composeId }: Props) => {
|
|||||||
composeStatus: "running",
|
composeStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Compose Deploying....");
|
toast.success("Deploying Compose....");
|
||||||
|
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
composeId,
|
composeId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Compose");
|
||||||
toast.success("Compose Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Compose");
|
|
||||||
});
|
|
||||||
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -50,17 +50,13 @@ export const DeployMariadb = ({ mariadbId }: Props) => {
|
|||||||
applicationStatus: "running",
|
applicationStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Database Deploying....");
|
toast.success("Deploying Database....");
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
mariadbId,
|
mariadbId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Database");
|
||||||
toast.success("Database Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Database");
|
|
||||||
});
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -50,17 +50,13 @@ export const DeployMongo = ({ mongoId }: Props) => {
|
|||||||
applicationStatus: "running",
|
applicationStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Database Deploying....");
|
toast.success("Deploying Database....");
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
mongoId,
|
mongoId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Database");
|
||||||
toast.success("Database Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Database");
|
|
||||||
});
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -50,17 +50,13 @@ export const DeployMysql = ({ mysqlId }: Props) => {
|
|||||||
applicationStatus: "running",
|
applicationStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Database Deploying....");
|
toast.success("Deploying Database....");
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
mysqlId,
|
mysqlId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Database");
|
||||||
toast.success("Database Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Database");
|
|
||||||
});
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -50,17 +50,13 @@ export const DeployPostgres = ({ postgresId }: Props) => {
|
|||||||
applicationStatus: "running",
|
applicationStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Database Deploying....");
|
toast.success("Deploying Database....");
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
postgresId,
|
postgresId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Database");
|
||||||
toast.success("Database Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Database");
|
|
||||||
});
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -50,17 +50,13 @@ export const DeployRedis = ({ redisId }: Props) => {
|
|||||||
applicationStatus: "running",
|
applicationStatus: "running",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Database Deploying....");
|
toast.success("Deploying Database...");
|
||||||
await refetch();
|
await refetch();
|
||||||
await deploy({
|
await deploy({
|
||||||
redisId,
|
redisId,
|
||||||
})
|
}).catch(() => {
|
||||||
.then(() => {
|
toast.error("Error to deploy Database");
|
||||||
toast.success("Database Deployed Succesfully");
|
});
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to deploy Database");
|
|
||||||
});
|
|
||||||
await refetch();
|
await refetch();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user