diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/ExecHostLogDO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/ExecHostLogDO.java
index e5b3522b..1981ac2c 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/ExecHostLogDO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/domain/ExecHostLogDO.java
@@ -44,6 +44,10 @@ public class ExecHostLogDO extends BaseDO {
@TableField("host_name")
private String hostName;
+ @Schema(description = "主机地址")
+ @TableField("host_address")
+ private String hostAddress;
+
@Schema(description = "执行状态")
@TableField("status")
private String status;
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecCommandHostVO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecCommandHostVO.java
index c54ea484..c1a42df6 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecCommandHostVO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecCommandHostVO.java
@@ -28,4 +28,13 @@ public class ExecCommandHostVO implements Serializable {
@Schema(description = "hostId")
private Long hostId;
+ @Schema(description = "主机名称")
+ private String hostName;
+
+ @Schema(description = "主机地址")
+ private String hostAddress;
+
+ @Schema(description = "执行状态")
+ private String status;
+
}
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecHostLogVO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecHostLogVO.java
index fa3d1c90..5260a96f 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecHostLogVO.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecHostLogVO.java
@@ -37,6 +37,9 @@ public class ExecHostLogVO implements Serializable {
@Schema(description = "主机名称")
private String hostName;
+ @Schema(description = "主机地址")
+ private String hostAddress;
+
@Schema(description = "执行状态")
private String status;
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecServiceImpl.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecServiceImpl.java
index fc107073..a50e1fc2 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecServiceImpl.java
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/service/impl/ExecServiceImpl.java
@@ -65,6 +65,8 @@ public class ExecServiceImpl implements ExecService {
private static final ReplacementFormatter FORMATTER = ReplacementFormatters.create("@{{ ", " }}")
.noMatchStrategy(NoMatchStrategy.KEEP);
+ private static final int DESC_OMIT = 60;
+
@Resource
private FileClient logsFileClient;
@@ -102,7 +104,13 @@ public class ExecServiceImpl implements ExecService {
.userId(userId)
.username(user.getUsername())
.source(ExecSourceEnum.BATCH.name())
- .description(Strings.ifBlank(request.getDescription(), Strings.retain(command, 60) + Const.OMIT))
+ .description(Strings.ifBlank(request.getDescription(), () -> {
+ if (command.length() < DESC_OMIT + 3) {
+ return command;
+ } else {
+ return command.substring(0, DESC_OMIT) + Const.OMIT;
+ }
+ }))
.command(command)
.parameterSchema(request.getParameterSchema())
.timeout(request.getTimeout())
@@ -120,6 +128,7 @@ public class ExecServiceImpl implements ExecService {
.logId(execId)
.hostId(s.getId())
.hostName(s.getName())
+ .hostAddress(s.getAddress())
.status(ExecHostStatusEnum.WAITING.name())
.command(FORMATTER.format(command, parameter))
.parameter(parameter)
@@ -136,6 +145,9 @@ public class ExecServiceImpl implements ExecService {
.map(s -> ExecCommandHostVO.builder()
.id(s.getId())
.hostId(s.getHostId())
+ .hostName(s.getHostName())
+ .hostAddress(s.getHostAddress())
+ .status(s.getStatus())
.build())
.collect(Collectors.toList());
return ExecCommandVO.builder()
diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/resources/mapper/ExecHostLogMapper.xml b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/resources/mapper/ExecHostLogMapper.xml
index f3a5888d..f6d8c196 100644
--- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/resources/mapper/ExecHostLogMapper.xml
+++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/resources/mapper/ExecHostLogMapper.xml
@@ -8,6 +8,7 @@
+
@@ -25,7 +26,7 @@
- id, log_id, host_id, host_name, status, command, parameter, exit_status, log_path, error_message, start_time, finish_time, create_time, update_time, creator, updater, deleted
+ id, log_id, host_id, host_name, host_address, status, command, parameter, exit_status, log_path, error_message, start_time, finish_time, create_time, update_time, creator, updater, deleted
diff --git a/orion-ops-ui/src/api/exec/exec-log.ts b/orion-ops-ui/src/api/exec/exec-log.ts
index f6d10d1f..75e3754b 100644
--- a/orion-ops-ui/src/api/exec/exec-log.ts
+++ b/orion-ops-ui/src/api/exec/exec-log.ts
@@ -47,6 +47,7 @@ export interface ExecHostLogQueryResponse extends TableData {
logId: number;
hostId: number;
hostName: string;
+ hostAddress: string;
status: string;
command: string;
parameter: string;
diff --git a/orion-ops-ui/src/api/exec/exec.ts b/orion-ops-ui/src/api/exec/exec.ts
index 9bf4ed96..552e0c2d 100644
--- a/orion-ops-ui/src/api/exec/exec.ts
+++ b/orion-ops-ui/src/api/exec/exec.ts
@@ -25,10 +25,22 @@ export interface ExecInterruptRequest {
*/
export interface ExecCommandResponse {
id: number;
- hosts: {
- id: number;
- hostId: number;
- };
+ hosts: Array;
+}
+
+/**
+ * 执行命令主机响应
+ */
+export interface ExecCommandHostResponse {
+ id: number;
+ hostId: number;
+ hostName: string;
+ hostAddress: string;
+ status: string;
+ exitStatus: number;
+ errorMessage: string;
+ startTime: number;
+ finishTime: number;
}
/**
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue
index e23665b7..d1606791 100644
--- a/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue
@@ -18,7 +18,7 @@
- {{ record.alias || `${record.name} (${record.code})` }}
+ {{ record.name }}
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
index c5c19539..3c35afc8 100644
--- a/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
@@ -145,6 +145,8 @@
// 加载主机列表
const { data } = await getCurrentAuthorizedHost('ssh');
hosts.value = data;
+ // 禁用别名
+ data.hostList.forEach(s => s.alias = undefined as unknown as string);
// 设置主机搜索选项
filterOptions.value = getAuthorizedHostOptions(data.hostList);
} catch (e) {
@@ -171,7 +173,6 @@
: list.filter(item => {
return (item.name as string)?.toLowerCase().indexOf(filterVal) > -1
|| (item.code as string)?.toLowerCase().indexOf(filterVal) > -1
- || (item.alias as string)?.toLowerCase().indexOf(filterVal) > -1
|| (item.address as string)?.toLowerCase().indexOf(filterVal) > -1;
});
}
diff --git a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
index 5ff27f27..7d6a469c 100644
--- a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
@@ -70,11 +70,9 @@
-
-
- {{ record.username }}
-
-
+
+ {{ record.username }}
+
diff --git a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
index 6dc73621..f9611009 100644
--- a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
@@ -82,11 +82,9 @@
:bordered="false">
-
-
- {{ record.username }}
-
-
+
+ {{ record.username }}
+
diff --git a/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts b/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
index 55ab626b..e98ec07e 100644
--- a/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
+++ b/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
@@ -21,15 +21,6 @@ const columns = [
title: '主机秘钥',
dataIndex: 'keyId',
slotName: 'keyId',
- }, {
- title: '创建时间',
- dataIndex: 'createTime',
- slotName: 'createTime',
- align: 'center',
- width: 180,
- render: ({ record }) => {
- return dateFormat(new Date(record.createTime));
- },
}, {
title: '修改时间',
dataIndex: 'updateTime',
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
index c6c6d743..0cfd5d1a 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
@@ -88,15 +88,13 @@
- {{ record.code }}
+ {{ record.code }}
-
-
- {{ record.address }}
-
-
+
+ {{ record.address }}
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-editor.vue b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-editor.vue
index e52d6f37..7817e6e0 100644
--- a/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-editor.vue
+++ b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-editor.vue
@@ -1,7 +1,7 @@
-