mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-17 09:25:20 +00:00
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) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9142127fb3
commit
898af1f74c
@@ -46,6 +46,7 @@ import {
|
|||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from "@/components/ui/tooltip";
|
} from "@/components/ui/tooltip";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint";
|
||||||
|
|
||||||
export type CacheType = "fetch" | "cache";
|
export type CacheType = "fetch" | "cache";
|
||||||
|
|
||||||
@@ -300,7 +301,12 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
|
|||||||
customEntrypoint: data.useCustomEntrypoint ? data.customEntrypoint : null,
|
customEntrypoint: data.useCustomEntrypoint ? data.customEntrypoint : null,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success(dictionary.success);
|
toast.success(
|
||||||
|
dictionary.success,
|
||||||
|
data.domainType === "compose"
|
||||||
|
? { description: COMPOSE_REDEPLOY_TOAST }
|
||||||
|
: undefined,
|
||||||
|
);
|
||||||
|
|
||||||
if (data.domainType === "application") {
|
if (data.domainType === "application") {
|
||||||
await utils.domain.byApplicationId.invalidate({
|
await utils.domain.byApplicationId.invalidate({
|
||||||
@@ -337,12 +343,7 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
|
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
|
||||||
|
|
||||||
{type === "compose" && (
|
{type === "compose" && <ComposeRedeployAlert className="mb-4" />}
|
||||||
<AlertBlock type="info" className="mb-4">
|
|
||||||
Whenever you make changes to domains, remember to redeploy your
|
|
||||||
compose to apply the changes.
|
|
||||||
</AlertBlock>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form
|
<form
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { AlertBlock } from "@/components/shared/alert-block";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domains attached to a compose service are rendered as docker labels and only
|
||||||
|
* take effect on the next deployment. These strings keep the "redeploy required"
|
||||||
|
* wording consistent across the add/edit dialog, the domains list and the
|
||||||
|
* toasts shown after create/update/delete/toggle operations.
|
||||||
|
*/
|
||||||
|
export const COMPOSE_REDEPLOY_HINT =
|
||||||
|
"Whenever you make changes to domains, remember to redeploy your compose to apply the changes.";
|
||||||
|
|
||||||
|
export const COMPOSE_REDEPLOY_TOAST =
|
||||||
|
"Redeploy the compose to apply the changes.";
|
||||||
|
|
||||||
|
export const ComposeRedeployAlert = ({ className }: { className?: string }) => (
|
||||||
|
<AlertBlock type="info" className={className}>
|
||||||
|
{COMPOSE_REDEPLOY_HINT}
|
||||||
|
</AlertBlock>
|
||||||
|
);
|
||||||
@@ -63,6 +63,7 @@ import { createColumns } from "./columns";
|
|||||||
import { DnsHelperModal } from "./dns-helper-modal";
|
import { DnsHelperModal } from "./dns-helper-modal";
|
||||||
import { AddDomain } from "./handle-domain";
|
import { AddDomain } from "./handle-domain";
|
||||||
import { HandleForwardAuth } from "./handle-forward-auth";
|
import { HandleForwardAuth } from "./handle-forward-auth";
|
||||||
|
import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint";
|
||||||
|
|
||||||
export type ValidationState = {
|
export type ValidationState = {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
@@ -151,7 +152,12 @@ export const ShowDomains = ({ id, type }: Props) => {
|
|||||||
try {
|
try {
|
||||||
await deleteDomain({ domainId });
|
await deleteDomain({ domainId });
|
||||||
refetch();
|
refetch();
|
||||||
toast.success("Domain deleted successfully");
|
toast.success(
|
||||||
|
"Domain deleted successfully",
|
||||||
|
type === "compose"
|
||||||
|
? { description: COMPOSE_REDEPLOY_TOAST }
|
||||||
|
: undefined,
|
||||||
|
);
|
||||||
} catch {
|
} catch {
|
||||||
toast.error("Error deleting domain");
|
toast.error("Error deleting domain");
|
||||||
}
|
}
|
||||||
@@ -265,6 +271,11 @@ export const ShowDomains = ({ id, type }: Props) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
{type === "compose" && data && data.length > 0 && (
|
||||||
|
<div className="px-6 pb-4">
|
||||||
|
<ComposeRedeployAlert />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<CardContent className="flex w-full flex-row gap-4">
|
<CardContent className="flex w-full flex-row gap-4">
|
||||||
{isLoadingDomains ? (
|
{isLoadingDomains ? (
|
||||||
<div className="flex w-full flex-row gap-4 min-h-[40vh] justify-center items-center">
|
<div className="flex w-full flex-row gap-4 min-h-[40vh] justify-center items-center">
|
||||||
@@ -466,18 +477,7 @@ export const ShowDomains = ({ id, type }: Props) => {
|
|||||||
description="Are you sure you want to delete this domain?"
|
description="Are you sure you want to delete this domain?"
|
||||||
type="destructive"
|
type="destructive"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await deleteDomain({
|
await handleDeleteDomain(item.domainId);
|
||||||
domainId: item.domainId,
|
|
||||||
})
|
|
||||||
.then((_data) => {
|
|
||||||
refetch();
|
|
||||||
toast.success(
|
|
||||||
"Domain deleted successfully",
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error deleting domain");
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user