fix(dashboard): 使用稳定设备标识
This commit is contained in:
@@ -54,6 +54,7 @@ export type BatteryInfo = z.infer<typeof batteryInfoSchema>
|
||||
|
||||
export const fleetUnitSchema = z.object({
|
||||
id: z.string(),
|
||||
displayName: z.string(),
|
||||
batch: z.string(),
|
||||
firmware: z.string(),
|
||||
cycles: z.number().int(),
|
||||
@@ -267,7 +268,8 @@ function toFleetUnit(item: BatteryInfo, prediction?: BatteryPrediction): FleetUn
|
||||
const riskScore = Math.round(clamp(prediction?.riskScore ?? fallbackRiskScore, 0, 100))
|
||||
|
||||
return {
|
||||
id: item.devName || item.mac,
|
||||
id: item.mac,
|
||||
displayName: item.devName || item.mac,
|
||||
batch: item.devModel,
|
||||
firmware: item.remark ?? '未提供',
|
||||
cycles: prediction?.cyclesUsed ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user