mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-24 14:38:23 +08:00
parent
be0a460935
commit
fba46be47a
2 changed files with 18 additions and 4 deletions
|
|
@ -178,7 +178,7 @@ const changeNode = (command: string) => {
|
|||
globalStore.currentNode = command || 'local';
|
||||
globalStore.currentNodeAddr = '';
|
||||
loadProductProFromDB();
|
||||
router.push({ name: 'home' });
|
||||
router.push({ name: 'home', query: { t: Date.now() } });
|
||||
return;
|
||||
}
|
||||
for (const item of nodes.value) {
|
||||
|
|
@ -198,7 +198,7 @@ const changeNode = (command: string) => {
|
|||
globalStore.currentNode = command || 'local';
|
||||
globalStore.currentNodeAddr = item.addr;
|
||||
loadProductProFromDB();
|
||||
router.push({ name: 'home' });
|
||||
router.push({ name: 'home', query: { t: Date.now() } });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div :key="$route.fullPath">
|
||||
<RouterButton
|
||||
:buttons="[
|
||||
{
|
||||
|
|
@ -339,6 +339,9 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
|
|||
memoryTotal: 0,
|
||||
memoryAvailable: 0,
|
||||
memoryUsed: 0,
|
||||
memoryFree: 0,
|
||||
memoryShard: 0,
|
||||
memoryCache: 0,
|
||||
memoryUsedPercent: 0,
|
||||
swapMemoryTotal: 0,
|
||||
swapMemoryAvailable: 0,
|
||||
|
|
@ -545,7 +548,7 @@ const toUpload = () => {
|
|||
licenseRef.value.acceptParams();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
const fetchData = () => {
|
||||
window.addEventListener('focus', onFocus);
|
||||
window.addEventListener('blur', onBlur);
|
||||
loadSafeStatus();
|
||||
|
|
@ -553,6 +556,17 @@ onMounted(() => {
|
|||
onLoadNetworkOptions();
|
||||
onLoadIOOptions();
|
||||
onLoadBaseInfo(true, 'all');
|
||||
};
|
||||
|
||||
onBeforeRouteUpdate((to, from, next) => {
|
||||
if (to.name === 'home') {
|
||||
fetchData();
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue