Add client count badge

This commit is contained in:
Mygod
2018-05-09 17:38:49 -07:00
parent d7c5dd18a5
commit dad9bc19e3
13 changed files with 227 additions and 104 deletions

View File

@@ -9,10 +9,11 @@ abstract class IpNeighbourMonitoringService : Service(), IpNeighbourMonitor.Call
protected abstract val activeIfaces: List<String>
override fun onIpNeighbourAvailable(neighbours: Map<String, IpNeighbour>) {
this.neighbours = neighbours.values.toList()
override fun onIpNeighbourAvailable(neighbours: List<IpNeighbour>) {
this.neighbours = neighbours
updateNotification()
}
override fun postIpNeighbourAvailable() {
protected fun updateNotification() {
val sizeLookup = neighbours.groupBy { it.dev }.mapValues { (_, neighbours) ->
neighbours
.filter { it.state != IpNeighbour.State.FAILED }