From 77bd51acdb440c48cf0f574befea5b80550a00aa Mon Sep 17 00:00:00 2001 From: fofolee Date: Wed, 27 Apr 2022 20:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/preload.js | 2 +- src/components/CommandRunResult.vue | 29 ++++++++------ src/components/ResultArea.vue | 26 +++++++----- src/components/popup/ObjectTree.vue | 62 +++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 25 deletions(-) create mode 100644 src/components/popup/ObjectTree.vue diff --git a/plugin/preload.js b/plugin/preload.js index ca2c335..7ebba0f 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -463,7 +463,7 @@ window.runCodeInSandbox = (code, callback, addVars = {}) => { sandbox.console = { log: (...stdout) => { console.log(stdout); - callback(parseStdout(stdout), null) + callback(stdout, null) }, error: (...stderr) => { callback(null, parseStdout(stderr)) diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 749e3b2..610220a 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -2,7 +2,7 @@
- + this.resultMaxLength) - content = - content.slice(0, this.resultMaxLength - 100) + - `\n\n...\n${ - contlength - this.resultMaxLength - 100 - } 字省略\n...\n\n` + - content.slice(contlength - 100); - let pretreatment = action(content); - pretreatment && (this.runResult += pretreatment); + // let contlength = content?.length || 0; + // if (contlength > this.resultMaxLength) + // content = + // content.slice(0, this.resultMaxLength - 100) + + // `\n\n...\n${ + // contlength - this.resultMaxLength - 100 + // } 字省略\n...\n\n` + + // content.slice(contlength - 100); + // let pretreatment = action(content); + // pretreatment && (this.runResult += pretreatment); + this.runResult = this.runResult.concat(content); this.outputAutoHeight(this.fromUtools); }, // 根据输出自动滚动及调整 utools 高度 @@ -258,7 +261,7 @@ export default { }); }, stopRun() { - this.runResult = ""; + this.runResult = []; if (!!this.subInputListener) { this.subInputValue = ""; utools.removeSubInput(); diff --git a/src/components/ResultArea.vue b/src/components/ResultArea.vue index 9aaf7f9..7bf0b1c 100644 --- a/src/components/ResultArea.vue +++ b/src/components/ResultArea.vue @@ -9,20 +9,22 @@ @load="frameLoad" v-if="showFrame" > -

+    
+
+ +

+      
+