mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
feat: gray out class name selector
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
parent
208f1f29f5
commit
72415622d9
@ -75,7 +75,11 @@ export default {
|
|||||||
const csiDrivers = this.$store.getters[`${ inStore }/all`](CSI_DRIVER) || [];
|
const csiDrivers = this.$store.getters[`${ inStore }/all`](CSI_DRIVER) || [];
|
||||||
|
|
||||||
return this.configArr.length >= csiDrivers.length;
|
return this.configArr.length >= csiDrivers.length;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
allowEmptySnapshotClassNameFeatureEnabled() {
|
||||||
|
return this.$store.getters['harvester-common/getFeatureEnabled']('allowEmptySnapshotClassName');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -139,7 +143,7 @@ export default {
|
|||||||
errors.push(this.t('validation.required', { key: this.t('harvester.setting.csiDriverConfig.volumeSnapshotClassName') }, true));
|
errors.push(this.t('validation.required', { key: this.t('harvester.setting.csiDriverConfig.volumeSnapshotClassName') }, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.value.backupVolumeSnapshotClassName) {
|
if (!this.allowEmptySnapshotClassNameFeatureEnabled && !config.value.backupVolumeSnapshotClassName) {
|
||||||
errors.push(this.t('validation.required', { key: this.t('harvester.setting.csiDriverConfig.backupVolumeSnapshotClassName') }, true));
|
errors.push(this.t('validation.required', { key: this.t('harvester.setting.csiDriverConfig.backupVolumeSnapshotClassName') }, true));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -162,6 +166,12 @@ export default {
|
|||||||
return driver === LONGHORN_DRIVER;
|
return driver === LONGHORN_DRIVER;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isBackupVolumeSnapshotClassNameDisabled(driver) {
|
||||||
|
if (this.allowEmptySnapshotClassNameFeatureEnabled) return true;
|
||||||
|
|
||||||
|
return driver === LONGHORN_DRIVER;
|
||||||
|
},
|
||||||
|
|
||||||
add() {
|
add() {
|
||||||
this.configArr.push({
|
this.configArr.push({
|
||||||
key: '',
|
key: '',
|
||||||
@ -227,7 +237,8 @@ export default {
|
|||||||
v-model:value="driver.value.backupVolumeSnapshotClassName"
|
v-model:value="driver.value.backupVolumeSnapshotClassName"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
required
|
required
|
||||||
:disabled="disableEdit(driver.key)"
|
:disabled="isBackupVolumeSnapshotClassNameDisabled(driver.key)"
|
||||||
|
:selectable="!allowEmptySnapshotClassNameFeatureEnabled"
|
||||||
:options="getVolumeSnapshotOptions(driver.key)"
|
:options="getVolumeSnapshotOptions(driver.key)"
|
||||||
:label="t('harvester.setting.csiDriverConfig.backupVolumeSnapshotClassName')"
|
:label="t('harvester.setting.csiDriverConfig.backupVolumeSnapshotClassName')"
|
||||||
@keydown.native.enter.prevent="()=>{}"
|
@keydown.native.enter.prevent="()=>{}"
|
||||||
|
|||||||
@ -43,7 +43,8 @@ const featuresV141 = [
|
|||||||
// TODO: add v1.4.2 official release note
|
// TODO: add v1.4.2 official release note
|
||||||
const featuresV142 = [
|
const featuresV142 = [
|
||||||
...featuresV141,
|
...featuresV141,
|
||||||
'refreshIntervalInSecond'
|
'refreshIntervalInSecond',
|
||||||
|
'allowEmptySnapshotClassName'
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: add v1.5.0 official release note
|
// TODO: add v1.5.0 official release note
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user