feat(platform): expose coverage service status

This commit is contained in:
lingniu
2026-07-04 02:03:12 +08:00
parent 5d401a8f0b
commit 526377c13f
9 changed files with 94 additions and 13 deletions

View File

@@ -56,6 +56,7 @@ export interface VehicleCoverageRow {
online: boolean;
lastSeen: string;
bindingStatus: string;
serviceStatus?: VehicleServiceStatus;
}
export interface VehicleIdentityResolution {

View File

@@ -7,6 +7,12 @@ import { PageHeader } from '../components/PageHeader';
import { StatusTag } from '../components/StatusTag';
function vehicleServiceStatus(row: VehicleCoverageRow) {
if (row.serviceStatus) {
return {
label: row.serviceStatus.title,
color: row.serviceStatus.severity === 'ok' ? 'green' as const : row.serviceStatus.severity === 'error' ? 'red' as const : 'orange' as const
};
}
if (row.bindingStatus !== 'bound') {
return { label: '身份未绑定', color: 'orange' as const };
}

View File

@@ -303,11 +303,19 @@ test('shows vehicle service status in vehicle list', async () => {
phone: '13307795425',
oem: 'G7s',
protocols: ['GB32960', 'JT808'],
sourceCount: 2,
sourceCount: 1,
onlineSourceCount: 1,
online: true,
lastSeen: '2026-07-03 20:12:10',
bindingStatus: 'bound'
bindingStatus: 'bound',
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
detail: '由车辆服务 API 统一判定',
sourceCount: 2,
onlineSourceCount: 1
}
}],
total: 1,
limit: 20,