路径标签.

This commit is contained in:
lijiahang
2024-04-24 13:39:21 +08:00
parent cdf10770d6
commit 8ecb5a687e
32 changed files with 1665 additions and 86 deletions

View File

@@ -14,12 +14,13 @@ import { getMenuList } from '@/api/system/menu';
import { getCurrentAuthorizedHostIdentity, getCurrentAuthorizedHostKey } from '@/api/asset/asset-authorized-data';
import { getCommandSnippetGroupList } from '@/api/asset/command-snippet-group';
import { getExecJobList } from '@/api/exec/exec-job';
import { getPathBookmarkGroupList } from '@/api/asset/path-bookmark-group';
export type CacheType = 'users' | 'menus' | 'roles'
| 'hosts' | 'hostGroups' | 'hostKeys' | 'hostIdentities'
| 'dictKeys'
| 'authorizedHostKeys' | 'authorizedHostIdentities'
| 'commandSnippetGroups'
| 'commandSnippetGroups' | 'pathBookmarkGroups'
| 'execJob'
| string
@@ -120,6 +121,11 @@ export default defineStore('cache', {
return await this.load('commandSnippetGroups', getCommandSnippetGroupList, force);
},
// 获取路径书签分组
async loadPathBookmarkGroups(force = false) {
return await this.load('pathBookmarkGroups', getPathBookmarkGroupList, force);
},
// 获取执行计划列表
async loadExecJobs(force = false) {
return await this.load('execJob', getExecJobList, force);

View File

@@ -8,7 +8,7 @@ import type {
TerminalShortcutSetting,
TerminalState
} from './types';
import type { ISshSession, PanelSessionTabType, TerminalPanelTabItem } from '@/views/host/terminal/types/terminal.type';
import type { ISftpSession, ISshSession, PanelSessionTabType, TerminalPanelTabItem } from '@/views/host/terminal/types/terminal.type';
import type { AuthorizedHostQueryResponse } from '@/api/asset/asset-authorized-data';
import { getCurrentAuthorizedHost } from '@/api/asset/asset-authorized-data';
import type { HostQueryResponse } from '@/api/asset/host';
@@ -226,6 +226,19 @@ export default defineStore('terminal', {
return this.sessionManager.getSession<ISshSession>(sessionTab.sessionId);
},
// 获取当前 sftp 会话
getCurrentSftpSession() {
// 获取面板会话
const sessionTab = this.panelManager
.getCurrentPanel()
.getCurrentTab();
if (!sessionTab || sessionTab.type !== PanelSessionType.SFTP.type) {
return;
}
// 获取会话
return this.sessionManager.getSession<ISftpSession>(sessionTab.sessionId);
},
},
});