1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added Firebase Cloud Messaging Relay.

This commit is contained in:
Ylian Saint-Hilaire 2021-02-02 23:31:44 -08:00
parent 6629a86339
commit 7e13633499
76 changed files with 124 additions and 80 deletions

View file

@ -9336,18 +9336,18 @@
if ((consoleNode.conn & 16) != 0) { onlineText += ", MQTT is online" }
QH('p15statetext', onlineText);
QE('p15uploadCore', ((consoleNode.conn & 1) != 0));
QV('p15outputselecttd', ((consoleNode.conn & 16) != 0) || ((currentNode.pmt == 1) && ((features2 & 2) != 0)));
QV('p15outputselecttd', ((consoleNode.conn & 16) != 0) || ((currentNode.pmt == 1) && ((features2 & 4) != 0)));
QV('p15outputselect2', ((consoleNode.conn & 16) != 0)); // MQTT channel
QV('p15outputselect3', ((currentNode.pmt == 1) && ((features2 & 2) != 0))); // Push Notification channel
QV('p15outputselect3', ((currentNode.pmt == 1) && ((features2 & 4) != 0))); // Two-way Push Notification channel
var c = Q('p15outputselect').value;
if (((consoleNode.conn & 16) == 0) && (c == 2)) { c = 1; Q('p15outputselect').value = 1; }
if (((currentNode.pmt != 1) || ((features2 & 2) == 0)) && (c == 3)) { c = 1; Q('p15outputselect').value = 1; }
if (((currentNode.pmt != 1) || ((features2 & 4) == 0)) && (c == 3)) { c = 1; Q('p15outputselect').value = 1; }
var active = false;
if (((consoleNode.conn & 1) != 0) && (c == 1)) { active = true; } // Agent
if (((consoleNode.conn & 16) != 0) && (c == 2)) { active = true; } // MQTT
if (((currentNode.pmt == 1) && ((features2 & 2) != 0)) && (c == 3)) { active = true; } // Push
if (((currentNode.pmt == 1) && ((features2 & 4) != 0)) && (c == 3)) { active = true; } // Push
QE('p15consoleText', active);
} else {
QH('p15statetext', "Access Denied");
@ -9386,7 +9386,7 @@
t = '<div style=color:orange>' + "MQTT" + '&gt; ' + EscapeHtml(v) + '<br/></div>';
consoleNode.consoleText += t;
meshserver.send({ action: 'sendmqttmsg', topic: 'console', nodeids: [ consoleNode._id ], msg: v });
} else if ((consoleNode.pmt == 1) && (Q('p15outputselect').value == 3) && ((features2 & 2) != 0)) {
} else if ((consoleNode.pmt == 1) && (Q('p15outputselect').value == 3) && ((features2 & 4) != 0)) {
// Send the command using push notification
t = '<div style=color:violet>' + "PUSH" + '&gt; ' + EscapeHtml(v) + '<br/></div>';
consoleNode.consoleText += t;