feat: small codebase refactoring (mostly removed unused code and changes in access control)

This commit is contained in:
Serhiy Mytrovtsiy
2024-05-08 17:21:58 +02:00
parent e925e6d131
commit eb882774bb
37 changed files with 160 additions and 583 deletions

View File

@@ -50,18 +50,12 @@ public struct GPU_Info: Codable {
}
}
public struct GPUs: value_t, Codable {
public struct GPUs: Codable {
public var list: [GPU_Info] = []
internal func active() -> [GPU_Info] {
return self.list.filter{ $0.state && $0.utilization != nil }.sorted{ $0.utilization ?? 0 > $1.utilization ?? 0 }
}
public var widgetValue: Double {
get {
return list.isEmpty ? 0 : (list[0].utilization ?? 0)
}
}
}
public class GPU: Module {