diff --git a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts index e07f34ade..eda4dace5 100644 --- a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts +++ b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts @@ -65,6 +65,8 @@ const baseSettings: WebServerSettings = { cleanupCacheApplications: false, cleanupCacheOnCompose: false, cleanupCacheOnPreviews: false, + remoteServersOnly: false, + enforceSSO: false, createdAt: null, updatedAt: new Date(), }; diff --git a/apps/dokploy/components/dashboard/project/add-application.tsx b/apps/dokploy/components/dashboard/project/add-application.tsx index 16fac353d..0c50cc41f 100644 --- a/apps/dokploy/components/dashboard/project/add-application.tsx +++ b/apps/dokploy/components/dashboard/project/add-application.tsx @@ -71,6 +71,9 @@ interface Props { export const AddApplication = ({ environmentId, projectName }: Props) => { const utils = api.useUtils(); const { data: isCloud } = api.settings.isCloud.useQuery(); + const { data: webServerSettings } = + api.settings.getWebServerSettings.useQuery(); + const showLocalOption = !isCloud && !webServerSettings?.remoteServersOnly; const [visible, setVisible] = useState(false); const slug = slugify(projectName); const { data: servers } = api.server.withSSHKey.useQuery(); @@ -171,7 +174,8 @@ export const AddApplication = ({ environmentId, projectName }: Props) => { - Select a Server {!isCloud ? "(Optional)" : ""} + Select a Server{" "} + {showLocalOption ? "(Optional)" : ""} @@ -191,17 +195,19 @@ export const AddApplication = ({ environmentId, projectName }: Props) => { - {!isCloud && ( + {showLocalOption && ( Dokploy @@ -236,7 +242,8 @@ export const AddCompose = ({ environmentId, projectName }: Props) => { ))} - Servers ({servers?.length + (!isCloud ? 1 : 0)}) + Servers ( + {servers?.length + (showLocalOption ? 1 : 0)}) diff --git a/apps/dokploy/components/dashboard/project/add-database.tsx b/apps/dokploy/components/dashboard/project/add-database.tsx index 966fe0013..a76de2775 100644 --- a/apps/dokploy/components/dashboard/project/add-database.tsx +++ b/apps/dokploy/components/dashboard/project/add-database.tsx @@ -219,6 +219,9 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => { const [visible, setVisible] = useState(false); const slug = slugify(projectName); const { data: isCloud } = api.settings.isCloud.useQuery(); + const { data: webServerSettings } = + api.settings.getWebServerSettings.useQuery(); + const showLocalOption = !isCloud && !webServerSettings?.remoteServersOnly; const { data: servers } = api.server.withSSHKey.useQuery(); const libsqlMutation = api.libsql.create.useMutation(); const mariadbMutation = api.mariadb.create.useMutation(); @@ -470,19 +473,20 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => {