mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
Implement improveMaintenanceMode feature flag
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
parent
927e0505e0
commit
a694288162
@ -12,6 +12,7 @@ const featuresV132 = [
|
|||||||
'autoRotateRke2CertsSetting',
|
'autoRotateRke2CertsSetting',
|
||||||
'supportBundleNodeCollectionTimeoutSetting',
|
'supportBundleNodeCollectionTimeoutSetting',
|
||||||
'kubeconfigDefaultTokenTTLMinutesSetting',
|
'kubeconfigDefaultTokenTTLMinutesSetting',
|
||||||
|
'improveMaintenanceMode',
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: change to https://github.com/harvester/dashboard/releases/tag/v1.4.0 after v1.4.0 release
|
// TODO: change to https://github.com/harvester/dashboard/releases/tag/v1.4.0 after v1.4.0 release
|
||||||
@ -30,7 +31,7 @@ const featuresV140 = [
|
|||||||
'schedulingVMBackup',
|
'schedulingVMBackup',
|
||||||
'vmSnapshotQuota',
|
'vmSnapshotQuota',
|
||||||
'longhornV2LVMSupport',
|
'longhornV2LVMSupport',
|
||||||
'improveMaintainMode',
|
'improveMaintenanceMode',
|
||||||
];
|
];
|
||||||
|
|
||||||
export const RELEASE_FEATURES = {
|
export const RELEASE_FEATURES = {
|
||||||
|
|||||||
@ -37,6 +37,10 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({ t: 'i18n/t' }),
|
...mapGetters({ t: 'i18n/t' }),
|
||||||
|
|
||||||
|
improveMaintenanceModeFeatureEnabled() {
|
||||||
|
return this.$store.getters['harvester-common/getFeatureEnabled']('improveMaintenanceMode');
|
||||||
|
},
|
||||||
|
|
||||||
actionResource() {
|
actionResource() {
|
||||||
return this.resources[0];
|
return this.resources[0];
|
||||||
},
|
},
|
||||||
@ -73,8 +77,14 @@ export default {
|
|||||||
} else if (res._status === 200 || res._status === 204) {
|
} else if (res._status === 200 || res._status === 204) {
|
||||||
const res = await this.actionResource.doAction('listUnhealthyVM');
|
const res = await this.actionResource.doAction('listUnhealthyVM');
|
||||||
|
|
||||||
if (res?.length) {
|
let data = res;
|
||||||
this.unhealthyVMs = res;
|
|
||||||
|
if (!this.improveMaintenanceModeFeatureEnabled) {
|
||||||
|
data = res.message ? [res] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data?.length) {
|
||||||
|
this.unhealthyVMs = data;
|
||||||
buttonCb(false);
|
buttonCb(false);
|
||||||
} else {
|
} else {
|
||||||
await this.actionResource.doAction('enableMaintenanceMode', { force: 'false' });
|
await this.actionResource.doAction('enableMaintenanceMode', { force: 'false' });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user