diff --git a/frontend/src/stores/plugin.ts b/frontend/src/stores/plugin.ts index f9cb30bb345abc35dd659475c350d388ace40e06..ea9a594d0cd190b3acd163769205801304b4059a 100644 --- a/frontend/src/stores/plugin.ts +++ b/frontend/src/stores/plugin.ts @@ -10,13 +10,21 @@ import type { Extention } from "@/types/plugin"; export const usePluginStore = defineStore("plugin", { state: () => { return { - extention: [] as Extention[], + extention: [] as any[], }; }, actions: { addExtention(pluginExt: Extention[]) { // 添加扩展点 - this.extention = pluginExt; + const map = new Map(); + [...this.extention, ...pluginExt].forEach((item) => { + if (!map.has(item.name)) { + map.set(item.name, item); + } + }); + let result = Array.from(map.values()); + + this.extention = result; }, delExtention(pluginExt: Extention[]) { // 删除扩展点 diff --git a/frontend/src/views/Cluster/Cluster.vue b/frontend/src/views/Cluster/Cluster.vue index 77ad59815f9a77fe78af0259a8c40681861d443d..a787224de820931778360945a84c0d7fb27dd75b 100644 --- a/frontend/src/views/Cluster/Cluster.vue +++ b/frontend/src/views/Cluster/Cluster.vue @@ -53,10 +53,24 @@ 删除 - - + + + + {{ item.name }} + + + {{ item.name }} + + {{ item.name }} @@ -119,6 +133,8 @@ import { RespCodeOK, type RespInterface } from "@/request/request"; import { usePluginStore } from "@/stores/plugin"; import { useTerminalStore } from "@/stores/terminal"; import { updatePlugins } from "@/views/Plugin/plugin"; +import { hasPermisson } from "@/module/permission"; +import type { Extention } from "@/types/plugin"; // 部门树 const departmentID = ref(1); diff --git a/frontend/src/views/Plugin/Plugin.vue b/frontend/src/views/Plugin/Plugin.vue index 0e54de7b3169af5fb3a5d0e6902b10f200dd661c..d264f170d090c95664f518484fbe00db1fd3eb1c 100644 --- a/frontend/src/views/Plugin/Plugin.vue +++ b/frontend/src/views/Plugin/Plugin.vue @@ -9,7 +9,7 @@
@@ -56,12 +58,12 @@ import { ElMessage } from "element-plus"; import PGTable from "@/components/PGTable.vue"; import AddPlugin from "./components/AddPlugin.vue"; +import AuthButton from "@/components/AuthButton.vue"; import { updatePlugins } from "./plugin"; import { getPluginsPaged, togglePlugin, deletePlugins } from "@/request/plugin"; import { RespCodeOK } from "@/request/request"; -import type { Extention } from "@/types/plugin"; -import { usePluginStore } from "@/stores/plugin"; + const displayDialog = ref(false); const plugins = ref([]); diff --git a/frontend/src/views/Role/components/authData.ts b/frontend/src/views/Role/components/authData.ts index cf44c0f39b443252fff8c86daeb588c57c0a201b..1ea102ce6a7ceaf49ebaa9df2f3e04c3173d27f1 100644 --- a/frontend/src/views/Role/components/authData.ts +++ b/frontend/src/views/Role/components/authData.ts @@ -5,7 +5,7 @@ * Author: Gzx1999 * Date: Wed Jan 3 18:00:12 2024 +0800 */ -// 整个系统需要控制权限的按钮配置项 当前24 +// 整个系统需要控制权限的按钮配置项 当前29 // 需要做动态添加插件权限逻辑 @@ -215,26 +215,57 @@ export let authData = [ isMenu: true, display: true, menuName: "plugin", - operations: [], + operations: [ + { + id: "22", + btnId: "15", + label: "插件操作", + menuName: "plugin_operate", + }, + ], }, { id: "9", label: "监控告警", isMenu: true, - display: false, + display: true, menuName: "monitor", operations: [ - { - id: "22", - btnId: "15", - label: "安装expoter", - menuName: "expoter_install", - }, { id: "23", btnId: "16", - label: "卸载expoter", - menuName: "expoter_uninstall", + label: "监控操作", + menuName: "monitor_operate", + }, + ], + }, + { + id: "10", + label: "主机日志", + isMenu: true, + display: true, + menuName: "logs", + operations: [ + { + id: "30", + btnId: "23", + label: "日志操作", + menuName: "logs_operate", + }, + ], + }, + { + id: "11", + label: "集群拓扑", + isMenu: true, + display: true, + menuName: "topo", + operations: [ + { + id: "31", + btnId: "24", + label: "拓扑操作", + menuName: "topology_operate", }, ], },