mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-21 00:01:26 +08:00
Refactor site import/export feature with improved toast notifications
Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
@@ -11,10 +11,14 @@ import { useDisplay } from 'vuetify'
|
||||
import { useDynamicButton } from '@/composables/useDynamicButton'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { usePWA } from '@/composables/usePWA'
|
||||
import { useToast } from 'vue-toastification'
|
||||
|
||||
// 国际化
|
||||
const { t } = useI18n()
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 路由
|
||||
const route = useRoute()
|
||||
|
||||
@@ -260,15 +264,9 @@ async function exportSites() {
|
||||
URL.revokeObjectURL(url)
|
||||
|
||||
// 显示成功提示
|
||||
const { t } = useI18n()
|
||||
const { useToast } = await import('vue-toastification')
|
||||
const $toast = useToast()
|
||||
$toast.success(t('site.messages.exportSuccess'))
|
||||
} catch (error) {
|
||||
console.error('Export sites failed:', error)
|
||||
const { t } = useI18n()
|
||||
const { useToast } = await import('vue-toastification')
|
||||
const $toast = useToast()
|
||||
$toast.error(t('site.messages.exportFailed'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user