style: 缓存信息多语言
This commit is contained in:
38
src/views/monitor/cache/info.vue
vendored
38
src/views/monitor/cache/info.vue
vendored
@@ -15,6 +15,8 @@ import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { getCache } from '@/api/monitor/cache';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
const { t } = useI18n();
|
||||
|
||||
echarts.use([
|
||||
ToolboxComponent,
|
||||
@@ -104,7 +106,7 @@ function commandStatsChart() {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '命令',
|
||||
name: t('views.monitor.cacheInfo.commandstats'),
|
||||
type: 'pie',
|
||||
radius: ['5%', '80%'],
|
||||
center: ['60%', '50%'],
|
||||
@@ -161,47 +163,51 @@ onMounted(() => {
|
||||
:bordered="true"
|
||||
:column="{ lg: 4, md: 2, xs: 1 }"
|
||||
>
|
||||
<a-descriptions-item label="服务版本">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.version')">
|
||||
{{ cache.info.server.redis_version }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="运行模式">
|
||||
{{ cache.info.server.redis_mode == 'standalone' ? '单机' : '集群' }}
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.mode')">
|
||||
{{
|
||||
cache.info.server.redis_mode == 'standalone'
|
||||
? t('views.monitor.cacheInfo.modeStandalone')
|
||||
: t('views.monitor.cacheInfo.modeClusters')
|
||||
}}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="端口">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.port')">
|
||||
{{ cache.info.server.tcp_port }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="客户端数">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.clients')">
|
||||
{{ cache.info.clients.connected_clients }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="运行时间(天)">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.uptimeInDays')">
|
||||
{{ cache.info.server.uptime_in_days }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="使用内存">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.memoryHuman')">
|
||||
{{ cache.info.memory.used_memory_human }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="使用CPU">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.usedCpu')">
|
||||
{{ parseFloat(cache.info.cpu.used_cpu_user_children).toFixed(2) }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="内存配置">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.maxmemory')">
|
||||
{{ cache.info.memory.maxmemory_human }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="AOF是否开启">
|
||||
{{ cache.info.persistence.aof_enabled == '0' ? '否' : '是' }}
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.aof')">
|
||||
{{ cache.info.persistence.aof_enabled == '1' }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="RDB是否成功">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.rdb')">
|
||||
{{ cache.info.persistence.rdb_last_bgsave_status }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="Key数量">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.dbSize')">
|
||||
{{ cache.dbSize }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="网络入口/出口">
|
||||
<a-descriptions-item :label="t('views.monitor.cacheInfo.kbps')">
|
||||
{{ cache.info.stats.instantaneous_input_kbps }} kps /
|
||||
{{ cache.info.stats.instantaneous_output_kbps }} kps
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
|
||||
<a-card title="命令统计" :bordered="false">
|
||||
<a-card :title="t('views.monitor.cacheInfo.commandstats')" :bordered="false">
|
||||
<div id="commandstats" style="height: 400px; width: 100%"></div>
|
||||
</a-card>
|
||||
</PageContainer>
|
||||
|
||||
Reference in New Issue
Block a user