mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-12 02:21:06 +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 autoRefresh = ref<NodeJS.Timeout | null>(null)
|
||||
|
||||
// 新增对话框
|
||||
const addDialog = ref(false)
|
||||
|
||||
@@ -37,6 +40,13 @@ function addDone() {
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
autoRefresh.value = setInterval(fetchData, 30000)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (autoRefresh.value) {
|
||||
clearInterval(autoRefresh.value)
|
||||
}
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
|
||||
Reference in New Issue
Block a user