diff --git a/src/api/types.ts b/src/api/types.ts index 9f3b197d..663e6bcd 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -523,6 +523,9 @@ export interface Plugin { // 是否已安装 installed?: boolean + + // 运行状态 + state?: boolean } // 种子信息 diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue index 81a8b6cc..564aa03c 100644 --- a/src/components/cards/PluginCard.vue +++ b/src/components/cards/PluginCard.vue @@ -14,7 +14,7 @@ const props = defineProps({ }) // 定义触发的自定义事件 -const emit = defineEmits(['remove']) +const emit = defineEmits(['remove', 'save']) // 提示框 const $toast = useToast() @@ -102,6 +102,8 @@ async function savePluginConf() { if (result.success) { $toast.success(`插件 ${props.plugin?.plugin_name} 配置已保存`) pluginConfigDialog.value = false + // 通知父组件刷新 + emit('save') } else { $toast.error(`插件 ${props.plugin?.plugin_name} 配置保存失败:${result.message}}`) @@ -192,7 +194,10 @@ const dropdownItems = ref([ - {{ props.plugin?.plugin_name }} + + + {{ props.plugin?.plugin_name }} + {{ props.plugin?.plugin_desc }} diff --git a/src/views/plugin/PluginCardListView.vue b/src/views/plugin/PluginCardListView.vue index a405f2e8..912e5cdd 100644 --- a/src/views/plugin/PluginCardListView.vue +++ b/src/views/plugin/PluginCardListView.vue @@ -71,6 +71,7 @@ onBeforeMount(fetchData) :key="data.id" :plugin="data" @remove="fetchData" + @save="fetchData" />