mirror of
https://github.com/wownero/cyberwow.git
synced 2026-11-20 07:04:19 +01:00
use incorrect json format as display format
This commit is contained in:
@@ -26,9 +26,9 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '../../config.dart' as config;
|
||||
import 'rpcView.dart' as rpcView;
|
||||
import '../../helper.dart';
|
||||
import '../../logging.dart';
|
||||
import 'rpcView.dart';
|
||||
|
||||
int rpcID = 0;
|
||||
|
||||
@@ -129,7 +129,7 @@ Future<List<dynamic>> getConnectionsSimple() async {
|
||||
}
|
||||
);
|
||||
|
||||
return _sortedConn.map(rpcPeerView).toList();
|
||||
return _sortedConn.map(rpcView.rpcPeerView).toList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import 'dart:math';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../config.dart' as config;
|
||||
import '../../helper.dart';
|
||||
|
||||
Map<String, dynamic> rpcTxView(Map<String, dynamic> x) {
|
||||
const _remove =
|
||||
@@ -53,7 +54,7 @@ Map<String, dynamic> rpcTxView(Map<String, dynamic> x) {
|
||||
(
|
||||
(k, v) {
|
||||
if (k == 'id_hash') {
|
||||
return MapEntry('id', v.substring(0, config.hashLength) + '...');
|
||||
return MapEntry('id', trimHash(v));
|
||||
}
|
||||
|
||||
else if (k == 'blob_size') {
|
||||
|
||||
@@ -20,6 +20,7 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import '../../config.dart' as config;
|
||||
import '../../helper.dart';
|
||||
|
||||
Map<String, dynamic> rpcPeerView(Map<String, dynamic> x) {
|
||||
const _remove =
|
||||
@@ -57,7 +58,7 @@ Map<String, dynamic> rpcPeerView(Map<String, dynamic> x) {
|
||||
(
|
||||
(k, v) {
|
||||
if (k == 'connection_id') {
|
||||
return MapEntry(k, v.substring(0, config.hashLength) + '...');
|
||||
return MapEntry(k, trimHash(v));
|
||||
}
|
||||
|
||||
const speedField =
|
||||
|
||||
@@ -21,11 +21,16 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'config.dart' as config;
|
||||
|
||||
String pretty(dynamic x) {
|
||||
final JsonEncoder encoder = JsonEncoder.withIndent(' ');
|
||||
return encoder.convert(x);
|
||||
return encoder.convert(x)
|
||||
.replaceAll(RegExp(r'["\[\]{},]'), '')
|
||||
.replaceAll('\n ', '\n');
|
||||
}
|
||||
|
||||
String trimHash(String x) => x.substring(0, config.hashLength) + ' ...';
|
||||
|
||||
int asInt(dynamic x) => x?.toInt() ?? 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user