Merge branch 'pr_3026' into dev

This commit is contained in:
Nick O'Leary
2021-07-02 09:22:35 +01:00
5 changed files with 19 additions and 3 deletions

View File

@@ -40,6 +40,10 @@
<input type="text" id="node-input-timer" style="width:65px;" data-i18n="[placeholder]exec.label.timeoutplace">
<span data-i18n="exec.label.seconds"></span>
</div>
<div class="form-row">
<label for="node-input-winHide" style="width: auto !important; padding-right:10px"><i class="fa fa-windows"></i> <span data-i18n="exec.label.winHide"></span></label>
<input type="checkbox" id="node-input-winHide" style="margin-top: 0; display:inline-block; width:auto;">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
@@ -56,6 +60,7 @@
append: {value:""},
useSpawn: {value:"false"},
timer: {value:""},
winHide: {value:false},
oldrc: {value:false},
name: {value:""}
},
@@ -92,6 +97,12 @@
});
$("#node-input-addpay-cb").trigger("change")
if (this.winHide === "true" || this.winHide === true) {
$("#node-input-winHide").prop("checked",true);
} else {
$("#node-input-winHide").prop("checked",false);
}
},
oneditsave: function() {
if (!$("#node-input-addpay-cb").prop("checked")) {

View File

@@ -34,7 +34,8 @@ module.exports = function(RED) {
this.timer = Number(n.timer || 0)*1000;
this.activeProcesses = {};
this.oldrc = (n.oldrc || false).toString();
this.execOpt = {encoding:'binary', maxBuffer:RED.settings.execMaxBufferSize||10000000};
this.execOpt = {encoding:'binary', maxBuffer:RED.settings.execMaxBufferSize||10000000, windowsHide: (n.winHide === true)};
this.spawnOpt = {windowsHide: (n.winHide === true) }
var node = this;
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { node.execOpt.shell = '/bin/bash'; }
@@ -86,7 +87,7 @@ module.exports = function(RED) {
var cmd = arg.shift();
/* istanbul ignore else */
if (RED.settings.verbose) { node.log(cmd+" ["+arg+"]"); }
child = spawn(cmd,arg);
child = spawn(cmd,arg,node.spawnOpt);
node.status({fill:"blue",shape:"dot",text:"pid:"+child.pid});
var unknownCommand = (child.pid === undefined);
if (node.timer !== 0) {