mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-15 14:11:46 +00:00
feat: make size editable (#562)
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
parent
532b6c4d50
commit
e3d30a0eec
@ -51,6 +51,7 @@ const FEATURE_FLAGS = {
|
|||||||
'v1.6.1': [],
|
'v1.6.1': [],
|
||||||
'v1.7.0': [
|
'v1.7.0': [
|
||||||
'vmMachineTypeAuto',
|
'vmMachineTypeAuto',
|
||||||
|
'lhV2VolExpansion',
|
||||||
'l2VlanTrunkMode'
|
'l2VlanTrunkMode'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@ -267,7 +267,19 @@ export default {
|
|||||||
|
|
||||||
rebuildStatus() {
|
rebuildStatus() {
|
||||||
return this.value.longhornEngine?.status?.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: {
|
watch: {
|
||||||
@ -463,7 +475,7 @@ export default {
|
|||||||
:output-modifier="true"
|
:output-modifier="true"
|
||||||
:increment="1024"
|
:increment="1024"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:disabled="value?.isLonghornV2 && isEdit"
|
:disabled="isResizeDisabled"
|
||||||
required
|
required
|
||||||
class="mb-20"
|
class="mb-20"
|
||||||
:suffix="GIBIBYTE"
|
:suffix="GIBIBYTE"
|
||||||
@ -471,7 +483,7 @@ export default {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Banner
|
<Banner
|
||||||
v-if="value?.isLonghornV2 && isEdit"
|
v-if="isResizeDisabled"
|
||||||
color="warning"
|
color="warning"
|
||||||
>
|
>
|
||||||
<span>{{ t('harvester.volume.longhorn.disableResize') }}</span>
|
<span>{{ t('harvester.volume.longhorn.disableResize') }}</span>
|
||||||
|
|||||||
@ -136,6 +136,10 @@ export default {
|
|||||||
pvcs() {
|
pvcs() {
|
||||||
return this.$store.getters['harvester/all'](PVC) || [];
|
return this.$store.getters['harvester/all'](PVC) || [];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isLHV2VolExpansionFeatureEnabled() {
|
||||||
|
return this.$store.getters['harvester-common/getFeatureEnabled']('lhV2VolExpansion');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@ -270,8 +274,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isResizeDisabled(volume) {
|
isResizeDisabled(volume) {
|
||||||
if (this.isCreate) return false;
|
if (this.isLHV2VolExpansionFeatureEnabled) return false;
|
||||||
if (volume.newCreateId) return false;
|
if (this.isCreate || volume.newCreateId) return false;
|
||||||
|
|
||||||
const isStopped = this.vm.stateDisplay === OFF;
|
const isStopped = this.vm.stateDisplay === OFF;
|
||||||
const isLonghornV2 = this.isLonghornV2(volume);
|
const isLonghornV2 = this.isLonghornV2(volume);
|
||||||
@ -406,7 +410,7 @@ export default {
|
|||||||
:label="ucFirst(value.volumeBackups.error.message)"
|
:label="ucFirst(value.volumeBackups.error.message)"
|
||||||
/>
|
/>
|
||||||
<Banner
|
<Banner
|
||||||
v-if="isLonghornV2(volume) && !isView"
|
v-if="!isLHV2VolExpansionFeatureEnabled && isLonghornV2(volume) && !isView"
|
||||||
color="warning"
|
color="warning"
|
||||||
:label="t('harvester.volume.longhorn.disableResize')"
|
:label="t('harvester.volume.longhorn.disableResize')"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user