Skip to content

Commit 217d780

Browse files
authored
fix: Fix the issue of abnormal time display on the monitoring page (#11001)
1 parent fe62dc1 commit 217d780

File tree

1 file changed

+6
-6
lines changed
  • frontend/src/views/host/monitor/monitor

1 file changed

+6
-6
lines changed

frontend/src/views/host/monitor/monitor/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
<script setup lang="ts">
221221
import { ref, reactive, onMounted, computed } from 'vue';
222222
import { loadMonitor, getNetworkOptions, getIOOptions } from '@/api/modules/host';
223-
import { computeSize, computeSizeFromKBs, dateFormat } from '@/utils/util';
223+
import { computeSize, computeSizeFromKBs, dateFormatWithoutYear } from '@/utils/util';
224224
import i18n from '@/lang';
225225
import MonitorRouter from '@/views/host/monitor/index.vue';
226226
import { GlobalStore } from '@/store';
@@ -309,7 +309,7 @@ const search = async (param: string) => {
309309
case 'base':
310310
let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date;
311311
baseDate = baseDate.map(function (item: any) {
312-
return dateFormat(null, null, item);
312+
return dateFormatWithoutYear(item);
313313
});
314314
if (param === 'cpu' || param === 'all') {
315315
initCPUCharts(baseDate, item);
@@ -358,7 +358,7 @@ const loadOptions = async () => {
358358
function initLoadCharts(item: Host.MonitorData) {
359359
let itemLoadDate = item.date.length === 0 ? loadEmptyDate(timeRangeLoad.value) : item.date;
360360
let loadDate = itemLoadDate.map(function (item: any) {
361-
return dateFormat(null, null, item);
361+
return dateFormatWithoutYear(item);
362362
});
363363
let load1Data = item.value.map(function (item: any) {
364364
return item.cpuLoad1.toFixed(2);
@@ -467,7 +467,7 @@ function initMemCharts(baseDate: any, items: Host.MonitorData) {
467467
function initNetCharts(item: Host.MonitorData) {
468468
let networkDate = item.date.length === 0 ? loadEmptyDate(timeRangeNetwork.value) : item.date;
469469
let date = networkDate.map(function (item: any) {
470-
return dateFormat(null, null, item);
470+
return dateFormatWithoutYear(item);
471471
});
472472
let networkUp = item.value.map(function (item: any) {
473473
return item.up.toFixed(2);
@@ -512,7 +512,7 @@ function initNetCharts(item: Host.MonitorData) {
512512
function initIOCharts(item: Host.MonitorData) {
513513
let itemIODate = item.date?.length === 0 ? loadEmptyDate(timeRangeIO.value) : item.date;
514514
let ioDate = itemIODate.map(function (item: any) {
515-
return dateFormat(null, null, item);
515+
return dateFormatWithoutYear(item);
516516
});
517517
let ioRead = item.value.map(function (item: any) {
518518
return Number((item.read / 1024).toFixed(2));
@@ -700,7 +700,7 @@ function withMemProcess(datas: any) {
700700
701701
function loadDate(name: any) {
702702
return ` <div style="display: inline-block; width: 100%; padding-bottom: 10px;">
703-
${i18n.global.t('commons.search.date')}: ${name}
703+
${i18n.global.t('commons.search.date')}: ${name.replaceAll('\n', ' ')}
704704
</div>`;
705705
}
706706

0 commit comments

Comments
 (0)