From e80994e9d4e00a97dd7b71d106f424ea9b9772b2 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Thu, 15 Oct 2020 15:51:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96terminal=20resize?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/cli/console.vue | 5 +- nezha-fronted/src/components/cli/webSSH.scss | 12 +- nezha-fronted/src/components/cli/webSSH.vue | 229 +++++++++++------- .../src/components/common/js/tools.js | 4 +- 4 files changed, 152 insertions(+), 98 deletions(-) diff --git a/nezha-fronted/src/components/cli/console.vue b/nezha-fronted/src/components/cli/console.vue index f41ffdb46..9df5f5955 100644 --- a/nezha-fronted/src/components/cli/console.vue +++ b/nezha-fronted/src/components/cli/console.vue @@ -77,11 +77,8 @@ export default { this.setFontSize(this.fontSize); }) }, - resizeServiceConsole(){ - const consoleBox = document.getElementById('ternimalContainer'+this.idIndex); + resizeServiceConsole(height){ let width = document.body.clientWidth;//可视宽度 - let height = parseInt(consoleBox.style.height); - if(height==null||!height){height=this.termimalHeight;} const winStyle={ width:width, height:height, diff --git a/nezha-fronted/src/components/cli/webSSH.scss b/nezha-fronted/src/components/cli/webSSH.scss index 80e59c128..0f1137a06 100644 --- a/nezha-fronted/src/components/cli/webSSH.scss +++ b/nezha-fronted/src/components/cli/webSSH.scss @@ -3,21 +3,11 @@ width: 100%; left: 0; position: fixed; - bottom: 50px; + bottom: 0; background: #fff; z-index: 2000; height: 300px; - #shell-service-resize-mask { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 100%; - display: none; - z-index: 1; - } .shell-split { cursor: ns-resize; height: 8px; diff --git a/nezha-fronted/src/components/cli/webSSH.vue b/nezha-fronted/src/components/cli/webSSH.vue index e805cd299..6bda77d93 100644 --- a/nezha-fronted/src/components/cli/webSSH.vue +++ b/nezha-fronted/src/components/cli/webSSH.vue @@ -2,10 +2,17 @@ @import './webSSH.scss';