feat(menubar): 调整两排卡片布局并加入复合曲线与数值动效
This commit is contained in:
@@ -12,9 +12,14 @@ import Foundation
|
||||
snapshot.network = [NetworkInterfaceMetrics(name: "en0", received: 1, sent: 1, download: 12, upload: 8),
|
||||
NetworkInterfaceMetrics(name: "utun0", received: 1, sent: 1, download: 99, upload: 99)]
|
||||
precondition(snapshot.downloadRate == 12 && snapshot.uploadRate == 8)
|
||||
snapshot.cpu = CPUMetrics(usage: 0.6, user: 0.4, system: 0.2, cores: [])
|
||||
var history = MetricHistory()
|
||||
for _ in 0..<65 { history.append(snapshot) }
|
||||
precondition(history.samples.count == 60 && history.interfaces["0:en0"]?.count == 60)
|
||||
precondition(history.samples.last?.cpuUser == 0.4 && history.samples.last?.cpuSystem == 0.2)
|
||||
snapshot.cpu = nil
|
||||
history.append(snapshot)
|
||||
precondition(history.samples.last?.cpuUser == nil && history.samples.last?.cpuSystem == nil)
|
||||
snapshot.network = []
|
||||
history.append(snapshot)
|
||||
precondition(history.interfaces.isEmpty && snapshot.downloadRate == nil)
|
||||
|
||||
Reference in New Issue
Block a user