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,