diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm index ac025abf..6426aa76 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm @@ -89,9 +89,9 @@ #end :data="tableRenderData" :pagination="pagination" + :bordered="false" @page-change="(page) => fetchTableData(page, pagination.pageSize)" - @page-size-change="(size) => fetchTableData(1, size)" - :bordered="false"> + @page-size-change="(size) => fetchTableData(1, size)"> #foreach($field in ${table.fields}) #if(${dictMap.containsKey(${field.propertyName})}) diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/controller/ExecLogController.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/controller/ExecLogController.java index 40da47b4..5bc67dfc 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/controller/ExecLogController.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/controller/ExecLogController.java @@ -67,7 +67,7 @@ public class ExecLogController { } @IgnoreLog(IgnoreLogMode.RET) - @GetMapping("/list") + @GetMapping("/host-list") @Operation(summary = "查询全部执行主机日志") @PreAuthorize("@ss.hasPermission('asset:exec-log:query')") public List getExecHostLogList(@RequestParam("logId") Long logId) { 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 995576db..fa3d1c90 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 @@ -49,9 +49,6 @@ public class ExecHostLogVO implements Serializable { @Schema(description = "退出码") private Integer exitStatus; - @Schema(description = "日志路径") - private String logPath; - @Schema(description = "错误信息") private String errorMessage; diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecLogVO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecLogVO.java index d9477a1b..bfa302b3 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecLogVO.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/vo/ExecLogVO.java @@ -34,12 +34,6 @@ public class ExecLogVO implements Serializable { @Schema(description = "执行用户名") private String username; - @Schema(description = "执行来源") - private String source; - - @Schema(description = "执行来源id") - private Long sourceId; - @Schema(description = "执行描述") private String description; diff --git a/orion-ops-ui/src/api/exec/exec-host-log.ts b/orion-ops-ui/src/api/exec/exec-host-log.ts new file mode 100644 index 00000000..ddf45730 --- /dev/null +++ b/orion-ops-ui/src/api/exec/exec-host-log.ts @@ -0,0 +1,135 @@ +import type { DataGrid, Pagination } from '@/types/global'; +import type { TableData } from '@arco-design/web-vue/es/table/interface'; +import axios from 'axios'; +import qs from 'query-string'; + +/** + * 主机执行记录创建请求 + */ +export interface ExecHostLogCreateRequest { + logId?: number; + hostId?: number; + hostName?: string; + status?: string; + command?: string; + parameter?: string; + exitStatus?: number; + logPath?: string; + errorMessage?: string; + startTime?: string; + finishTime?: string; +} + +/** + * 主机执行记录更新请求 + */ +export interface ExecHostLogUpdateRequest extends ExecHostLogCreateRequest { + id?: number; +} + +/** + * 主机执行记录查询请求 + */ +export interface ExecHostLogQueryRequest extends Pagination { + searchValue?: string; + id?: number; + logId?: number; + hostId?: number; + hostName?: string; + status?: string; + command?: string; + parameter?: string; + exitStatus?: number; + logPath?: string; + errorMessage?: string; + startTime?: string; + finishTime?: string; +} + +/** + * 主机执行记录查询响应 + */ +export interface ExecHostLogQueryResponse extends TableData { + id: number; + logId: number; + hostId: number; + hostName: string; + status: string; + command: string; + parameter: string; + exitStatus: number; + logPath: string; + errorMessage: string; + startTime: number; + finishTime: number; + createTime: number; + updateTime: number; + creator: string; + updater: string; +} + +/** + * 创建主机执行记录 + */ +export function createExecHostLog(request: ExecHostLogCreateRequest) { + return axios.post('/asset/exec-host-log/create', request); +} + +/** + * 更新主机执行记录 + */ +export function updateExecHostLog(request: ExecHostLogUpdateRequest) { + return axios.put('/asset/exec-host-log/update', request); +} + +/** + * 查询主机执行记录 + */ +export function getExecHostLog(id: number) { + return axios.get('/asset/exec-host-log/get', { params: { id } }); +} + +/** + * 批量查询主机执行记录 + */ +export function batchGetExecHostLogList(idList: Array) { + return axios.get('/asset/exec-host-log/batch-get', { + params: { idList }, + paramsSerializer: params => { + return qs.stringify(params, { arrayFormat: 'comma' }); + } + }); +} + +/** + * 查询全部主机执行记录 + */ +export function getExecHostLogList(request: ExecHostLogQueryRequest) { + return axios.post>('/asset/exec-host-log/list', request); +} + +/** + * 分页查询主机执行记录 + */ +export function getExecHostLogPage(request: ExecHostLogQueryRequest) { + return axios.post>('/asset/exec-host-log/query', request); +} + +/** + * 删除主机执行记录 + */ +export function deleteExecHostLog(id: number) { + return axios.delete('/asset/exec-host-log/delete', { params: { id } }); +} + +/** + * 批量删除主机执行记录 + */ +export function batchDeleteExecHostLog(idList: Array) { + return axios.delete('/asset/exec-host-log/batch-delete', { + params: { idList }, + paramsSerializer: params => { + return qs.stringify(params, { arrayFormat: 'comma' }); + } + }); +} diff --git a/orion-ops-ui/src/api/exec/exec-log.ts b/orion-ops-ui/src/api/exec/exec-log.ts new file mode 100644 index 00000000..1d6c33c4 --- /dev/null +++ b/orion-ops-ui/src/api/exec/exec-log.ts @@ -0,0 +1,95 @@ +import type { DataGrid, Pagination } from '@/types/global'; +import type { TableData } from '@arco-design/web-vue/es/table/interface'; +import axios from 'axios'; +import qs from 'query-string'; + +/** + * 执行记录查询请求 + */ +export interface ExecLogQueryRequest extends Pagination { + id?: number; + userId?: number; + description?: string; + command?: string; + status?: string; + startTimeRange?: string[]; +} + +/** + * 执行记录查询响应 + */ +export interface ExecLogQueryResponse extends TableData, ExecLogQueryExtraResponse { + id: number; + userId: number; + username: string; + description: string; + command: string; + timeout: number; + status: string; + startTime: number; + finishTime: number; +} + +/** + * 执行记录查询响应 拓展 + */ +export interface ExecLogQueryExtraResponse { + hosts: Array; +} + +/** + * 主机执行记录查询响应 + */ +export interface ExecHostLogQueryResponse extends TableData { + id: number; + logId: number; + hostId: number; + hostName: string; + status: string; + command: string; + parameter: string; + exitStatus: number; + errorMessage: string; + startTime: number; + finishTime: number; +} + +/** + * 查询执行记录 + */ +export function getExecLog(id: number) { + return axios.get('/asset/exec-log/get', { params: { id } }); +} + +/** + * 分页查询执行记录 + */ +export function getExecLogPage(request: ExecLogQueryRequest) { + return axios.post>('/asset/exec-log/query', request); +} + +/** + * 查询主机执行记录 + */ +export function getExecHostLogList(logId: number) { + return axios.get>('/asset/exec-log/host-list', { params: { logId } }); +} + +/** + * 删除执行记录 + */ +export function deleteExecLog(id: number) { + return axios.delete('/asset/exec-log/delete', { params: { id } }); +} + +/** + * 批量删除执行记录 + */ +export function batchDeleteExecLog(idList: Array) { + return axios.delete('/asset/exec-log/batch-delete', { + params: { idList }, + paramsSerializer: params => { + return qs.stringify(params, { arrayFormat: 'comma' }); + } + }); +} diff --git a/orion-ops-ui/src/router/routes/modules/exec.ts b/orion-ops-ui/src/router/routes/modules/exec.ts index 7fe80c0f..7203c2c3 100644 --- a/orion-ops-ui/src/router/routes/modules/exec.ts +++ b/orion-ops-ui/src/router/routes/modules/exec.ts @@ -11,6 +11,16 @@ const EXEC: AppRouteRecordRaw = { path: '/exec-template', component: () => import('@/views/exec/exec-template/index.vue'), }, + { + name: 'execLog', + path: '/exec-log', + component: () => import('@/views/exec/exec-log/index.vue'), + }, + { + name: 'execHostLog', + path: '/exec-host-log', + component: () => import('@/views/exec/exec-host-log/index.vue'), + }, ], }; diff --git a/orion-ops-ui/src/types/table.ts b/orion-ops-ui/src/types/table.ts index a4c4f277..f25a94ef 100644 --- a/orion-ops-ui/src/types/table.ts +++ b/orion-ops-ui/src/types/table.ts @@ -3,6 +3,7 @@ import { reactive } from 'vue'; import { useAppStore } from '@/store'; import { isNumber } from '@/utils/is'; import { TablePageSizeOptions } from '@/types/const'; +import { TableExpandable } from '@arco-design/web-vue/es/table/interface'; /** * 创建列表分页 @@ -31,3 +32,14 @@ export const useRowSelection = (ext?: TableRowSelection): TableRowSelection => { ...ext }); }; + +/** + * 创建表格展开 + */ +export const useExpandable = (ext?: TableExpandable): TableExpandable => { + return reactive({ + width: 50, + fixed: true, + ...ext + }); +}; diff --git a/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-form-modal.vue b/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-form-modal.vue new file mode 100644 index 00000000..9792babe --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-form-modal.vue @@ -0,0 +1,206 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-table.vue b/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-table.vue new file mode 100644 index 00000000..e4497751 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/components/exec-host-log-table.vue @@ -0,0 +1,257 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-host-log/index.vue b/orion-ops-ui/src/views/exec/exec-host-log/index.vue new file mode 100644 index 00000000..52aed3a5 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/index.vue @@ -0,0 +1,51 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-host-log/types/const.ts b/orion-ops-ui/src/views/exec/exec-host-log/types/const.ts new file mode 100644 index 00000000..22e32c06 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/types/const.ts @@ -0,0 +1,22 @@ +/** + * 执行状态 + */ +// FIXME 检查这里的类型 +export const execHostStatus = { + // 等待中 + WAITING: 'WAITING', + // 运行中 + RUNNING: 'RUNNING', + // 执行完成 + COMPLETED: 'COMPLETED', + // 执行失败 + FAILED: 'FAILED', + // 已中断 + INTERRUPTED: 'INTERRUPTED', +} + +// 执行状态 字典项 +export const execHostStatusKey = 'execHostStatus'; + +// 加载的字典值 +export const dictKeys = [execHostStatusKey]; diff --git a/orion-ops-ui/src/views/exec/exec-host-log/types/form.rules.ts b/orion-ops-ui/src/views/exec/exec-host-log/types/form.rules.ts new file mode 100644 index 00000000..ba2bf7bf --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/types/form.rules.ts @@ -0,0 +1,82 @@ +import type { FieldRule } from '@arco-design/web-vue'; + +export const logId = [{ + required: true, + message: '请输入执行日志id' +}] as FieldRule[]; + +export const hostId = [{ + required: true, + message: '请输入主机id' +}] as FieldRule[]; + +export const hostName = [{ + required: true, + message: '请输入主机名称' +}, { + maxLength: 128, + message: '主机名称长度不能大于128位' +}] as FieldRule[]; + +export const status = [{ + required: true, + message: '请输入执行状态' +}, { + maxLength: 12, + message: '执行状态长度不能大于12位' +}] as FieldRule[]; + +export const command = [{ + required: true, + message: '请输入执行命令' +}] as FieldRule[]; + +export const parameter = [{ + required: true, + message: '请输入执行参数' +}] as FieldRule[]; + +export const exitStatus = [{ + required: true, + message: '请输入退出码' +}] as FieldRule[]; + +export const logPath = [{ + required: true, + message: '请输入日志路径' +}, { + maxLength: 512, + message: '日志路径长度不能大于512位' +}] as FieldRule[]; + +export const errorMessage = [{ + required: true, + message: '请输入错误信息' +}, { + maxLength: 255, + message: '错误信息长度不能大于255位' +}] as FieldRule[]; + +export const startTime = [{ + required: true, + message: '请输入执行开始时间' +}] as FieldRule[]; + +export const finishTime = [{ + required: true, + message: '请输入执行结束时间' +}] as FieldRule[]; + +export default { + logId, + hostId, + hostName, + status, + command, + parameter, + exitStatus, + logPath, + errorMessage, + startTime, + finishTime, +} as Record; diff --git a/orion-ops-ui/src/views/exec/exec-host-log/types/table.columns.ts b/orion-ops-ui/src/views/exec/exec-host-log/types/table.columns.ts new file mode 100644 index 00000000..8a9d1c64 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-host-log/types/table.columns.ts @@ -0,0 +1,122 @@ +import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; +import { dateFormat } from '@/utils'; + +const columns = [ + { + title: 'id', + dataIndex: 'id', + slotName: 'id', + width: 70, + align: 'left', + fixed: 'left', + }, { + title: '执行日志id', + dataIndex: 'logId', + slotName: 'logId', + align: 'left', + }, { + title: '主机id', + dataIndex: 'hostId', + slotName: 'hostId', + align: 'left', + }, { + title: '主机名称', + dataIndex: 'hostName', + slotName: 'hostName', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行状态', + dataIndex: 'status', + slotName: 'status', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行命令', + dataIndex: 'command', + slotName: 'command', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行参数', + dataIndex: 'parameter', + slotName: 'parameter', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '退出码', + dataIndex: 'exitStatus', + slotName: 'exitStatus', + align: 'left', + }, { + title: '日志路径', + dataIndex: 'logPath', + slotName: 'logPath', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '错误信息', + dataIndex: 'errorMessage', + slotName: 'errorMessage', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行开始时间', + dataIndex: 'startTime', + slotName: 'startTime', + align: 'left', + width: 180, + render: ({ record }) => { + return record.startTime && dateFormat(new Date(record.startTime)); + }, + }, { + title: '执行结束时间', + dataIndex: 'finishTime', + slotName: 'finishTime', + align: 'left', + width: 180, + render: ({ record }) => { + return record.finishTime && dateFormat(new Date(record.finishTime)); + }, + }, { + title: '创建时间', + dataIndex: 'createTime', + slotName: 'createTime', + align: 'center', + width: 180, + render: ({ record }) => { + return dateFormat(new Date(record.createTime)); + }, + }, { + title: '修改时间', + dataIndex: 'updateTime', + slotName: 'updateTime', + align: 'center', + width: 180, + render: ({ record }) => { + return dateFormat(new Date(record.updateTime)); + }, + }, { + title: '创建人', + dataIndex: 'creator', + slotName: 'creator', + }, { + title: '修改人', + dataIndex: 'updater', + slotName: 'updater', + }, { + title: '操作', + slotName: 'handle', + width: 130, + align: 'center', + fixed: 'right', + }, +] as TableColumnData[]; + +export default columns; diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue new file mode 100644 index 00000000..6d32a3fb --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue @@ -0,0 +1,80 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-log-form-modal.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-form-modal.vue new file mode 100644 index 00000000..b47cde9c --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-form-modal.vue @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue new file mode 100644 index 00000000..2de48f67 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue @@ -0,0 +1,259 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-log/index.vue b/orion-ops-ui/src/views/exec/exec-log/index.vue new file mode 100644 index 00000000..a49b4258 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/index.vue @@ -0,0 +1,48 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/exec-log/types/const.ts b/orion-ops-ui/src/views/exec/exec-log/types/const.ts new file mode 100644 index 00000000..c6f258e1 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/types/const.ts @@ -0,0 +1,38 @@ +/** + * 批量执行状态 + */ +export const execStatus = { + // 等待中 + WAITING: 'WAITING', + // 运行中 + RUNNING: 'RUNNING', + // 执行完成 + COMPLETED: 'COMPLETED', + // 执行失败 + FAILED: 'FAILED', +}; + +/** + * 主机执行状态 + */ +export const execHostStatus = { + // 等待中 + WAITING: 'WAITING', + // 运行中 + RUNNING: 'RUNNING', + // 执行完成 + COMPLETED: 'COMPLETED', + // 执行失败 + FAILED: 'FAILED', + // 已中断 + INTERRUPTED: 'INTERRUPTED', +}; + +// 执行状态 字典项 +export const execStatusKey = 'execStatus'; + +// 执行状态 字典项 +export const execHostStatusKey = 'execHostStatus'; + +// 加载的字典值 +export const dictKeys = [execStatusKey, execHostStatusKey]; diff --git a/orion-ops-ui/src/views/exec/exec-log/types/form.rules.ts b/orion-ops-ui/src/views/exec/exec-log/types/form.rules.ts new file mode 100644 index 00000000..5ffc2a66 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/types/form.rules.ts @@ -0,0 +1,76 @@ +import type { FieldRule } from '@arco-design/web-vue'; + +export const userId = [{ + required: true, + message: '请输入执行用户id' +}] as FieldRule[]; + +export const username = [{ + required: true, + message: '请输入执行用户名' +}, { + maxLength: 32, + message: '执行用户名长度不能大于32位' +}] as FieldRule[]; + +export const source = [{ + required: true, + message: '请输入执行来源' +}, { + maxLength: 12, + message: '执行来源长度不能大于12位' +}] as FieldRule[]; + +export const sourceId = [{ + required: true, + message: '请输入执行来源id' +}] as FieldRule[]; + +export const description = [{ + required: true, + message: '请输入执行描述' +}, { + maxLength: 128, + message: '执行描述长度不能大于128位' +}] as FieldRule[]; + +export const command = [{ + required: true, + message: '请输入执行命令' +}] as FieldRule[]; + +export const timeout = [{ + required: true, + message: '请输入超时时间' +}] as FieldRule[]; + +export const status = [{ + required: true, + message: '请输入执行状态' +}, { + maxLength: 12, + message: '执行状态长度不能大于12位' +}] as FieldRule[]; + +export const startTime = [{ + required: true, + message: '请输入执行开始时间' +}] as FieldRule[]; + +export const finishTime = [{ + required: true, + message: '请输入执行完成时间' +}] as FieldRule[]; + +export default { + userId, + username, + source, + sourceId, + description, + command, + timeout, + status, + startTime, + finishTime, +} as Record; diff --git a/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts b/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts new file mode 100644 index 00000000..8a9d1c64 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts @@ -0,0 +1,122 @@ +import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; +import { dateFormat } from '@/utils'; + +const columns = [ + { + title: 'id', + dataIndex: 'id', + slotName: 'id', + width: 70, + align: 'left', + fixed: 'left', + }, { + title: '执行日志id', + dataIndex: 'logId', + slotName: 'logId', + align: 'left', + }, { + title: '主机id', + dataIndex: 'hostId', + slotName: 'hostId', + align: 'left', + }, { + title: '主机名称', + dataIndex: 'hostName', + slotName: 'hostName', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行状态', + dataIndex: 'status', + slotName: 'status', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行命令', + dataIndex: 'command', + slotName: 'command', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行参数', + dataIndex: 'parameter', + slotName: 'parameter', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '退出码', + dataIndex: 'exitStatus', + slotName: 'exitStatus', + align: 'left', + }, { + title: '日志路径', + dataIndex: 'logPath', + slotName: 'logPath', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '错误信息', + dataIndex: 'errorMessage', + slotName: 'errorMessage', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行开始时间', + dataIndex: 'startTime', + slotName: 'startTime', + align: 'left', + width: 180, + render: ({ record }) => { + return record.startTime && dateFormat(new Date(record.startTime)); + }, + }, { + title: '执行结束时间', + dataIndex: 'finishTime', + slotName: 'finishTime', + align: 'left', + width: 180, + render: ({ record }) => { + return record.finishTime && dateFormat(new Date(record.finishTime)); + }, + }, { + title: '创建时间', + dataIndex: 'createTime', + slotName: 'createTime', + align: 'center', + width: 180, + render: ({ record }) => { + return dateFormat(new Date(record.createTime)); + }, + }, { + title: '修改时间', + dataIndex: 'updateTime', + slotName: 'updateTime', + align: 'center', + width: 180, + render: ({ record }) => { + return dateFormat(new Date(record.updateTime)); + }, + }, { + title: '创建人', + dataIndex: 'creator', + slotName: 'creator', + }, { + title: '修改人', + dataIndex: 'updater', + slotName: 'updater', + }, { + title: '操作', + slotName: 'handle', + width: 130, + align: 'center', + fixed: 'right', + }, +] as TableColumnData[]; + +export default columns; diff --git a/orion-ops-ui/src/views/exec/exec-log/types/sub-table.columns.ts b/orion-ops-ui/src/views/exec/exec-log/types/sub-table.columns.ts new file mode 100644 index 00000000..f62df522 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/types/sub-table.columns.ts @@ -0,0 +1,40 @@ +import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; + +const columns = [ + { + title: '执行主机', + dataIndex: 'hostName', + slotName: 'hostName', + align: 'left', + width: 168, + ellipsis: true, + tooltip: true, + }, { + title: '执行命令', + dataIndex: 'command', + slotName: 'command', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行状态1', + dataIndex: 'status1', + slotName: 'status1', + align: 'left', + width: 118, + }, { + title: '执行时间', + dataIndex: 'startTime', + slotName: 'startTime', + align: 'left', + width: 180, + }, { + title: '操作', + slotName: 'handle', + width: 130, + align: 'center', + fixed: 'right', + }, +] as TableColumnData[]; + +export default columns; diff --git a/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts b/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts new file mode 100644 index 00000000..b52d84f4 --- /dev/null +++ b/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts @@ -0,0 +1,54 @@ +import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; + +const columns = [ + { + title: 'id', + dataIndex: 'id', + slotName: 'id', + width: 70, + align: 'left', + fixed: 'left', + }, { + title: '描述', + dataIndex: 'description', + slotName: 'description', + align: 'left', + width: 168, + ellipsis: true, + tooltip: true, + }, { + title: '执行命令', + dataIndex: 'command', + slotName: 'command', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '执行用户', + dataIndex: 'username', + slotName: 'username', + align: 'left', + width: 118, + ellipsis: true, + }, { + title: '执行状态', + dataIndex: 'status', + slotName: 'status', + align: 'left', + width: 118, + }, { + title: '执行时间', + dataIndex: 'startTime', + slotName: 'startTime', + align: 'left', + width: 180, + }, { + title: '操作', + slotName: 'handle', + width: 130, + align: 'center', + fixed: 'right', + }, +] as TableColumnData[]; + +export default columns;