Skip to content

Commit 645a81b

Browse files
committed
feat: add tooltip to Daily Docker Cleanup toggle
Add an informative tooltip explaining the cleanup behavior and linking to Schedule Jobs docs for custom cleanup strategies. Closes #3973
1 parent a6db83c commit 645a81b

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

apps/dokploy/components/dashboard/settings/servers/actions/toggle-docker-cleanup.tsx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { toast } from "sonner";
21
import { Label } from "@/components/ui/label";
32
import { Switch } from "@/components/ui/switch";
3+
import {
4+
Tooltip,
5+
TooltipContent,
6+
TooltipProvider,
7+
TooltipTrigger,
8+
} from "@/components/ui/tooltip";
49
import { api } from "@/utils/api";
10+
import { HelpCircle } from "lucide-react";
11+
import { toast } from "sonner";
512

613
interface Props {
714
serverId?: string;
@@ -52,7 +59,37 @@ export const ToggleDockerCleanup = ({ serverId }: Props) => {
5259
return (
5360
<div className="flex items-center gap-4">
5461
<Switch checked={!!enabled} onCheckedChange={handleToggle} />
55-
<Label className="text-primary">Daily Docker Cleanup</Label>
62+
<TooltipProvider delayDuration={0}>
63+
<Tooltip>
64+
<TooltipTrigger asChild>
65+
<Label className="text-primary flex items-center gap-1.5 cursor-pointer">
66+
Daily Docker Cleanup
67+
<HelpCircle className="size-4 text-muted-foreground" />
68+
</Label>
69+
</TooltipTrigger>
70+
<TooltipContent side="top" className="max-w-sm">
71+
<p>
72+
Runs a full Docker cleanup daily, pruning stopped
73+
containers, unused images, volumes, build cache, and
74+
system resources. This may remove images built for
75+
Compose services that run on-demand (backup runners,
76+
cron jobs, one-off tasks).
77+
</p>
78+
<p className="mt-1">
79+
For custom cleanup strategies, use{" "}
80+
<a
81+
href="https://docs.dokploy.com/docs/core/schedule-jobs#example-1-automatic-docker-cleanup"
82+
target="_blank"
83+
rel="noopener noreferrer"
84+
className="underline text-primary"
85+
>
86+
Schedule Jobs
87+
</a>{" "}
88+
on your web server or remote servers.
89+
</p>
90+
</TooltipContent>
91+
</Tooltip>
92+
</TooltipProvider>
5693
</div>
5794
);
5895
};

0 commit comments

Comments
 (0)