diff --git a/agents/meshcore.js b/agents/meshcore.js
index 5ad897c5..a88d31c5 100644
--- a/agents/meshcore.js
+++ b/agents/meshcore.js
@@ -1230,8 +1230,11 @@ function handleServerCommand(data) {
ipr.message = data.msg;
ipr.username = data.username;
if (data.realname && (data.realname != '')) { ipr.username = data.realname; }
+ ipr.timeout = (typeof data.timeout === 'number' ? data.timeout : 120000);
global._clientmessage = ipr.then(function (img) {
- this.messagebox = require('win-dialog').create(this.title, this.message, this.username, { timeout: 120000, b64Image: img.split(',').pop(), background: color_options.background, foreground: color_options.foreground });
+ var options = { b64Image: img.split(',').pop(), background: color_options.background, foreground: color_options.foreground }
+ if (this.timeout != 0) { options.timeout = this.timeout; }
+ this.messagebox = require('win-dialog').create(this.title, this.message, this.username, options);
this.__childPromise.addMessage = this.messagebox.addMessage.bind(this.messagebox);
return (this.messagebox);
});
diff --git a/meshctrl.js b/meshctrl.js
index cc57f021..cb536835 100644
--- a/meshctrl.js
+++ b/meshctrl.js
@@ -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': {
diff --git a/views/default.handlebars b/views/default.handlebars
index d2acdbff..73b69983 100644
--- a/views/default.handlebars
+++ b/views/default.handlebars
@@ -5766,10 +5766,18 @@
setDialogMode(2, "Edit Device Tags", 3, d2groupActionFunctionTagsExec, x);
} else if (op == 108) {
// Device notification
- var x = "Perform batch device notification" + '
';
- x += '';
- x += '
';
- x += '';
+ var x = "