mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 19:38:41 +00:00
iOS: extract device/platform info into DeviceInfoHelper, keep Settings platform string as iOS X.Y.Z
This commit is contained in:
committed by
Peter Steinberger
parent
e3ac491da3
commit
32d7756d8c
@@ -374,9 +374,9 @@ struct SettingsTab: View {
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.middle)
|
||||
LabeledContent("Device", value: self.deviceFamily())
|
||||
LabeledContent("Platform", value: self.platformString())
|
||||
LabeledContent("OpenClaw", value: self.openClawVersionString())
|
||||
LabeledContent("Device", value: DeviceInfoHelper.deviceFamily())
|
||||
LabeledContent("Platform", value: DeviceInfoHelper.platformStringForDisplay())
|
||||
LabeledContent("OpenClaw", value: DeviceInfoHelper.openClawVersionString())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -584,32 +584,6 @@ struct SettingsTab: View {
|
||||
return trimmed.isEmpty ? "Not connected" : trimmed
|
||||
}
|
||||
|
||||
private func platformString() -> String {
|
||||
let v = ProcessInfo.processInfo.operatingSystemVersion
|
||||
return "iOS \(v.majorVersion).\(v.minorVersion).\(v.patchVersion)"
|
||||
}
|
||||
|
||||
private func deviceFamily() -> String {
|
||||
switch UIDevice.current.userInterfaceIdiom {
|
||||
case .pad:
|
||||
"iPad"
|
||||
case .phone:
|
||||
"iPhone"
|
||||
default:
|
||||
"iOS"
|
||||
}
|
||||
}
|
||||
|
||||
private func openClawVersionString() -> String {
|
||||
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "dev"
|
||||
let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? ""
|
||||
let trimmedBuild = build.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
if trimmedBuild.isEmpty || trimmedBuild == version {
|
||||
return version
|
||||
}
|
||||
return "\(version) (\(trimmedBuild))"
|
||||
}
|
||||
|
||||
private func featureToggle(
|
||||
_ title: String,
|
||||
isOn: Binding<Bool>,
|
||||
|
||||
Reference in New Issue
Block a user