This is an automated email from the ASF dual-hosted git repository.

kerwin612 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 1cb60104 [type:fix]Fix pluginList data synchronization bug (#461)
1cb60104 is described below

commit 1cb60104cd6e862f68888136cd498a4805940da5
Author: xcsnx <1192709...@qq.com>
AuthorDate: Thu Jul 25 08:36:58 2024 +0800

    [type:fix]Fix pluginList data synchronization bug (#461)
    
    * fix pluginList sync bug
    
    * fix cr
    
    ---------
    
    Co-authored-by: ‘xcsnx’ <‘1192709...@qq.com’>
---
 src/locales/zh-CN.json |  2 +-
 src/models/plugin.js   | 10 ----------
 src/services/api.js    | 17 +++++++----------
 3 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index d71cf9c3..6ef2c2b7 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -70,7 +70,7 @@
   "SHENYU.MENU.SYSTEM.MANAGMENT.USER": "用户管理",
   "SHENYU.MENU.SYSTEM.MANAGMENT.RESOURCE": "资源管理",
   "SHENYU.MENU.SYSTEM.MANAGMENT.ALERT": "告警管理",
-  "SHENYU.MENU.SYSTEM.MANAGMENT.PLUGIN": "插件模板管理",
+  "SHENYU.MENU.SYSTEM.MANAGMENT.PLUGIN": "插件元数据管理",
   "SHENYU.MENU.SYSTEM.MANAGMENT.PLUGINHANDLE": "插件处理管理",
   "SHENYU.MENU.SYSTEM.MANAGMENT.AUTHEN": "认证管理",
   "SHENYU.MENU.SYSTEM.MANAGMENT.METADATA": "元数据管理",
diff --git a/src/models/plugin.js b/src/models/plugin.js
index 583cf369..8e9544fb 100644
--- a/src/models/plugin.js
+++ b/src/models/plugin.js
@@ -22,7 +22,6 @@ import {
   updatePlugin,
   deletePlugin,
   addPlugin,
-  asyncPlugin,
   updatepluginEnabled,
   fetchPluginHandleByPluginId,
   addPluginResource,
@@ -141,15 +140,6 @@ export default {
       yield put({ type: "fetch", payload });
     },
 
-    *asyncAll(_, { call }) {
-      const json = yield call(asyncPlugin);
-      if (json.code === 200) {
-        message.success(getIntlContent("SHENYU.COMMON.RESPONSE.SYNC.SUCCESS"));
-      } else {
-        message.warn(json.message);
-      }
-    },
-
     *fetchByPluginId(params, { call }) {
       const { payload, callback } = params;
       const json = yield call(fetchPluginHandleByPluginId, payload);
diff --git a/src/services/api.js b/src/services/api.js
index c793896d..13ebd5f6 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -533,13 +533,6 @@ export async function querySecretInfo() {
   return fetch(`${baseUrl}/platform/secretInfo`).catch(() => {});
 }
 
-// sync all plugin
-export async function asyncPlugin() {
-  return request(`${baseUrl}/plugin/syncPluginAll`, {
-    method: `POST`,
-  });
-}
-
 // export all config
 export async function asyncConfigExport() {
   return download(`${baseUrl}/configs/export`, {
@@ -559,9 +552,13 @@ export async function asyncConfigImport(params) {
 
 // 同步单个插件
 export async function asyncOnePlugin(params) {
-  return request(`${baseUrl}/plugin/syncPluginData/${params.id}`, {
-    method: `PUT`,
-  });
+  // todo:[To be refactored with namespace] Temporarily hardcode
+  return request(
+    
`${baseUrl}/namespacePlugin/syncPluginData/id=${params.id}&namespaceId=649330b6-c2d7-4edc-be8e-8a54df9eb385`,
+    {
+      method: `PUT`,
+    },
+  );
 }
 
 // get plugin dropdown list

Reply via email to