diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/PathBookmarkDO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/PathBookmarkDO.java
index 31418a8b..a1e1b135 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/PathBookmarkDO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/PathBookmarkDO.java
@@ -42,6 +42,10 @@ public class PathBookmarkDO extends BaseDO {
@TableField("name")
private String name;
+ @Schema(description = "类型")
+ @TableField("type")
+ private String type;
+
@Schema(description = "路径")
@TableField("path")
private String path;
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/PathBookmarkCacheDTO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/PathBookmarkCacheDTO.java
index a99e11a8..232694a9 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/PathBookmarkCacheDTO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/PathBookmarkCacheDTO.java
@@ -34,6 +34,9 @@ public class PathBookmarkCacheDTO implements LongCacheIdModel, Serializable {
@Schema(description = "名称")
private String name;
+ @Schema(description = "类型")
+ private String type;
+
@Schema(description = "路径")
private String path;
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkCreateRequest.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkCreateRequest.java
index 16ce34d5..a02ba7fc 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkCreateRequest.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkCreateRequest.java
@@ -34,6 +34,11 @@ public class PathBookmarkCreateRequest implements Serializable {
@Schema(description = "名称")
private String name;
+ @NotBlank
+ @Size(max = 4)
+ @Schema(description = "类型")
+ private String type;
+
@NotBlank
@Size(max = 1024)
@Schema(description = "路径")
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkUpdateRequest.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkUpdateRequest.java
index f0533e4d..76dd371d 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkUpdateRequest.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/request/path/PathBookmarkUpdateRequest.java
@@ -39,6 +39,11 @@ public class PathBookmarkUpdateRequest implements Serializable {
@Schema(description = "名称")
private String name;
+ @NotBlank
+ @Size(max = 4)
+ @Schema(description = "类型")
+ private String type;
+
@NotBlank
@Size(max = 1024)
@Schema(description = "路径")
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/PathBookmarkVO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/PathBookmarkVO.java
index ce56ce09..551ba746 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/PathBookmarkVO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/PathBookmarkVO.java
@@ -36,6 +36,9 @@ public class PathBookmarkVO implements Serializable {
@Schema(description = "名称")
private String name;
+ @Schema(description = "类型")
+ private String type;
+
@Schema(description = "路径")
private String path;
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/mapper/PathBookmarkMapper.xml b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/mapper/PathBookmarkMapper.xml
index 9dd14ff2..12581fc7 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/mapper/PathBookmarkMapper.xml
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/mapper/PathBookmarkMapper.xml
@@ -8,6 +8,7 @@
+
@@ -18,7 +19,7 @@
- id, user_id, group_id, name, path, create_time, update_time, creator, updater, deleted
+ id, user_id, group_id, name, type, path, create_time, update_time, creator, updater, deleted
diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/dict/DictValueQueryRequest.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/dict/DictValueQueryRequest.java
index ab7b6365..a66356fc 100644
--- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/dict/DictValueQueryRequest.java
+++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/entity/request/dict/DictValueQueryRequest.java
@@ -36,4 +36,7 @@ public class DictValueQueryRequest extends PageRequest {
@Schema(description = "配置描述")
private String label;
+ @Schema(description = "额外参数")
+ private String extra;
+
}
diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DictValueServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DictValueServiceImpl.java
index 72168b9a..78976b6a 100644
--- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DictValueServiceImpl.java
+++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DictValueServiceImpl.java
@@ -374,6 +374,7 @@ public class DictValueServiceImpl implements DictValueService {
.like(DictValueDO::getKeyName, request.getKeyName())
.like(DictValueDO::getValue, request.getValue())
.like(DictValueDO::getLabel, request.getLabel())
+ .like(DictValueDO::getExtra, request.getExtra())
.orderByDesc(DictValueDO::getId);
}
diff --git a/orion-ops-ui/src/api/asset/path-bookmark.ts b/orion-ops-ui/src/api/asset/path-bookmark.ts
index 6e38c26e..e83ac0cf 100644
--- a/orion-ops-ui/src/api/asset/path-bookmark.ts
+++ b/orion-ops-ui/src/api/asset/path-bookmark.ts
@@ -7,6 +7,7 @@ import axios from 'axios';
export interface PathBookmarkCreateRequest {
groupId?: number;
name?: string;
+ type?: string;
path?: string;
}
@@ -24,6 +25,7 @@ export interface PathBookmarkQueryResponse extends PathBookmarkQueryResponseExtr
id: number;
groupId: number;
name: string;
+ type: string;
path: string;
}
diff --git a/orion-ops-ui/src/api/system/dict-value.ts b/orion-ops-ui/src/api/system/dict-value.ts
index 2de4f3cc..090fa1a7 100644
--- a/orion-ops-ui/src/api/system/dict-value.ts
+++ b/orion-ops-ui/src/api/system/dict-value.ts
@@ -34,14 +34,11 @@ export interface DictValueRollbackRequest {
* 字典配置值查询请求
*/
export interface DictValueQueryRequest extends Pagination {
- searchValue?: string;
- id?: number;
keyId?: number;
keyName?: string;
value?: string;
label?: string;
extra?: string;
- sort?: number;
}
/**
diff --git a/orion-ops-ui/src/store/modules/terminal/index.ts b/orion-ops-ui/src/store/modules/terminal/index.ts
index fcc3548f..8d539f2e 100644
--- a/orion-ops-ui/src/store/modules/terminal/index.ts
+++ b/orion-ops-ui/src/store/modules/terminal/index.ts
@@ -8,7 +8,7 @@ import type {
TerminalShortcutSetting,
TerminalState
} from './types';
-import type { ISftpSession, ISshSession, PanelSessionTabType, TerminalPanelTabItem } from '@/views/host/terminal/types/terminal.type';
+import type { ITerminalSession, 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';
@@ -18,7 +18,7 @@ import { defineStore } from 'pinia';
import { getPreference, updatePreference } from '@/api/user/preference';
import { nextId } from '@/utils';
import { Message } from '@arco-design/web-vue';
-import { PanelSessionType, TerminalTabs } from '@/views/host/terminal/types/terminal.const';
+import { TerminalTabs } from '@/views/host/terminal/types/terminal.const';
import TerminalTabManager from '@/views/host/terminal/handler/terminal-tab-manager';
import TerminalSessionManager from '@/views/host/terminal/handler/terminal-session-manager';
import TerminalPanelManager from '@/views/host/terminal/handler/terminal-panel-manager';
@@ -195,8 +195,30 @@ export default defineStore('terminal', {
}
},
- // 检查当前是否为终端页面 并且获取当前 ssh 会话
- getAndCheckCurrentSshSession(tips: boolean = true) {
+ // 获取当前会话类型
+ getCurrentSessionType(tips: boolean = false) {
+ // 获取当前 activeTab
+ const activeTab = this.tabManager.active;
+ if (activeTab !== TerminalTabs.TERMINAL_PANEL.key) {
+ if (tips) {
+ Message.warning('请切换到终端标签页');
+ }
+ return;
+ }
+ // 获取面板会话
+ const type = this.panelManager
+ .getCurrentPanel()
+ .getCurrentTab()
+ ?.type;
+ if (!type && tips) {
+ Message.warning(`请打开 ${type}`);
+ return;
+ }
+ return type;
+ },
+
+ // 获取当前会话
+ getCurrentSession(type: string, tips: boolean = false) {
// 获取当前 activeTab
const activeTab = this.tabManager.active;
if (activeTab !== TerminalTabs.TERMINAL_PANEL.key) {
@@ -206,37 +228,24 @@ export default defineStore('terminal', {
return;
}
// 获取当前会话
- const session = this.getCurrentSshSession();
+ const session = this._getCurrentSession(type);
if (!session && tips) {
- Message.warning('请打开终端');
+ Message.warning(`请打开 ${type}`);
}
return session;
},
- // 获取当前 ssh 会话
- getCurrentSshSession() {
+ // 获取当前会话
+ _getCurrentSession(type: string): T | undefined {
// 获取面板会话
const sessionTab = this.panelManager
.getCurrentPanel()
.getCurrentTab();
- if (!sessionTab || sessionTab.type !== PanelSessionType.SSH.type) {
+ if (!sessionTab || sessionTab.type !== type) {
return;
}
// 获取会话
- return this.sessionManager.getSession(sessionTab.sessionId);
- },
-
- // 获取当前 sftp 会话
- getCurrentSftpSession() {
- // 获取面板会话
- const sessionTab = this.panelManager
- .getCurrentPanel()
- .getCurrentTab();
- if (!sessionTab || sessionTab.type !== PanelSessionType.SFTP.type) {
- return;
- }
- // 获取会话
- return this.sessionManager.getSession(sessionTab.sessionId);
+ return this.sessionManager.getSession(sessionTab.sessionId);
},
},
diff --git a/orion-ops-ui/src/views/asset-audit/connect-log/components/connect-log-table.vue b/orion-ops-ui/src/views/asset-audit/connect-log/components/connect-log-table.vue
index 96174248..651aa121 100644
--- a/orion-ops-ui/src/views/asset-audit/connect-log/components/connect-log-table.vue
+++ b/orion-ops-ui/src/views/asset-audit/connect-log/components/connect-log-table.vue
@@ -114,6 +114,12 @@
{{ record.hostAddress }}
+
+
+
+ {{ getDictValue(connectTypeKey, record.type) }}
+
+
+ import type { ISshSession } from '@/views/host/terminal/types/terminal.type';
import type { CommandSnippetWrapperResponse, CommandSnippetQueryResponse } from '@/api/asset/command-snippet';
import { ref, provide } from 'vue';
import useVisible from '@/hooks/visible';
@@ -85,13 +86,14 @@
import { deleteCommandSnippet, getCommandSnippetList } from '@/api/asset/command-snippet';
import { useCacheStore, useTerminalStore } from '@/store';
import { openUpdateSnippetKey, removeSnippetKey } from '../types/const';
+ import { PanelSessionType } from '@/views/host/terminal/types/terminal.const';
import CommandSnippetListItem from './command-snippet-list-item.vue';
import CommandSnippetListGroup from './command-snippet-list-group.vue';
import CommandSnippetFormDrawer from './command-snippet-form-drawer.vue';
const { loading, setLoading } = useLoading();
const { visible, setVisible } = useVisible();
- const { getCurrentSshSession } = useTerminalStore();
+ const { getCurrentSession } = useTerminalStore();
const cacheStore = useCacheStore();
const formDrawer = ref();
@@ -274,8 +276,8 @@
// 关闭回调
const onClose = () => {
- // 聚焦终端
- getCurrentSshSession()?.focus();
+ // 关闭时候如果打开的是终端 则聚焦终端
+ getCurrentSession(PanelSessionType.SSH.type)?.focus();
};
diff --git a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
index d631ec93..c3f38aab 100644
--- a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
+++ b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
@@ -113,18 +113,20 @@