add first agent connection to the details page and attribute firstconnect #7408

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458
2025-11-16 18:53:30 +00:00
parent 9545bec218
commit a1f182426e
6 changed files with 7153 additions and 6745 deletions

View File

@@ -869,7 +869,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// This node does not exist, create it.
var agentName = obj.agentName ? obj.agentName : obj.agentInfo.computerName;
var device = { type: 'node', mtype: mesh.mtype, _id: obj.dbNodeKey, icon: obj.agentInfo.platformType, meshid: obj.dbMeshKey, name: agentName, rname: obj.agentInfo.computerName, domain: domain.id, agent: { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }, host: null };
var device = { type: 'node', mtype: mesh.mtype, _id: obj.dbNodeKey, icon: obj.agentInfo.platformType, meshid: obj.dbMeshKey, name: agentName, rname: obj.agentInfo.computerName, domain: domain.id, agent: { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }, host: null, firstconnect: obj.connectTime };
db.Set(device);
// Event the new node