plugin-cluster-manager 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/914.5dc1105cf3ada6a6.js +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/externalVersion.js +6 -5
- package/dist/locale/en-US.json +138 -124
- package/dist/locale/vi-VN.json +139 -125
- package/dist/locale/zh-CN.json +140 -125
- package/dist/server/actions/cluster-nodes.js +2 -6
- package/dist/server/actions/doctor.js +1 -5
- package/dist/server/actions/orchestrator.js +37 -0
- package/dist/server/actions/queue-mappings.js +107 -0
- package/dist/server/collections/worker-queue-mappings.js +106 -0
- package/dist/server/orchestrator/PackageManager.js +1 -8
- package/dist/server/orchestrator/docker-adapter.js +49 -27
- package/dist/server/plugin.js +10 -8
- package/dist/server/queue-scanner.js +141 -0
- package/dist/server/utils/node.js +30 -2
- package/package.json +46 -42
- package/src/client/AclCacheManager.tsx +292 -287
- package/src/client/ClusterManagerLayout.tsx +6 -0
- package/src/client/ClusterNodes.tsx +8 -1
- package/src/client/ContainerOrchestrator.tsx +184 -102
- package/src/client/QueueAssignment.tsx +355 -0
- package/src/client/TaskManager.tsx +194 -187
- package/src/client/WorkflowExecutions.tsx +243 -238
- package/src/client-v2/plugin.tsx +24 -0
- package/src/locale/en-US.json +138 -124
- package/src/locale/vi-VN.json +139 -125
- package/src/locale/zh-CN.json +140 -125
- package/src/server/actions/cluster-nodes.ts +3 -7
- package/src/server/actions/doctor.ts +2 -6
- package/src/server/actions/orchestrator.ts +54 -2
- package/src/server/actions/queue-mappings.ts +94 -0
- package/src/server/collections/worker-queue-mappings.ts +85 -0
- package/src/server/orchestrator/PackageManager.ts +2 -10
- package/src/server/orchestrator/docker-adapter.ts +74 -37
- package/src/server/plugin.ts +12 -10
- package/src/server/queue-scanner.ts +154 -0
- package/src/server/utils/node.ts +48 -0
- package/dist/client/AclCacheManager.d.ts +0 -2
- package/dist/client/CacheMonitor.d.ts +0 -2
- package/dist/client/ClusterManagerLayout.d.ts +0 -2
- package/dist/client/ClusterNodes.d.ts +0 -2
- package/dist/client/ContainerOrchestrator.d.ts +0 -2
- package/dist/client/Doctor.d.ts +0 -2
- package/dist/client/EventQueueMonitor.d.ts +0 -2
- package/dist/client/LockMonitor.d.ts +0 -2
- package/dist/client/NginxCacheManager.d.ts +0 -2
- package/dist/client/PackageInstaller.d.ts +0 -2
- package/dist/client/PluginOperations.d.ts +0 -2
- package/dist/client/RedisMonitor.d.ts +0 -2
- package/dist/client/TaskManager.d.ts +0 -2
- package/dist/client/WorkflowExecutions.d.ts +0 -2
- package/dist/client/index.d.ts +0 -5
- package/dist/client/utils/clientSafeCache.d.ts +0 -3
- package/dist/client/utils/requestDedupInterceptor.d.ts +0 -2
- package/dist/client/utils.d.ts +0 -12
- package/dist/index.d.ts +0 -2
- package/dist/server/actions/acl-cache.d.ts +0 -53
- package/dist/server/actions/cache-monitor.d.ts +0 -33
- package/dist/server/actions/cluster-nodes.d.ts +0 -64
- package/dist/server/actions/doctor.d.ts +0 -82
- package/dist/server/actions/event-queue-monitor.d.ts +0 -13
- package/dist/server/actions/lock-monitor.d.ts +0 -19
- package/dist/server/actions/orchestrator.d.ts +0 -58
- package/dist/server/actions/package-manager.d.ts +0 -6
- package/dist/server/actions/plugin-operations.d.ts +0 -6
- package/dist/server/actions/redis-monitor.d.ts +0 -12
- package/dist/server/actions/tasks.d.ts +0 -7
- package/dist/server/actions/workflow-executions.d.ts +0 -7
- package/dist/server/adapters/redis-lock-adapter.d.ts +0 -15
- package/dist/server/adapters/redis-node-registry.d.ts +0 -12
- package/dist/server/adapters/redis-pubsub-adapter.d.ts +0 -16
- package/dist/server/collections/app.d.ts +0 -8
- package/dist/server/collections/cluster-manager-acl-cache.d.ts +0 -22
- package/dist/server/collections/cluster-manager-cache-mgr.d.ts +0 -22
- package/dist/server/collections/cluster-manager-cluster.d.ts +0 -22
- package/dist/server/collections/cluster-manager-doctor-runs.d.ts +0 -3
- package/dist/server/collections/cluster-manager-doctor.d.ts +0 -18
- package/dist/server/collections/cluster-manager-lock.d.ts +0 -22
- package/dist/server/collections/cluster-manager-plugins.d.ts +0 -18
- package/dist/server/collections/cluster-manager-queue.d.ts +0 -22
- package/dist/server/collections/cluster-manager-redis.d.ts +0 -22
- package/dist/server/collections/cluster-manager-workflow.d.ts +0 -22
- package/dist/server/collections/cluster-manager.d.ts +0 -22
- package/dist/server/collections/orchestrator-settings.d.ts +0 -59
- package/dist/server/collections/orchestrator-stacks.d.ts +0 -102
- package/dist/server/collections/worker-orchestrator.d.ts +0 -22
- package/dist/server/collections/worker-packages-configs.d.ts +0 -3
- package/dist/server/collections/worker-packages.d.ts +0 -22
- package/dist/server/hooks/cacheInvalidationHooks.d.ts +0 -1
- package/dist/server/middlewares/listMetaCacheMiddleware.d.ts +0 -2
- package/dist/server/orchestrator/PackageManager.d.ts +0 -39
- package/dist/server/orchestrator/docker-adapter.d.ts +0 -41
- package/dist/server/orchestrator/index.d.ts +0 -4
- package/dist/server/orchestrator/k8s-adapter.d.ts +0 -50
- package/dist/server/orchestrator/leader-election.d.ts +0 -48
- package/dist/server/orchestrator/types.d.ts +0 -84
- package/dist/server/plugin.d.ts +0 -26
- package/dist/server/utils/node.d.ts +0 -6
- package/dist/server/utils/redis.d.ts +0 -29
- package/dist/server/utils/versionManager.d.ts +0 -10
- package/dist/shared/packages.d.ts +0 -23
- /package/{dist/server/index.d.ts → src/client-v2/index.tsx} +0 -0
|
@@ -1,287 +1,292 @@
|
|
|
1
|
-
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
message.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{ title: t('
|
|
128
|
-
{ title: t('
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import { Card, Row, Col, Statistic, Table, Tag, Button, Space, Popconfirm, message, Typography, Select } from 'antd';
|
|
3
|
+
import {
|
|
4
|
+
ReloadOutlined,
|
|
5
|
+
DeleteOutlined,
|
|
6
|
+
SafetyCertificateOutlined,
|
|
7
|
+
ThunderboltOutlined,
|
|
8
|
+
CheckCircleOutlined,
|
|
9
|
+
CloseCircleOutlined,
|
|
10
|
+
} from '@ant-design/icons';
|
|
11
|
+
import { useAPIClient } from '@nocobase/client';
|
|
12
|
+
import { useT } from './utils';
|
|
13
|
+
|
|
14
|
+
const { Text } = Typography;
|
|
15
|
+
|
|
16
|
+
interface AclStats {
|
|
17
|
+
totalChecks: number;
|
|
18
|
+
cacheHits: number;
|
|
19
|
+
cacheMisses: number;
|
|
20
|
+
hitRate: number;
|
|
21
|
+
cachedKeys: number;
|
|
22
|
+
ttlSeconds: number;
|
|
23
|
+
startedAt: string;
|
|
24
|
+
detailByRole: Record<string, { checks: number; hits: number; misses: number }>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CachedKey {
|
|
28
|
+
key: string;
|
|
29
|
+
role: string;
|
|
30
|
+
resource: string;
|
|
31
|
+
action: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function AclCacheManager() {
|
|
35
|
+
const api = useAPIClient();
|
|
36
|
+
const t = useT();
|
|
37
|
+
const [stats, setStats] = useState<AclStats | null>(null);
|
|
38
|
+
const [keys, setKeys] = useState<CachedKey[]>([]);
|
|
39
|
+
const [loading, setLoading] = useState(false);
|
|
40
|
+
const [autoRefresh, setAutoRefresh] = useState<number | null>(null);
|
|
41
|
+
|
|
42
|
+
const fetchAll = useCallback(async () => {
|
|
43
|
+
setLoading(true);
|
|
44
|
+
try {
|
|
45
|
+
const [statsRes, keysRes] = await Promise.all([
|
|
46
|
+
api.request({ url: 'clusterManagerAclCache:stats' }),
|
|
47
|
+
api.request({ url: 'clusterManagerAclCache:listKeys' }),
|
|
48
|
+
]);
|
|
49
|
+
const statsData = statsRes?.data?.data || statsRes?.data || {};
|
|
50
|
+
setStats(statsData);
|
|
51
|
+
const keysArray = Array.isArray(keysRes?.data?.data?.data)
|
|
52
|
+
? keysRes.data.data.data
|
|
53
|
+
: Array.isArray(keysRes?.data?.data)
|
|
54
|
+
? keysRes.data.data
|
|
55
|
+
: Array.isArray(keysRes?.data)
|
|
56
|
+
? keysRes.data
|
|
57
|
+
: [];
|
|
58
|
+
setKeys(keysArray);
|
|
59
|
+
} catch {
|
|
60
|
+
message.error('Failed to load ACL cache data');
|
|
61
|
+
} finally {
|
|
62
|
+
setLoading(false);
|
|
63
|
+
}
|
|
64
|
+
}, [api]);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
fetchAll();
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!autoRefresh) return;
|
|
72
|
+
const timer = setInterval(fetchAll, autoRefresh * 1000);
|
|
73
|
+
return () => clearInterval(timer);
|
|
74
|
+
}, [autoRefresh, fetchAll]);
|
|
75
|
+
|
|
76
|
+
const handleClearAll = async () => {
|
|
77
|
+
try {
|
|
78
|
+
const res = await api.request({ url: 'clusterManagerAclCache:clear', method: 'post' });
|
|
79
|
+
message.success(`Cleared ${res.data?.deletedCount || 0} cache entries`);
|
|
80
|
+
fetchAll();
|
|
81
|
+
} catch {
|
|
82
|
+
message.error('Failed to clear cache');
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const handleResetStats = async () => {
|
|
87
|
+
try {
|
|
88
|
+
await api.request({ url: 'clusterManagerAclCache:resetStats', method: 'post' });
|
|
89
|
+
message.success('Stats reset');
|
|
90
|
+
fetchAll();
|
|
91
|
+
} catch {
|
|
92
|
+
message.error('Failed to reset stats');
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleClearRole = async (roleName: string) => {
|
|
97
|
+
try {
|
|
98
|
+
const res = await api.request({
|
|
99
|
+
url: 'clusterManagerAclCache:clearRole',
|
|
100
|
+
method: 'post',
|
|
101
|
+
data: { roleName },
|
|
102
|
+
});
|
|
103
|
+
message.success(`Cleared ${res.data?.deletedCount || 0} entries for role "${roleName}"`);
|
|
104
|
+
fetchAll();
|
|
105
|
+
} catch {
|
|
106
|
+
message.error('Failed to clear role cache');
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
if (!stats) return null;
|
|
111
|
+
|
|
112
|
+
const detailByRole = stats.detailByRole || {};
|
|
113
|
+
const roleData = Object.entries(detailByRole).map(([role, data]) => ({
|
|
114
|
+
role,
|
|
115
|
+
...data,
|
|
116
|
+
hitRate: data.checks > 0 ? Math.round((data.hits / data.checks) * 10000) / 100 : 0,
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
const keyColumns = [
|
|
120
|
+
{
|
|
121
|
+
title: t('Role'),
|
|
122
|
+
dataIndex: 'role',
|
|
123
|
+
width: 120,
|
|
124
|
+
filters: [...new Set(keys.map((k) => k.role))].map((r) => ({ text: r, value: r })),
|
|
125
|
+
onFilter: (value: any, record: CachedKey) => record.role === value,
|
|
126
|
+
},
|
|
127
|
+
{ title: t('Resource'), dataIndex: 'resource', width: 200 },
|
|
128
|
+
{ title: t('Action'), dataIndex: 'action', width: 120 },
|
|
129
|
+
{
|
|
130
|
+
title: t('Cache Key'),
|
|
131
|
+
dataIndex: 'key',
|
|
132
|
+
ellipsis: true,
|
|
133
|
+
render: (val: string) => (
|
|
134
|
+
<Text code style={{ fontSize: 11 }}>
|
|
135
|
+
{val}
|
|
136
|
+
</Text>
|
|
137
|
+
),
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
const roleColumns = [
|
|
142
|
+
{ title: t('Role'), dataIndex: 'role', width: 150 },
|
|
143
|
+
{ title: t('Checks'), dataIndex: 'checks', width: 100, sorter: (a: any, b: any) => a.checks - b.checks },
|
|
144
|
+
{
|
|
145
|
+
title: t('Hits'),
|
|
146
|
+
dataIndex: 'hits',
|
|
147
|
+
width: 100,
|
|
148
|
+
render: (val: number) => <Text type="success">{val}</Text>,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: t('Misses'),
|
|
152
|
+
dataIndex: 'misses',
|
|
153
|
+
width: 100,
|
|
154
|
+
render: (val: number) => <Text type="danger">{val}</Text>,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
title: t('Hit Rate'),
|
|
158
|
+
dataIndex: 'hitRate',
|
|
159
|
+
width: 100,
|
|
160
|
+
render: (val: number) => <Tag color={val > 80 ? 'green' : val > 50 ? 'orange' : 'red'}>{val}%</Tag>,
|
|
161
|
+
sorter: (a: any, b: any) => a.hitRate - b.hitRate,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: t('Actions'),
|
|
165
|
+
width: 80,
|
|
166
|
+
render: (_: any, record: any) => (
|
|
167
|
+
<Popconfirm
|
|
168
|
+
title={`${t('Clear cache for role')} "${record.role}"?`}
|
|
169
|
+
onConfirm={() => handleClearRole(record.role)}
|
|
170
|
+
>
|
|
171
|
+
<Button type="link" size="small" icon={<DeleteOutlined />} danger />
|
|
172
|
+
</Popconfirm>
|
|
173
|
+
),
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<div>
|
|
179
|
+
<Space style={{ marginBottom: 16 }}>
|
|
180
|
+
<Button icon={<ReloadOutlined />} onClick={fetchAll} loading={loading}>
|
|
181
|
+
{t('Refresh')}
|
|
182
|
+
</Button>
|
|
183
|
+
<Select
|
|
184
|
+
placeholder={t('Auto refresh')}
|
|
185
|
+
allowClear
|
|
186
|
+
style={{ width: 160 }}
|
|
187
|
+
value={autoRefresh}
|
|
188
|
+
onChange={setAutoRefresh}
|
|
189
|
+
options={[
|
|
190
|
+
{ value: 5, label: t('Every 5s') },
|
|
191
|
+
{ value: 10, label: t('Every 10s') },
|
|
192
|
+
{ value: 30, label: t('Every 30s') },
|
|
193
|
+
]}
|
|
194
|
+
/>
|
|
195
|
+
<Popconfirm title={t('Clear all ACL cache entries?')} onConfirm={handleClearAll}>
|
|
196
|
+
<Button icon={<DeleteOutlined />} danger>
|
|
197
|
+
{t('Clear All Cache')}
|
|
198
|
+
</Button>
|
|
199
|
+
</Popconfirm>
|
|
200
|
+
<Popconfirm title={t('Reset ACL stats counters?')} onConfirm={handleResetStats}>
|
|
201
|
+
<Button>{t('Reset Stats')}</Button>
|
|
202
|
+
</Popconfirm>
|
|
203
|
+
<Tag>TTL: {stats.ttlSeconds}s</Tag>
|
|
204
|
+
<Tag>
|
|
205
|
+
{t('Since')}: {new Date(stats.startedAt).toLocaleString()}
|
|
206
|
+
</Tag>
|
|
207
|
+
</Space>
|
|
208
|
+
|
|
209
|
+
{/* Overview stats */}
|
|
210
|
+
<Row gutter={[16, 16]}>
|
|
211
|
+
<Col span={6}>
|
|
212
|
+
<Card size="small">
|
|
213
|
+
<Statistic title={t('Total ACL Checks')} value={stats.totalChecks} prefix={<SafetyCertificateOutlined />} />
|
|
214
|
+
</Card>
|
|
215
|
+
</Col>
|
|
216
|
+
<Col span={6}>
|
|
217
|
+
<Card size="small">
|
|
218
|
+
<Statistic
|
|
219
|
+
title={t('Cache Hits')}
|
|
220
|
+
value={stats.cacheHits}
|
|
221
|
+
prefix={<CheckCircleOutlined />}
|
|
222
|
+
valueStyle={{ color: '#3f8600' }}
|
|
223
|
+
/>
|
|
224
|
+
</Card>
|
|
225
|
+
</Col>
|
|
226
|
+
<Col span={6}>
|
|
227
|
+
<Card size="small">
|
|
228
|
+
<Statistic
|
|
229
|
+
title={t('Cache Misses')}
|
|
230
|
+
value={stats.cacheMisses}
|
|
231
|
+
prefix={<CloseCircleOutlined />}
|
|
232
|
+
valueStyle={{ color: '#cf1322' }}
|
|
233
|
+
/>
|
|
234
|
+
</Card>
|
|
235
|
+
</Col>
|
|
236
|
+
<Col span={6}>
|
|
237
|
+
<Card size="small">
|
|
238
|
+
<Statistic
|
|
239
|
+
title={t('Hit Rate')}
|
|
240
|
+
value={stats.hitRate}
|
|
241
|
+
suffix="%"
|
|
242
|
+
prefix={<ThunderboltOutlined />}
|
|
243
|
+
valueStyle={{
|
|
244
|
+
color: stats.hitRate > 80 ? '#3f8600' : stats.hitRate > 50 ? '#faad14' : '#cf1322',
|
|
245
|
+
}}
|
|
246
|
+
/>
|
|
247
|
+
<Text type="secondary">
|
|
248
|
+
{t('Cached keys')}: {stats.cachedKeys}
|
|
249
|
+
</Text>
|
|
250
|
+
</Card>
|
|
251
|
+
</Col>
|
|
252
|
+
</Row>
|
|
253
|
+
|
|
254
|
+
{/* Per-role breakdown */}
|
|
255
|
+
<Row gutter={[16, 16]} style={{ marginTop: 16 }}>
|
|
256
|
+
<Col span={12}>
|
|
257
|
+
<Card title={t('Stats by Role')} size="small">
|
|
258
|
+
{roleData.length === 0 ? (
|
|
259
|
+
<Text type="secondary">{t('No ACL checks recorded yet')}</Text>
|
|
260
|
+
) : (
|
|
261
|
+
<Table
|
|
262
|
+
rowKey="role"
|
|
263
|
+
size="small"
|
|
264
|
+
pagination={false}
|
|
265
|
+
dataSource={roleData}
|
|
266
|
+
columns={roleColumns}
|
|
267
|
+
scroll={{ x: 'max-content' }}
|
|
268
|
+
/>
|
|
269
|
+
)}
|
|
270
|
+
</Card>
|
|
271
|
+
</Col>
|
|
272
|
+
|
|
273
|
+
{/* Cached keys */}
|
|
274
|
+
<Col span={12}>
|
|
275
|
+
<Card title={`${t('Cached Permission Keys')} (${keys.length})`} size="small">
|
|
276
|
+
{keys.length === 0 ? (
|
|
277
|
+
<Text type="secondary">{t('No cached keys')}</Text>
|
|
278
|
+
) : (
|
|
279
|
+
<Table
|
|
280
|
+
rowKey="key"
|
|
281
|
+
size="small"
|
|
282
|
+
pagination={{ pageSize: 10, size: 'small' }}
|
|
283
|
+
dataSource={keys}
|
|
284
|
+
columns={keyColumns}
|
|
285
|
+
/>
|
|
286
|
+
)}
|
|
287
|
+
</Card>
|
|
288
|
+
</Col>
|
|
289
|
+
</Row>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
@@ -8,6 +8,7 @@ import { ContainerOrchestrator } from './ContainerOrchestrator';
|
|
|
8
8
|
import { PackageInstaller } from './PackageInstaller';
|
|
9
9
|
import { PluginOperations } from './PluginOperations';
|
|
10
10
|
import { Doctor } from './Doctor';
|
|
11
|
+
import { QueueAssignment } from './QueueAssignment';
|
|
11
12
|
import { useT } from './utils';
|
|
12
13
|
|
|
13
14
|
export function ClusterManagerLayout() {
|
|
@@ -57,6 +58,11 @@ export function ClusterManagerLayout() {
|
|
|
57
58
|
label: t('Doctor'),
|
|
58
59
|
children: <Doctor />,
|
|
59
60
|
},
|
|
61
|
+
{
|
|
62
|
+
key: 'queues',
|
|
63
|
+
label: t('Queue Assignment'),
|
|
64
|
+
children: <QueueAssignment />,
|
|
65
|
+
},
|
|
60
66
|
]}
|
|
61
67
|
/>
|
|
62
68
|
</div>
|
|
@@ -643,7 +643,14 @@ export function ClusterNodes() {
|
|
|
643
643
|
|
|
644
644
|
{/* Cluster nodes table */}
|
|
645
645
|
<Card title={t('Cluster Nodes')} size="small">
|
|
646
|
-
<Table
|
|
646
|
+
<Table
|
|
647
|
+
dataSource={environments}
|
|
648
|
+
columns={nodeColumns}
|
|
649
|
+
rowKey="id"
|
|
650
|
+
size="small"
|
|
651
|
+
pagination={false}
|
|
652
|
+
scroll={{ x: 'max-content' }}
|
|
653
|
+
/>
|
|
647
654
|
</Card>
|
|
648
655
|
|
|
649
656
|
{/* Current node details (always APP node) */}
|