|
|
|
@ -1,5 +1,10 @@
|
|
|
|
import * as yup from "yup";
|
|
|
|
import * as yup from "yup";
|
|
|
|
import { IEditNetworkForm, INetworkNodeItem, IPAMConfig } from "../../../types";
|
|
|
|
import {
|
|
|
|
|
|
|
|
IEditNetworkForm,
|
|
|
|
|
|
|
|
IIPAM,
|
|
|
|
|
|
|
|
INetworkNodeItem,
|
|
|
|
|
|
|
|
IPAMConfig
|
|
|
|
|
|
|
|
} from "../../../types";
|
|
|
|
import { pruneArray, pruneObject } from "../../../utils/forms";
|
|
|
|
import { pruneArray, pruneObject } from "../../../utils/forms";
|
|
|
|
|
|
|
|
|
|
|
|
export const validationSchema = yup.object({
|
|
|
|
export const validationSchema = yup.object({
|
|
|
|
@ -135,7 +140,7 @@ export const getFinalValues = (
|
|
|
|
},
|
|
|
|
},
|
|
|
|
networkConfig: {
|
|
|
|
networkConfig: {
|
|
|
|
name: values.networkName,
|
|
|
|
name: values.networkName,
|
|
|
|
ipam: {
|
|
|
|
ipam: pruneObject({
|
|
|
|
driver: driver ? driver : undefined,
|
|
|
|
driver: driver ? driver : undefined,
|
|
|
|
config: pruneArray(
|
|
|
|
config: pruneArray(
|
|
|
|
configurations.map((configuration) =>
|
|
|
|
configurations.map((configuration) =>
|
|
|
|
@ -177,7 +182,7 @@ export const getFinalValues = (
|
|
|
|
options.map((option) => [option.key, option.value])
|
|
|
|
options.map((option) => [option.key, option.value])
|
|
|
|
);
|
|
|
|
);
|
|
|
|
})()
|
|
|
|
})()
|
|
|
|
},
|
|
|
|
}) as IIPAM,
|
|
|
|
labels: Object.fromEntries(
|
|
|
|
labels: Object.fromEntries(
|
|
|
|
labels.map((label) => [label.key, label.value])
|
|
|
|
labels.map((label) => [label.key, label.value])
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|