diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx index b09eb525..06470e05 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx @@ -35,7 +35,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { GlobeIcon, HelpCircle } from "lucide-react"; +import { GlobeIcon, HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -156,90 +156,111 @@ const Service = ( - { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/application/${applicationId}?tab=${e}`; - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Logs - Deployments - Domains - Advanced - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/application/${applicationId}?tab=${e}`; + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Logs + Deployments + Domains + Advanced + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
+
- -
- -
-
- -
- -
-
- {!data?.serverId && ( - +
- +
- )} + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} - -
- -
-
- -
- -
-
- -
- -
-
- -
- - - - - - - - -
-
-
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ + + + + + + + +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx index d6746a9e..fd2eb443 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx @@ -29,7 +29,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { CircuitBoard } from "lucide-react"; +import { CircuitBoard, ServerOff } from "lucide-react"; import { HelpCircle } from "lucide-react"; import type { GetServerSidePropsContext, @@ -151,98 +151,118 @@ const Service = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/compose/${composeId}?tab=${e}`; - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - {data?.composeType === "docker-compose" && ( - Environment - )} - {!data?.serverId && ( - Monitoring - )} - Logs - Deployments - Domains - Advanced - -
- - - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/compose/${composeId}?tab=${e}`; + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + {data?.composeType === "docker-compose" && ( + Environment + )} + {!data?.serverId && ( + Monitoring + )} + Logs + Deployments + Domains + Advanced + +
+ - -
- + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- +
+
+ +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + + +
+
- )} - -
- -
-
+ +
+ +
+
- -
- -
-
- - -
- -
-
- -
- - -
-
- + +
+ +
+
+ +
+ + +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx index 12a793a7..080f7c8d 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx @@ -30,7 +30,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { HelpCircle } from "lucide-react"; +import { HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -137,79 +137,99 @@ const Mariadb = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/mariadb/${mariadbId}?tab=${e}`; - - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Backups - Logs - Advanced - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/mariadb/${mariadbId}?tab=${e}`; - -
- - - + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Backups + Logs + Advanced + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- + + +
- )} - -
- -
-
- -
- -
-
- -
- -
-
- + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx index e5245527..78af40fb 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx @@ -30,7 +30,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { HelpCircle } from "lucide-react"; +import { HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -138,80 +138,100 @@ const Mongo = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/mongo/${mongoId}?tab=${e}`; - - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Backups - Logs - Advanced - - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/mongo/${mongoId}?tab=${e}`; - -
- - - + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Backups + Logs + Advanced + + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- + + +
- )} - -
- -
-
- -
- -
-
- -
- -
-
- + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx index 0dd68baa..726ac82e 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx @@ -30,7 +30,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { HelpCircle } from "lucide-react"; +import { HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -137,80 +137,100 @@ const MySql = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/mysql/${mysqlId}?tab=${e}`; - - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Backups - Logs - Advanced - - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/mysql/${mysqlId}?tab=${e}`; - -
- - - + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Backups + Logs + Advanced + + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- + + +
- )} - -
- -
-
- -
- -
-
- -
- -
-
- + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx index 1affd1d5..88c9f05e 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx @@ -30,7 +30,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { HelpCircle } from "lucide-react"; +import { HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -138,80 +138,100 @@ const Postgresql = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/postgres/${postgresId}?tab=${e}`; - - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Backups - Logs - Advanced - - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/postgres/${postgresId}?tab=${e}`; - -
- - - + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Backups + Logs + Advanced + + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- + + +
- )} - -
- -
-
- -
- -
-
- -
- -
-
- + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + )}
); }; diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx index 58e77ff4..fa3ac92c 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx @@ -29,7 +29,7 @@ import { appRouter } from "@/server/api/root"; import { api } from "@/utils/api"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; -import { HelpCircle } from "lucide-react"; +import { HelpCircle, ServerOff } from "lucide-react"; import type { GetServerSidePropsContext, InferGetServerSidePropsType, @@ -137,74 +137,94 @@ const Redis = (
- { - setSab(e as TabState); - const newPath = `/dashboard/project/${projectId}/services/redis/${redisId}?tab=${e}`; - - router.push(newPath, undefined, { shallow: true }); - }} - > -
- - General - Environment - {!data?.serverId && ( - Monitoring - )} - Logs - Advanced - - -
- - {(auth?.rol === "admin" || user?.canDeleteServices) && ( - - )} + {data?.server?.serverStatus === "inactive" ? ( +
+
+ + + This service is hosted on the server {data.server.name}, but this + server has been disabled because your current plan doesn't include + enough servers. Please purchase more servers to regain access to + this application. + + + Go to{" "} + + Billing + +
+ ) : ( + { + setSab(e as TabState); + const newPath = `/dashboard/project/${projectId}/services/redis/${redisId}?tab=${e}`; - -
- - - + router.push(newPath, undefined, { shallow: true }); + }} + > +
+ + General + Environment + {!data?.serverId && ( + Monitoring + )} + Logs + Advanced + + +
+ + {(auth?.rol === "admin" || user?.canDeleteServices) && ( + + )} +
- - -
- -
-
- {!data?.serverId && ( - + +
- + + +
- )} - -
- -
-
- -
- -
-
- + +
+ +
+
+ {!data?.serverId && ( + +
+ +
+
+ )} + +
+ +
+
+ +
+ +
+
+ + )}
); }; diff --git a/apps/dokploy/server/api/routers/compose.ts b/apps/dokploy/server/api/routers/compose.ts index 21704f94..f50956b2 100644 --- a/apps/dokploy/server/api/routers/compose.ts +++ b/apps/dokploy/server/api/routers/compose.ts @@ -252,7 +252,6 @@ export const composeRouter = createTRPCRouter({ descriptionLog: "", server: !!compose.serverId, }; - console.log(jobData); if (IS_CLOUD && compose.serverId) { jobData.serverId = compose.serverId;