Skip to content
Merged
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
16 changes: 16 additions & 0 deletions frontend/src/views/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ const currentChartInfo = reactive({
netBytesSent: 0,
netBytesRecv: 0,
});
const skipNextCurrentInfoDelta = ref(false);

const chartsOption = ref({ ioChart1: null, networkChart: null });

Expand Down Expand Up @@ -686,6 +687,7 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
const res = await loadBaseInfo(searchInfo.ioOption, searchInfo.netOption);
baseInfo.value = res.data;
updateCurrentInfo(baseInfo.value.currentInfo);
skipNextCurrentInfoDelta.value = true;
onLoadCurrentInfo();
isStatusInit.value = false;
statusRef.value?.acceptParams(currentInfo.value, baseInfo.value);
Expand Down Expand Up @@ -744,6 +746,19 @@ const jumpPanel = (row: any) => {

const onLoadCurrentInfo = async () => {
const res = await loadCurrentInfo(searchInfo.ioOption, searchInfo.netOption);
if (skipNextCurrentInfoDelta.value) {
skipNextCurrentInfoDelta.value = false;
currentChartInfo.netBytesSent = 0;
currentChartInfo.netBytesRecv = 0;
currentChartInfo.ioReadBytes = 0;
currentChartInfo.ioWriteBytes = 0;
currentChartInfo.ioCount = 0;
currentChartInfo.ioTime = 0;
updateCurrentInfo(res.data);
statusRef.value?.acceptParams(currentInfo.value, baseInfo.value);
return;
}

currentInfo.value.timeSinceUptime = res.data.timeSinceUptime;

let timeInterval = Number(res.data.uptime - currentInfo.value.uptime) || 3;
Expand Down Expand Up @@ -984,6 +999,7 @@ const loadSource = (row: any) => {

const onFocus = () => {
isActive.value = true;
skipNextCurrentInfoDelta.value = true;
};
const onBlur = () => {
isActive.value = false;
Expand Down
Loading