feat: added an option to select chart history range for line chart in the popup view (CPU module only for now)

This commit is contained in:
Serhiy Mytrovtsiy
2024-03-05 19:04:02 +01:00
parent 14e14d6be5
commit 79ec0ed00f
3 changed files with 32 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ public struct DoubleValue {
}
}
extension [DoubleValue] {
public func max() -> Double? { self.max { $0.value < $1.value }?.value }
public func max() -> Double? { self.max(by: { $0.value < $1.value })?.value }
}
public struct ColorValue: Equatable {
@@ -326,3 +326,11 @@ public let FanValues: [KeyValue_t] = [
KeyValue_t(key: "rpm", value: "RPM", additional: FanValue.rpm),
KeyValue_t(key: "percentage", value: "Percentage", additional: FanValue.percentage)
]
public var LineChartHistory: [KeyValue_p] = [
KeyValue_t(key: "60", value: "1 minute"),
KeyValue_t(key: "120", value: "2 minutes"),
KeyValue_t(key: "180", value: "3 minutes"),
KeyValue_t(key: "300", value: "5 minutes"),
KeyValue_t(key: "600", value: "10 minutes")
]