diff --git a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx index 536752791..e556650b8 100644 --- a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx +++ b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx @@ -109,6 +109,16 @@ const ServiceModeSwarmSchema = z }) .strict(); +const NetworkSwarmSchema = z.array( + z + .object({ + Target: z.string().optional(), + Aliases: z.array(z.string()).optional(), + DriverOpts: z.object({}).optional(), + }) + .strict(), +); + const LabelsSwarmSchema = z.record(z.string()); const createStringToJSONSchema = (schema: z.ZodTypeAny) => { @@ -165,6 +175,7 @@ const addSwarmSettings = z.object({ ).nullable(), modeSwarm: createStringToJSONSchema(ServiceModeSwarmSchema).nullable(), labelsSwarm: createStringToJSONSchema(LabelsSwarmSchema).nullable(), + networkSwarm: createStringToJSONSchema(NetworkSwarmSchema).nullable(), }); type AddSwarmSettings = z.infer; @@ -195,6 +206,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => { rollbackConfigSwarm: null, modeSwarm: null, labelsSwarm: null, + networkSwarm: null, }, resolver: zodResolver(addSwarmSettings), }); @@ -223,6 +235,9 @@ export const AddSwarmSettings = ({ applicationId }: Props) => { labelsSwarm: data.labelsSwarm ? JSON.stringify(data.labelsSwarm, null, 2) : null, + networkSwarm: data.networkSwarm + ? JSON.stringify(data.networkSwarm, null, 2) + : null, }); } }, [form, form.reset, data]); @@ -237,6 +252,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => { rollbackConfigSwarm: data.rollbackConfigSwarm, modeSwarm: data.modeSwarm, labelsSwarm: data.labelsSwarm, + networkSwarm: data.networkSwarm, }) .then(async () => { toast.success("Swarm settings updated"); @@ -618,12 +634,69 @@ export const AddSwarmSettings = ({ applicationId }: Props) => { )} /> - + ( + + Network + + + + + Check the interface + + + + + +
+														{`[
+  {
+	"Target" : string | undefined;
+	"Aliases" : string[] | undefined;
+	"DriverOpts" : { [key: string]: string } | undefined;
+  }
+]`}
+													
+
+
+
+
+ +