diff --git a/package.json b/package.json index 00dc6539..c7881438 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.4.5", + "version": "1.4.6", "private": true, "bin": "dist/service.js", "scripts": { diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue index 391ce7e8..ada25cef 100644 --- a/src/components/cards/PluginCard.vue +++ b/src/components/cards/PluginCard.vue @@ -143,6 +143,24 @@ const iconPath = computed(() => { : `/plugin_icon/${props.plugin?.plugin_icon}` }) +// 重置插件 +async function resetPlugin() { + try { + const result: { [key: string]: any } = await api.get(`plugin/reset/${props.plugin?.id}`) + if (result.success) { + $toast.success(`插件 ${props.plugin?.plugin_name} 数据已重置`) + // 通知父组件刷新 + emit('save') + } + else { + $toast.error(`插件 ${props.plugin?.plugin_name} 重置失败:${result.message}}`) + } + } + catch (error) { + console.error(error) + } +} + // 弹出菜单 const dropdownItems = ref([ { @@ -164,9 +182,19 @@ const dropdownItems = ref([ }, }, { - title: '卸载', + title: '重置', value: 3, show: true, + props: { + prependIcon: 'mdi-cancel', + color: 'warning', + click: resetPlugin, + }, + }, + { + title: '卸载', + value: 4, + show: true, props: { prependIcon: 'mdi-trash-can-outline', color: 'error',