Fixed device last seen date and time.
Ylian Saint-Hilaire committed
May 1, 2020 at 22:30 UTC
c06947084aa4a3bd5283c7af89237b773ccb25a8
2 files changed
+2
-1
meshagent.js
+1
-1
@@ -83,7 +83,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
83
}
84
} else {
85
// Update the last connect time
86
- if (obj.authenticated == 2) { db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport, cause: 1 }); }
86
+ if (obj.authenticated == 2) { db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: Date.now(), addr: obj.remoteaddrport, cause: 1 }); }
87
}
88
89
// Set this agent as no longer authenticated
views/default.handlebars
+1
@@ -2588,6 +2588,7 @@
2588
// Change the node connection state
2589
node.conn = message.event.conn;
2590
node.pwr = message.event.pwr;
2591
+ node.lastconnect = Date.now();
2592
2593
// Web page update
2594
masterUpdate(4 | 16);