fixed loop error

This commit is contained in:
WeeXnes 2025-02-28 22:01:38 +01:00
parent c56a146def
commit 56fe2afb1a
2 changed files with 11 additions and 5 deletions

View file

@ -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>

View file

@ -24,5 +24,5 @@ export const settings = reactive({
"libvirt",
"frp"
],
password_hash: ""
password_hash: "$2b$10$cdGQ1EqJxtTFe.E9ifZ.0O2inml3sEcLaWFyK9EdmCelmZ2l2Ez8e"
});