🆕 format
This commit is contained in:
parent
f820e28540
commit
707c87455a
@ -1,6 +1,6 @@
|
|||||||
const { Server } = require('socket.io')
|
const { Server } = require('socket.io')
|
||||||
const { Client: SSHClient } = require('ssh2')
|
const { Client: SSHClient } = require('ssh2')
|
||||||
const { readHostList, readSSHRecord, verifyAuthSync, RSADecryptSync, AESDecryptSync } = require('../utils')
|
const { readHostList, readSSHRecord, verifyAuthSync, AESDecryptSync } = require('../utils')
|
||||||
|
|
||||||
function createTerminal(socket, sshClient) {
|
function createTerminal(socket, sshClient) {
|
||||||
sshClient.shell({ term: 'xterm-color' }, (err, stream) => {
|
sshClient.shell({ term: 'xterm-color' }, (err, stream) => {
|
||||||
|
@ -18,13 +18,29 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<InfoSide ref="infoSideRef" v-model:show-input-command="showInputCommand" :host-info="curHost" :visible="visible"
|
<InfoSide
|
||||||
@click-input-command="clickInputCommand" />
|
ref="infoSideRef"
|
||||||
|
v-model:show-input-command="showInputCommand"
|
||||||
|
:host-info="curHost"
|
||||||
|
:visible="visible"
|
||||||
|
@click-input-command="clickInputCommand"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="terminals_sftp_wrap">
|
<div class="terminals_sftp_wrap">
|
||||||
<el-tabs v-model="activeTabIndex" type="border-card" tab-position="top" @tab-remove="removeTab"
|
<el-tabs
|
||||||
@tab-change="tabChange">
|
v-model="activeTabIndex"
|
||||||
<el-tab-pane v-for="(item, index) in terminalTabs" :key="index" :label="item.name" :name="index" :closable="true">
|
type="border-card"
|
||||||
|
tab-position="top"
|
||||||
|
@tab-remove="removeTab"
|
||||||
|
@tab-change="tabChange"
|
||||||
|
>
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="(item, index) in terminalTabs"
|
||||||
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:name="index"
|
||||||
|
:closable="true"
|
||||||
|
>
|
||||||
<div class="tab_content_wrap" :style="{ height: mainHeight + 'px' }">
|
<div class="tab_content_wrap" :style="{ height: mainHeight + 'px' }">
|
||||||
<TerminalTab ref="terminalTabRefs" :host="item.host" />
|
<TerminalTab ref="terminalTabRefs" :host="item.host" />
|
||||||
<Sftp :host="item.host" @resize="resizeTerminal" />
|
<Sftp :host="item.host" @resize="resizeTerminal" />
|
||||||
@ -162,7 +178,7 @@ const handleInputCommand = async (command) => {
|
|||||||
const curTabTerminal = terminalTabRefs.value[activeTabIndex.value]
|
const curTabTerminal = terminalTabRefs.value[activeTabIndex.value]
|
||||||
await $nextTick()
|
await $nextTick()
|
||||||
curTabTerminal?.focusTab()
|
curTabTerminal?.focusTab()
|
||||||
curTabTerminal.handleInputCommand(`${command}\n`)
|
curTabTerminal.handleInputCommand(`${ command }\n`)
|
||||||
showInputCommand.value = false
|
showInputCommand.value = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user