Skip to content

Commit 0649593

Browse files
authored
Bugfix/metrics fixes (#434)
* Updated dashboard html file * Changed explorer to listen on the same port as old dashboard * Using correct field names in js file * Sending correct key in metrics
1 parent 8184059 commit 0649593

File tree

4 files changed

+254
-282
lines changed

4 files changed

+254
-282
lines changed

explorer/public/assets/js/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,16 @@ function compareNodes(node1, node2) {
144144
function createMixnodeRows(mixNodes) {
145145
mixNodes.sort(compareNodes)
146146

147+
const currentUnixTime = new Date().getTime() * 1000000;
148+
147149
mixNodes.forEach(node => {
148150
// because javascript works in mysterious ways, if you sanitize "0", it will return ""
149151
let purifiedRep = DOMPurify.sanitize(node.reputation)
150152
if (purifiedRep.length === 0) {
151153
purifiedRep = 0
152154
}
153155
var $tr = $('<tr>').append(
154-
$('<input type="hidden" id="prev-timestamp-' + node.pubKey + '" value="' + node.timestamp + '"> '),
156+
$('<input type="hidden" id="prev-timestamp-' + node.identityKey + '" value="' + currentUnixTime + '"> '),
155157
$('<td>').html(makeStatusDot(node.identityKey)),
156158
$('<td>').text(purifiedRep),
157159
$('<td>').text(DOMPurify.sanitize(node.version)),
@@ -218,7 +220,6 @@ function processMessage(evt) {
218220
prevTimestamp = updateTimeStampStorage(msg);
219221

220222
timeDiff = (msg.timestamp - prevTimeStamp) / 1000000000;
221-
222223
displayReceivedPackets(msg, timeDiff);
223224
displaySentPackets(msg, timeDiff);
224225
}

0 commit comments

Comments
 (0)