feat(platform): highlight unified vehicle service posture
This commit is contained in:
@@ -44,6 +44,15 @@ function formatCount(value?: number | null) {
|
||||
return value == null ? '0' : value.toLocaleString();
|
||||
}
|
||||
|
||||
function vehicleServiceOnlineText(serviceSummary: VehicleServiceSummary | null, summary: DashboardSummary | null) {
|
||||
const onlineVehicles = serviceSummary?.onlineVehicles ?? summary?.onlineVehicles;
|
||||
const totalVehicles = serviceSummary?.totalVehicles;
|
||||
if (onlineVehicles == null || totalVehicles == null) {
|
||||
return '未接入';
|
||||
}
|
||||
return `${onlineVehicles.toLocaleString()} / ${totalVehicles.toLocaleString()} 在线`;
|
||||
}
|
||||
|
||||
function formatProtocolRate(row: ProtocolStat) {
|
||||
if (!Number.isFinite(row.total) || row.total <= 0) {
|
||||
return '0%';
|
||||
@@ -169,6 +178,16 @@ export function Dashboard({ onOpenVehicle, onOpenQuality, onOpenVehicles }: { on
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
<Card bordered title="统一车辆服务" style={{ marginBottom: 16 }}>
|
||||
<Space wrap>
|
||||
<Tag color="blue">{vehicleServiceOnlineText(serviceSummary, summary)}</Tag>
|
||||
<Tag color="green">{formatCount(serviceSummary?.multiSourceVehicles)} 多源覆盖</Tag>
|
||||
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>
|
||||
{formatCount(summary?.issueVehicles)} 质量关注
|
||||
</Tag>
|
||||
<Tag color={(summary?.kafkaLag ?? 0) > 0 ? 'orange' : 'green'}>Kafka Lag {formatLag(summary?.kafkaLag)}</Tag>
|
||||
</Space>
|
||||
</Card>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Card title="车辆服务状态" bordered>
|
||||
|
||||
Reference in New Issue
Block a user