feat: add new widget Network Chart (#189) for Network module.

This commit is contained in:
Serhiy Mytrovtsiy
2021-01-21 21:56:06 +01:00
parent 38eeda6ac6
commit e524df7d5e
8 changed files with 250 additions and 30 deletions

View File

@@ -132,13 +132,15 @@ public class Network: Module {
}
private func usageCallback(_ value: Network_Usage?) {
if value == nil {
guard let value = value else {
return
}
self.popupView.usageCallback(value!)
self.popupView.usageCallback(value)
if let widget = self.widget as? SpeedWidget {
widget.setValue(upload: value!.bandwidth.upload, download: value!.bandwidth.download)
widget.setValue(upload: value.bandwidth.upload, download: value.bandwidth.download)
} else if let widget = self.widget as? NetworkChart {
widget.setValue(upload: Double(value.bandwidth.upload), download: Double(value.bandwidth.download))
}
}
}