1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00

feat: 首页监控中上下行流量数据单位自动格式化 (#4207) (#4989)

This commit is contained in:
Zolo 2024-05-13 22:37:52 +08:00 committed by GitHub
parent 8b9d1d9052
commit 188d9dd4c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,8 +125,12 @@
<template #body> <template #body>
<div style="position: relative; margin-top: 20px"> <div style="position: relative; margin-top: 20px">
<div class="monitor-tags" v-if="chartOption === 'network'"> <div class="monitor-tags" v-if="chartOption === 'network'">
<el-tag>{{ $t('monitor.up') }}: {{ currentChartInfo.netBytesSent }} KB/s</el-tag> <el-tag>
<el-tag>{{ $t('monitor.down') }}: {{ currentChartInfo.netBytesRecv }} KB/s</el-tag> {{ $t('monitor.up') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesSent) }}
</el-tag>
<el-tag>
{{ $t('monitor.down') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesRecv) }}
</el-tag>
<el-tag>{{ $t('home.totalSend') }}: {{ computeSize(currentInfo.netBytesSent) }}</el-tag> <el-tag>{{ $t('home.totalSend') }}: {{ computeSize(currentInfo.netBytesSent) }}</el-tag>
<el-tag>{{ $t('home.totalRecv') }}: {{ computeSize(currentInfo.netBytesRecv) }}</el-tag> <el-tag>{{ $t('home.totalRecv') }}: {{ computeSize(currentInfo.netBytesRecv) }}</el-tag>
</div> </div>
@ -247,7 +251,7 @@ import LicenseImport from '@/components/license-import/index.vue';
import CardWithHeader from '@/components/card-with-header/index.vue'; import CardWithHeader from '@/components/card-with-header/index.vue';
import i18n from '@/lang'; import i18n from '@/lang';
import { Dashboard } from '@/api/interface/dashboard'; import { Dashboard } from '@/api/interface/dashboard';
import { dateFormatForSecond, computeSize } from '@/utils/util'; import { dateFormatForSecond, computeSize, computeSizeFromKBs } from '@/utils/util';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard'; import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard';
import { getIOOptions, getNetworkOptions } from '@/api/modules/host'; import { getIOOptions, getNetworkOptions } from '@/api/modules/host';