feat(networks): add MTU option to network creation

This commit is contained in:
Mauricio Siu
2026-08-03 04:09:50 -06:00
parent a1230098c9
commit 69a5615544
6 changed files with 8969 additions and 1 deletions
@@ -54,6 +54,14 @@ const networkFormSchema = z
attachable: z.boolean(),
enableIPv4: z.boolean(),
enableIPv6: z.boolean(),
mtu: z
.string()
.refine(
(value) =>
value === "" ||
(/^\d+$/.test(value) && +value >= 68 && +value <= 65535),
{ message: "MTU must be a number between 68 and 65535" },
),
ipamDriver: z.string().optional(),
ipamConfig: z.array(ipamConfigEntrySchema),
})
@@ -85,6 +93,7 @@ const defaultValues: NetworkFormValues = {
attachable: false,
enableIPv4: true,
enableIPv6: false,
mtu: "",
ipamDriver: "",
ipamConfig: [],
};
@@ -147,6 +156,7 @@ export const HandleNetwork = ({ serverId, children }: HandleNetworkProps) => {
attachable: data.attachable,
enableIPv4: data.enableIPv4,
enableIPv6: data.enableIPv6,
mtu: data.mtu ? Number(data.mtu) : undefined,
ipam: {
driver: data.ipamDriver || undefined,
config: data.ipamConfig,
@@ -232,6 +242,23 @@ export const HandleNetwork = ({ serverId, children }: HandleNetworkProps) => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="mtu"
render={({ field }) => (
<FormItem>
<FormLabel>MTU (optional)</FormLabel>
<FormControl>
<Input placeholder="1500" inputMode="numeric" {...field} />
</FormControl>
<FormDescription className="text-muted-foreground">
Maximum transmission unit. Leave empty to use Docker's
default.
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
</div>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
{toggleOptions.map((option) => (
@@ -0,0 +1 @@
ALTER TABLE "network" ADD COLUMN "mtu" integer;
File diff suppressed because it is too large Load Diff
+7
View File
@@ -1247,6 +1247,13 @@
"when": 1785709848209,
"tag": "0177_glossy_brother_voodoo",
"breakpoints": true
},
{
"idx": 178,
"version": "7",
"when": 1785751631838,
"tag": "0178_silky_randall",
"breakpoints": true
}
]
}