Added diagnostic agent connection status.

Ylian Saint-Hilaire committed Apr 12, 2019 at 16:12 UTC e3d9ac6fdef4b9390e5d164b47b4c0a12b718652
3 files changed +16 -4
meshagent.js
+14 -2
@@ -778,7 +778,13 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
778 if (nodes.length == 1)
779 {
780 self.realNodeKey = nodes[0].raid;
781 - self.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: self.realNodeKey } }));
781 +
782 + // Get agent connection state
783 + var agentConnected = false;
784 + var state = parent.parent.GetConnectivityState(self.realNodeKey);
785 + if (state) { agentConnected = ((state.connectivity & 1) != 0) }
786 +
787 + self.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: self.realNodeKey, agent: agentConnected } }));
788 } else
789 {
790 self.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: null } }));
@@ -1124,7 +1130,13 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1130 db.Get('da' + obj.dbNodeKey, function (err, nodes) {
1131 if (nodes.length == 1) {
1132 obj.realNodeKey = nodes[0].raid;
1127 - obj.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: obj.realNodeKey } }));
1133 +
1134 + // Get agent connection state
1135 + var agentConnected = false;
1136 + var state = parent.parent.GetConnectivityState(obj.realNodeKey);
1137 + if (state) { agentConnected = ((state.connectivity & 1) != 0) }
1138 +
1139 + obj.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: obj.realNodeKey, agent: agentConnected } }));
1140 } else {
1141 obj.send(JSON.stringify({ action: 'diagnostic', value: { command: 'query', value: null } }));
1142 }
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.3.2-k",
3 + "version": "0.3.2-l",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
views/default.handlebars
+1 -1
@@ -7577,7 +7577,7 @@
7577 QV('topbar', x != 0);
7578 if ((x == 0) && (webPageFullScreen)) {
7579 QC('body').add("arg_hide");
7580 - QS('column_l').height = 'calc(100vh - 110px)';
7580 + QS('column_l').height = 'calc(100vh - 111px)';
7581
7582 // Please check. I think this part is not needed anymore. Removing class will revert to default style
7583 //QS('page_content').position = '';