feat: [ENHANCEMENT] Add setting upgrade-config to UI(#8369) (#347)

Signed-off-by: Nick Chung <nick.chung@suse.com>
This commit is contained in:
Nick Chung
2025-07-01 11:14:56 +08:00
committed by GitHub
parent be421054d8
commit dc683a50a4
8 changed files with 226 additions and 6 deletions
+21 -1
View File
@@ -6,6 +6,8 @@ import LabeledSelect from '@shell/components/form/LabeledSelect';
import { TextAreaAutoGrow } from '@components/Form/TextArea';
import UnitInput from '@shell/components/form/UnitInput';
import CreateEditView from '@shell/mixins/create-edit-view';
import { DOC } from '../config/doc-links';
import { docLink } from '../utils/feature-flags';
import { HCI_ALLOWED_SETTINGS, HCI_SINGLE_CLUSTER_ALLOWED_SETTING, HCI_SETTING } from '../config/settings';
@@ -58,7 +60,13 @@ export default {
return {
setting,
description: isHarvester ? t(`advancedSettings.descriptions.harv-${ this.value.id }`) : t(`advancedSettings.descriptions.${ this.value.id }`),
description: isHarvester ? t(
`advancedSettings.descriptions.harv-${ this.value.id }`,
this.getDocLinkParams()
) : t(
`advancedSettings.descriptions.${ this.value.id }`,
this.getDocLinkParams()
),
editHelp: t(`advancedSettings.editHelp.${ this.value.id }`),
enumOptions,
canReset,
@@ -171,6 +179,18 @@ export default {
if (typeof this.$refs.settingComp?.useDefault === 'function') {
this.$refs.settingComp.useDefault();
}
},
getDocLinkParams() {
const setting = HCI_ALLOWED_SETTINGS[this.value.id] || HCI_SINGLE_CLUSTER_ALLOWED_SETTING[this.value.id];
if (setting?.docPath) {
const version = this.$store.getters['harvester-common/getServerVersion']();
const url = docLink(DOC[setting.docPath], version);
return { url };
}
return {};
}
}
};