diff --git a/nezha-fronted/src/assets/css/components/cli/webSSHNew.scss b/nezha-fronted/src/assets/css/components/cli/webSSHNew.scss index b996c37a7..0d387a8df 100644 --- a/nezha-fronted/src/assets/css/components/cli/webSSHNew.scss +++ b/nezha-fronted/src/assets/css/components/cli/webSSHNew.scss @@ -138,6 +138,7 @@ input { background: #1E1E1E !important; border: none; + color: white; } input::input-placeholder{ color: #7C7C7C; diff --git a/nezha-fronted/src/components/cli/consoleNew.vue b/nezha-fronted/src/components/cli/consoleNew.vue index 30da7583b..6cb9966e8 100644 --- a/nezha-fronted/src/components/cli/consoleNew.vue +++ b/nezha-fronted/src/components/cli/consoleNew.vue @@ -154,6 +154,7 @@ export default { } let url = '' this.terminal.height = document.body.clientHeight - 100 + this.terminal.width = document.body.clientWidth if (this.terminal.type === 'asset') { url = baseUrl + '/terminal.ws?width=' + this.terminal.width + '&height=' + this.terminal.height + '&cols=' + this.terminal.cols + '&rows=' + this.terminal.rows + '&token=' + token + '&assetId=' + this.terminal.assetId + '&accountId=' + this.terminal.accountId + '&uuid=' + this.terminal.uuid } else if (this.terminal.type === 'custom') { @@ -240,7 +241,7 @@ export default { this.term.attach(this.terminalSocket) this.term._initialized = true - this.term.fit()// 自适应大小(使终端的尺寸和几何尺寸适合于终端容器的尺寸) 只是width + // this.term.fit()// 自适应大小(使终端的尺寸和几何尺寸适合于终端容器的尺寸) 只是width this.$nextTick(() => { // 解决进入全屏和退出全屏是底部隐藏 this.setFontSize(this.fontSize) }) diff --git a/nezha-fronted/src/components/cli/terminal.vue b/nezha-fronted/src/components/cli/terminal.vue index a24a76d2e..fb555c0c7 100644 --- a/nezha-fronted/src/components/cli/terminal.vue +++ b/nezha-fronted/src/components/cli/terminal.vue @@ -11,7 +11,7 @@ - + @@ -31,7 +31,8 @@ export default { logo: '', fileListStateType: '', message: '', - name: '' + name: '', + placeholder: this.$t('terminal.placeholder') } }, computed: { @@ -83,8 +84,18 @@ export default { hideFileState () { this.$refs.fileListState.fileStateShow(false, this.fileListStateType) }, + placeholderChange (type) { + if (type == 'focus') { + this.placeholder = '' + }else { + this.placeholder = this.$t('terminal.placeholder') + } + }, sendMessage () { this.$refs.websshNew.sendMessage(this.message) + setTimeout(() => { + this.message = '' + }) } }, beforeDestroy () { diff --git a/nezha-fronted/src/components/cli/webSSHNew.vue b/nezha-fronted/src/components/cli/webSSHNew.vue index f8ca3fac2..3410118d5 100644 --- a/nezha-fronted/src/components/cli/webSSHNew.vue +++ b/nezha-fronted/src/components/cli/webSSHNew.vue @@ -14,7 +14,7 @@
-
+
{{item.terminal.userName}}