mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-18 09:55:19 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
+13
-14
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user