From a855c44c8e237d1bb72f34e7bc5606b0ec7b1383 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 26 Nov 2019 17:29:47 +0800 Subject: [PATCH] only show active connections --- cyberwow/lib/controller/rpc/rpc.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/controller/rpc/rpc.dart b/cyberwow/lib/controller/rpc/rpc.dart index 5233325..a4b3592 100644 --- a/cyberwow/lib/controller/rpc/rpc.dart +++ b/cyberwow/lib/controller/rpc/rpc.dart @@ -116,7 +116,10 @@ Future incomingConnectionsCount() => Future> getConnectionsSimple() async { final _connections = await rpc('get_connections', field: 'connections').then(asList); - return _connections.map + const minActiveTime = 8; + final _activeConnections = _connections.where((x) => x['live_time'] > minActiveTime); + + return _activeConnections.map ( (x) { const _remove =