Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/src/views/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const isSafety = ref();
const chartOption = ref('network');
let timer: NodeJS.Timer | null = null;
let isInit = ref<boolean>(true);
let isStatusInit = ref<boolean>(true);
let isActive = ref(true);

const ioReadBytes = ref<Array<number>>([]);
Expand Down Expand Up @@ -355,7 +356,8 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
baseInfo.value = res.data;
currentInfo.value = baseInfo.value.currentInfo;
await onLoadCurrentInfo();
statuRef.value.acceptParams(currentInfo.value, baseInfo.value);
isStatusInit.value = false;
statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value);
appRef.value.acceptParams();
if (isInit) {
timer = setInterval(async () => {
Expand Down Expand Up @@ -421,7 +423,7 @@ const onLoadCurrentInfo = async () => {
}
loadData();
currentInfo.value = res.data;
statuRef.value.acceptParams(currentInfo.value, baseInfo.value);
statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value);
};

function loadUpTime(uptime: number) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/home/status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const currentInfo = ref<Dashboard.CurrentInfo>({
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;
baseInfo.value = base;
freshChart('cpu', 'CPU', formatNumber(currentInfo.value.cpuUsedPercent));
Expand All @@ -215,7 +215,7 @@ const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo):
freshChart('disk' + i, itemPath, formatNumber(currentInfo.value.diskData[i].usedPercent));
}
if (currentInfo.value.diskData.length > 5) {
showMore.value = false;
showMore.value = isInit ? false : showMore.value || false;
}
});
};
Expand Down