feat(platform): show release in quality health

This commit is contained in:
lingniu
2026-07-04 15:40:41 +08:00
parent d72da88c3f
commit eaf7fcaa0e
2 changed files with 8 additions and 5 deletions

View File

@@ -640,10 +640,11 @@ export function Quality({
))} ))}
</div> </div>
<Row gutter={16}> <Row gutter={16}>
<Col span={6}><Card bordered title="Kafka Lag">{formatLag(health?.kafkaLag)}</Card></Col> <Col span={5}><Card bordered title="Kafka Lag">{formatLag(health?.kafkaLag)}</Card></Col>
<Col span={6}><Card bordered title="活跃连接">{formatLag(health?.activeConnections)}</Card></Col> <Col span={5}><Card bordered title="活跃连接">{formatLag(health?.activeConnections)}</Card></Col>
<Col span={6}><Card bordered title="Redis 在线 Key">{formatLag(health?.redisOnlineKeys)}</Card></Col> <Col span={5}><Card bordered title="Redis 在线 Key">{formatLag(health?.redisOnlineKeys)}</Card></Col>
<Col span={6}> <Col span={5}><Card bordered title="运行版本">{health?.runtime?.platformRelease || '未标记'}</Card></Col>
<Col span={4}>
<Card bordered title="存储读取"> <Card bordered title="存储读取">
<Tag color={statusColor[storageReadStatus(health)] ?? 'grey'}> <Tag color={statusColor[storageReadStatus(health)] ?? 'grey'}>
{storageReadStatus(health) === 'pending' ? '检测中' : storageReadStatus(health) === 'ok' ? '正常' : '异常'} {storageReadStatus(health) === 'pending' ? '检测中' : storageReadStatus(health) === 'ok' ? '正常' : '异常'}

View File

@@ -8998,7 +8998,7 @@ test('quality health shows active connection capacity metric', async () => {
ok: true, ok: true,
json: async () => ({ json: async () => ({
data: path.includes('/api/ops/health') data: path.includes('/api/ops/health')
? { linkHealth: [], kafkaLag: 0, activeConnections: 120000, redisOnlineKeys: 368, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } } ? { linkHealth: [], kafkaLag: 0, activeConnections: 120000, redisOnlineKeys: 368, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000, platformRelease: 'platform-20260704153710' } }
: path.includes('/api/quality/summary') : path.includes('/api/quality/summary')
? { issueVehicleCount: 0, issueRecordCount: 0, errorCount: 0, warningCount: 0, protocols: [], issueTypes: [] } ? { issueVehicleCount: 0, issueRecordCount: 0, errorCount: 0, warningCount: 0, protocols: [], issueTypes: [] }
: { items: [], total: 0, limit: 20, offset: 0 }, : { items: [], total: 0, limit: 20, offset: 0 },
@@ -9013,6 +9013,8 @@ test('quality health shows active connection capacity metric', async () => {
expect(await screen.findByRole('heading', { name: '告警通知' })).toBeInTheDocument(); expect(await screen.findByRole('heading', { name: '告警通知' })).toBeInTheDocument();
expect(await screen.findByText('活跃连接')).toBeInTheDocument(); expect(await screen.findByText('活跃连接')).toBeInTheDocument();
expect(screen.getByText('120,000')).toBeInTheDocument(); expect(screen.getByText('120,000')).toBeInTheDocument();
expect(screen.getByText('运行版本')).toBeInTheDocument();
expect(screen.getByText('platform-20260704153710')).toBeInTheDocument();
}); });
test('quality health shows structured capacity findings', async () => { test('quality health shows structured capacity findings', async () => {