[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-02-06 06:18:48 +00:00
committed by GitHub
parent 1c4e95d8e3
commit 83599cee37
@@ -104,8 +104,7 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => {
formData.networks formData.networks
?.filter((network) => network.Target) ?.filter((network) => network.Target)
.map((network) => { .map((network) => {
const entries = const entries = (network.DriverOptsEntries ?? []).filter(
(network.DriverOptsEntries ?? []).filter(
(e) => e.key.trim() !== "", (e) => e.key.trim() !== "",
); );
const driverOpts = const driverOpts =
@@ -194,10 +193,12 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => {
<div className="space-y-2"> <div className="space-y-2">
<FormLabel>Driver options (optional)</FormLabel> <FormLabel>Driver options (optional)</FormLabel>
<FormDescription> <FormDescription>
e.g. com.docker.network.driver.mtu, com.docker.network.driver.host_binding e.g. com.docker.network.driver.mtu,
com.docker.network.driver.host_binding
</FormDescription> </FormDescription>
{(form.watch(`networks.${index}.DriverOptsEntries`) ?? []).map( {(
(_, optIndex) => ( form.watch(`networks.${index}.DriverOptsEntries`) ?? []
).map((_, optIndex) => (
<div <div
key={optIndex} key={optIndex}
className="flex gap-2 items-end flex-wrap" className="flex gap-2 items-end flex-wrap"
@@ -247,21 +248,19 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => {
Remove Remove
</Button> </Button>
</div> </div>
), ))}
)}
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
size="sm" size="sm"
onClick={() => { onClick={() => {
const entries = const entries =
form.getValues( form.getValues(`networks.${index}.DriverOptsEntries`) ??
`networks.${index}.DriverOptsEntries`, [];
) ?? []; form.setValue(`networks.${index}.DriverOptsEntries`, [
form.setValue( ...entries,
`networks.${index}.DriverOptsEntries`, { key: "", value: "" },
[...entries, { key: "", value: "" }], ]);
);
}} }}
> >
Add driver option Add driver option