diff --git a/apps/web-antd/src/locales/langs/en-US/page.json b/apps/web-antd/src/locales/langs/en-US/page.json index 50936a3a..b423e3ec 100644 --- a/apps/web-antd/src/locales/langs/en-US/page.json +++ b/apps/web-antd/src/locales/langs/en-US/page.json @@ -59,6 +59,24 @@ "title": { "used_memory": "Used Memory" } + }, + "info": { + "title": "Basic Info", + "version": "Version", + "mode": "Mode", + "os": "OS", + "arch": "Arch", + "uptime": "Uptime", + "clients": "Connections", + "memory_human": "Allocated Memory", + "connections_received": "Connections Received", + "commands_processed": "Commands Processed", + "rejected_connections": "Rejected Connections", + "keys_command_stats": "Keys Stats", + "role": "Role", + "used_cpu": "Used CPU", + "used_cpu_children": "Used CPU Children", + "keys_num": "Keys Num" } } } diff --git a/apps/web-antd/src/locales/langs/zh-CN/page.json b/apps/web-antd/src/locales/langs/zh-CN/page.json index b7ca09f6..1ebcb019 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -59,6 +59,24 @@ "title": { "used_memory": "已使用内存" } + }, + "info": { + "title": "基础信息", + "version": "版本", + "mode": "模式", + "os": "操作系统", + "arch": "架构", + "uptime": "运行时间", + "clients": "连接数", + "memory_human": "已分配内存", + "connections_received": "可接受连接数", + "commands_processed": "已执行命令", + "rejected_connections": "已拒绝连接", + "keys_command_stats": "查询次数", + "role": "角色", + "used_cpu": "CPU 消耗", + "used_cpu_children": "后台 CPU 占用", + "keys_num": "Keys 数量" } } } diff --git a/apps/web-antd/src/views/monitor/redis/index.vue b/apps/web-antd/src/views/monitor/redis/index.vue index a3c744c9..c91c10d7 100644 --- a/apps/web-antd/src/views/monitor/redis/index.vue +++ b/apps/web-antd/src/views/monitor/redis/index.vue @@ -32,6 +32,71 @@ const fetchRedisData = async () => { }; fetchRedisData(); +const redisDescriptionItems = computed(() => [ + { + label: $t('page.monitor.redis.info.version'), + value: redisInfo.value?.redis_version, + }, + { + label: $t('page.monitor.redis.info.os'), + value: redisInfo.value?.os, + }, + { + label: $t('page.monitor.redis.info.arch'), + value: redisInfo.value?.arch_bits, + }, + { + label: $t('page.monitor.redis.info.mode'), + value: redisInfo.value?.redis_mode, + }, + { + label: $t('page.monitor.redis.info.role'), + value: redisInfo.value?.role, + }, + { + label: $t('page.monitor.redis.info.memory_human'), + value: redisInfo.value?.used_memory_human, + }, + { + label: $t('page.monitor.redis.info.connections_received'), + value: redisInfo.value?.total_connections_received, + }, + { + label: $t('page.monitor.redis.info.clients'), + value: redisInfo.value?.blocked_clients, + }, + { + label: $t('page.monitor.redis.info.rejected_connections'), + value: redisInfo.value?.rejected_connections, + }, + { + label: $t('page.monitor.redis.info.commands_processed'), + value: redisInfo.value?.total_commands_processed, + }, + { + label: $t('page.monitor.redis.info.keys_command_stats'), + value: + Number(redisInfo.value?.keyspace_hits) + + Number(redisInfo.value?.keyspace_misses), + }, + { + label: $t('page.monitor.redis.info.keys_num'), + value: redisInfo.value?.keys_num, + }, + { + label: $t('page.monitor.redis.info.used_cpu'), + value: redisInfo.value?.used_cpu_sys, + }, + { + label: $t('page.monitor.redis.info.used_cpu_children'), + value: redisInfo.value?.used_cpu_sys_children, + }, + { + label: $t('page.monitor.redis.info.uptime'), + value: redisInfo.value?.uptime_in_seconds, + }, +]); + watch(redisInfo, (val) => { usedMemory.value = Number.parseFloat( (Number(val.used_memory) / 1024 / 1024).toFixed(2), @@ -40,36 +105,37 @@ watch(redisInfo, (val) => {