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