fixed loop error
This commit is contained in:
parent
c56a146def
commit
56fe2afb1a
2 changed files with 11 additions and 5 deletions
|
@ -220,6 +220,8 @@ const fetchSettings = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
let intervalId: NodeJS.Timeout;
|
||||
|
||||
onMounted(async () => {
|
||||
let isAuthed = await checkAuth(useRouter())
|
||||
if(isAuthed){
|
||||
|
@ -231,15 +233,19 @@ onMounted(async () => {
|
|||
await fetchMemoryInfo()
|
||||
await fetchNetworkInfo()
|
||||
if(settings.enable_services) await fetchServiceInfo()
|
||||
const intervalId = setInterval(fetchCpuTemp, 7000);
|
||||
onUnmounted(() => {
|
||||
clearInterval(intervalId);
|
||||
});
|
||||
intervalId = setInterval(fetchCpuTemp, 7000);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
onBeforeUnmount(()=>{
|
||||
clearInterval(intervalId);
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ export const settings = reactive({
|
|||
"libvirt",
|
||||
"frp"
|
||||
],
|
||||
password_hash: ""
|
||||
password_hash: "$2b$10$cdGQ1EqJxtTFe.E9ifZ.0O2inml3sEcLaWFyK9EdmCelmZ2l2Ez8e"
|
||||
});
|
Loading…
Add table
Reference in a new issue