mirror of https://github.com/node-red/node-red.git
exec node: add windowsHide option to hide windows under Windows
parent
79875ef50d
commit
91ab3bd972
packages/node_modules/@node-red/nodes
core/function
locales/en-US
function
|
@ -40,6 +40,10 @@
|
||||||
<input type="text" id="node-input-timer" style="width:65px;" data-i18n="[placeholder]exec.label.timeoutplace">
|
<input type="text" id="node-input-timer" style="width:65px;" data-i18n="[placeholder]exec.label.timeoutplace">
|
||||||
<span data-i18n="exec.label.seconds"></span>
|
<span data-i18n="exec.label.seconds"></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="node-input-windowsHide" style="width: auto !important; padding-right:10px"><i class="fa fa-windows"></i> <span data-i18n="exec.label.windowshide"></span></label>
|
||||||
|
<input type="checkbox" id="node-input-windowsHide" style="display:inline-block; width:auto;">
|
||||||
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<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">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||||
|
@ -56,6 +60,7 @@
|
||||||
append: {value:""},
|
append: {value:""},
|
||||||
useSpawn: {value:"false"},
|
useSpawn: {value:"false"},
|
||||||
timer: {value:""},
|
timer: {value:""},
|
||||||
|
windowsHide: {value:false},
|
||||||
oldrc: {value:false},
|
oldrc: {value:false},
|
||||||
name: {value:""}
|
name: {value:""}
|
||||||
},
|
},
|
||||||
|
@ -92,6 +97,12 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#node-input-addpay-cb").trigger("change")
|
$("#node-input-addpay-cb").trigger("change")
|
||||||
|
|
||||||
|
if (this.windowsHide === "true" || this.windowsHide === true) {
|
||||||
|
$("#node-input-windowsHide").prop("checked",true);
|
||||||
|
} else {
|
||||||
|
$("#node-input-windowsHide").prop("checked",false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
oneditsave: function() {
|
oneditsave: function() {
|
||||||
if (!$("#node-input-addpay-cb").prop("checked")) {
|
if (!$("#node-input-addpay-cb").prop("checked")) {
|
||||||
|
|
|
@ -34,7 +34,8 @@ module.exports = function(RED) {
|
||||||
this.timer = Number(n.timer || 0)*1000;
|
this.timer = Number(n.timer || 0)*1000;
|
||||||
this.activeProcesses = {};
|
this.activeProcesses = {};
|
||||||
this.oldrc = (n.oldrc || false).toString();
|
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.windowsHide === true)};
|
||||||
|
this.spawnOpt = {windowsHide: (n.windowsHide === true) }
|
||||||
var node = this;
|
var node = this;
|
||||||
|
|
||||||
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { node.execOpt.shell = '/bin/bash'; }
|
if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { node.execOpt.shell = '/bin/bash'; }
|
||||||
|
|
|
@ -80,4 +80,5 @@
|
||||||
<p>If the node has more than one process running then <code>msg.pid</code> must also be set with the value of the PID to be killed.</p>
|
<p>If the node has more than one process running then <code>msg.pid</code> must also be set with the value of the PID to be killed.</p>
|
||||||
<p>If a value is provided in the <code>Timeout</code> field then, if the process has not completed when the specified number of seconds has elapsed, the process will be killed automatically</p>
|
<p>If a value is provided in the <code>Timeout</code> field then, if the process has not completed when the specified number of seconds has elapsed, the process will be killed automatically</p>
|
||||||
<p>Tip: if running a Python app you may need to use the <code>-u</code> parameter to stop the output being buffered.</p>
|
<p>Tip: if running a Python app you may need to use the <code>-u</code> parameter to stop the output being buffered.</p>
|
||||||
|
<p>The <code>Hide windows</code> option can be set to hide shell windows under Windows.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -198,7 +198,8 @@
|
||||||
"seconds": "seconds",
|
"seconds": "seconds",
|
||||||
"stdout": "stdout",
|
"stdout": "stdout",
|
||||||
"stderr": "stderr",
|
"stderr": "stderr",
|
||||||
"retcode": "return code"
|
"retcode": "return code",
|
||||||
|
"windowshide": "Hide windows"
|
||||||
},
|
},
|
||||||
"placeholder": {
|
"placeholder": {
|
||||||
"extraparams": "extra input parameters"
|
"extraparams": "extra input parameters"
|
||||||
|
|
Loading…
Reference in New Issue