feat(platform): keep canonical source summary slots
This commit is contained in:
@@ -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: '缺失车辆',
|
||||
|
||||
Reference in New Issue
Block a user