From c56514b063110c7bc43f5838430af6f79d6646ca Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 28 May 2024 20:33:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(X-Pack):=20xpack=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=88=86=E7=A6=BB=E9=83=A8=E7=BD=B2=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/home/RestIndexController.java | 11 ++++ core/core-frontend/src/api/plugin.ts | 4 ++ .../src/components/plugin/src/index.vue | 66 ++++++++++--------- .../core-frontend/src/config/axios/service.ts | 2 + de-xpack | 2 +- .../io/dataease/utils/WhitelistUtils.java | 1 + 6 files changed, 55 insertions(+), 31 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java index bebb41227d..ce541e1d53 100644 --- a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java +++ b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java @@ -2,6 +2,7 @@ package io.dataease.home; import io.dataease.utils.ModelUtils; import io.dataease.utils.RsaUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -11,6 +12,9 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping public class RestIndexController { + @Value("${dataease.xpack-front-distributed:false}") + private boolean xpackFrontDistributed; + @GetMapping("/dekey") @ResponseBody public String dekey() { @@ -23,4 +27,11 @@ public class RestIndexController { return ModelUtils.isDesktop(); } + + @GetMapping("/xpackModel") + @ResponseBody + public boolean xpackModel() { + return xpackFrontDistributed; + } + } diff --git a/core/core-frontend/src/api/plugin.ts b/core/core-frontend/src/api/plugin.ts index 5eef5c9ca1..b708650759 100644 --- a/core/core-frontend/src/api/plugin.ts +++ b/core/core-frontend/src/api/plugin.ts @@ -1,3 +1,7 @@ import request from '@/config/axios' export const load = (key: string) => request.get({ url: `/xpackComponent/content/${key}` }) + +export const loadDistributed = () => request.get({ url: '/DEXPack.umd.js' }) + +export const xpackModelApi = () => request.get({ url: '/xpackModel' }) diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index e2825f2eeb..6197cca108 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -1,10 +1,9 @@