mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-27 15:45:53 -05:00
Fixed CIRA server crash.
This commit is contained in:
parent
e1bbd49490
commit
f2ed881e09
@ -182,7 +182,7 @@ function createMeshCore(agent) {
|
|||||||
var apps = {};
|
var apps = {};
|
||||||
apps[data.value] = 1;
|
apps[data.value] = 1;
|
||||||
try { mesh.SendCommand({ action: 'sessions', type: 'app', value: apps }); } catch (e) { }
|
try { mesh.SendCommand({ action: 'sessions', type: 'app', value: apps }); } catch (e) { }
|
||||||
this._send({ cmd: 'serverstate', value: meshServerConnectionState, url: require('MeshAgent').ConnectedServer });
|
this._send({ cmd: 'serverstate', value: meshServerConnectionState, url: require('MeshAgent').ConnectedServer, amt: (amt != null) });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'query':
|
case 'query':
|
||||||
@ -192,14 +192,19 @@ function createMeshCore(agent) {
|
|||||||
this._send(data);
|
this._send(data);
|
||||||
break;
|
break;
|
||||||
case 'descriptors':
|
case 'descriptors':
|
||||||
require('ChainViewer').getSnapshot().then(function (f)
|
require('ChainViewer').getSnapshot().then(function (f) {
|
||||||
{
|
|
||||||
this.tag.payload.result = f;
|
this.tag.payload.result = f;
|
||||||
this.tag.ipc._send(this.tag.payload);
|
this.tag.ipc._send(this.tag.payload);
|
||||||
}).parentPromise.tag = { ipc: this, payload: data };
|
}).parentPromise.tag = { ipc: this, payload: data };
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'amtstate':
|
||||||
|
if (amt == null) return;
|
||||||
|
var func = function amtStateFunc(state) { if (state != null) { amtStateFunc.pipe._send({ cmd: 'amtstate', value: state }); } }
|
||||||
|
func.pipe = this;
|
||||||
|
amt.getAmtInfo(func);
|
||||||
|
break;
|
||||||
case 'sessions':
|
case 'sessions':
|
||||||
this._send({ cmd: 'sessions', sessions: tunnelUserCount });
|
this._send({ cmd: 'sessions', sessions: tunnelUserCount });
|
||||||
break;
|
break;
|
||||||
|
10
meshuser.js
10
meshuser.js
@ -662,7 +662,10 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
if ((state.connectivity & 1) != 0) { var agent = parent.wsagents[docs[i]._id]; if (agent != null) { docs[i].agct = agent.connectTime; } }
|
if ((state.connectivity & 1) != 0) { var agent = parent.wsagents[docs[i]._id]; if (agent != null) { docs[i].agct = agent.connectTime; } }
|
||||||
|
|
||||||
// Use the connection time of the CIRA/Relay connection
|
// Use the connection time of the CIRA/Relay connection
|
||||||
if ((state.connectivity & 2) != 0) { var cira = parent.parent.mpsserver.GetConnectionToNode(docs[i]._id, null, true); if (cira != null) { docs[i].cict = cira[0].tag.connectTime; } }
|
if ((state.connectivity & 2) != 0) {
|
||||||
|
var ciraConnection = parent.parent.mpsserver.GetConnectionToNode(docs[i]._id, null, true);
|
||||||
|
if ((ciraConnection != null) && (ciraConnection.tag != null)) { docs[i].cict = ciraConnection.tag.connectTime; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compress the meshid's
|
// Compress the meshid's
|
||||||
@ -3480,7 +3483,10 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
if ((state.connectivity & 1) != 0) { var agent = parent.wsagents[node._id]; if (agent != null) { node.agct = agent.connectTime; } }
|
if ((state.connectivity & 1) != 0) { var agent = parent.wsagents[node._id]; if (agent != null) { node.agct = agent.connectTime; } }
|
||||||
|
|
||||||
// Uuse the connection time of the CIRA/Relay connection
|
// Uuse the connection time of the CIRA/Relay connection
|
||||||
if ((state.connectivity & 2) != 0) { var cira = parent.parent.mpsserver.GetConnectionToNode(node._id, null, true); if (cira != null) { node.cict = cira[0].tag.connectTime; } }
|
if ((state.connectivity & 2) != 0) {
|
||||||
|
var ciraConnection = parent.parent.mpsserver.GetConnectionToNode(node._id, null, true);
|
||||||
|
if ((ciraConnection != null) && (ciraConnection.tag != null)) { node.cict = ciraConnection.tag.connectTime; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event the node change
|
// Event the node change
|
||||||
|
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user