@@ -32,6 +32,71 @@ const fetchRedisData = async () => {
3232};
3333fetchRedisData ();
3434
35+ const redisDescriptionItems = computed (() => [
36+ {
37+ label: $t (' page.monitor.redis.info.version' ),
38+ value: redisInfo .value ?.redis_version ,
39+ },
40+ {
41+ label: $t (' page.monitor.redis.info.os' ),
42+ value: redisInfo .value ?.os ,
43+ },
44+ {
45+ label: $t (' page.monitor.redis.info.arch' ),
46+ value: redisInfo .value ?.arch_bits ,
47+ },
48+ {
49+ label: $t (' page.monitor.redis.info.mode' ),
50+ value: redisInfo .value ?.redis_mode ,
51+ },
52+ {
53+ label: $t (' page.monitor.redis.info.role' ),
54+ value: redisInfo .value ?.role ,
55+ },
56+ {
57+ label: $t (' page.monitor.redis.info.memory_human' ),
58+ value: redisInfo .value ?.used_memory_human ,
59+ },
60+ {
61+ label: $t (' page.monitor.redis.info.connections_received' ),
62+ value: redisInfo .value ?.total_connections_received ,
63+ },
64+ {
65+ label: $t (' page.monitor.redis.info.clients' ),
66+ value: redisInfo .value ?.blocked_clients ,
67+ },
68+ {
69+ label: $t (' page.monitor.redis.info.rejected_connections' ),
70+ value: redisInfo .value ?.rejected_connections ,
71+ },
72+ {
73+ label: $t (' page.monitor.redis.info.commands_processed' ),
74+ value: redisInfo .value ?.total_commands_processed ,
75+ },
76+ {
77+ label: $t (' page.monitor.redis.info.keys_command_stats' ),
78+ value:
79+ Number (redisInfo .value ?.keyspace_hits ) +
80+ Number (redisInfo .value ?.keyspace_misses ),
81+ },
82+ {
83+ label: $t (' page.monitor.redis.info.keys_num' ),
84+ value: redisInfo .value ?.keys_num ,
85+ },
86+ {
87+ label: $t (' page.monitor.redis.info.used_cpu' ),
88+ value: redisInfo .value ?.used_cpu_sys ,
89+ },
90+ {
91+ label: $t (' page.monitor.redis.info.used_cpu_children' ),
92+ value: redisInfo .value ?.used_cpu_sys_children ,
93+ },
94+ {
95+ label: $t (' page.monitor.redis.info.uptime' ),
96+ value: redisInfo .value ?.uptime_in_seconds ,
97+ },
98+ ]);
99+
35100watch (redisInfo , (val ) => {
36101 usedMemory .value = Number .parseFloat (
37102 (Number (val .used_memory ) / 1024 / 1024 ).toFixed (2 ),
@@ -40,36 +105,37 @@ watch(redisInfo, (val) => {
40105 </script >
41106
42107<template >
43- <div >
44- <a-card
45- :title =" $t('page.monitor.redis.desc.title')"
46- :loading =" loading"
47- class =" info-card"
48- >
49- <a-descriptions >
50- <a-descriptions-item label =" Test" >123</a-descriptions-item >
51- </a-descriptions >
52- </a-card >
53- <a-space style =" padding-top : 22px " />
54- <a-row :gutter =" 20" >
55- <a-col :span =" 12" >
108+ <div class =" container mx-auto p-4" >
109+ <div class =" mb-2 rounded-lg p-2 shadow-md" >
110+ <a-card :title =" $t('page.monitor.redis.desc.title')" :loading =" loading" >
111+ <a-descriptions >
112+ <a-descriptions-item
113+ v-for =" item in redisDescriptionItems"
114+ :label =" item.label"
115+ :key =" item.label"
116+ >
117+ {{ item.value }}
118+ </a-descriptions-item >
119+ </a-descriptions >
120+ </a-card >
121+ </div >
122+ <div class =" flex flex-col gap-2 md:flex-row" >
123+ <div class =" rounded-lg p-2 shadow-md md:w-1/2" >
56124 <a-card
57125 :title =" $t('page.monitor.redis.cards.commands.title')"
58126 :loading =" loading"
59- class =" info-card"
60127 >
61128 <CommandsSeries :stats =" redisStats" />
62129 </a-card >
63- </a-col >
64- <a-col :span = " 12 " >
130+ </div >
131+ <div class = " rounded-lg p-2 shadow-md md:w-1/2 " >
65132 <a-card
66133 :title =" $t('page.monitor.redis.cards.memory.title')"
67134 :loading =" loading"
68- class =" info-card"
69135 >
70136 <ActiveSeries :memory =" redisUsedMemory" />
71137 </a-card >
72- </a-col >
73- </a-row >
138+ </div >
139+ </div >
74140 </div >
75141</template >
0 commit comments