feat(platform-web): keep realtime source in vehicle links
This commit is contained in:
@@ -11,7 +11,7 @@ function canOpenVehicle(vin?: string) {
|
||||
return Boolean(value && value !== 'unknown');
|
||||
}
|
||||
|
||||
export function Realtime({ onOpenVehicle }: { onOpenVehicle: (vin: string) => void }) {
|
||||
export function Realtime({ onOpenVehicle }: { onOpenVehicle: (vin: string, protocol?: string) => void }) {
|
||||
const [rows, setRows] = useState<VehicleRealtimeRow[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [filters, setFilters] = useState<Record<string, string>>({});
|
||||
@@ -105,7 +105,7 @@ export function Realtime({ onOpenVehicle }: { onOpenVehicle: (vin: string) => vo
|
||||
title: '操作',
|
||||
width: 110,
|
||||
render: (_: unknown, row: VehicleRealtimeRow) => (
|
||||
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin)}>车辆服务</Button>
|
||||
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin, row.primaryProtocol)}>车辆服务</Button>
|
||||
)
|
||||
}
|
||||
]}
|
||||
|
||||
Reference in New Issue
Block a user