mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
feat 插件操作确认
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.4.6",
|
"version": "1.4.6-1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin } from '@/api/types'
|
import type { Plugin } from '@/api/types'
|
||||||
import FormRender from '@/components/render/FormRender.vue'
|
import FormRender from '@/components/render/FormRender.vue'
|
||||||
@@ -19,6 +20,9 @@ const emit = defineEmits(['remove', 'save'])
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 确认框
|
||||||
|
const createConfirm = useConfirm()
|
||||||
|
|
||||||
// 本身是否可见
|
// 本身是否可见
|
||||||
const isVisible = ref(true)
|
const isVisible = ref(true)
|
||||||
|
|
||||||
@@ -42,6 +46,22 @@ const isImageLoaded = ref(false)
|
|||||||
|
|
||||||
// 调用API卸载插件
|
// 调用API卸载插件
|
||||||
async function uninstallPlugin() {
|
async function uninstallPlugin() {
|
||||||
|
const isConfirmed = await createConfirm({
|
||||||
|
title: '确认',
|
||||||
|
content: `是否确认卸载插件 ${props.plugin?.plugin_name} ?`,
|
||||||
|
confirmationText: '确认',
|
||||||
|
cancellationText: '取消',
|
||||||
|
dialogProps: {
|
||||||
|
maxWidth: '50rem',
|
||||||
|
},
|
||||||
|
confirmationButtonProps: {
|
||||||
|
variant: 'tonal',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isConfirmed)
|
||||||
|
return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.delete(`plugin/${props.plugin?.id}`)
|
const result: { [key: string]: any } = await api.delete(`plugin/${props.plugin?.id}`)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
@@ -145,6 +165,22 @@ const iconPath = computed(() => {
|
|||||||
|
|
||||||
// 重置插件
|
// 重置插件
|
||||||
async function resetPlugin() {
|
async function resetPlugin() {
|
||||||
|
const isConfirmed = await createConfirm({
|
||||||
|
title: '确认',
|
||||||
|
content: `是否确认重置插件 ${props.plugin?.plugin_name} 的配置数据?`,
|
||||||
|
confirmationText: '确认',
|
||||||
|
cancellationText: '取消',
|
||||||
|
dialogProps: {
|
||||||
|
maxWidth: '50rem',
|
||||||
|
},
|
||||||
|
confirmationButtonProps: {
|
||||||
|
variant: 'tonal',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isConfirmed)
|
||||||
|
return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get(`plugin/reset/${props.plugin?.id}`)
|
const result: { [key: string]: any } = await api.get(`plugin/reset/${props.plugin?.id}`)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user