Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fba46be

Browse files
fix: Fix overview page refresh issue (1Panel-dev#9785)
Refs 1Panel-dev#9756 1Panel-dev#9769
1 parent be0a460 commit fba46be

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

‎frontend/src/layout/components/Sidebar/components/Collapse.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const changeNode = (command: string) => {
178178
globalStore.currentNode = command || 'local';
179179
globalStore.currentNodeAddr = '';
180180
loadProductProFromDB();
181-
router.push({ name: 'home' });
181+
router.push({ name: 'home', query: { t: Date.now() } });
182182
return;
183183
}
184184
for (const item of nodes.value) {
@@ -198,7 +198,7 @@ const changeNode = (command: string) => {
198198
globalStore.currentNode = command || 'local';
199199
globalStore.currentNodeAddr = item.addr;
200200
loadProductProFromDB();
201-
router.push({ name: 'home' });
201+
router.push({ name: 'home', query: { t: Date.now() } });
202202
}
203203
}
204204
};

‎frontend/src/views/home/index.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div:key="$route.fullPath">
33
<RouterButton
44
:buttons="[
55
{
@@ -339,6 +339,9 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
339339
memoryTotal: 0,
340340
memoryAvailable: 0,
341341
memoryUsed: 0,
342+
memoryFree: 0,
343+
memoryShard: 0,
344+
memoryCache: 0,
342345
memoryUsedPercent: 0,
343346
swapMemoryTotal: 0,
344347
swapMemoryAvailable: 0,
@@ -545,14 +548,25 @@ const toUpload = () => {
545548
licenseRef.value.acceptParams();
546549
};
547550
548-
onMounted(() => {
551+
const fetchData =() => {
549552
window.addEventListener('focus', onFocus);
550553
window.addEventListener('blur', onBlur);
551554
loadSafeStatus();
552555
loadUpgradeStatus();
553556
onLoadNetworkOptions();
554557
onLoadIOOptions();
555558
onLoadBaseInfo(true, 'all');
559+
};
560+
561+
onBeforeRouteUpdate((to, from, next) => {
562+
if (to.name === 'home') {
563+
fetchData();
564+
}
565+
next();
566+
});
567+
568+
onMounted(() => {
569+
fetchData();
556570
});
557571
558572
onBeforeUnmount(() => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /