fix(platform): align topbar missing source status

This commit is contained in:
lingniu
2026-07-04 07:58:24 +08:00
parent 1d691306db
commit 4251ea5235
2 changed files with 16 additions and 12 deletions

View File

@@ -417,6 +417,7 @@ function normalizeHistoryFilterValues(filters: Record<string, unknown> = {}): Re
function serviceStatusFromOverview(overview: VehicleServiceOverview): VehicleServiceStatus {
const sourceCount = overview.sourceCount;
const onlineSourceCount = overview.onlineSourceCount;
const missingProtocols = overview.sourceConsistency?.missingProtocols ?? [];
if (!overview.vin) {
return {
status: 'identity_required',
@@ -447,6 +448,16 @@ function serviceStatusFromOverview(overview: VehicleServiceOverview): VehicleSer
onlineSourceCount
};
}
if (missingProtocols.length > 0) {
return {
status: 'degraded',
severity: 'warning',
title: '来源不完整',
detail: `${onlineSourceCount}/${sourceCount} 个来源在线,车辆服务可用但缺少 ${missingProtocols.join('、')} 来源。`,
sourceCount,
onlineSourceCount
};
}
if (onlineSourceCount < sourceCount) {
return {
status: 'degraded',