feat: make size editable (#562)

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
Yiya Chen 2025-10-17 15:36:36 +08:00 committed by GitHub
parent 532b6c4d50
commit e3d30a0eec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 6 deletions

View File

@ -51,6 +51,7 @@ const FEATURE_FLAGS = {
'v1.6.1': [],
'v1.7.0': [
'vmMachineTypeAuto',
'lhV2VolExpansion',
'l2VlanTrunkMode'
]
};

View File

@ -267,7 +267,19 @@ export default {
rebuildStatus() {
return this.value.longhornEngine?.status?.rebuildStatus;
}
},
isLHV2VolExpansionFeatureEnabled() {
return this.$store.getters['harvester-common/getFeatureEnabled']('lhV2VolExpansion');
},
isResizeDisabled() {
return (
!this.isLHV2VolExpansionFeatureEnabled &&
this.value?.isLonghornV2 &&
this.isEdit
);
},
},
watch: {
@ -463,7 +475,7 @@ export default {
:output-modifier="true"
:increment="1024"
:mode="mode"
:disabled="value?.isLonghornV2 && isEdit"
:disabled="isResizeDisabled"
required
class="mb-20"
:suffix="GIBIBYTE"
@ -471,7 +483,7 @@ export default {
/>
<Banner
v-if="value?.isLonghornV2 && isEdit"
v-if="isResizeDisabled"
color="warning"
>
<span>{{ t('harvester.volume.longhorn.disableResize') }}</span>

View File

@ -136,6 +136,10 @@ export default {
pvcs() {
return this.$store.getters['harvester/all'](PVC) || [];
},
isLHV2VolExpansionFeatureEnabled() {
return this.$store.getters['harvester-common/getFeatureEnabled']('lhV2VolExpansion');
},
},
watch: {
@ -270,8 +274,8 @@ export default {
},
isResizeDisabled(volume) {
if (this.isCreate) return false;
if (volume.newCreateId) return false;
if (this.isLHV2VolExpansionFeatureEnabled) return false;
if (this.isCreate || volume.newCreateId) return false;
const isStopped = this.vm.stateDisplay === OFF;
const isLonghornV2 = this.isLonghornV2(volume);
@ -406,7 +410,7 @@ export default {
:label="ucFirst(value.volumeBackups.error.message)"
/>
<Banner
v-if="isLonghornV2(volume) && !isView"
v-if="!isLHV2VolExpansionFeatureEnabled && isLonghornV2(volume) && !isView"
color="warning"
:label="t('harvester.volume.longhorn.disableResize')"
/>