feat(platform): highlight quality link health
This commit is contained in:
@@ -4,6 +4,12 @@ import { api } from '../api/client';
|
|||||||
import type { OpsHealth, QualityIssueRow } from '../api/types';
|
import type { OpsHealth, QualityIssueRow } from '../api/types';
|
||||||
import { PageHeader } from '../components/PageHeader';
|
import { PageHeader } from '../components/PageHeader';
|
||||||
|
|
||||||
|
const statusColor: Record<string, 'green' | 'orange' | 'red' | 'grey'> = {
|
||||||
|
ok: 'green',
|
||||||
|
warning: 'orange',
|
||||||
|
error: 'red'
|
||||||
|
};
|
||||||
|
|
||||||
function formatLag(value?: number | null) {
|
function formatLag(value?: number | null) {
|
||||||
return value == null ? '未接入' : value.toLocaleString();
|
return value == null ? '未接入' : value.toLocaleString();
|
||||||
}
|
}
|
||||||
@@ -91,7 +97,12 @@ export function Quality() {
|
|||||||
pagination={false}
|
pagination={false}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: '链路', dataIndex: 'name' },
|
{ title: '链路', dataIndex: 'name' },
|
||||||
{ title: '状态', dataIndex: 'status' },
|
{
|
||||||
|
title: '状态',
|
||||||
|
render: (_: unknown, row: { status: string }) => (
|
||||||
|
<Tag color={statusColor[row.status] ?? 'grey'}>{row.status}</Tag>
|
||||||
|
)
|
||||||
|
},
|
||||||
{ title: '说明', dataIndex: 'detail' }
|
{ title: '说明', dataIndex: 'detail' }
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user