Version 0.6.0

This commit is contained in:
Ylian Saint-Hilaire 2020-07-31 18:05:00 -07:00
parent 32cef1f05d
commit ce517bc21d
8 changed files with 463 additions and 388 deletions

View File

@ -2374,7 +2374,7 @@ function createMeshCore(agent) {
var response = null;
switch (cmd) {
case 'help': { // Displays available commands
var fin = '', f = '', availcommands = 'coredump,service,fdsnapshot,fdcount,startupoptions,alert,agentsize,versions,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,nwslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,amt,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,sendcaps,openurl,amtreset,amtccm,amtacm,amtdeactivate,amtpolicy,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,scanamt,wallpaper,addagentmsg,clearagentmsg';
var fin = '', f = '', availcommands = 'coredump,service,fdsnapshot,fdcount,startupoptions,alert,agentsize,versions,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,nwslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,amt,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,sendcaps,openurl,amtreset,amtccm,amtacm,amtdeactivate,amtpolicy,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,scanamt,wallpaper,agentmsg';
if (process.platform == 'win32') { availcommands += ',safemode,wpfhwacceleration,uac'; }
if (process.platform != 'freebsd') { availcommands += ',vm';}
if (require('MeshAgent').maxKvmTileSize != null) { availcommands += ',kvmmode'; }
@ -2389,11 +2389,24 @@ function createMeshCore(agent) {
response = "Available commands: \r\n" + fin + ".";
break;
}
case 'addagentmsg': {
if (args['_'].length != 1) {
response = "Proper usage: addagentmsg \"Alert Message\""; // Display usage
case 'agentmsg': {
if (args['_'].length == 0) {
response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [index]\r\n agentmsg list"; // Display usage
} else {
tunnelUserCount.msg[args['_'][0]] = 1;
if ((args['_'][0] == 'add') && (args['_'].length > 1)) {
var msgIndex = 1, iconIndex = 0;
while (tunnelUserCount.msg[msgIndex] != null) { msgIndex++; }
if (args['_'].length >= 3) { try { iconIndex = parseInt(args['_'][2]); } catch (ex) { } }
if (typeof iconIndex != 'number') { iconIndex = 0; }
tunnelUserCount.msg[msgIndex] = { msg: args['_'][1], icon: iconIndex };
response = 'Agent message ' + msgIndex + ' added.';
} else if ((args['_'][0] == 'remove') && (args['_'].length > 1)) {
var msgIndex = 0;
try { msgIndex = parseInt(args['_'][1]); } catch (ex) { }
if (tunnelUserCount.msg[msgIndex] == null) { response = "Message not found."; } else { delete tunnelUserCount.msg[msgIndex]; response = "Message removed."; }
} else if (args['_'][0] == 'list') {
response = JSON.stringify(tunnelUserCount.msg, null, 2);
}
try { mesh.SendCommand({ action: 'sessions', type: 'msg', value: tunnelUserCount.msg }); } catch (ex) { }
}
break;

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.5.99",
"version": "0.6.0",
"keywords": [
"Remote Device Management",
"Remote Device Monitoring",
@ -34,8 +34,6 @@
"sample-config-advanced.json"
],
"dependencies": {
"archiver": "^4.0.2",
"archiver-zip-encrypted": "^1.0.8",
"body-parser": "^1.19.0",
"cbor": "^4.1.5",
"compression": "^1.7.4",
@ -44,29 +42,14 @@
"express": "^4.17.0",
"express-handlebars": "^3.1.0",
"express-ws": "^4.0.0",
"image-size": "^0.8.3",
"ipcheck": "^0.1.0",
"jwt-simple": "^0.5.6",
"minimist": "^1.2.0",
"mongodb": "^3.6.0",
"multiparty": "^4.2.1",
"nedb": "^1.8.0",
"node-forge": "^0.8.4",
"node-rdpjs-2": "^0.3.5",
"node-windows": "^0.1.14",
"otplib": "^10.2.3",
"passport": "^0.4.1",
"passport-azure-oauth2": "^0.1.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-reddit": "^0.2.4",
"passport-twitter": "^1.0.4",
"plivo": "^4.7.0",
"saslprep": "^1.0.3",
"ws": "^6.2.1",
"xmldom": "^0.1.27",
"yauzl": "^2.10.0",
"yubikeyotp": "^0.2.0"
"yauzl": "^2.10.0"
},
"devDependencies": {},
"repository": {

BIN
public/images/notify24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/images/notify48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -797,6 +797,25 @@ NoMeshesPanel img {
background-color:#44F;
}
.NotifyIcon1 { width:48px; height:48px; background: url(../images/notify48.png) 0px 0px; }
.NotifyIcon2 { width:48px; height:48px; background: url(../images/notify48.png) -48px 0px; }
.NotifyIcon3 { width:48px; height:48px; background: url(../images/notify48.png) -96px 0px; }
.NotifyIcon4 { width:48px; height:48px; background: url(../images/notify48.png) -144px 0px; }
.NotifyIcon5 { width:48px; height:48px; background: url(../images/notify48.png) -192px 0px; }
.NotifyIcon6 { width:48px; height:48px; background: url(../images/notify48.png) -240px 0px; }
.NotifyIcon7 { width:48px; height:48px; background: url(../images/notify48.png) -288px 0px; }
.NotifyIcon8 { width:48px; height:48px; background: url(../images/notify48.png) -336px 0px; }
.NotifyIcon9 { width:48px; height:48px; background: url(../images/notify48.png) -384px 0px; }
.NotifyIconSmall1 { width:24px; height:24px; background: url(../images/notify24.png) 0px 0px; }
.NotifyIconSmall2 { width:24px; height:24px; background: url(../images/notify24.png) -24px 0px; }
.NotifyIconSmall3 { width:24px; height:24px; background: url(../images/notify24.png) -48px 0px; }
.NotifyIconSmall4 { width:24px; height:24px; background: url(../images/notify24.png) -72px 0px; }
.NotifyIconSmall5 { width:24px; height:24px; background: url(../images/notify24.png) -96px 0px; }
.NotifyIconSmall6 { width:24px; height:24px; background: url(../images/notify24.png) -120px 0px; }
.NotifyIconSmall7 { width:24px; height:24px; background: url(../images/notify24.png) -144px 0px; }
.NotifyIconSmall8 { width:24px; height:24px; background: url(../images/notify24.png) -168px 0px; }
.NotifyIconSmall9 { width:24px; height:24px; background: url(../images/notify24.png) -192px 0px; }
.deviceBatteryLarge {
position:absolute;
left:10px;

File diff suppressed because it is too large Load Diff

View File

@ -140,6 +140,16 @@
float: left;
}
.NotifyIconSmall1 { width:24px; height:24px; background: url(../images/notify24.png) 0px 0px; }
.NotifyIconSmall2 { width:24px; height:24px; background: url(../images/notify24.png) -24px 0px; }
.NotifyIconSmall3 { width:24px; height:24px; background: url(../images/notify24.png) -48px 0px; }
.NotifyIconSmall4 { width:24px; height:24px; background: url(../images/notify24.png) -72px 0px; }
.NotifyIconSmall5 { width:24px; height:24px; background: url(../images/notify24.png) -96px 0px; }
.NotifyIconSmall6 { width:24px; height:24px; background: url(../images/notify24.png) -120px 0px; }
.NotifyIconSmall7 { width:24px; height:24px; background: url(../images/notify24.png) -144px 0px; }
.NotifyIconSmall8 { width:24px; height:24px; background: url(../images/notify24.png) -168px 0px; }
.NotifyIconSmall9 { width:24px; height:24px; background: url(../images/notify24.png) -192px 0px; }
.gray {
/*filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");*/ /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
@ -2300,15 +2310,19 @@
function showDeviceMessages(nodeid, force, e) {
if (e) haltEvent(e);
if (xxdialogMode && !force) return false;
var node = null, x = '';
var node = null, x = '<div style=max-height:200px;width:100%;overflow-y:auto;overflow-x:hidden>', count = 0;
if (nodeid == null) { node = currentNode; } else { node = getNodeFromId(nodeid); }
if ((node == null) || (node.sessions == null) || (node.sessions.msg == null)) { setDialogMode(0); return false; }
for (var i in node.sessions.msg) {
var msg = i;
var msg = i, icon = 5;
if (typeof node.sessions.msg[i].msg == 'string') { msg = node.sessions.msg[i].msg; }
x += '<div style="border-radius:5px;background-color:#BBB;width:100%;padding:4px;margin-bottom:4px">' + EscapeHtml(i) + '</div>';
if (typeof node.sessions.msg[i].icon == 'number') { icon = node.sessions.msg[i].icon; }
if ((icon < 1) || (icon > 9)) { icon = 5; }
x += '<table style=width:100%><td style=width:24px><div class=NotifyIconSmall' + icon + '></div><td><div style="border-radius:5px;background-color:#BBB;width:calc(100% - 18px);padding:8px">' + EscapeHtml(msg) + '</div></table>';
count++;
}
if (x != '') setDialogMode(2, "Agent Messages" + ' - ' + EscapeHtml(node.name), 1, null, x, 'MESSAGES-' + node._id);
x += '</div>';
if (count > 0) setDialogMode(2, "Agent Messages" + ' - ' + EscapeHtml(node.name), 1, null, x, 'MESSAGES-' + node._id);
return false;
}

View File

@ -3696,15 +3696,19 @@
function showDeviceMessages(nodeid, force, e) {
if (e) haltEvent(e);
if (xxdialogMode && !force) return false;
var node = null, x = '';
var node = null, x = '<div style=max-height:200px;overflow-y:auto>', count = 0;
if (nodeid == null) { node = currentNode; } else { node = getNodeFromId(nodeid); }
if ((node == null) || (node.sessions == null) || (node.sessions.msg == null)) { setDialogMode(0); return false; }
for (var i in node.sessions.msg) {
var msg = i;
var msg = i, icon = 5;
if (typeof node.sessions.msg[i].msg == 'string') { msg = node.sessions.msg[i].msg; }
x += '<div style="border-radius:5px;background-color:#BBB;width:100%;padding:4px;margin-bottom:4px">' + EscapeHtml(i) + '</div>';
if (typeof node.sessions.msg[i].icon == 'number') { icon = node.sessions.msg[i].icon; }
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>';
count++;
}
if (x != '') setDialogMode(2, "Agent Messages" + ' - ' + EscapeHtml(node.name), 1, null, x, 'MESSAGES-' + node._id);
x += '</div>';
if (count > 0) setDialogMode(2, "Agent Messages" + ' - ' + EscapeHtml(node.name), 1, null, x, 'MESSAGES-' + node._id);
return false;
}