Skip to content

Commit

Permalink
Fix session display issue when it is not ssh session
Browse files Browse the repository at this point in the history
  • Loading branch information
nxshell committed Nov 24, 2022
1 parent 6ecb0d3 commit 6d39ec1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/layout/components/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@contextmenu="handleSessionTreeContextMenu"
>
<template v-slot:additional="scope">
<el-tooltip class="item" effect="dark" :content="T('home.sessions-context-menu.sftp')" placement="top-start">
<el-tooltip v-if="scope.data.type == 'node' && scope.data.config.protocal == 'ssh'" class="item" effect="dark" :content="T('home.sessions-context-menu.sftp')" placement="top-start">
<span class="session-extend" @click.stop="handleOpenSFTP(scope.data)">
<i class="el-icon-folder-opened" />
</span>
Expand Down Expand Up @@ -114,11 +114,6 @@ export default {
type: 'normal',
handler: this.handleSessionTreeContextMenu_Connect
},
{
label: 'home.sessions-context-menu.sftp',
type: 'normal',
handler: this.handleSessionTreeContextMenu_SFTP
},
{
label: 'home.sessions-context-menu.cut',
type: 'normal',
Expand Down Expand Up @@ -217,7 +212,15 @@ export default {
if (this.currentSelectedSessionNodeConfigType === SESSION_CONFIG_TYPE.NODE) {
// TODO: 获取SessionConfig的状态,过滤掉一些无用状态
return this.sessionConfigsTreeContextMenu.node
let contextMenu = [ ...this.sessionConfigsTreeContextMenu.node ]
if (this.currentSelectedSessionProtocal === "ssh") {
contextMenu.unshift({
label: 'home.sessions-context-menu.sftp',
type: 'normal',
handler: this.handleSessionTreeContextMenu_SFTP
})
}
return contextMenu
}
},
/**
Expand Down Expand Up @@ -294,6 +297,7 @@ export default {
const { data } = node
const sessCfg = data.data
this.currentSelectedSessionNodeConfigType = sessCfg.type
this.currentSelectedSessionProtocal = sessCfg.config.protocal
},
// 删除会话或者会话目录
handleSessionTreeContextMenu_Delete() {
Expand Down

0 comments on commit 6d39ec1

Please sign in to comment.