Added agent notification internalization.

This commit is contained in:
Ylian Saint-Hilaire 2021-06-04 11:15:51 -07:00
parent 71de4af33d
commit e39cd672ab
2 changed files with 7 additions and 1 deletions

View File

@ -2941,6 +2941,10 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
sendPeriodicServerUpdate(); sendPeriodicServerUpdate();
break; break;
} }
case 'agentmsgx': {
try { mesh.SendCommand({ action: 'sessions', type: 'msg', value: { 0: { msg: "This is an old agent version, consider updating.", msgid: 117, icon: 3 } } }); } catch (ex) { }
break;
}
case 'agentmsg': { case 'agentmsg': {
if (args['_'].length == 0) { if (args['_'].length == 0) {
response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [index]\r\n agentmsg list"; // Display usage response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [index]\r\n agentmsg list"; // Display usage

View File

@ -4309,6 +4309,7 @@
for (var i in node.sessions.msg) { for (var i in node.sessions.msg) {
var msg = i, icon = 5; var msg = i, icon = 5;
if (typeof node.sessions.msg[i].msg == 'string') { msg = node.sessions.msg[i].msg; } if (typeof node.sessions.msg[i].msg == 'string') { msg = node.sessions.msg[i].msg; }
if ((typeof node.sessions.msg[i].msgid == 'number') && (eventsMessageId[node.sessions.msg[i].msgid] != null)) { msg = eventsMessageId[node.sessions.msg[i].msgid]; }
if (typeof node.sessions.msg[i].icon == 'number') { icon = node.sessions.msg[i].icon; } if (typeof node.sessions.msg[i].icon == 'number') { icon = node.sessions.msg[i].icon; }
if ((icon < 1) || (icon > 9)) { icon = 5; } if ((icon < 1) || (icon > 9)) { icon = 5; }
x += '<table style=width:96%><td style=width:24px><div class=NotifyIconSmall' + icon + '></div><td><div style="border-radius:5px;background-color:#BBB;width:100%;padding:8px">' + EscapeHtml(msg) + '</div></table>'; x += '<table style=width:96%><td style=width:24px><div class=NotifyIconSmall' + icon + '></div><td><div style="border-radius:5px;background-color:#BBB;width:100%;padding:8px">' + EscapeHtml(msg) + '</div></table>';
@ -12386,7 +12387,8 @@
113: "Added push notification authentication device", 113: "Added push notification authentication device",
114: "Removed push notification authentication device", 114: "Removed push notification authentication device",
115: "Added login token", 115: "Added login token",
116: "Removed login token" 116: "Removed login token",
117: "This is an old agent version, consider updating.xx"
}; };
// Highlights the device being hovered // Highlights the device being hovered