feat(platform): keep canonical source summary slots

This commit is contained in:
lingniu
2026-07-04 07:54:38 +08:00
parent 422ac684ed
commit 1d691306db
6 changed files with 72 additions and 5 deletions

View File

@@ -44,6 +44,13 @@ function formatCount(value?: number | null) {
return value == null ? '0' : value.toLocaleString();
}
function formatProtocolRate(row: ProtocolStat) {
if (!Number.isFinite(row.total) || row.total <= 0) {
return '0%';
}
return `${Math.round((row.online / row.total) * 100)}%`;
}
function rowServiceStatus(row: { serviceStatus?: { title: string; severity: string }; onlineSourceCount: number; sourceCount: number }) {
if (row.serviceStatus) {
return {
@@ -201,7 +208,7 @@ export function Dashboard({ onOpenVehicle, onOpenQuality, onOpenVehicles }: { on
{ title: '总数', dataIndex: 'total' },
{
title: '在线率',
render: (_: unknown, row: ProtocolStat) => `${Math.round((row.online / row.total) * 100)}%`
render: (_: unknown, row: ProtocolStat) => formatProtocolRate(row)
},
{
title: '缺失车辆',