add harvester-common/getFeatureEnabled store function

This commit is contained in:
andy.lee 2024-11-07 18:12:27 +08:00 committed by Francesco Torchia
parent 77d7f13836
commit 4c981f6380
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
6 changed files with 11 additions and 6 deletions

View File

@ -247,7 +247,7 @@ export default {
<div class="row mb-20">
<div
v-if="!value.isEtcd && value.isCPUManagerEnabled"
v-if="!value.isEtcd && value.cpuPinningFeatureEnabled"
class="col span-6"
>
<LabelValue

View File

@ -15,7 +15,7 @@ import { ucFirst } from '@shell/utils/string';
import HarvesterResource from '../harvester';
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester';
import { HCI } from '../../types';
import { featureEnabled } from '../../utils/server';
import { featureEnabled } from '../../utils/feature-flags';
const ALLOW_SYSTEM_LABEL_KEYS = [
'topology.kubernetes.io/zone',

View File

@ -14,7 +14,7 @@ import { BACKUP_TYPE } from '../config/types';
import { HCI } from '../types';
import HarvesterResource from './harvester';
import { LVM_DRIVER } from './harvester/storage.k8s.io.storageclass';
import { featureEnabled } from '../utils/server';
import { featureEnabled } from '../utils/feature-flags';
export const OFF = 'Off';

View File

@ -1,6 +1,7 @@
import Parse from 'url-parse';
import { HCI } from '../types';
import { PRODUCT_NAME } from '../config/harvester';
import { featureEnabled } from '../utils/feature-flags';
const state = function() {
return {
@ -39,7 +40,7 @@ const mutations = {
},
uploadEnd(state, value) {
const filtered = state.uploadingImages.filter(l => l !== value);
const filtered = state.uploadingImages.filter((l) => l !== value);
state['uploadingImages'] = filtered;
}
@ -67,7 +68,11 @@ const getters = {
},
uploadingImageError(state) {
return name => state.uploadingImageError[name];
return (name) => state.uploadingImageError[name];
},
getFeatureEnabled: (_state, _getters, _rootState, rootGetters) => (feature) => {
return featureEnabled(rootGetters, feature);
},
getHarvesterClusterUrl: (state, getters, rootState, rootGetters) => (url) => {