From 898af1f74ccc5fb7480f5146fd1c1f7a843cde97 Mon Sep 17 00:00:00 2001 From: Vyacheslav Scherbinin Date: Thu, 25 Jun 2026 00:01:22 +0700 Subject: [PATCH] feat(domains): show redeploy hint on all compose domain actions Compose domains are rendered as docker labels and only take effect on the next deployment. Extract the "redeploy required" notice into a reusable component/strings and surface it consistently: as a banner in the domains list, in the add/edit dialog (replacing the inline copy), and in the toast shown after create/update/delete. Unify grid deletion onto the shared handler so the hint applies in both grid and table views. Groundwork for the upcoming domain enable/disable toggle. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../application/domains/handle-domain.tsx | 15 ++++++----- .../application/domains/redeploy-hint.tsx | 19 ++++++++++++++ .../application/domains/show-domains.tsx | 26 +++++++++---------- 3 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 apps/dokploy/components/dashboard/application/domains/redeploy-hint.tsx diff --git a/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx b/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx index be8901921..8bb763add 100644 --- a/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx +++ b/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx @@ -46,6 +46,7 @@ import { TooltipTrigger, } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; +import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint"; export type CacheType = "fetch" | "cache"; @@ -300,7 +301,12 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => { customEntrypoint: data.useCustomEntrypoint ? data.customEntrypoint : null, }) .then(async () => { - toast.success(dictionary.success); + toast.success( + dictionary.success, + data.domainType === "compose" + ? { description: COMPOSE_REDEPLOY_TOAST } + : undefined, + ); if (data.domainType === "application") { await utils.domain.byApplicationId.invalidate({ @@ -337,12 +343,7 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => { {isError && {error?.message}} - {type === "compose" && ( - - Whenever you make changes to domains, remember to redeploy your - compose to apply the changes. - - )} + {type === "compose" && }
( + + {COMPOSE_REDEPLOY_HINT} + +); diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index daed0e251..d3497b49a 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -63,6 +63,7 @@ import { createColumns } from "./columns"; import { DnsHelperModal } from "./dns-helper-modal"; import { AddDomain } from "./handle-domain"; import { HandleForwardAuth } from "./handle-forward-auth"; +import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint"; export type ValidationState = { isLoading: boolean; @@ -151,7 +152,12 @@ export const ShowDomains = ({ id, type }: Props) => { try { await deleteDomain({ domainId }); refetch(); - toast.success("Domain deleted successfully"); + toast.success( + "Domain deleted successfully", + type === "compose" + ? { description: COMPOSE_REDEPLOY_TOAST } + : undefined, + ); } catch { toast.error("Error deleting domain"); } @@ -265,6 +271,11 @@ export const ShowDomains = ({ id, type }: Props) => { )} + {type === "compose" && data && data.length > 0 && ( +
+ +
+ )} {isLoadingDomains ? (
@@ -466,18 +477,7 @@ export const ShowDomains = ({ id, type }: Props) => { description="Are you sure you want to delete this domain?" type="destructive" onClick={async () => { - await deleteDomain({ - domainId: item.domainId, - }) - .then((_data) => { - refetch(); - toast.success( - "Domain deleted successfully", - ); - }) - .catch(() => { - toast.error("Error deleting domain"); - }); + await handleDeleteDomain(item.domainId); }} >