|
220 | 220 | <script setup lang="ts"> |
221 | 221 | import { ref, reactive, onMounted, computed } from 'vue'; |
222 | 222 | import { loadMonitor, getNetworkOptions, getIOOptions } from '@/api/modules/host'; |
223 | | -import { computeSize, computeSizeFromKBs, dateFormat } from '@/utils/util'; |
| 223 | +import { computeSize, computeSizeFromKBs, dateFormatWithoutYear } from '@/utils/util'; |
224 | 224 | import i18n from '@/lang'; |
225 | 225 | import MonitorRouter from '@/views/host/monitor/index.vue'; |
226 | 226 | import { GlobalStore } from '@/store'; |
@@ -309,7 +309,7 @@ const search = async (param: string) => { |
309 | 309 | case 'base': |
310 | 310 | let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date; |
311 | 311 | baseDate = baseDate.map(function (item: any) { |
312 | | - return dateFormat(null, null, item); |
| 312 | + return dateFormatWithoutYear(item); |
313 | 313 | }); |
314 | 314 | if (param === 'cpu' || param === 'all') { |
315 | 315 | initCPUCharts(baseDate, item); |
@@ -358,7 +358,7 @@ const loadOptions = async () => { |
358 | 358 | function initLoadCharts(item: Host.MonitorData) { |
359 | 359 | let itemLoadDate = item.date.length === 0 ? loadEmptyDate(timeRangeLoad.value) : item.date; |
360 | 360 | let loadDate = itemLoadDate.map(function (item: any) { |
361 | | - return dateFormat(null, null, item); |
| 361 | + return dateFormatWithoutYear(item); |
362 | 362 | }); |
363 | 363 | let load1Data = item.value.map(function (item: any) { |
364 | 364 | return item.cpuLoad1.toFixed(2); |
@@ -467,7 +467,7 @@ function initMemCharts(baseDate: any, items: Host.MonitorData) { |
467 | 467 | function initNetCharts(item: Host.MonitorData) { |
468 | 468 | let networkDate = item.date.length === 0 ? loadEmptyDate(timeRangeNetwork.value) : item.date; |
469 | 469 | let date = networkDate.map(function (item: any) { |
470 | | - return dateFormat(null, null, item); |
| 470 | + return dateFormatWithoutYear(item); |
471 | 471 | }); |
472 | 472 | let networkUp = item.value.map(function (item: any) { |
473 | 473 | return item.up.toFixed(2); |
@@ -512,7 +512,7 @@ function initNetCharts(item: Host.MonitorData) { |
512 | 512 | function initIOCharts(item: Host.MonitorData) { |
513 | 513 | let itemIODate = item.date?.length === 0 ? loadEmptyDate(timeRangeIO.value) : item.date; |
514 | 514 | let ioDate = itemIODate.map(function (item: any) { |
515 | | - return dateFormat(null, null, item); |
| 515 | + return dateFormatWithoutYear(item); |
516 | 516 | }); |
517 | 517 | let ioRead = item.value.map(function (item: any) { |
518 | 518 | return Number((item.read / 1024).toFixed(2)); |
@@ -700,7 +700,7 @@ function withMemProcess(datas: any) { |
700 | 700 |
|
701 | 701 | function loadDate(name: any) { |
702 | 702 | 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', ' ')} |
704 | 704 | </div>`; |
705 | 705 | } |
706 | 706 |
|
|
0 commit comments