mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
feat: 添加自动刷新功能,每30秒更新工作流数据
This commit is contained in:
@@ -13,6 +13,9 @@ const appMode = inject('pwaMode') && display.mdAndDown.value
|
|||||||
// 是否刷新
|
// 是否刷新
|
||||||
const isRefreshed = ref(false)
|
const isRefreshed = ref(false)
|
||||||
|
|
||||||
|
// 自动刷新定时器
|
||||||
|
const autoRefresh = ref<NodeJS.Timeout | null>(null)
|
||||||
|
|
||||||
// 新增对话框
|
// 新增对话框
|
||||||
const addDialog = ref(false)
|
const addDialog = ref(false)
|
||||||
|
|
||||||
@@ -37,6 +40,13 @@ function addDone() {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData()
|
fetchData()
|
||||||
|
autoRefresh.value = setInterval(fetchData, 30000)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (autoRefresh.value) {
|
||||||
|
clearInterval(autoRefresh.value)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user