From 7d491691226dd89967b990de640ecd7a4ccde5aa Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 15 Aug 2025 16:42:12 +0200 Subject: [PATCH] feat: added bootable disks to the Dashboard --- Kit/plugins/Remote.swift | 10 +- Kit/plugins/SystemKit.swift | 119 +++++++++++++++++- .../ar.lproj/Localizable.strings | 1 + .../bg.lproj/Localizable.strings | 1 + .../ca.lproj/Localizable.strings | 1 + .../cs.lproj/Localizable.strings | 1 + .../da.lproj/Localizable.strings | 1 + .../de.lproj/Localizable.strings | 1 + .../el.lproj/Localizable.strings | 1 + .../en-AU.lproj/Localizable.strings | 1 + .../en-GB.lproj/Localizable.strings | 1 + .../en.lproj/Localizable.strings | 1 + .../es.lproj/Localizable.strings | 1 + .../et.lproj/Localizable.strings | 1 + .../fa.lproj/Localizable.strings | 1 + .../fi.lproj/Localizable.strings | 1 + .../fr.lproj/Localizable.strings | 1 + .../he.lproj/Localizable.strings | 1 + .../hi.lproj/Localizable.strings | 1 + .../hr.lproj/Localizable.strings | 1 + .../hu.lproj/Localizable.strings | 1 + .../id.lproj/Localizable.strings | 1 + .../it.lproj/Localizable.strings | 1 + .../ja.lproj/Localizable.strings | 1 + .../ko.lproj/Localizable.strings | 1 + .../nb.lproj/Localizable.strings | 1 + .../nl.lproj/Localizable.strings | 1 + .../pl.lproj/Localizable.strings | 1 + .../pt-BR.lproj/Localizable.strings | 1 + .../pt-PT.lproj/Localizable.strings | 1 + .../ro.lproj/Localizable.strings | 1 + .../ru.lproj/Localizable.strings | 1 + .../sk.lproj/Localizable.strings | 1 + .../sl.lproj/Localizable.strings | 1 + .../sv.lproj/Localizable.strings | 1 + .../th.lproj/Localizable.strings | 1 + .../tr.lproj/Localizable.strings | 1 + .../uk.lproj/Localizable.strings | 1 + .../vi.lproj/Localizable.strings | 1 + .../zh-Hans.lproj/Localizable.strings | 1 + .../zh-Hant.lproj/Localizable.strings | 1 + Stats/Views/Dashboard.swift | 20 ++- Widgets/Supporting Files/Info.plist | 2 +- 43 files changed, 184 insertions(+), 6 deletions(-) diff --git a/Kit/plugins/Remote.swift b/Kit/plugins/Remote.swift index 5926a778..46d11c0a 100644 --- a/Kit/plugins/Remote.swift +++ b/Kit/plugins/Remote.swift @@ -386,7 +386,7 @@ class WebSocketManager: NSObject { var wsHost = Remote.host.absoluteString wsHost = wsHost.replacingOccurrences(of: "https", with: "wss").replacingOccurrences(of: "http", with: "ws") - let url = URL(string: "\(wsHost)/remote?jwt=\(Remote.shared.auth.accessToken)&device_id=\(Remote.shared.id.uuidString)")! + let url = URL(string: "\(wsHost)/remote?jwt=\(Remote.shared.auth.accessToken)&machine_id=\(Remote.shared.id.uuidString)")! self.webSocket = self.session?.webSocketTask(with: url) self.webSocket?.resume() @@ -434,12 +434,14 @@ class WebSocketManager: NSObject { let model: String? let modelID: String? let os: OS + let arch: String? } struct Hardware: Codable { let cpu: cpu_s? let gpu: [gpu_s]? let ram: [dimm_s]? + let disk: [disk_s]? } let details = Details( @@ -453,12 +455,14 @@ class WebSocketManager: NSObject { name: SystemKit.shared.device.os?.name, version: SystemKit.shared.device.os?.version.getFullVersion(), build: SystemKit.shared.device.os?.build - ) + ), + arch: SystemKit.shared.device.arch ), hardware: Hardware( cpu: SystemKit.shared.device.info.cpu, gpu: SystemKit.shared.device.info.gpu, - ram: SystemKit.shared.device.info.ram?.dimms + ram: SystemKit.shared.device.info.ram?.dimms, + disk: SystemKit.shared.device.info.disk, ) ) let jsonData = try? JSONEncoder().encode(details) diff --git a/Kit/plugins/SystemKit.swift b/Kit/plugins/SystemKit.swift index c660580d..695a9b5a 100644 --- a/Kit/plugins/SystemKit.swift +++ b/Kit/plugins/SystemKit.swift @@ -133,14 +133,26 @@ public struct gpu_s: Codable { public var frequencies: [Int32]? = nil } +public struct disk_s: Codable { + public var id: String? = nil + public var name: String? = nil + public var size: Int64? = nil +} + public struct info_s { public var cpu: cpu_s? = nil public var ram: ram_s? = nil public var gpu: [gpu_s]? = nil + public var disk: [disk_s]? = nil } public struct device_s { - public var model: model_s = model_s(name: localizedString("Unknown"), year: Calendar.current.component(.year, from: Date()), type: .unknown) + public var model: model_s = model_s( + name: localizedString("Unknown"), + year: Calendar.current.component(.year, from: Date()), + type: .unknown, + ) + public var arch: String = "unknown" public var serialNumber: String? = nil public var bootDate: Date? = nil @@ -167,6 +179,12 @@ public class SystemKit { self.device.model = model } + #if arch(x86_64) + self.device.arch = "x86_64" + #elseif arch(arm64) + self.device.arch = "arm64" + #endif + self.device.bootDate = self.bootDate() let procInfo = ProcessInfo() @@ -184,6 +202,7 @@ public class SystemKit { self.device.info.cpu = self.getCPUInfo() self.device.info.ram = self.getRamInfo() self.device.info.gpu = self.getGPUInfo() + self.device.info.disk = self.getDiskInfo() self.device.platform = self.getPlatform() } @@ -389,6 +408,104 @@ public class SystemKit { return list } + private func getDiskInfo() -> [disk_s]? { + var bootableDisks: [disk_s] = [] + + guard let output = process(path: "/usr/sbin/diskutil", arguments: ["list", "-plist"]) else { + return nil + } + + do { + if let data = output.data(using: .utf8), + let plist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any], + let allDisksAndPartitions = plist["AllDisksAndPartitions"] as? [[String: Any]] { + + for disk in allDisksAndPartitions { + if let partitions = disk["Partitions"] as? [[String: Any]] { + for partition in partitions { + if let bootable = partition["Bootable"] as? Bool, bootable { + var bootableDisk = disk_s() + if let id = partition["DiskUUID"] as? String { + bootableDisk.id = id + } else if let deviceIdentifier = partition["DeviceIdentifier"] as? String { + bootableDisk.id = "/dev/" + deviceIdentifier + } + if let volumeName = partition["VolumeName"] as? String { + bootableDisk.name = volumeName + } + if let size = partition["Size"] as? Int64 { + bootableDisk.size = size + } + if bootableDisk.id != nil { + bootableDisks.append(bootableDisk) + } + } + } + } + + if let contentType = disk["Content"] as? String, contentType == "Apple_APFS_Container" || contentType == "Apple_CoreStorage" { + if let deviceIdentifier = disk["DeviceIdentifier"] as? String, + let infoOutput = process(path: "/usr/sbin/diskutil", arguments: ["info", "-plist", deviceIdentifier]), + let infoData = infoOutput.data(using: .utf8), + let info = try PropertyListSerialization.propertyList(from: infoData, options: [], format: nil) as? [String: Any] { + if let isBootDisk = info["BootableVolume"] as? Bool, isBootDisk { + var bootableDisk = disk_s() + if let id = info["DiskUUID"] as? String { + bootableDisk.id = id + } else { + bootableDisk.id = "/dev/" + deviceIdentifier + } + if let name = info["VolumeName"] as? String { + bootableDisk.name = name + } else if let name = disk["DeviceIdentifier"] as? String { + bootableDisk.name = name + } + + if let size = disk["Size"] as? Int64 { + bootableDisk.size = size + } else if let total = info["TotalSize"] as? Int64 { + bootableDisk.size = total + } + + if bootableDisk.id != nil { + bootableDisks.append(bootableDisk) + } + } + } + } + } + } + } catch { + print("Error parsing diskutil output: \(error)") + return nil + } + + if bootableDisks.isEmpty { + if let startupDiskInfo = process(path: "/usr/sbin/diskutil", arguments: ["info", "-plist", "/"]) { + if let data = startupDiskInfo.data(using: .utf8), + let plist = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] { + var bootDisk = disk_s() + if let id = plist["DiskUUID"] as? String { + bootDisk.id = id + } else if let deviceNode = plist["DeviceNode"] as? String { + bootDisk.id = deviceNode + } + if let volumeName = plist["VolumeName"] as? String { + bootDisk.name = volumeName + } + if let totalSize = plist["TotalSize"] as? Int64 { + bootDisk.size = totalSize + } + if bootDisk.id != nil { + bootableDisks.append(bootDisk) + } + } + } + } + + return bootableDisks + } + private func getFrequencies(cpuName: String) -> ([Int32], [Int32])? { var iterator = io_iterator_t() let result = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("AppleARMIODevice"), &iterator) diff --git a/Stats/Supporting Files/ar.lproj/Localizable.strings b/Stats/Supporting Files/ar.lproj/Localizable.strings index 22e10174..5add684c 100644 --- a/Stats/Supporting Files/ar.lproj/Localizable.strings +++ b/Stats/Supporting Files/ar.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 خيوط"; "Number of e-cores" = "%0 نوى كفاءة"; "Number of p-cores" = "%0 نوى أداء"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "تم تثبيت أحدث إصدار من الإحصاءات"; diff --git a/Stats/Supporting Files/bg.lproj/Localizable.strings b/Stats/Supporting Files/bg.lproj/Localizable.strings index 9178c57f..6a2c371c 100644 --- a/Stats/Supporting Files/bg.lproj/Localizable.strings +++ b/Stats/Supporting Files/bg.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 нишки"; "Number of e-cores" = "%0 ефикасни ядра"; "Number of p-cores" = "%0 производителни ядра"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Имате най-новата версия на Stats"; diff --git a/Stats/Supporting Files/ca.lproj/Localizable.strings b/Stats/Supporting Files/ca.lproj/Localizable.strings index 5a92cabf..c2c8d5de 100644 --- a/Stats/Supporting Files/ca.lproj/Localizable.strings +++ b/Stats/Supporting Files/ca.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 fils"; "Number of e-cores" = "%0 nuclis d'eficiència"; "Number of p-cores" = "%0 nuclis de rendiment"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "L'última versió d'Stats està instal·lada"; diff --git a/Stats/Supporting Files/cs.lproj/Localizable.strings b/Stats/Supporting Files/cs.lproj/Localizable.strings index c63fa84e..6b2ee56a 100644 --- a/Stats/Supporting Files/cs.lproj/Localizable.strings +++ b/Stats/Supporting Files/cs.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 vláken"; "Number of e-cores" = "%0 efektivních jader"; "Number of p-cores" = "%0 výkonných jader"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Byla nainstalována nejnovější verze Stats"; diff --git a/Stats/Supporting Files/da.lproj/Localizable.strings b/Stats/Supporting Files/da.lproj/Localizable.strings index cd59a943..23559b43 100644 --- a/Stats/Supporting Files/da.lproj/Localizable.strings +++ b/Stats/Supporting Files/da.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 tråde"; "Number of e-cores" = "%0 efficiency kerner"; "Number of p-cores" = "%0 performance kerner"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Den nyeste udgave af Stats er installeret"; diff --git a/Stats/Supporting Files/de.lproj/Localizable.strings b/Stats/Supporting Files/de.lproj/Localizable.strings index 8ae78484..c47fdcdc 100644 --- a/Stats/Supporting Files/de.lproj/Localizable.strings +++ b/Stats/Supporting Files/de.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 Threads"; "Number of e-cores" = "%0 Effizienz-Kerne"; "Number of p-cores" = "%0 Per­for­mance-Kerne"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Die neueste Version von Stats ist installiert"; diff --git a/Stats/Supporting Files/el.lproj/Localizable.strings b/Stats/Supporting Files/el.lproj/Localizable.strings index fc491358..dde04a7d 100644 --- a/Stats/Supporting Files/el.lproj/Localizable.strings +++ b/Stats/Supporting Files/el.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 πυρήνες απόδοσης"; "Number of p-cores" = "%0 πυρήνες επίδοσης"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Η τελευταία έκδοση του Stats είναι εγκατεστημένη"; diff --git a/Stats/Supporting Files/en-AU.lproj/Localizable.strings b/Stats/Supporting Files/en-AU.lproj/Localizable.strings index dba33048..15e5e66d 100644 --- a/Stats/Supporting Files/en-AU.lproj/Localizable.strings +++ b/Stats/Supporting Files/en-AU.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "The latest version of Stats is installed"; diff --git a/Stats/Supporting Files/en-GB.lproj/Localizable.strings b/Stats/Supporting Files/en-GB.lproj/Localizable.strings index 25faeb12..9bc21350 100644 --- a/Stats/Supporting Files/en-GB.lproj/Localizable.strings +++ b/Stats/Supporting Files/en-GB.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "The latest version of Stats is installed"; diff --git a/Stats/Supporting Files/en.lproj/Localizable.strings b/Stats/Supporting Files/en.lproj/Localizable.strings index a26ed596..077025c3 100644 --- a/Stats/Supporting Files/en.lproj/Localizable.strings +++ b/Stats/Supporting Files/en.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "The latest version of Stats is installed"; diff --git a/Stats/Supporting Files/es.lproj/Localizable.strings b/Stats/Supporting Files/es.lproj/Localizable.strings index a246571a..efa9936c 100644 --- a/Stats/Supporting Files/es.lproj/Localizable.strings +++ b/Stats/Supporting Files/es.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "Número de hilos"; "Number of e-cores" = "Número de núcleos de eficiencia"; "Number of p-cores" = "Número de núcleos de rendimiento"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "La última versión de Stats está instalada"; diff --git a/Stats/Supporting Files/et.lproj/Localizable.strings b/Stats/Supporting Files/et.lproj/Localizable.strings index 99f5bb3b..b436d83b 100644 --- a/Stats/Supporting Files/et.lproj/Localizable.strings +++ b/Stats/Supporting Files/et.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 lõimed"; "Number of e-cores" = "%0 tõhusatuumad"; "Number of p-cores" = "%0 jõudlustuumad"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Uusim versioon on installitud"; diff --git a/Stats/Supporting Files/fa.lproj/Localizable.strings b/Stats/Supporting Files/fa.lproj/Localizable.strings index e31242a8..de15cb9a 100644 --- a/Stats/Supporting Files/fa.lproj/Localizable.strings +++ b/Stats/Supporting Files/fa.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 ترد‌ها"; "Number of e-cores" = "%0 هسته‌های کم‌مصرف"; "Number of p-cores" = "%0 هسته‌های پرقدرت"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "آخرین نسخه‌ی Stats نصب شده است"; diff --git a/Stats/Supporting Files/fi.lproj/Localizable.strings b/Stats/Supporting Files/fi.lproj/Localizable.strings index 2199de6a..2595124e 100644 --- a/Stats/Supporting Files/fi.lproj/Localizable.strings +++ b/Stats/Supporting Files/fi.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 säiettä"; "Number of e-cores" = "%0 e-ydintä"; "Number of p-cores" = "%0 p-ydintä"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Stats on päivitetty viimeisimpään versioon"; diff --git a/Stats/Supporting Files/fr.lproj/Localizable.strings b/Stats/Supporting Files/fr.lproj/Localizable.strings index dccd26a6..a98f1952 100644 --- a/Stats/Supporting Files/fr.lproj/Localizable.strings +++ b/Stats/Supporting Files/fr.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 cœurs à haute effica­cité éner­gétique"; "Number of p-cores" = "%0 cœurs de perfor­mance"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "La dernière version de Stats est installée"; diff --git a/Stats/Supporting Files/he.lproj/Localizable.strings b/Stats/Supporting Files/he.lproj/Localizable.strings index 7066e6f7..66a6f596 100644 --- a/Stats/Supporting Files/he.lproj/Localizable.strings +++ b/Stats/Supporting Files/he.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 טרדים"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "מותקנת Stats הגרסא האחרונה של"; diff --git a/Stats/Supporting Files/hi.lproj/Localizable.strings b/Stats/Supporting Files/hi.lproj/Localizable.strings index 9e933685..a9510ffc 100644 --- a/Stats/Supporting Files/hi.lproj/Localizable.strings +++ b/Stats/Supporting Files/hi.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 थ्रेड्स"; "Number of e-cores" = "%0 दक्षता कोर"; "Number of p-cores" = "%0 प्रदर्शन कोर"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "आँकड़े का नवीनतम संस्करण स्थापित है"; diff --git a/Stats/Supporting Files/hr.lproj/Localizable.strings b/Stats/Supporting Files/hr.lproj/Localizable.strings index e50793a5..48c0066b 100644 --- a/Stats/Supporting Files/hr.lproj/Localizable.strings +++ b/Stats/Supporting Files/hr.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "Broj komponenti procesa: %0"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Instalirana je najnovija verzija programa Stats"; diff --git a/Stats/Supporting Files/hu.lproj/Localizable.strings b/Stats/Supporting Files/hu.lproj/Localizable.strings index d35914f3..280211f6 100644 --- a/Stats/Supporting Files/hu.lproj/Localizable.strings +++ b/Stats/Supporting Files/hu.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 szál"; "Number of e-cores" = "%0 energiatakarékos mag"; "Number of p-cores" = "%0 teljesítményre optimalizált mag"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "A Stats legújabb verziója van telepítve"; diff --git a/Stats/Supporting Files/id.lproj/Localizable.strings b/Stats/Supporting Files/id.lproj/Localizable.strings index 10bf0a52..a8d9a0a4 100644 --- a/Stats/Supporting Files/id.lproj/Localizable.strings +++ b/Stats/Supporting Files/id.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 thread"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Versi terbaru dari Stats telah dipasang"; diff --git a/Stats/Supporting Files/it.lproj/Localizable.strings b/Stats/Supporting Files/it.lproj/Localizable.strings index 3a53fb55..f4be113f 100644 --- a/Stats/Supporting Files/it.lproj/Localizable.strings +++ b/Stats/Supporting Files/it.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 thread"; "Number of e-cores" = "%0 efficiency core"; "Number of p-cores" = "%0 performance core"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "L'ultima versione di Stats è installata"; diff --git a/Stats/Supporting Files/ja.lproj/Localizable.strings b/Stats/Supporting Files/ja.lproj/Localizable.strings index d9fda0d5..7efd24b0 100644 --- a/Stats/Supporting Files/ja.lproj/Localizable.strings +++ b/Stats/Supporting Files/ja.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 スレッド"; "Number of e-cores" = "%0 高効率コア"; "Number of p-cores" = "%0 高性能コア"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "最新の Stats がインストールされています"; diff --git a/Stats/Supporting Files/ko.lproj/Localizable.strings b/Stats/Supporting Files/ko.lproj/Localizable.strings index b21c7545..135bcf65 100644 --- a/Stats/Supporting Files/ko.lproj/Localizable.strings +++ b/Stats/Supporting Files/ko.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 스레드"; "Number of e-cores" = "%0 효율 코어"; "Number of p-cores" = "%0 성능 코어"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "최신 버전의 Stats가 설치되어 있습니다"; diff --git a/Stats/Supporting Files/nb.lproj/Localizable.strings b/Stats/Supporting Files/nb.lproj/Localizable.strings index 308f20cd..801aadb4 100644 --- a/Stats/Supporting Files/nb.lproj/Localizable.strings +++ b/Stats/Supporting Files/nb.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 tråder"; "Number of e-cores" = "%0 effektivitetskjerner"; "Number of p-cores" = "%0 ytelseskjerner"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Du har den nyeste versjonen av Stats"; diff --git a/Stats/Supporting Files/nl.lproj/Localizable.strings b/Stats/Supporting Files/nl.lproj/Localizable.strings index 298b54cd..404dfa96 100644 --- a/Stats/Supporting Files/nl.lproj/Localizable.strings +++ b/Stats/Supporting Files/nl.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "De laatste versie van Stats is geïnstalleerd."; diff --git a/Stats/Supporting Files/pl.lproj/Localizable.strings b/Stats/Supporting Files/pl.lproj/Localizable.strings index 0cedc460..92aeeaa8 100644 --- a/Stats/Supporting Files/pl.lproj/Localizable.strings +++ b/Stats/Supporting Files/pl.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 wątków"; "Number of e-cores" = "%0 rdzeni energooszczędnych"; "Number of p-cores" = "%0 rdzeni wydajnościowych"; +"Disks" = "Dyski"; // Update "The latest version of Stats installed" = "Najnowsza wersja Stats zainstalowana"; diff --git a/Stats/Supporting Files/pt-BR.lproj/Localizable.strings b/Stats/Supporting Files/pt-BR.lproj/Localizable.strings index 50b247ac..8f717e7f 100644 --- a/Stats/Supporting Files/pt-BR.lproj/Localizable.strings +++ b/Stats/Supporting Files/pt-BR.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 núcleos de eficiência"; "Number of p-cores" = "%0 núcleos de desempenho"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "A versão mais recente do Stats está instalada"; diff --git a/Stats/Supporting Files/pt-PT.lproj/Localizable.strings b/Stats/Supporting Files/pt-PT.lproj/Localizable.strings index 1ace2902..896ef997 100644 --- a/Stats/Supporting Files/pt-PT.lproj/Localizable.strings +++ b/Stats/Supporting Files/pt-PT.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "A versão mais recente do Stats instalada"; diff --git a/Stats/Supporting Files/ro.lproj/Localizable.strings b/Stats/Supporting Files/ro.lproj/Localizable.strings index 2d1d35bf..dff8d8bc 100644 --- a/Stats/Supporting Files/ro.lproj/Localizable.strings +++ b/Stats/Supporting Files/ro.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 threads"; "Number of e-cores" = "%0 efficiency cores"; "Number of p-cores" = "%0 performance cores"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Cea mai recentă versiune de Stats instalată"; diff --git a/Stats/Supporting Files/ru.lproj/Localizable.strings b/Stats/Supporting Files/ru.lproj/Localizable.strings index 6808e8cc..7852bffe 100644 --- a/Stats/Supporting Files/ru.lproj/Localizable.strings +++ b/Stats/Supporting Files/ru.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 потоков"; "Number of e-cores" = "%0 энергоэффективных ядер"; "Number of p-cores" = "%0 производительных ядер"; +"Disks" = "Диски"; // Update "The latest version of Stats installed" = "Установлена последняя версия"; diff --git a/Stats/Supporting Files/sk.lproj/Localizable.strings b/Stats/Supporting Files/sk.lproj/Localizable.strings index 66e41580..241ead6b 100644 --- a/Stats/Supporting Files/sk.lproj/Localizable.strings +++ b/Stats/Supporting Files/sk.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 vlákien"; "Number of e-cores" = "%0 efektívnych jadier"; "Number of p-cores" = "%0 výkonných jadier"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Bola nainštalovaná najnovšia verzia Stats"; diff --git a/Stats/Supporting Files/sl.lproj/Localizable.strings b/Stats/Supporting Files/sl.lproj/Localizable.strings index fa16101f..4b66e730 100644 --- a/Stats/Supporting Files/sl.lproj/Localizable.strings +++ b/Stats/Supporting Files/sl.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 niti"; "Number of e-cores" = "%0 učinkovitih jeder"; "Number of p-cores" = "%0 performančnih jeder"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Nameščena je najnovejša različica programa Stats"; diff --git a/Stats/Supporting Files/sv.lproj/Localizable.strings b/Stats/Supporting Files/sv.lproj/Localizable.strings index 716e8323..02438855 100644 --- a/Stats/Supporting Files/sv.lproj/Localizable.strings +++ b/Stats/Supporting Files/sv.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 trådar"; "Number of e-cores" = "%0 effektivitetskärnor"; "Number of p-cores" = "%0 prestandakärnor"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Den senaste versionen av Stats är installerad"; diff --git a/Stats/Supporting Files/th.lproj/Localizable.strings b/Stats/Supporting Files/th.lproj/Localizable.strings index f889745b..43158896 100644 --- a/Stats/Supporting Files/th.lproj/Localizable.strings +++ b/Stats/Supporting Files/th.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 thread"; "Number of e-cores" = "%0 cores ประสิทธิภาพ"; "Number of p-cores" = "%0 cores ประสิทธิผล"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "เวอร์ชันล่าสุดของ Stats ได้รับการติดตั้งแล้ว"; diff --git a/Stats/Supporting Files/tr.lproj/Localizable.strings b/Stats/Supporting Files/tr.lproj/Localizable.strings index 198197bb..3d993285 100644 --- a/Stats/Supporting Files/tr.lproj/Localizable.strings +++ b/Stats/Supporting Files/tr.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 iş parçacığı"; "Number of e-cores" = "%0 verimlilik çekirdeği"; "Number of p-cores" = "%0 performans çekirdeği"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Stats'ın son sürümü kurulu"; diff --git a/Stats/Supporting Files/uk.lproj/Localizable.strings b/Stats/Supporting Files/uk.lproj/Localizable.strings index b78f2a52..4539157e 100644 --- a/Stats/Supporting Files/uk.lproj/Localizable.strings +++ b/Stats/Supporting Files/uk.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 потоків"; "Number of e-cores" = "%0 енергоефективних ядер"; "Number of p-cores" = "%0 високопродуктивних ядер"; +"Disks" = "Диски"; // Update "The latest version of Stats installed" = "Встановлено останню версію"; diff --git a/Stats/Supporting Files/vi.lproj/Localizable.strings b/Stats/Supporting Files/vi.lproj/Localizable.strings index b8cae943..5ffd2875 100644 --- a/Stats/Supporting Files/vi.lproj/Localizable.strings +++ b/Stats/Supporting Files/vi.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 luồng"; "Number of e-cores" = "%0 nhân tiết kiệm"; "Number of p-cores" = "%0 nhân hiệu năng"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "Phiên bản Stats mới nhất đã được cài đặt"; diff --git a/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings b/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings index 516d1eb6..f2bb6c1e 100644 --- a/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings +++ b/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 线程"; "Number of e-cores" = "%0 能效核心"; "Number of p-cores" = "%0 性能核心"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "已安装最新版 Stats"; diff --git a/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings b/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings index c8081a16..ee77646c 100644 --- a/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings +++ b/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings @@ -177,6 +177,7 @@ "Number of threads" = "%0 執行緒"; "Number of e-cores" = "%0 個節能核心"; "Number of p-cores" = "%0 個效能核心"; +"Disks" = "Disks"; // Update "The latest version of Stats installed" = "已安裝最新版本"; diff --git a/Stats/Views/Dashboard.swift b/Stats/Views/Dashboard.swift index 03fe09fe..7453b3f5 100644 --- a/Stats/Views/Dashboard.swift +++ b/Stats/Views/Dashboard.swift @@ -141,6 +141,23 @@ class Dashboard: NSStackView { } return value } + private var disksValue: String { + guard let disks = SystemKit.shared.device.info.disk else { + return localizedString("Unknown") + } + + var value = "" + for i in 0..CFBundleShortVersionString 2.11.49 CFBundleVersion - 709 + 710 NSExtension NSExtensionPointIdentifier