add count to pool and peers

pull/2/head
fuwa 4 years ago
parent 3a087dc2f7
commit 165158b0a4

@ -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

@ -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) {