fix: 数据迁移模块
This commit is contained in:
@@ -1611,7 +1611,9 @@ const handleDetailMigrateState = () => {
|
||||
loadDataMigrateProgress()
|
||||
startMigratePolling()
|
||||
}
|
||||
startDetailAutoRefresh()
|
||||
} else if (!vm.migrating) {
|
||||
stopDetailAutoRefresh()
|
||||
if (migratePollingTimer) {
|
||||
stopMigratePolling()
|
||||
dataMigrateProgressData.value = null
|
||||
@@ -2287,12 +2289,21 @@ const migrateProgressBarStatus = (stage) => {
|
||||
let migratePollingTimer = null
|
||||
const startMigratePolling = () => {
|
||||
stopMigratePolling()
|
||||
migratePollingTimer = setInterval(loadDataMigrateProgress, 5000)
|
||||
migratePollingTimer = setInterval(loadDataMigrateProgress, 3000)
|
||||
}
|
||||
const stopMigratePolling = () => {
|
||||
if (migratePollingTimer) { clearInterval(migratePollingTimer); migratePollingTimer = null }
|
||||
}
|
||||
|
||||
let detailAutoRefreshTimer = null
|
||||
const startDetailAutoRefresh = () => {
|
||||
if (detailAutoRefreshTimer) return
|
||||
detailAutoRefreshTimer = setInterval(() => { loadDetail() }, 3000)
|
||||
}
|
||||
const stopDetailAutoRefresh = () => {
|
||||
if (detailAutoRefreshTimer) { clearInterval(detailAutoRefreshTimer); detailAutoRefreshTimer = null }
|
||||
}
|
||||
|
||||
const abortLoading = ref(false)
|
||||
const handleAbortMigrate = () => {
|
||||
ElMessageBox.confirm('确定要中断当前数据迁移吗?此操作不可恢复!', '中断迁移', {
|
||||
@@ -3361,7 +3372,7 @@ onActivated(() => {
|
||||
if (loadedVmId !== vmId.value) initPage()
|
||||
})
|
||||
onDeactivated(() => { isPageActive = false; stopMigratePolling() })
|
||||
onBeforeUnmount(() => { isPageActive = false; disposeCharts(); stopMigratePolling() })
|
||||
onBeforeUnmount(() => { isPageActive = false; disposeCharts(); stopMigratePolling(); stopDetailAutoRefresh() })
|
||||
onMounted(() => { isPageActive = true; initPage() })
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user