mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决概览页多磁盘刷新问题 (#1640)
This commit is contained in:
parent
d01a964534
commit
ef948bca76
@ -239,6 +239,7 @@ const isSafety = ref();
|
|||||||
const chartOption = ref('network');
|
const chartOption = ref('network');
|
||||||
let timer: NodeJS.Timer | null = null;
|
let timer: NodeJS.Timer | null = null;
|
||||||
let isInit = ref<boolean>(true);
|
let isInit = ref<boolean>(true);
|
||||||
|
let isStatusInit = ref<boolean>(true);
|
||||||
let isActive = ref(true);
|
let isActive = ref(true);
|
||||||
|
|
||||||
const ioReadBytes = ref<Array<number>>([]);
|
const ioReadBytes = ref<Array<number>>([]);
|
||||||
@ -355,7 +356,8 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
|
|||||||
baseInfo.value = res.data;
|
baseInfo.value = res.data;
|
||||||
currentInfo.value = baseInfo.value.currentInfo;
|
currentInfo.value = baseInfo.value.currentInfo;
|
||||||
await onLoadCurrentInfo();
|
await onLoadCurrentInfo();
|
||||||
statuRef.value.acceptParams(currentInfo.value, baseInfo.value);
|
isStatusInit.value = false;
|
||||||
|
statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value);
|
||||||
appRef.value.acceptParams();
|
appRef.value.acceptParams();
|
||||||
if (isInit) {
|
if (isInit) {
|
||||||
timer = setInterval(async () => {
|
timer = setInterval(async () => {
|
||||||
@ -421,7 +423,7 @@ const onLoadCurrentInfo = async () => {
|
|||||||
}
|
}
|
||||||
loadData();
|
loadData();
|
||||||
currentInfo.value = res.data;
|
currentInfo.value = res.data;
|
||||||
statuRef.value.acceptParams(currentInfo.value, baseInfo.value);
|
statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
function loadUpTime(uptime: number) {
|
function loadUpTime(uptime: number) {
|
||||||
|
@ -201,7 +201,7 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
|
|||||||
shotTime: new Date(),
|
shotTime: new Date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo): void => {
|
const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo, isInit: boolean): void => {
|
||||||
currentInfo.value = current;
|
currentInfo.value = current;
|
||||||
baseInfo.value = base;
|
baseInfo.value = base;
|
||||||
freshChart('cpu', 'CPU', formatNumber(currentInfo.value.cpuUsedPercent));
|
freshChart('cpu', 'CPU', formatNumber(currentInfo.value.cpuUsedPercent));
|
||||||
@ -215,7 +215,7 @@ const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo):
|
|||||||
freshChart('disk' + i, itemPath, formatNumber(currentInfo.value.diskData[i].usedPercent));
|
freshChart('disk' + i, itemPath, formatNumber(currentInfo.value.diskData[i].usedPercent));
|
||||||
}
|
}
|
||||||
if (currentInfo.value.diskData.length > 5) {
|
if (currentInfo.value.diskData.length > 5) {
|
||||||
showMore.value = false;
|
showMore.value = isInit ? false : showMore.value || false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user