fix(ios): improve fleet overview and app identity
- Show stable group health in a fixed 2x2 metric grid - Add link-chain state to fleet cards and parse hardware/control/SIM/cellular - Replace the wrapped icon with a full-bleed app icon - Bump the IPA build number
This commit is contained in:
@@ -5,13 +5,16 @@ final class DeviceViewModel: ObservableObject {
|
||||
@Published var snapshot: DeviceSnapshot?
|
||||
@Published var isLoading = false
|
||||
@Published var errorMessage: String?
|
||||
@Published private(set) var connectionStatus: ConnectionStatus = .unknown
|
||||
|
||||
let instance: Instance
|
||||
private let service: DeviceService
|
||||
private let probe: ConnectionProbe?
|
||||
|
||||
init(instance: Instance, service: DeviceService) {
|
||||
init(instance: Instance, service: DeviceService, probe: ConnectionProbe? = nil) {
|
||||
self.instance = instance
|
||||
self.service = service
|
||||
self.probe = probe
|
||||
}
|
||||
|
||||
func refresh() async {
|
||||
@@ -24,6 +27,13 @@ final class DeviceViewModel: ObservableObject {
|
||||
} catch {
|
||||
errorMessage = "无法加载设备数据。"
|
||||
}
|
||||
guard let probe else {
|
||||
connectionStatus = .offline
|
||||
isLoading = false
|
||||
return
|
||||
}
|
||||
let result = try? await probe.test(instance)
|
||||
connectionStatus = result?.status ?? .offline
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user