Skip to content

Commit 3287aa7

Browse files
authored
feat: add the server monitor view (#19)
* feat: add the server monitor view * chore: add i18n
1 parent 93742f0 commit 3287aa7

File tree

5 files changed

+323
-54
lines changed

5 files changed

+323
-54
lines changed

apps/web-antd/src/adapter/vxe-table.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ setupVbenVxeTable({
2121
columnConfig: {
2222
resizable: true,
2323
},
24-
minHeight: 320,
24+
minHeight: 180,
2525
formConfig: {
2626
// 全局禁用vxe-table的表单配置,使用formOptions
2727
enabled: false,

apps/web-antd/src/locales/langs/en-US/page.json

+50-23
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,8 @@
3535
"sysRole": "System Role",
3636
"sysUser": "System User"
3737
},
38-
"table": {
39-
"created_time": "Create Time",
40-
"id": "ID",
41-
"mark": "Mark",
42-
"operation": "Operation",
43-
"updated_time": "Update time"
44-
},
4538
"monitor": {
4639
"redis": {
47-
"desc": {
48-
"title": "Basic Information"
49-
},
5040
"cards": {
5141
"commands": {
5242
"title": "Command Statistics"
@@ -55,29 +45,66 @@
5545
"title": "Memory Status"
5646
}
5747
},
58-
"stats": {
59-
"title": {
60-
"used_memory": "Used Memory"
61-
}
48+
"desc": {
49+
"title": "Basic Information"
6250
},
6351
"info": {
64-
"title": "Basic Info",
65-
"version": "Version",
66-
"mode": "Mode",
67-
"os": "OS",
6852
"arch": "Arch",
69-
"uptime": "Uptime",
7053
"clients": "Connections",
71-
"memory_human": "Allocated Memory",
72-
"connections_received": "Connections Received",
7354
"commands_processed": "Commands Processed",
74-
"rejected_connections": "Rejected Connections",
55+
"connections_received": "Connections Received",
7556
"keys_command_stats": "Keys Stats",
57+
"keys_num": "Keys Num",
58+
"memory_human": "Allocated Memory",
59+
"mode": "Mode",
60+
"os": "OS",
61+
"rejected_connections": "Rejected Connections",
7662
"role": "Role",
63+
"title": "Basic Info",
64+
"uptime": "Uptime",
7765
"used_cpu": "Used CPU",
7866
"used_cpu_children": "Used CPU Children",
79-
"keys_num": "Keys Num"
67+
"version": "Version"
68+
},
69+
"stats": {
70+
"title": {
71+
"used_memory": "Used Memory"
72+
}
8073
}
74+
},
75+
"server": {
76+
"cpu": {
77+
"current_freq": "Current Freq",
78+
"logical_num": "Logical Num",
79+
"physical_num": "Physical Num",
80+
"usage": "Usage"
81+
},
82+
"disk": {
83+
"device": "Device",
84+
"dir": "Dir",
85+
"free": "Free",
86+
"title": "Disk",
87+
"total": "Total",
88+
"type": "Type",
89+
"usage": "Usage",
90+
"used": "Used"
91+
},
92+
"memory": {
93+
"free": "Free",
94+
"title": "Memory",
95+
"total": "Total",
96+
"usage": "Usage",
97+
"used": "Used"
98+
},
99+
"service": "Service",
100+
"system": "System"
81101
}
102+
},
103+
"table": {
104+
"created_time": "Created Time",
105+
"id": "ID",
106+
"mark": "Mark",
107+
"operation": "Operation",
108+
"updated_time": "Updated time"
82109
}
83110
}

apps/web-antd/src/locales/langs/zh-CN/page.json

+50-23
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,8 @@
3535
"sysRole": "系统角色",
3636
"sysUser": "系统角色"
3737
},
38-
"table": {
39-
"created_time": "创建时间",
40-
"id": "序号",
41-
"mark": "备注",
42-
"operation": "操作",
43-
"updated_time": "更新时间"
44-
},
4538
"monitor": {
4639
"redis": {
47-
"desc": {
48-
"title": "基本信息"
49-
},
5040
"cards": {
5141
"commands": {
5242
"title": "命令统计"
@@ -55,29 +45,66 @@
5545
"title": "内存情况"
5646
}
5747
},
58-
"stats": {
59-
"title": {
60-
"used_memory": "已使用内存"
61-
}
48+
"desc": {
49+
"title": "基本信息"
6250
},
6351
"info": {
64-
"title": "基础信息",
65-
"version": "版本",
66-
"mode": "模式",
67-
"os": "操作系统",
6852
"arch": "架构",
69-
"uptime": "运行时间",
7053
"clients": "连接数",
71-
"memory_human": "已分配内存",
72-
"connections_received": "可接受连接数",
7354
"commands_processed": "已执行命令",
74-
"rejected_connections": "已拒绝连接",
55+
"connections_received": "可接受连接数",
7556
"keys_command_stats": "查询次数",
57+
"keys_num": "Keys 数量",
58+
"memory_human": "已分配内存",
59+
"mode": "模式",
60+
"os": "操作系统",
61+
"rejected_connections": "已拒绝连接",
7662
"role": "角色",
63+
"title": "基础信息",
64+
"uptime": "运行时间",
7765
"used_cpu": "CPU 消耗",
7866
"used_cpu_children": "后台 CPU 占用",
79-
"keys_num": "Keys 数量"
67+
"version": "版本"
68+
},
69+
"stats": {
70+
"title": {
71+
"used_memory": "已使用内存"
72+
}
8073
}
74+
},
75+
"server": {
76+
"cpu": {
77+
"current_freq": "当前频率",
78+
"logical_num": "逻辑核心数",
79+
"physical_num": "物理核心数",
80+
"usage": "使用率"
81+
},
82+
"disk": {
83+
"device": "设备",
84+
"dir": "路径",
85+
"free": "空闲",
86+
"title": "磁盘",
87+
"total": "总计",
88+
"type": "类型",
89+
"usage": "使用率",
90+
"used": "已使用"
91+
},
92+
"memory": {
93+
"free": "空闲",
94+
"title": "内存",
95+
"total": "总量",
96+
"usage": "使用率",
97+
"used": "已使用"
98+
},
99+
"service": "服务",
100+
"system": "系统"
81101
}
102+
},
103+
"table": {
104+
"created_time": "创建时间",
105+
"id": "序号",
106+
"mark": "备注",
107+
"operation": "操作",
108+
"updated_time": "更新时间"
82109
}
83110
}

apps/web-antd/src/views/monitor/redis/index.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ watch(redisInfo, (val) => {
105105
</script>
106106

107107
<template>
108-
<div class="container mx-auto p-4">
109-
<div class="mb-2 rounded-lg p-2 shadow-md">
108+
<div class="flex flex-col items-center px-4">
109+
<div class="mt-4 w-full">
110110
<a-card :title="$t('page.monitor.redis.desc.title')" :loading="loading">
111111
<a-descriptions>
112112
<a-descriptions-item
@@ -119,16 +119,16 @@ watch(redisInfo, (val) => {
119119
</a-descriptions>
120120
</a-card>
121121
</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">
122+
<div class="mt-4 flex w-full space-x-4">
123+
<div class="flex-1">
124124
<a-card
125125
:title="$t('page.monitor.redis.cards.commands.title')"
126126
:loading="loading"
127127
>
128128
<CommandsSeries :stats="redisStats" />
129129
</a-card>
130130
</div>
131-
<div class="rounded-lg p-2 shadow-md md:w-1/2">
131+
<div class="flex-1">
132132
<a-card
133133
:title="$t('page.monitor.redis.cards.memory.title')"
134134
:loading="loading"

0 commit comments

Comments
 (0)