diff --git a/cyberwow/lib/controller/rpc/rpc.dart b/cyberwow/lib/controller/rpc/rpc.dart index eede624..07f2cee 100644 --- a/cyberwow/lib/controller/rpc/rpc.dart +++ b/cyberwow/lib/controller/rpc/rpc.dart @@ -139,6 +139,9 @@ Future> getConnectionsSimple() async { 'current_download', 'current_upload', 'rpc_credits_per_hash', + 'state', + 'recv_idle_time', + 'send_idle_time', ]; final _filteredConn = x..removeWhere diff --git a/cyberwow/lib/widget/synced.dart b/cyberwow/lib/widget/synced.dart index 37a335a..c308ac9 100644 --- a/cyberwow/lib/widget/synced.dart +++ b/cyberwow/lib/widget/synced.dart @@ -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) {