From 59402b19dd9a0fbcb1de3f6f958ffc683717811b Mon Sep 17 00:00:00 2001 From: bwcx_jzy Date: Tue, 2 Jan 2024 17:46:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=87=8D=E6=96=B0=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=A1=B9=E7=9B=AE=E3=80=81=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=BC=93=E5=AD=98=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG-BETA.md | 1 + .../node/NodeProjectInfoController.java | 17 -------- .../node/script/NodeScriptController.java | 16 ------- .../system/WorkspaceController.java | 1 - web-vue/src/api/node-other.js | 9 ---- web-vue/src/api/node.js | 9 ---- web-vue/src/pages/node/script-list.vue | 42 +++++++------------ web-vue/src/pages/node/search.vue | 21 ++++++---- 8 files changed, 28 insertions(+), 88 deletions(-) diff --git a/CHANGELOG-BETA.md b/CHANGELOG-BETA.md index cf3d2ca27..241763ac3 100644 --- a/CHANGELOG-BETA.md +++ b/CHANGELOG-BETA.md @@ -5,6 +5,7 @@ ### 🐞 解决BUG、优化功能 1. 【server】修复 工作空间菜单配置无法使用(感谢@新) +2. 【server】优化 重新同步节点项目、节点脚本缓存交互 ------ diff --git a/modules/server/src/main/java/org/dromara/jpom/controller/node/NodeProjectInfoController.java b/modules/server/src/main/java/org/dromara/jpom/controller/node/NodeProjectInfoController.java index da28858c7..f03440725 100644 --- a/modules/server/src/main/java/org/dromara/jpom/controller/node/NodeProjectInfoController.java +++ b/modules/server/src/main/java/org/dromara/jpom/controller/node/NodeProjectInfoController.java @@ -24,7 +24,6 @@ package org.dromara.jpom.controller.node; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.db.Entity; import cn.keepbx.jpom.IJsonMessage; import cn.keepbx.jpom.model.JsonMessage; import lombok.extern.slf4j.Slf4j; @@ -40,7 +39,6 @@ import org.dromara.jpom.model.user.UserModel; import org.dromara.jpom.permission.ClassFeature; import org.dromara.jpom.permission.Feature; import org.dromara.jpom.permission.MethodFeature; -import org.dromara.jpom.permission.SystemPermission; import org.dromara.jpom.service.node.ProjectInfoCacheService; import org.dromara.jpom.service.user.TriggerTokenLogServer; import org.springframework.http.MediaType; @@ -127,21 +125,6 @@ public class NodeProjectInfoController extends BaseServerController { return JsonMessage.success("主动清除:" + count + StrUtil.SPACE + msg); } - /** - * 删除节点缓存的所有项目 - * - * @return json - */ - @GetMapping(value = "clear_all_project", produces = MediaType.APPLICATION_JSON_VALUE) - @SystemPermission(superUser = true) - @Feature(cls = ClassFeature.PROJECT, method = MethodFeature.DEL) - public IJsonMessage clearAll() { - Entity where = Entity.create(); - where.set("id", " <> id"); - int del = projectInfoCacheService.del(where); - return JsonMessage.success("成功删除" + del + "条项目缓存"); - } - /** * 排序 * diff --git a/modules/server/src/main/java/org/dromara/jpom/controller/node/script/NodeScriptController.java b/modules/server/src/main/java/org/dromara/jpom/controller/node/script/NodeScriptController.java index fb6ab59e3..8a7bf2bef 100644 --- a/modules/server/src/main/java/org/dromara/jpom/controller/node/script/NodeScriptController.java +++ b/modules/server/src/main/java/org/dromara/jpom/controller/node/script/NodeScriptController.java @@ -24,7 +24,6 @@ package org.dromara.jpom.controller.node.script; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.db.Entity; import cn.keepbx.jpom.IJsonMessage; import cn.keepbx.jpom.model.JsonMessage; import org.dromara.jpom.common.BaseServerController; @@ -138,21 +137,6 @@ public class NodeScriptController extends BaseServerController { return JsonMessage.success("主动清除 " + cache + StrUtil.SPACE + msg); } - /** - * 删除节点缓存的所有脚本模版 - * - * @return json - */ - @GetMapping(value = "clear_all", produces = MediaType.APPLICATION_JSON_VALUE) - @SystemPermission(superUser = true) - @Feature(method = MethodFeature.DEL) - public IJsonMessage clearAll() { - Entity where = Entity.create(); - where.set("id", " <> id"); - int del = nodeScriptServer.del(where); - return JsonMessage.success("成功删除" + del + "条脚本模版缓存"); - } - /** * 释放脚本关联的节点 * diff --git a/modules/server/src/main/java/org/dromara/jpom/controller/system/WorkspaceController.java b/modules/server/src/main/java/org/dromara/jpom/controller/system/WorkspaceController.java index 5a2413b2b..18a5c3ad9 100644 --- a/modules/server/src/main/java/org/dromara/jpom/controller/system/WorkspaceController.java +++ b/modules/server/src/main/java/org/dromara/jpom/controller/system/WorkspaceController.java @@ -292,7 +292,6 @@ public class WorkspaceController extends BaseServerController { //"classpath:/menus/index.json" //"classpath:/menus/node-index.json" config.put("serverMenus", this.readMenusJson("classpath:/menus/index.json")); - config.put("nodeMenus", this.readMenusJson("classpath:/menus/node-index.json")); return JsonMessage.success("", config); } diff --git a/web-vue/src/api/node-other.js b/web-vue/src/api/node-other.js index aa23178b4..af760cc7a 100644 --- a/web-vue/src/api/node-other.js +++ b/web-vue/src/api/node-other.js @@ -107,15 +107,6 @@ export function deleteScript(params) { }); } -// 删除节点脚本模版缓存 -export function delAllCache() { - return axios({ - url: "/node/script/clear_all", - method: "get", - params: {}, - }); -} - /** * 解绑 Script * @param {id} params diff --git a/web-vue/src/api/node.js b/web-vue/src/api/node.js index 0d3600518..0f14ce5d7 100644 --- a/web-vue/src/api/node.js +++ b/web-vue/src/api/node.js @@ -94,15 +94,6 @@ export function sortItem(params) { }); } -// 删除节点项目缓存 -export function delAllProjectCache() { - return axios({ - url: "/node/clear_all_project", - method: "get", - params: {}, - }); -} - // 项目排序 export function sortItemProject(params) { return axios({ diff --git a/web-vue/src/pages/node/script-list.vue b/web-vue/src/pages/node/script-list.vue index 95ab12fd9..f6474ae15 100644 --- a/web-vue/src/pages/node/script-list.vue +++ b/web-vue/src/pages/node/script-list.vue @@ -15,12 +15,16 @@ 新增 - - 重新同步 - - - 删除缓存 - + + 同步缓存 + + + {{ nodeName }} + + + + 同步缓存 +