Skip to content

Commit 173c663

Browse files
committed
[enh] Allow to change period on blockchain stats charts (24h by default)
[enh] Add network stats charts (endpoints per API) [enh] Add currency stats charts (memberships and pending memberships)
1 parent 05532a6 commit 173c663

22 files changed

+783
-197
lines changed

www/js/entities/peer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ Peer.prototype.isBma = function() {
176176
};
177177

178178
Peer.prototype.hasBma = function() {
179-
return this.hasEndpoint('(BASIC_MERKLE_API|BMAS|BMATOR)');
179+
return this.hasEndpoint('(BASIC_MERKLED_API|BMAS|BMATOR)');
180180
};

www/plugins/es/js/controllers/document-controllers.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ angular.module('cesium.es.document.controllers', ['cesium.es.services'])
66
$stateProvider
77

88
.state('app.document_search', {
9-
url: "/data/search/:index/:type?q",
9+
url: "/data/search/:index/:type?q&sort",
1010
views: {
1111
'menuContent': {
1212
templateUrl: "plugins/es/templates/document/lookup.html",
@@ -47,8 +47,10 @@ function ESDocumentLookupController($scope, $ionicPopover, $location, $timeout,
4747
$scope.helptipPrefix = 'helptip-document';
4848
$scope.compactMode = angular.isDefined($scope.compactMode) ? $scope.compactMode : true;
4949
$scope._source = $scope._source || ["issuer", "hash", "time", "creationTime", "title", "message", "recipient",
50-
// Movement field:
51-
"medianTime", "amount", "currency", "reference"
50+
// Movement fields:
51+
"medianTime", "amount", "currency", "reference",
52+
// Pending fields:
53+
"pubkey", "uid", "blockNumber"
5254
];
5355
$scope.showHeaders = angular.isDefined($scope.showHeaders) ? $scope.showHeaders : true;
5456

@@ -62,6 +64,14 @@ function ESDocumentLookupController($scope, $ionicPopover, $location, $timeout,
6264
$scope.entered = true;
6365
$scope.search.index = state.stateParams && state.stateParams.index || $scope.search.index;
6466
$scope.search.type = state.stateParams && state.stateParams.type || $scope.search.type;
67+
$scope.search.text = state.stateParams && state.stateParams.q || $scope.search.text;
68+
$scope.search.sort = state.stateParams && state.stateParams.sort || $scope.search.sort;
69+
$scope.search.last = !$scope.search.text;
70+
$scope.load();
71+
}
72+
73+
// Reload only if params changed (.e.g if comes from a graph click)
74+
else if (state.stateParams && state.stateParams.q && $scope.search.text !== state.stateParams.q) {
6575
$scope.search.text = state.stateParams && state.stateParams.q || $scope.search.text;
6676
$scope.search.last = !$scope.search.text;
6777
$scope.load();

www/plugins/graph/css/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
Graph currency popover
44
**********/
55

6-
.popover-graph-currency {
6+
.popover-graph-range {
77
height: 300px !important;
88
max-width: 250px !important;
99
}
10+
.popover-graph-period {
11+
height: 420px !important;
12+
max-width: 250px !important;
13+
}

www/plugins/graph/i18n/locale-en-GB.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"HOUR": "Group by <b>hour</b>",
1616
"DAY": "Group by <b>day</b>",
1717
"MONTH": "Group by <b>month</b>"
18+
},
19+
"MAX_AGE": {
20+
"DAY": "For 24h",
21+
"WEEK": "For a week",
22+
"MONTH": "For a month",
23+
"QUARTER": "For 3 months",
24+
"SEMESTER": "For 6 months",
25+
"YEAR": "For a year",
26+
"FOREVER": "Forever"
1827
}
1928
},
2029
"ACCOUNT": {
@@ -49,7 +58,11 @@
4958
"MONETARY_MASS_SHARE_LABEL": "Average per member",
5059
"UD_TITLE": "Evolution of the universal dividend",
5160
"MEMBERS_COUNT_TITLE": "Evolution of the number of members",
52-
"MEMBERS_COUNT_LABEL": "Number of members"
61+
"MEMBERS_COUNT_LABEL": "Number of members",
62+
"MEMBERS_DELTA_TITLE": "variation in the number of members",
63+
"IS_MEMBER_DELTA_LABEL": "Validated memberships",
64+
"WAS_MEMBER_DELTA_LABEL": "Membership losses",
65+
"PENDING_DELTA_LABEL": "Membership requests"
5366
},
5467
"PEER": {
5568
"VIEW": {
@@ -86,6 +99,24 @@
8699
"TITLE": "Other documents",
87100
"HISTORY_DELETE": "Deletion of documents"
88101
}
102+
},
103+
"SYNCHRO": {
104+
"TITLE": "Synchronization statistics",
105+
"COUNT": {
106+
"TITLE": "Synchronized volume",
107+
"INSERTS": "Insertions",
108+
"UPDATES": "Updates",
109+
"DELETES": "Deletions"
110+
},
111+
"PEER": {
112+
"TITLE": "Requested peers",
113+
"ES_USER_API": "Peers with with user data",
114+
"ES_SUBSCRIPTION_API": "Peers with subscription"
115+
},
116+
"PERFORMANCE": {
117+
"TITLE": "Execution performance",
118+
"DURATION": "Execution time (ms)"
119+
}
89120
}
90121
}
91122
}

www/plugins/graph/i18n/locale-en.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"HOUR": "Group by <b>hour</b>",
1616
"DAY": "Group by <b>day</b>",
1717
"MONTH": "Group by <b>month</b>"
18+
},
19+
"MAX_AGE": {
20+
"DAY": "For 24h",
21+
"WEEK": "For a week",
22+
"MONTH": "For a month",
23+
"QUARTER": "For 3 months",
24+
"SEMESTER": "For 6 months",
25+
"YEAR": "For a year",
26+
"FOREVER": "Forever"
1827
}
1928
},
2029
"ACCOUNT": {
@@ -49,7 +58,11 @@
4958
"MONETARY_MASS_SHARE_LABEL": "Average per member",
5059
"UD_TITLE": "Evolution of the universal dividend",
5160
"MEMBERS_COUNT_TITLE": "Evolution of the number of members",
52-
"MEMBERS_COUNT_LABEL": "Number of members"
61+
"MEMBERS_COUNT_LABEL": "Number of members",
62+
"MEMBERS_DELTA_TITLE": "variation in the number of members",
63+
"IS_MEMBER_DELTA_LABEL": "Validated memberships",
64+
"WAS_MEMBER_DELTA_LABEL": "Membership losses",
65+
"PENDING_DELTA_LABEL": "Membership requests"
5366
},
5467
"PEER": {
5568
"VIEW": {
@@ -86,6 +99,24 @@
8699
"TITLE": "Other documents",
87100
"HISTORY_DELETE": "Deletion of documents"
88101
}
102+
},
103+
"SYNCHRO": {
104+
"TITLE": "Synchronization statistics",
105+
"COUNT": {
106+
"TITLE": "Synchronized volume",
107+
"INSERTS": "Insertions",
108+
"UPDATES": "Updates",
109+
"DELETES": "Deletions"
110+
},
111+
"PEER": {
112+
"TITLE": "Requested peers",
113+
"ES_USER_API": "Peers with with user data",
114+
"ES_SUBSCRIPTION_API": "Peers with subscription"
115+
},
116+
"PERFORMANCE": {
117+
"TITLE": "Execution performance",
118+
"DURATION": "Execution time (ms)"
119+
}
89120
}
90121
}
91122
}

www/plugins/graph/i18n/locale-fr-FR.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"HOUR": "Heure",
1616
"DAY": "Jour",
1717
"MONTH": "Mois"
18+
},
19+
"MAX_AGE": {
20+
"DAY": "Depuis 24h",
21+
"WEEK": "Depuis une semaine",
22+
"MONTH": "Depuis un mois",
23+
"QUARTER": "Depuis 3 mois",
24+
"SEMESTER": "Depuis 6 mois",
25+
"YEAR": "Depuis un an",
26+
"FOREVER": "Depuis toujours"
1827
}
1928
},
2029
"ACCOUNT": {
@@ -50,15 +59,18 @@
5059
"TX_COUNT_TITLE": "Nombre de transactions écrites",
5160
"TX_COUNT_LABEL": "Nombre de transactions",
5261
"TX_AVG_BY_BLOCK": "Nombre moyen de transactions / bloc"
53-
5462
},
5563
"CURRENCY": {
5664
"MONETARY_MASS_TITLE": "Evolution de la masse monétaire",
5765
"MONETARY_MASS_LABEL": "Masse monétaire",
5866
"MONETARY_MASS_SHARE_LABEL": "Moyenne par membre",
5967
"UD_TITLE": "Evolution du dividende universel",
6068
"MEMBERS_COUNT_TITLE": "Evolution du nombre de membres",
61-
"MEMBERS_COUNT_LABEL": "Nombre de membres"
69+
"MEMBERS_COUNT_LABEL": "Nombre de membres",
70+
"MEMBERS_DELTA_TITLE": "Variation du nombre de membres",
71+
"IS_MEMBER_DELTA_LABEL": "Prises en compte d'adhésion",
72+
"WAS_MEMBER_DELTA_LABEL": "Pertes d'adhésion",
73+
"PENDING_DELTA_LABEL": "Demandes d'adhésion"
6274
},
6375
"PEER": {
6476
"VIEW": {
@@ -106,13 +118,18 @@
106118
},
107119
"PEER": {
108120
"TITLE": "Noeuds requêtés",
109-
"ES_USER_API": "Noeuds données utilisateurs",
110-
"ES_SUBSCRIPTION_API": "Noeuds services en ligne"
121+
"ES_USER_API": "Noeuds avec données utilisateurs",
122+
"ES_SUBSCRIPTION_API": "Noeuds avec services en ligne"
111123
},
112124
"PERFORMANCE": {
113125
"TITLE": "Performances d'exécution",
114126
"DURATION": "Temps d'exécution (ms)"
115127
}
128+
},
129+
"NETWORK": {
130+
"TITLE": "Statistiques réseau",
131+
"ENDPOINT_COUNT_TITLE": "Nombre de points d'accès",
132+
"ENDPOINT_DELTA_TITLE": "Variation du nombre de points d'accès"
116133
}
117134
}
118135
}

www/plugins/graph/js/controllers/blockchain-controllers.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ function GpBlockchainTxCountController($scope, $controller, $q, $state, $filter,
8686
if (!result || !result.times) return; // no data
8787
$scope.times = result.times;
8888

89-
var formatInteger = $filter('formatInteger');
9089
var formatAmount = $filter('formatDecimal');
9190
$scope.currencySymbol = $filter('currencySymbolNoHtml')($scope.formData.currency, $scope.formData.useRelative);
9291

9392
// Data
94-
if ($scope.formData.rangeDuration != 'hour') {
93+
if ($scope.formData.rangeDuration !== 'hour') {
9594
$scope.data = [
9695
result.amount,
9796
result.count
@@ -207,13 +206,18 @@ function GpBlockchainIssuersController($scope, $controller, $q, $state, $transla
207206
// Initialize the super class and extend it.
208207
angular.extend(this, $controller('GpCurrencyAbstractCtrl', {$scope: $scope}));
209208

209+
// Change defaults
210+
$scope.formData.maxAge = 'day';
211+
$scope.computeStartTimeByAge();
212+
210213
$scope.load = function() {
214+
211215
return $q.all([
212216
$translate([
213217
'GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_TITLE',
214218
'GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_LABEL'
215219
]),
216-
gpData.blockchain.countByIssuer($scope.formData.currency)
220+
gpData.blockchain.countByIssuer($scope.formData.currency, {startTime: $scope.formData.startTime})
217221
])
218222
.then(function(result) {
219223
var translations = result[0];

0 commit comments

Comments
 (0)