From 47ac7437c0b5fb41c40f98765889922b9cf2b27f Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 8 Sep 2023 15:36:54 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types.ts | 3 +++ src/components/cards/PluginCard.vue | 37 +++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/api/types.ts b/src/api/types.ts index b8cc0977..5f1762b3 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -526,6 +526,9 @@ export interface Plugin { // 运行状态 state?: boolean + + // 是否有详情页面 + has_page?: boolean } // 种子信息 diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue index 57ea2f73..672c06bf 100644 --- a/src/components/cards/PluginCard.vue +++ b/src/components/cards/PluginCard.vue @@ -119,6 +119,8 @@ async function savePluginConf() { // 显示插件详情 async function showPluginInfo() { + // 加载详情 + await loadPluginPage() pluginConfigDialog.value = false pluginInfoDialog.value = true } @@ -129,17 +131,35 @@ async function showPluginConfig() { await loadPluginForm() // 加载配置 await loadPluginConf() - // 加载详情 - await loadPluginPage() // 显示对话框 + pluginInfoDialog.value = false pluginConfigDialog.value = true } // 弹出菜单 const dropdownItems = ref([ { - title: '卸载', + title: '查看详情', value: 1, + show: props.plugin?.has_page, + props: { + prependIcon: 'mdi-information-outline', + click: showPluginInfo, + }, + }, + { + title: '插件配置', + value: 2, + show: true, + props: { + prependIcon: 'mdi-cog-outline', + click: showPluginConfig, + }, + }, + { + title: '卸载插件', + value: 3, + show: true, props: { prependIcon: 'mdi-trash-can-outline', color: 'error', @@ -155,7 +175,12 @@ const dropdownItems = ref([ v-if="isVisible" :width="props.width" :height="props.height" - @click="showPluginConfig" + @click="() => { + if (props.plugin?.has_page) + showPluginInfo() + else + showPluginConfig() + }" >
+ + 配置 + 关闭