add count to pool and peers

This commit is contained in:
fuwa
2019-11-26 13:09:10 +08:00
parent 3a087dc2f7
commit 165158b0a4
2 changed files with 16 additions and 2 deletions
+3
View File
@@ -139,6 +139,9 @@ Future<List<dynamic>> getConnectionsSimple() async {
'current_download',
'current_upload',
'rpc_credits_per_hash',
'state',
'recv_idle_time',
'send_idle_time',
];
final _filteredConn = x..removeWhere
+13 -2
View File
@@ -141,9 +141,20 @@ Widget rpcView(BuildContext context, String title, dynamic body) {
}
Widget getInfo(BuildContext context, SyncedState state) => rpcView(context, 'info', state.getInfo);
Widget getConnections(BuildContext context, SyncedState state) => rpcView(context, 'connections', state.getConnections);
Widget syncInfo(BuildContext context, SyncedState state) => rpcView(context, 'sync info', state.syncInfo);
Widget getTransactionPool(BuildContext context, SyncedState state) => rpcView(context, 'tx pool', state.getTransactionPool);
Widget getTransactionPool(BuildContext context, SyncedState state) {
final pool = state.getTransactionPool;
final subTitle = pool.isEmpty ? '' : ' ‹${pool.length}›';
return rpcView(context, 'tx pool' + subTitle, pool);
}
Widget getConnections(BuildContext context, SyncedState state) {
final peers = state.getConnections;
final subTitle = peers.isEmpty ? '' : ' ‹${peers.length}›';
return rpcView(context, 'peers' + subTitle, peers);
}
Widget terminalView(BuildContext context, String title, SyncedState state) {