From 983c8d5e9eec268b277eef3ab438470be0cf4061 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 20 Jan 2026 16:31:33 +0100 Subject: [PATCH] refactor(cluster): streamline swarm settings documentation and UI components - Removed unused documentation URLs from menu items in swarm settings. - Enhanced doc descriptions for better clarity on configuration options. - Refactored tooltip implementation for improved UI consistency. --- .../cluster/modify-swarm-settings.tsx | 98 ++++++------------- 1 file changed, 32 insertions(+), 66 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx index aa96d320d..ee427feca 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx @@ -1,4 +1,4 @@ -import { ExternalLink, Settings } from "lucide-react"; +import { Settings } from "lucide-react"; import { useState } from "react"; import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; @@ -33,8 +33,7 @@ type MenuItem = { id: string; label: string; description: string; - docUrl?: string; - docDescription?: string; + docDescription: string; }; const menuItems: MenuItem[] = [ @@ -42,81 +41,64 @@ const menuItems: MenuItem[] = [ id: "health-check", label: "Health Check", description: "Configure health check settings", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#healthcheck", docDescription: - "Configure HEALTHCHECK to test a container's health. Determines if a container is healthy by running a command inside the container.", + "Configure HEALTHCHECK to test a container's health. Determines if a container is healthy by running a command inside the container. Test, Interval, Timeout, StartPeriod, and Retries control health monitoring.", }, { id: "restart-policy", label: "Restart Policy", description: "Configure restart policy", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#restart-policy", docDescription: - "Configure the restart policy for containers in the service. Controls when and how containers should be restarted.", + "Configure the restart policy for containers in the service. Condition (none, on-failure, any), Delay (nanoseconds between restarts), MaxAttempts, and Window control restart behavior.", }, { id: "placement", label: "Placement", description: "Configure placement constraints", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#placement-pref", docDescription: - "Control which nodes service tasks can be scheduled on. Use constraints, preferences, and platform specifications.", + "Control which nodes service tasks can be scheduled on. Constraints (node.id==xyz), Preferences (spread.node.labels.zone), MaxReplicas, and Platforms specify task placement rules.", }, { id: "update-config", label: "Update Config", description: "Configure update strategy", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#update-config", docDescription: - "Configure how the service should be updated. Controls parallelism, delay, failure action, and order of updates.", + "Configure how the service should be updated. Parallelism (tasks updated simultaneously), Delay, FailureAction (pause, continue, rollback), Monitor, MaxFailureRatio, and Order (stop-first, start-first) control updates.", }, { id: "rollback-config", label: "Rollback Config", description: "Configure rollback strategy", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#rollback-config", docDescription: - "Configure automated rollback on update failure. Similar to update config but applies to rollback operations.", + "Configure automated rollback on update failure. Uses same parameters as UpdateConfig: Parallelism, Delay, FailureAction, Monitor, MaxFailureRatio, and Order.", }, { id: "mode", label: "Mode", description: "Configure service mode", - docUrl: "https://docs.docker.com/reference/cli/docker/service/create/#mode", docDescription: - "Set service mode to either 'replicated' (default) with a specified number of tasks, or 'global' (one task per node).", + "Set service mode to either 'Replicated' with a specified number of tasks (Replicas), or 'Global' (one task per node).", }, { id: "labels", label: "Labels", description: "Configure service labels", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#label", docDescription: - "Add metadata to services using labels. Labels are key-value pairs for organizing and filtering services.", + "Add metadata to services using labels. Labels are key-value pairs (e.g., com.example.foo=bar) for organizing and filtering services.", }, { id: "stop-grace-period", label: "Stop Grace Period", description: "Configure stop grace period", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#stop-grace-period", docDescription: - "Time to wait before forcefully killing a container. Given in nanoseconds. Default is 10 seconds.", + "Time to wait before forcefully killing a container. Specified in nanoseconds (e.g., 10000000000 = 10 seconds). Allows containers to shutdown gracefully.", }, { id: "endpoint-spec", label: "Endpoint Spec", description: "Configure endpoint specification", - docUrl: - "https://docs.docker.com/reference/cli/docker/service/create/#endpoint-mode", docDescription: - "Configure endpoint mode for service discovery. Choose between 'vip' (virtual IP) or 'dnsrr' (DNS round-robin).", + "Configure endpoint mode for service discovery. Mode 'vip' (virtual IP - default) uses a single virtual IP. Mode 'dnsrr' (DNS round-robin) returns DNS entries for all tasks.", }, ]; @@ -163,44 +145,28 @@ export const AddSwarmSettings = ({ id, type }: Props) => {