Skip to content

Commit

Permalink
fix: fix addon opt version
Browse files Browse the repository at this point in the history
  • Loading branch information
laojun committed Sep 27, 2024
1 parent 124d1c1 commit 92e25f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion shell/app/modules/dcos/common/containers/terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ interface IProps {
containerId?: string;
instanceTerminal?: boolean;
clusterExist?: boolean;
instance?: any;
}

const ServiceTerminal = (props: IProps) => {
const { clusterName, instanceTerminal = false, host, user, port, containerId, clusterExist } = props;
const { clusterName, instanceTerminal = false, host, user, port, containerId, clusterExist, instance } = props;
const [clusterDetail, setClusterDetail] = React.useState<ORG_CLUSTER.ICluster | null>(null);
React.useEffect(() => {
if (clusterName && clusterExist !== true) {
Expand Down Expand Up @@ -65,6 +66,9 @@ const ServiceTerminal = (props: IProps) => {
host,
port: 2375,
container: containerId,
podName: instance?.podName,
namespace: instance?.podNamespace,
containerName: instance?.containerName,
},
};
if (!initData.args.host) {
Expand Down
4 changes: 2 additions & 2 deletions shell/app/modules/project/pages/addon/addon-category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const AddonCategory = () => {
})
.then(after);
} else {
const { addonName, name, plan, addonInstanceRoutingId, configs, importConfig } = values;
const { addonName, name, plan, optionVersion, addonInstanceRoutingId, configs, importConfig } = values;
const newAddonType = addonSpecList.find((a) => a.addonName === addonName);
let config = null;
if (importConfig) {
Expand Down Expand Up @@ -133,7 +133,7 @@ export const AddonCategory = () => {
addons: {
[name]: {
plan,
options: configs,
options: { ...(configs || {}), version: optionVersion },
},
},
workspace: values.workspace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ThirdAddonForm = (props: IProps) => {
itemProps: {
onChange(v: string) {
onFieldChange('addonName', v);
form.setFieldsValue({ plan: undefined });
form.setFieldsValue({ plan: undefined, optionVersion: undefined });
},
disabled: editData !== null || query.addon === AddonType.APIGateway,
},
Expand Down Expand Up @@ -117,6 +117,12 @@ const ThirdAddonForm = (props: IProps) => {
],
};
const appendField = [
{
label: i18n.t('version'),
name: 'optionVersion',
type: 'select',
options: curAddon.versions?.map((item: string) => ({ name: item, value: item })),
},
{
label: i18n.t('dop:Environment'),
name: 'workspace',
Expand Down
2 changes: 2 additions & 0 deletions shell/app/modules/project/types/custom-addon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare namespace CUSTOM_ADDON {
vars: string[] | null;
tenantVars: string[] | null;
version: string;
versions?: string[];
}

interface InsQuery {
Expand All @@ -53,6 +54,7 @@ declare namespace CUSTOM_ADDON {
workspace: string;
plan: Plan;
addonInstanceRoutingId?: string;
optionVersion?: string;
importConfig?: string;
}

Expand Down

0 comments on commit 92e25f1

Please sign in to comment.