From e8865119ce0835b734df97b6979ea848e7183997 Mon Sep 17 00:00:00 2001 From: yazhou Date: Tue, 24 Sep 2024 17:24:55 +0800 Subject: [PATCH] feat: Add KUBESPHERE_EDITION constants to globals config Signed-off-by: yazhou --- packages/core/src/run.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/run.tsx b/packages/core/src/run.tsx index 9564882edcf..ec7e92c1cf0 100644 --- a/packages/core/src/run.tsx +++ b/packages/core/src/run.tsx @@ -17,10 +17,12 @@ import i18n from './utils/i18n'; import emitter from './utils/emitter'; import App from './App'; -import { isEmpty } from 'lodash'; +import { isEmpty, set } from 'lodash'; -globals.context = new Context(); +set(globals, 'config.isKsEdition', process.env.KUBESPHERE_EDITION === 'ks'); +set(globals, 'config.isKseEdition', process.env.KUBESPHERE_EDITION === 'kse'); +globals.context = new Context(); if (!isEmpty(globals?.ksConfig?.enabledExtensionModulesStatus)) { Object.entries(globals.ksConfig.enabledExtensionModulesStatus).forEach(([key, value]) => { if ((value as Record).annotations) {