From ae07979e90416b4c5fd6c4e0c48478895f18f827 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 11 Jan 2023 11:24:56 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2505=20fix=EF=BC=9A=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=88=B0=E6=89=80=E6=9C=89=E7=AA=97=E5=8F=A3?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/cli/consoleNew.vue | 8 ++++---- nezha-fronted/src/components/cli/terminal.vue | 4 ++-- nezha-fronted/src/components/cli/webSSHNew.vue | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/cli/consoleNew.vue b/nezha-fronted/src/components/cli/consoleNew.vue index bf1dfa1c0..e33b66b2b 100644 --- a/nezha-fronted/src/components/cli/consoleNew.vue +++ b/nezha-fronted/src/components/cli/consoleNew.vue @@ -254,9 +254,9 @@ export default { reconnect () { this.terminal.isLogin = false this.closeSocket() - setTimeout(()=>{ + setTimeout(() => { this.beforeCreate() - },100) + }, 100) }, closeFileDir () { this.showFileDir(false) @@ -276,8 +276,8 @@ export default { }, enterStr (message) { if (this.terminalSocket && this.terminal.isLogin) { - this.terminalSocket.send(message) - this.terminalSocket.send('\n') + this.term.send(message) + this.term.send('\n') this.term.scrollToBottom() this.historyChange(message) } diff --git a/nezha-fronted/src/components/cli/terminal.vue b/nezha-fronted/src/components/cli/terminal.vue index e483c92d9..9071cbba7 100644 --- a/nezha-fronted/src/components/cli/terminal.vue +++ b/nezha-fronted/src/components/cli/terminal.vue @@ -94,10 +94,10 @@ export default { const data = JSON.parse(e.data) self.$get('asset/asset/' + data.id).then(res => { const asset = res.data - self.$refs.websshNew.addConsole(asset.id, asset.manageIp, '', '', 'asset') + self.$refs.websshNew.addConsole(asset.id, asset.manageIp, '', '', 'asset', asset) }) } catch (e) { - // console.log(e) + console.log(e) } } }) diff --git a/nezha-fronted/src/components/cli/webSSHNew.vue b/nezha-fronted/src/components/cli/webSSHNew.vue index aa95a10c6..74ce8d424 100644 --- a/nezha-fronted/src/components/cli/webSSHNew.vue +++ b/nezha-fronted/src/components/cli/webSSHNew.vue @@ -654,7 +654,7 @@ export default { terminal.userName = res.data.authUsername + '@' + res.data.host terminal.host = res.data.host if (id) { - console.terminal.terminalType = asset.type.authProtocol + console.terminal.terminalType = asset ? asset.type.authProtocol : console.terminal.terminalType console.terminal.username = '' this.editableTabsValue = newTabName this.editableTabs.push(console) @@ -689,7 +689,7 @@ export default { console.name = newTabName console.terminal.name = newTabName console.terminal.isLogin = false - this.editableTabs.push(console) + this.addConsole(item.terminal.assetId, item.terminal.host, '', '', 'asset') } else { this.customConnect = { ...item.terminal.custom,