mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
Fix the Tab UI bug, and fix stdout/stderr clear issue
This commit is contained in:
parent
c411f596f9
commit
ff3cbd88dd
13
app/index.js
13
app/index.js
|
@ -118,14 +118,15 @@ var config = {
|
|||
var myLayout = new GoldenLayout(config);
|
||||
|
||||
myLayout.registerComponent('example', function(container, state) {
|
||||
container.getElement().html('<div >' + state.text + '</div>');
|
||||
container.getElement().html('<div>' + state.text + '</div>');
|
||||
});
|
||||
|
||||
myLayout.init();
|
||||
|
||||
var addContentItem = function(title, text) {
|
||||
var newItemConfig = {
|
||||
var contentItemConfig = {
|
||||
title: title,
|
||||
id: title,
|
||||
type: 'component',
|
||||
componentName: 'example',
|
||||
componentState: {
|
||||
|
@ -133,7 +134,13 @@ var addContentItem = function(title, text) {
|
|||
}
|
||||
};
|
||||
|
||||
myLayout.root.contentItems[0].addChild(newItemConfig);
|
||||
var contentItems = myLayout.root.getItemsById(title);
|
||||
var contentItemsCount = contentItems.length;
|
||||
if (contentItemsCount > 0) {
|
||||
contentItems[0].element.show();
|
||||
} else {
|
||||
myLayout.root.contentItems[0].addChild(contentItemConfig);
|
||||
}
|
||||
};
|
||||
|
||||
// enable move the window with mouse drag and drop
|
||||
|
|
|
@ -175,6 +175,9 @@ var HTTPObject = function(engine) {
|
|||
} else {
|
||||
this.setBinPath("bin\\x86\\curl-8.10.1_1-win32-mingw\\bin\\curl.exe");
|
||||
}
|
||||
|
||||
// do not clear after calling the `exec`
|
||||
this._interface.setIsPreventClear(true);
|
||||
} else if (this.engine == "BITS") {
|
||||
this._interface = SHELL.create();
|
||||
this.setBinPath("bitsadmin.exe"); // the location of BITS binary
|
||||
|
@ -715,7 +718,7 @@ var HTTPObject = function(engine) {
|
|||
debuggingText = this._interface.stderr.read();
|
||||
}
|
||||
|
||||
// clear the stdout and stderr
|
||||
// clear manually
|
||||
this._interface.clear();
|
||||
} else if (this.engine == "BITS") {
|
||||
var job_name = "welsonjs_" + PipeIPC.UUIDv4.create().substring(0, 8);
|
||||
|
@ -1172,7 +1175,7 @@ exports.parseURL = parseURL;
|
|||
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
||||
exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible
|
||||
|
||||
exports.VERSIONINFO = "HTTP REST Client (http.js) version 0.7.34";
|
||||
exports.VERSIONINFO = "HTTP REST Client (http.js) version 0.7.35";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
18
lib/shell.js
18
lib/shell.js
|
@ -12,6 +12,7 @@ var ShellObject = function() {
|
|||
this.isElevated = false;
|
||||
this.isFork = false;
|
||||
this.isVisibleWindow = false;
|
||||
this.isPreventClear = false;
|
||||
this.charset = PipeIPC.CdoUS_ASCII;
|
||||
|
||||
this.stdout = null;
|
||||
|
@ -38,6 +39,11 @@ var ShellObject = function() {
|
|||
this.charset = charset;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.setIsPreventClear = function(flag) {
|
||||
this.isPreventClear = flag;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.setWorkingDirectory = function(dirname) {
|
||||
if (typeof(dirname) === "string") {
|
||||
|
@ -95,10 +101,12 @@ var ShellObject = function() {
|
|||
this.stdout.flush();
|
||||
this.stderr.flush();
|
||||
|
||||
if (typeof stdOutPath === "string")
|
||||
if (typeof stdOutPath === "string") {
|
||||
this.stdout.startRecorder(stdOutPath, PipeIPC.ForWriting);
|
||||
if (typeof stdErrPath === "string")
|
||||
}
|
||||
if (typeof stdErrPath === "string") {
|
||||
this.stderr.startRecorder(stdErrPath, PipeIPC.ForWriting);
|
||||
}
|
||||
|
||||
var c = "%comspec% /c (" + this.build(cmd) + ") 1> " + this.stdout.path;
|
||||
//c += " 2>&1";
|
||||
|
@ -118,6 +126,10 @@ var ShellObject = function() {
|
|||
//console.log("[stdout] " + stdout);
|
||||
//console.log("[stderr] " + stderr);
|
||||
|
||||
if (!this.isPreventClear) {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
return stdout;
|
||||
};
|
||||
|
||||
|
@ -224,7 +236,7 @@ exports.getPathOfMyDocuments = function() {
|
|||
|
||||
exports.CdoCharset = PipeIPC.CdoCharset;
|
||||
|
||||
exports.VERSIONINFO = "Windows Shell Interface (shell.js) version 0.3.14";
|
||||
exports.VERSIONINFO = "Windows Shell Interface (shell.js) version 0.3.15";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user