mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
feat 插件重置
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.4.5",
|
"version": "1.4.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -143,6 +143,24 @@ const iconPath = computed(() => {
|
|||||||
: `/plugin_icon/${props.plugin?.plugin_icon}`
|
: `/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([
|
const dropdownItems = ref([
|
||||||
{
|
{
|
||||||
@@ -164,9 +182,19 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '卸载',
|
title: '重置',
|
||||||
value: 3,
|
value: 3,
|
||||||
show: true,
|
show: true,
|
||||||
|
props: {
|
||||||
|
prependIcon: 'mdi-cancel',
|
||||||
|
color: 'warning',
|
||||||
|
click: resetPlugin,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '卸载',
|
||||||
|
value: 4,
|
||||||
|
show: true,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-trash-can-outline',
|
prependIcon: 'mdi-trash-can-outline',
|
||||||
color: 'error',
|
color: 'error',
|
||||||
|
|||||||
Reference in New Issue
Block a user