-
{
- await deploy({
- composeId: composeId,
- })
- .then(() => {
- toast.success("Compose deployed successfully");
- refetch();
- router.push(
- `/dashboard/project/${data?.project.projectId}/services/compose/${composeId}?tab=deployments`,
- );
- })
- .catch(() => {
- toast.error("Error deploying compose");
- });
- }}
- >
-
-
-
{
- await redeploy({
- composeId: composeId,
- })
- .then(() => {
- toast.success("Compose rebuilt successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error rebuilding compose");
- });
- }}
- >
-
-
- {data?.composeType === "docker-compose" &&
- data?.composeStatus === "idle" ? (
+
{
- await start({
+ await deploy({
composeId: composeId,
})
.then(() => {
- toast.success("Compose started successfully");
+ toast.success("Compose deployed successfully");
refetch();
+ router.push(
+ `/dashboard/project/${data?.project.projectId}/services/compose/${composeId}?tab=deployments`,
+ );
})
.catch(() => {
- toast.error("Error starting compose");
+ toast.error("Error deploying compose");
});
}}
>
-
- ) : (
{
- await stop({
+ await redeploy({
composeId: composeId,
})
.then(() => {
- toast.success("Compose stopped successfully");
+ toast.success("Compose rebuilt successfully");
refetch();
})
.catch(() => {
- toast.error("Error stopping compose");
+ toast.error("Error rebuilding compose");
});
}}
>
-
- Stop
-
+
+ Rebuild
+
+
+
+
+
+
+
+ Only rebuilds the compose without downloading new code
+
+
+
- )}
-
+ {data?.composeType === "docker-compose" &&
+ data?.composeStatus === "idle" ? (
+ {
+ await start({
+ composeId: composeId,
+ })
+ .then(() => {
+ toast.success("Compose started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting compose");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the compose (requires a previous successful build)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ composeId: composeId,
+ })
+ .then(() => {
+ toast.success("Compose stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping compose");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running compose
+
+
+
+
+
+ )}
+
{
Deploy Settings
- {
- setIsDeploying(true);
- await new Promise((resolve) => setTimeout(resolve, 1000));
- refetch();
- }}
- >
-
- Deploy
-
-
- {
- await reload({
- mariadbId: mariadbId,
- appName: data?.appName || "",
- })
- .then(() => {
- toast.success("Mariadb reloaded successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error reloading Mariadb");
- });
- }}
- >
-
- Reload
-
-
-
- {data?.applicationStatus === "idle" ? (
+
{
- await start({
- mariadbId: mariadbId,
- })
- .then(() => {
- toast.success("Mariadb started successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error starting Mariadb");
- });
+ setIsDeploying(true);
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ refetch();
}}
>
-
- Start
-
+
+ Deploy
+
+
+
+
+
+
+ Downloads and sets up the MariaDB database
+
+
+
- ) : (
{
- await stop({
+ await reload({
mariadbId: mariadbId,
+ appName: data?.appName || "",
})
.then(() => {
- toast.success("Mariadb stopped successfully");
+ toast.success("Mariadb reloaded successfully");
refetch();
})
.catch(() => {
- toast.error("Error stopping Mariadb");
+ toast.error("Error reloading Mariadb");
});
}}
>
-
- Stop
-
+
+ Reload
+
+
+
+
+
+
+
+ Restart the MariaDB service without rebuilding
+
+
+
- )}
+ {data?.applicationStatus === "idle" ? (
+ {
+ await start({
+ mariadbId: mariadbId,
+ })
+ .then(() => {
+ toast.success("Mariadb started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting Mariadb");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the MariaDB database (requires a previous
+ successful setup)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ mariadbId: mariadbId,
+ })
+ .then(() => {
+ toast.success("Mariadb stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping Mariadb");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running MariaDB database
+
+
+
+
+
+ )}
+
{
Deploy Settings
- {
- setIsDeploying(true);
- await new Promise((resolve) => setTimeout(resolve, 1000));
- refetch();
- }}
- >
-
- Deploy
-
-
- {
- await reload({
- mongoId: mongoId,
- appName: data?.appName || "",
- })
- .then(() => {
- toast.success("Mongo reloaded successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error reloading Mongo");
- });
- }}
- >
-
- Reload
-
-
-
- {data?.applicationStatus === "idle" ? (
+
{
- await start({
+ setIsDeploying(true);
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ refetch();
+ }}
+ >
+
+ Deploy
+
+
+
+
+
+
+ Downloads and sets up the MongoDB database
+
+
+
+
+
+ {
+ await reload({
mongoId: mongoId,
+ appName: data?.appName || "",
})
.then(() => {
- toast.success("Mongo started successfully");
+ toast.success("Mongo reloaded successfully");
refetch();
})
.catch(() => {
- toast.error("Error starting Mongo");
+ toast.error("Error reloading Mongo");
});
}}
>
-
- Start
-
+
+ Reload
+
+
+
+
+
+
+
+ Restart the MongoDB service without rebuilding
+
+
+
- ) : (
- {
- await stop({
- mongoId: mongoId,
- })
- .then(() => {
- toast.success("Mongo stopped successfully");
- refetch();
+ {data?.applicationStatus === "idle" ? (
+ {
+ await start({
+ mongoId: mongoId,
})
- .catch(() => {
- toast.error("Error stopping Mongo");
- });
- }}
- >
-
- Stop
-
-
-
- )}
+ .then(() => {
+ toast.success("Mongo started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting Mongo");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the MongoDB database (requires a previous
+ successful setup)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ mongoId: mongoId,
+ })
+ .then(() => {
+ toast.success("Mongo stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping Mongo");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running MongoDB database
+
+
+
+
+
+ )}
+
{
Deploy Settings
- {
- setIsDeploying(true);
- await new Promise((resolve) => setTimeout(resolve, 1000));
- refetch();
- }}
- >
-
- Deploy
-
-
- {
- await reload({
- mysqlId: mysqlId,
- appName: data?.appName || "",
- })
- .then(() => {
- toast.success("Mysql reloaded successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error reloading Mysql");
- });
- }}
- >
-
- Reload
-
-
-
- {data?.applicationStatus === "idle" ? (
+
{
- await start({
- mysqlId: mysqlId,
- })
- .then(() => {
- toast.success("Mysql started successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error starting Mysql");
- });
+ setIsDeploying(true);
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ refetch();
}}
>
-
- Start
-
+
+ Deploy
+
+
+
+
+
+
+ Downloads and sets up the MySQL database
+
+
+
- ) : (
{
- await stop({
+ await reload({
mysqlId: mysqlId,
+ appName: data?.appName || "",
})
.then(() => {
- toast.success("Mysql stopped successfully");
+ toast.success("Mysql reloaded successfully");
refetch();
})
.catch(() => {
- toast.error("Error stopping Mysql");
+ toast.error("Error reloading Mysql");
});
}}
>
-
- Stop
-
+
+ Reload
+
+
+
+
+
+
+
+ Restart the MySQL service without rebuilding
+
+
+
- )}
-
+ {data?.applicationStatus === "idle" ? (
+ {
+ await start({
+ mysqlId: mysqlId,
+ })
+ .then(() => {
+ toast.success("Mysql started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting Mysql");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the MySQL database (requires a previous
+ successful setup)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ mysqlId: mysqlId,
+ })
+ .then(() => {
+ toast.success("Mysql stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping Mysql");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running MySQL database
+
+
+
+
+
+ )}
+
{
);
return (
-
-
-
- General
-
-
- {
- setIsDeploying(true);
-
- await new Promise((resolve) => setTimeout(resolve, 1000));
- refetch();
- }}
- >
-
- Deploy
-
-
-
- {
- await reload({
- postgresId: postgresId,
- appName: data?.appName || "",
- })
- .then(() => {
- toast.success("Postgres reloaded successfully");
+ <>
+
+
+
+ Deploy Settings
+
+
+
+ {
+ setIsDeploying(true);
+ await new Promise((resolve) => setTimeout(resolve, 1000));
refetch();
- })
- .catch(() => {
- toast.error("Error reloading Postgres");
- });
- }}
- >
-
- Reload
-
-
-
- {data?.applicationStatus === "idle" ? (
- {
- await start({
- postgresId: postgresId,
- })
- .then(() => {
- toast.success("Postgres started successfully");
- refetch();
+ }}
+ >
+
+ Deploy
+
+
+
+
+
+
+ Downloads and sets up the PostgreSQL database
+
+
+
+
+
+ {
+ await reload({
+ postgresId: postgresId,
+ appName: data?.appName || "",
})
- .catch(() => {
- toast.error("Error starting Postgres");
- });
- }}
+ .then(() => {
+ toast.success("Postgres reloaded successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error reloading Postgres");
+ });
+ }}
+ >
+
+ Reload
+
+
+
+
+
+
+
+ Restart the PostgreSQL service without rebuilding
+
+
+
+
+
+ {data?.applicationStatus === "idle" ? (
+ {
+ await start({
+ postgresId: postgresId,
+ })
+ .then(() => {
+ toast.success("Postgres started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting Postgres");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the PostgreSQL database (requires a previous
+ successful setup)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ postgresId: postgresId,
+ })
+ .then(() => {
+ toast.success("Postgres stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping Postgres");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running PostgreSQL database
+
+
+
+
+
+ )}
+
+
-
- Start
-
+
+
+ Open Terminal
-
- ) : (
- {
- await stop({
- postgresId: postgresId,
- })
- .then(() => {
- toast.success("Postgres stopped successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error stopping Postgres");
- });
- }}
- >
-
- Stop
-
-
-
- )}
-
-
-
-
- Open Terminal
-
-
-
-
-
{
- setIsDrawerOpen(false);
- setFilteredLogs([]);
- setIsDeploying(false);
- refetch();
- }}
- filteredLogs={filteredLogs}
- />
-
+
+
+
+
{
+ setIsDrawerOpen(false);
+ setFilteredLogs([]);
+ setIsDeploying(false);
+ refetch();
+ }}
+ filteredLogs={filteredLogs}
+ />
+
+ >
);
};
diff --git a/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx b/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx
index e309ef49..d9c2e10a 100644
--- a/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx
+++ b/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx
@@ -2,12 +2,26 @@ import { DialogAction } from "@/components/shared/dialog-action";
import { DrawerLogs } from "@/components/shared/drawer-logs";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import { api } from "@/utils/api";
-import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
+import {
+ Ban,
+ CheckCircle2,
+ HelpCircle,
+ RefreshCcw,
+ Terminal,
+} from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
+
interface Props {
redisId: string;
}
@@ -63,94 +77,150 @@ export const ShowGeneralRedis = ({ redisId }: Props) => {
Deploy Settings
- {
- setIsDeploying(true);
- await new Promise((resolve) => setTimeout(resolve, 1000));
- refetch();
- }}
- >
-
- Deploy
-
-
- {
- await reload({
- redisId: redisId,
- appName: data?.appName || "",
- })
- .then(() => {
- toast.success("Redis reloaded successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error reloading Redis");
- });
- }}
- >
-
- Reload
-
-
-
- {/* */}
- {data?.applicationStatus === "idle" ? (
+
{
- await start({
- redisId: redisId,
- })
- .then(() => {
- toast.success("Redis started successfully");
- refetch();
- })
- .catch(() => {
- toast.error("Error starting Redis");
- });
+ setIsDeploying(true);
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ refetch();
}}
>
-
- Start
-
+
+ Deploy
+
+
+
+
+
+
+ Downloads and sets up the Redis database
+
+
+
- ) : (
{
- await stop({
+ await reload({
redisId: redisId,
+ appName: data?.appName || "",
})
.then(() => {
- toast.success("Redis stopped successfully");
+ toast.success("Redis reloaded successfully");
refetch();
})
.catch(() => {
- toast.error("Error stopping Redis");
+ toast.error("Error reloading Redis");
});
}}
>
-
- Stop
-
+
+ Reload
+
+
+
+
+
+
+
+ Restart the Redis service without rebuilding
+
+
+
- )}
-
+ {data?.applicationStatus === "idle" ? (
+ {
+ await start({
+ redisId: redisId,
+ })
+ .then(() => {
+ toast.success("Redis started successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error starting Redis");
+ });
+ }}
+ >
+
+ Start
+
+
+
+
+
+
+
+
+ Start the Redis database (requires a previous
+ successful setup)
+
+
+
+
+
+
+ ) : (
+ {
+ await stop({
+ redisId: redisId,
+ })
+ .then(() => {
+ toast.success("Redis stopped successfully");
+ refetch();
+ })
+ .catch(() => {
+ toast.error("Error stopping Redis");
+ });
+ }}
+ >
+
+ Stop
+
+
+
+
+
+
+
+ Stop the currently running Redis database
+
+
+
+
+
+ )}
+