feat(platform): expose source consistency in vehicle coverage
This commit is contained in:
@@ -33,6 +33,15 @@ function sourceEvidenceText(row: VehicleCoverageRow) {
|
||||
return `${row.onlineSourceCount}/${row.sourceCount} 来源在线`;
|
||||
}
|
||||
|
||||
function sourceConsistencyTag(row: VehicleCoverageRow) {
|
||||
const consistency = row.sourceConsistency;
|
||||
if (!consistency) {
|
||||
return <Tag color="grey">未诊断</Tag>;
|
||||
}
|
||||
const color = consistency.severity === 'ok' ? 'green' as const : consistency.severity === 'error' ? 'red' as const : 'orange' as const;
|
||||
return <Tag color={color}>{consistency.title || consistency.status}</Tag>;
|
||||
}
|
||||
|
||||
async function copyVehicleShareURL() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}${window.location.hash}`);
|
||||
@@ -154,6 +163,11 @@ export function Vehicles({
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '来源一致性',
|
||||
width: 140,
|
||||
render: (_: unknown, row: VehicleCoverageRow) => sourceConsistencyTag(row)
|
||||
},
|
||||
{ title: '证据覆盖', width: 120, render: (_: unknown, row: VehicleCoverageRow) => sourceEvidenceText(row) },
|
||||
{ title: '在线', width: 90, render: (_: unknown, row: VehicleCoverageRow) => <StatusTag status={row.online ? 'ok' : 'offline'} /> },
|
||||
{ title: '最后在线', dataIndex: 'lastSeen', width: 170 },
|
||||
|
||||
Reference in New Issue
Block a user