Fixed last connect time and user consent dialog.
This commit is contained in:
parent
1db0899a7d
commit
07c6415f85
10
meshagent.js
10
meshagent.js
|
@ -44,7 +44,6 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
|
||||
// Disconnect this agent
|
||||
obj.close = function (arg) {
|
||||
obj.authenticated = -1;
|
||||
if ((arg == 1) || (arg == null)) { try { ws.close(); if (obj.nodeid != null) { parent.parent.debug('agent', 'Soft disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } } catch (e) { console.log(e); } } // Soft close, close the websocket
|
||||
if (arg == 2) { try { ws._socket._parent.end(); if (obj.nodeid != null) { parent.parent.debug('agent', 'Hard disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } } catch (e) { console.log(e); } } // Hard close, close the TCP socket
|
||||
// If arg == 3, don't communicate with this agent anymore, but don't disconnect (Duplicate agent).
|
||||
|
@ -81,9 +80,12 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
}
|
||||
} else {
|
||||
// Update the last connect time
|
||||
if (obj.authenticated == 2) { db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport }); }
|
||||
if (obj.authenticated == 2) { db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport, cause: 1 }); }
|
||||
}
|
||||
|
||||
// Set this agent as no longer authenticated
|
||||
obj.authenticated = -1;
|
||||
|
||||
// If we where updating the agent, clean that up.
|
||||
if (obj.agentUpdate != null) {
|
||||
if (obj.agentUpdate.fd) { try { parent.fs.close(obj.agentUpdate.fd); } catch (ex) { } }
|
||||
|
@ -682,7 +684,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
|
||||
// Mark when this device connected
|
||||
obj.connectTime = Date.now();
|
||||
db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport });
|
||||
db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport, cause: 1 });
|
||||
|
||||
// Device already exists, look if changes have occured
|
||||
var changes = [], change = 0, log = 0;
|
||||
|
@ -743,7 +745,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
|
||||
// Mark when this device connected
|
||||
obj.connectTime = Date.now();
|
||||
db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport });
|
||||
db.Set({ _id: 'lc' + obj.dbNodeKey, type: 'lastconnect', domain: domain.id, time: obj.connectTime, addr: obj.remoteaddrport, cause: 1 });
|
||||
|
||||
// This node does not exist, create it.
|
||||
var device = { type: 'node', mtype: mesh.mtype, _id: obj.dbNodeKey, icon: obj.agentInfo.platformType, meshid: obj.dbMeshKey, name: obj.agentInfo.computerName, rname: obj.agentInfo.computerName, domain: domain.id, agent: { ver: obj.agentInfo.agentVersion, id: obj.agentInfo.agentId, caps: obj.agentInfo.capabilities }, host: null };
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "meshcentral",
|
||||
"version": "0.4.1-u",
|
||||
"version": "0.4.1-v",
|
||||
"keywords": [
|
||||
"Remote Management",
|
||||
"Intel AMT",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7183,14 +7183,14 @@
|
|||
if (serverinfo.consent & 0x0010) { Q('d20flag4').checked = true; }
|
||||
if (serverinfo.consent & 0x0004) { Q('d20flag5').checked = true; }
|
||||
if (serverinfo.consent & 0x0020) { Q('d20flag6').checked = true; }
|
||||
if (serverinfo.consent & 0x0040) { Q('d20flag7').checked = true; }
|
||||
if (debugmode) { if (serverinfo.consent & 0x0040) { Q('d20flag7').checked = true; } }
|
||||
QE('d20flag1', !(serverinfo.consent & 0x0001));
|
||||
QE('d20flag2', !(serverinfo.consent & 0x0008));
|
||||
QE('d20flag3', !(serverinfo.consent & 0x0002));
|
||||
QE('d20flag4', !(serverinfo.consent & 0x0010));
|
||||
QE('d20flag5', !(serverinfo.consent & 0x0004));
|
||||
QE('d20flag6', !(serverinfo.consent & 0x0020));
|
||||
QE('d20flag7', !(serverinfo.consent & 0x0040));
|
||||
if (debugmode) { QE('d20flag7', !(serverinfo.consent & 0x0040)); }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7202,7 +7202,7 @@
|
|||
if (Q('d20flag4').checked) { consent += 0x0010; }
|
||||
if (Q('d20flag5').checked) { consent += 0x0004; }
|
||||
if (Q('d20flag6').checked) { consent += 0x0020; }
|
||||
if (Q('d20flag7').checked) { consent += 0x0040; }
|
||||
if (debugmode) { if (Q('d20flag7').checked) { consent += 0x0040; } }
|
||||
meshserver.send({ action: 'editmesh', meshid: currentMesh._id, consent: consent });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue