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

add timeout to message box notifications (#5689)

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2024-01-12 22:46:12 +00:00 committed by GitHub
parent cb0b02152a
commit 00db0a3a39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 20 deletions

View file

@ -941,15 +941,17 @@ if (args['_'].length == 0) {
console.log("Display a message on the remote device, Example usages:\r\n");
console.log(winRemoveSingleQuotes(" MeshCtrl DeviceMessage --id 'deviceid' --msg \"message\""));
console.log(winRemoveSingleQuotes(" MeshCtrl DeviceMessage --id 'deviceid' --msg \"message\" --title \"title\""));
console.log(winRemoveSingleQuotes(" MeshCtrl DeviceMessage --id 'deviceid' --msg \"message\" --title \"title\" --timeout 120000"));
console.log("\r\nRequired arguments:\r\n");
if (process.platform == 'win32') {
console.log(" --id [deviceid] - The device identifier.");
console.log(" --id [deviceid] - The device identifier.");
} else {
console.log(" --id '[deviceid]' - The device identifier.");
console.log(" --id '[deviceid]' - The device identifier.");
}
console.log(" --msg [message] - The message to display.");
console.log(" --msg [message] - The message to display.");
console.log("\r\nOptional arguments:\r\n");
console.log(" --title [title] - Messagebox title, default is \"MeshCentral\".");
console.log(" --title [title] - Messagebox title, default is \"MeshCentral\".");
console.log(" --timeout [miliseconds] - After timeout messagebox vanishes, 0 keeps messagebox open until closed manually, default is 120000 (2 Minutes).");
break;
}
case 'devicetoast': {
@ -1735,7 +1737,7 @@ function serverConnect() {
break;
}
case 'devicemessage': {
ws.send(JSON.stringify({ action: 'msg', type: 'messagebox', nodeid: args.id, title: args.title ? args.title : "MeshCentral", msg: args.msg, responseid: 'meshctrl' }));
ws.send(JSON.stringify({ action: 'msg', type: 'messagebox', nodeid: args.id, title: args.title ? args.title : "MeshCentral", msg: args.msg, timeout: args.timeout ? args.timeout : 120000, responseid: 'meshctrl' }));
break;
}
case 'devicetoast': {