fix(platform): align topbar missing source status
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user