|
|
|
@ -106,11 +106,13 @@ const initialValues: IEditServiceForm = {
|
|
|
|
imageTag: "",
|
|
|
|
imageTag: "",
|
|
|
|
serviceName: "",
|
|
|
|
serviceName: "",
|
|
|
|
containerName: "",
|
|
|
|
containerName: "",
|
|
|
|
|
|
|
|
networks: [],
|
|
|
|
profiles: [],
|
|
|
|
profiles: [],
|
|
|
|
ports: [],
|
|
|
|
ports: [],
|
|
|
|
environmentVariables: [],
|
|
|
|
environmentVariables: [],
|
|
|
|
volumes: [],
|
|
|
|
volumes: [],
|
|
|
|
labels: []
|
|
|
|
labels: [],
|
|
|
|
|
|
|
|
dependsOn: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
yup.addMethod<yup.StringSchema>(yup.string, "port", function (message) {
|
|
|
|
yup.addMethod<yup.StringSchema>(yup.string, "port", function (message) {
|
|
|
|
@ -288,10 +290,12 @@ export const getInitialValues = (node?: IServiceNodeItem): IEditServiceForm => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
build,
|
|
|
|
build,
|
|
|
|
deploy,
|
|
|
|
deploy,
|
|
|
|
|
|
|
|
depends_on,
|
|
|
|
image,
|
|
|
|
image,
|
|
|
|
container_name = "",
|
|
|
|
container_name = "",
|
|
|
|
environment,
|
|
|
|
environment,
|
|
|
|
volumes,
|
|
|
|
volumes,
|
|
|
|
|
|
|
|
networks,
|
|
|
|
ports,
|
|
|
|
ports,
|
|
|
|
profiles,
|
|
|
|
profiles,
|
|
|
|
labels
|
|
|
|
labels
|
|
|
|
@ -458,6 +462,7 @@ export const getInitialValues = (node?: IServiceNodeItem): IEditServiceForm => {
|
|
|
|
accessMode
|
|
|
|
accessMode
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
networks: (networks as string[]) ?? (initialValues.networks as string[]),
|
|
|
|
ports: ports0.map((port) => {
|
|
|
|
ports: ports0.map((port) => {
|
|
|
|
const slashIndex = port.lastIndexOf("/");
|
|
|
|
const slashIndex = port.lastIndexOf("/");
|
|
|
|
const protocol = slashIndex >= 0 ? port.substring(slashIndex + 1) : "";
|
|
|
|
const protocol = slashIndex >= 0 ? port.substring(slashIndex + 1) : "";
|
|
|
|
@ -475,7 +480,8 @@ export const getInitialValues = (node?: IServiceNodeItem): IEditServiceForm => {
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
profiles: profiles ?? initialValues.profiles,
|
|
|
|
profiles: profiles ?? initialValues.profiles,
|
|
|
|
labels:
|
|
|
|
labels:
|
|
|
|
extractObjectOrArray("=", "key", "value", labels) ?? initialValues.labels
|
|
|
|
extractObjectOrArray("=", "key", "value", labels) ?? initialValues.labels,
|
|
|
|
|
|
|
|
dependsOn: (depends_on as string[]) ?? (initialValues.dependsOn as string[])
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@ -486,9 +492,11 @@ export const getFinalValues = (
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
build,
|
|
|
|
build,
|
|
|
|
deploy,
|
|
|
|
deploy,
|
|
|
|
|
|
|
|
dependsOn,
|
|
|
|
environmentVariables,
|
|
|
|
environmentVariables,
|
|
|
|
ports,
|
|
|
|
ports,
|
|
|
|
profiles,
|
|
|
|
profiles,
|
|
|
|
|
|
|
|
networks,
|
|
|
|
volumes,
|
|
|
|
volumes,
|
|
|
|
labels
|
|
|
|
labels
|
|
|
|
} = values;
|
|
|
|
} = values;
|
|
|
|
@ -590,6 +598,7 @@ export const getFinalValues = (
|
|
|
|
(volume.accessMode ? `:${volume.accessMode}` : "")
|
|
|
|
(volume.accessMode ? `:${volume.accessMode}` : "")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
networks: pruneArray(networks),
|
|
|
|
ports: pruneArray(
|
|
|
|
ports: pruneArray(
|
|
|
|
ports.map(
|
|
|
|
ports.map(
|
|
|
|
(port) =>
|
|
|
|
(port) =>
|
|
|
|
@ -599,7 +608,8 @@ export const getFinalValues = (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
profiles: pruneArray(profiles),
|
|
|
|
profiles: pruneArray(profiles),
|
|
|
|
labels: packArrayAsObject(labels, "key", "value")
|
|
|
|
labels: packArrayAsObject(labels, "key", "value"),
|
|
|
|
|
|
|
|
depends_on: pruneArray(dependsOn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|