mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
feat: memory overview item
This commit is contained in:
@@ -41,6 +41,15 @@ extension ClashApiDatasStorage: ApiRequestStreamDelegate {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func didUpdateMemory(memory: Int64) {
|
||||
let v = ByteCountFormatter().string(fromByteCount: memory)
|
||||
|
||||
if overviewData.memory != v {
|
||||
overviewData.memory = v
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fileprivate let TrafficHistoryLimit = 120
|
||||
@@ -56,6 +65,8 @@ class ClashOverviewData: ObservableObject, Identifiable {
|
||||
|
||||
@Published var activeConns = "0"
|
||||
|
||||
@Published var memory = "0 MB"
|
||||
|
||||
@Published var downloadHistories = [CGFloat](repeating: 0, count: TrafficHistoryLimit)
|
||||
@Published var uploadHistories = [CGFloat](repeating: 0, count: TrafficHistoryLimit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user