[>("activeTab", activeTab);
-const settingName = computed(() => plugin.value?.spec.settingName);
-const configMapName = computed(() => plugin.value?.spec.configMapName);
-
const { isStarted } = usePluginLifeCycle(plugin);
-const { setting, handleFetchSettings } = useSettingForm(
- settingName,
- configMapName
-);
-
const handleFetchPlugin = async () => {
try {
const response =
@@ -80,6 +69,14 @@ const handleFetchPlugin = async () => {
}
};
+const handleFetchSettings = async () => {
+ if (!plugin.value) return;
+ const { data } = await apiClient.plugin.fetchPluginSetting({
+ name: plugin.value?.metadata.name,
+ });
+ setting.value = data;
+};
+
const handleTabChange = (id: string) => {
const tab = tabs.value.find((item) => item.id === id);
if (tab) {
@@ -110,7 +107,7 @@ const handleTriggerTabChange = () => {
onMounted(async () => {
await handleFetchPlugin();
- if (!currentUserHasPermission(["system:settings:view"])) {
+ if (!currentUserHasPermission(["system:plugins:manage"])) {
handleTriggerTabChange();
return;
}
@@ -161,9 +158,6 @@ watch([() => route.name, () => route.params], () => {
size="sm"
/>
-
- 安装
-
]
diff --git a/src/modules/system/plugins/module.ts b/src/modules/system/plugins/module.ts
index dec39294..3b6a5b51 100644
--- a/src/modules/system/plugins/module.ts
+++ b/src/modules/system/plugins/module.ts
@@ -56,7 +56,7 @@ export default definePlugin({
component: PluginSetting,
meta: {
title: "插件设置",
- permissions: ["system:settings:view"],
+ permissions: ["system:plugins:manage"],
},
},
],