From 3a087dc2f760623ba1d01210a095cbcbde50dcf1 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 26 Nov 2019 12:52:58 +0800 Subject: [PATCH] clean up connections view --- cyberwow/lib/controller/rpc/rpc.dart | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/controller/rpc/rpc.dart b/cyberwow/lib/controller/rpc/rpc.dart index 9d0aa02..eede624 100644 --- a/cyberwow/lib/controller/rpc/rpc.dart +++ b/cyberwow/lib/controller/rpc/rpc.dart @@ -119,7 +119,34 @@ Future> getConnectionsSimple() async { return _connections.map ( (x) { - return x.map + const _remove = + [ + 'address_type', + 'connection_id', + 'host', + 'ip', + 'local_ip', + 'localhost', + 'peer_id', + 'port', + 'recv_count', + 'rpc_port', + 'send_count', + 'support_flags', + + 'avg_download', + 'avg_upload', + 'current_download', + 'current_upload', + 'rpc_credits_per_hash', + ]; + + final _filteredConn = x..removeWhere + ( + (k,v) => _remove.contains(k) + ); + + return _filteredConn.map ( (k, v) { if (k == 'connection_id') {