🚧 定时任务.
This commit is contained in:
@@ -49,7 +49,7 @@ demo: http://101.43.254.243:1081/
|
||||
* 在线终端: 提供便捷的在线 Web 终端服务, 支持快捷命令、自定义快捷键和主题风格。
|
||||
* 文件管理: 实现远程主机大文件的批量上传、下载和在线编辑等操作。
|
||||
* 批量操作: 支持远程主机批量执行 shell 命令。
|
||||
* 计划执行: 支持配置 cron 表达式, 定时执行主机 shell 命令。
|
||||
* 计划任务: 支持配置 cron 表达式, 定时执行主机 shell 命令。
|
||||
* 操作日志: 记录用户操作日志,确保操作可追溯, 提高系统安全性。
|
||||
* 可扩展性: 前后端代码规范统一、代码质量高、健壮且易于阅读和扩展。
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ demo: http://101.43.254.243:1081/
|
||||
* 在线终端: 提供便捷的在线 Web 终端服务, 支持快捷命令、自定义快捷键和主题风格。
|
||||
* 文件管理: 实现远程主机大文件的批量上传、下载和在线编辑等操作。
|
||||
* 批量操作: 支持远程主机批量执行 shell 命令。
|
||||
* 计划执行: 支持配置 cron 表达式, 定时执行主机 shell 命令。
|
||||
* 计划任务: 支持配置 cron 表达式, 定时执行主机 shell 命令。
|
||||
* 操作日志: 记录用户操作日志,确保操作可追溯, 提高系统安全性。
|
||||
* 可扩展性: 前后端代码规范统一、代码质量高、健壮且易于阅读和扩展。
|
||||
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
* 🐞 修复 主机列表卡片视图重置条件后 tag 消失
|
||||
* 🐞 修复 主机分组授权页面刷新不显示 loading
|
||||
* 🐞 修复 面包屑组件路径显示不全的问题
|
||||
* 🐞 修复 数据字典历史提示无权限
|
||||
* 🩰 修改 主机终端亮色模式配色
|
||||
* 🌈 新增 定时执行模块
|
||||
* 🩰 修改 执行模板 UI 修改
|
||||
* 🌈 新增 计划任务模块
|
||||
* 🌈 新增 计划任务日志模块
|
||||
* 🔨 添加 quartz 配置
|
||||
* 🔨 修改 redisson 配置
|
||||
* 🔨 优化 orion-ops-framework 配置规范化
|
||||
* 🔨 优化 前端 props 命名规范化
|
||||
|
||||
@@ -44,18 +44,18 @@ public class CodeGenerators {
|
||||
// .color("blue", "gray", "red", "green", "white")
|
||||
// .valueUseFields()
|
||||
// .build(),
|
||||
Template.create("exec_job", "计划执行", "exec")
|
||||
Template.create("exec_job", "计划任务", "exec")
|
||||
.disableUnitTest()
|
||||
.vue("exec", "exec-job")
|
||||
.enableDrawerForm()
|
||||
.dict("execJobStatus", "status")
|
||||
.comment("计划执行状态")
|
||||
.comment("计划任务状态")
|
||||
.field("execJobStatus")
|
||||
.fields("DISABLED", "ENABLED")
|
||||
.labels("禁用", "启用")
|
||||
.values(0, 1)
|
||||
.build(),
|
||||
Template.create("exec_job_host", "计划执行主机", "exec")
|
||||
Template.create("exec_job_host", "计划任务主机", "exec")
|
||||
.disableUnitTest()
|
||||
.vue("exec", "exec-job-host")
|
||||
.build(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
### 创建计划执行任务
|
||||
### 创建计划任务
|
||||
POST {{baseUrl}}/asset/exec-job/create
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
@@ -13,7 +13,7 @@ Authorization: {{token}}
|
||||
}
|
||||
|
||||
|
||||
### 更新计划执行任务
|
||||
### 更新计划任务
|
||||
PUT {{baseUrl}}/asset/exec-job/update
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
@@ -31,7 +31,7 @@ Authorization: {{token}}
|
||||
}
|
||||
|
||||
|
||||
### 更新计划执行任务状态
|
||||
### 更新计划任务状态
|
||||
PUT {{baseUrl}}/asset/exec-job/update-status
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
@@ -42,12 +42,12 @@ Authorization: {{token}}
|
||||
}
|
||||
|
||||
|
||||
### 查询计划执行任务
|
||||
### 查询计划任务
|
||||
GET {{baseUrl}}/asset/exec-job/get?id=1
|
||||
Authorization: {{token}}
|
||||
|
||||
|
||||
### 分页查询计划执行任务
|
||||
### 分页查询计划任务
|
||||
POST {{baseUrl}}/asset/exec-job/query
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
@@ -62,7 +62,7 @@ Authorization: {{token}}
|
||||
}
|
||||
|
||||
|
||||
### 删除计划执行任务
|
||||
### 删除计划任务
|
||||
DELETE {{baseUrl}}/asset/exec-job/delete?id=1
|
||||
Authorization: {{token}}
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 计划执行任务 api
|
||||
* 计划任务 api
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
* @since 2024-3-28 12:03
|
||||
*/
|
||||
@Tag(name = "asset - 计划执行任务服务")
|
||||
@Tag(name = "asset - 计划任务服务")
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RestWrapper
|
||||
@@ -42,7 +42,7 @@ public class ExecJobController {
|
||||
|
||||
@OperatorLog(ExecJobOperatorType.CREATE)
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建计划执行任务")
|
||||
@Operation(summary = "创建计划任务")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:create')")
|
||||
public Long createExecJob(@Validated @RequestBody ExecJobCreateRequest request) {
|
||||
return execJobService.createExecJob(request);
|
||||
@@ -50,7 +50,7 @@ public class ExecJobController {
|
||||
|
||||
@OperatorLog(ExecJobOperatorType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新计划执行任务")
|
||||
@Operation(summary = "更新计划任务")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:update')")
|
||||
public Integer updateExecJob(@Validated @RequestBody ExecJobUpdateRequest request) {
|
||||
return execJobService.updateExecJobById(request);
|
||||
@@ -58,7 +58,7 @@ public class ExecJobController {
|
||||
|
||||
@OperatorLog(ExecJobOperatorType.UPDATE_STATUS)
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新计划执行任务状态")
|
||||
@Operation(summary = "更新计划任务状态")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:update-status')")
|
||||
public Integer updateExecJobStatus(@Validated @RequestBody ExecJobUpdateStatusRequest request) {
|
||||
return execJobService.updateExecJobStatus(request);
|
||||
@@ -66,7 +66,7 @@ public class ExecJobController {
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查询计划执行任务")
|
||||
@Operation(summary = "查询计划任务")
|
||||
@Parameter(name = "id", description = "id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:query')")
|
||||
public ExecJobVO getExecJob(@RequestParam("id") Long id) {
|
||||
@@ -75,7 +75,7 @@ public class ExecJobController {
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@PostMapping("/query")
|
||||
@Operation(summary = "分页查询计划执行任务")
|
||||
@Operation(summary = "分页查询计划任务")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:query')")
|
||||
public DataGrid<ExecJobVO> getExecJobPage(@Validated(Page.class) @RequestBody ExecJobQueryRequest request) {
|
||||
return execJobService.getExecJobPage(request);
|
||||
@@ -83,7 +83,7 @@ public class ExecJobController {
|
||||
|
||||
@OperatorLog(ExecJobOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除计划执行任务")
|
||||
@Operation(summary = "删除计划任务")
|
||||
@Parameter(name = "id", description = "id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:delete')")
|
||||
public Integer deleteExecJob(@RequestParam("id") Long id) {
|
||||
@@ -92,7 +92,7 @@ public class ExecJobController {
|
||||
|
||||
@OperatorLog(ExecJobOperatorType.TRIGGER)
|
||||
@PostMapping("/trigger")
|
||||
@Operation(summary = "手动触发计划执行任务")
|
||||
@Operation(summary = "手动触发计划任务")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:trigger')")
|
||||
public HttpWrapper<?> triggerExecJob(@Validated @RequestBody ExecJobTriggerRequest request) {
|
||||
execJobService.manualTriggerExecJob(request.getId());
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
### 查询计划执行任务日志
|
||||
### 查询计划任务日志
|
||||
GET {{baseUrl}}/asset/exec-job-log/get?id=1
|
||||
Authorization: {{token}}
|
||||
|
||||
|
||||
### 分页查询计划执行任务日志
|
||||
### 分页查询计划任务日志
|
||||
POST {{baseUrl}}/asset/exec-job-log/query
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
@@ -20,12 +20,12 @@ Authorization: {{token}}
|
||||
}
|
||||
|
||||
|
||||
### 删除计划执行任务日志
|
||||
### 删除计划任务日志
|
||||
DELETE {{baseUrl}}/asset/exec-job-log/delete?id=1
|
||||
Authorization: {{token}}
|
||||
|
||||
|
||||
### 批量删除计划执行任务日志
|
||||
### 批量删除计划任务日志
|
||||
DELETE {{baseUrl}}/asset/exec-job-log/batch-delete?idList=1,2,3
|
||||
Authorization: {{token}}
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务日志 api
|
||||
* 计划任务日志 api
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.1
|
||||
* @since 2024-3-11 11:31
|
||||
*/
|
||||
@Tag(name = "asset - 计划执行任务日志服务")
|
||||
@Tag(name = "asset - 计划任务日志服务")
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RestWrapper
|
||||
@@ -53,7 +53,7 @@ public class ExecJobLogController {
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@PostMapping("/query")
|
||||
@Operation(summary = "分页查询计划执行任务日志")
|
||||
@Operation(summary = "分页查询计划任务日志")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:query')")
|
||||
public DataGrid<ExecLogVO> getExecJobLogPage(@Validated(Page.class) @RequestBody ExecLogQueryRequest request) {
|
||||
request.setSource(SOURCE);
|
||||
@@ -62,7 +62,7 @@ public class ExecJobLogController {
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查询计划执行任务日志")
|
||||
@Operation(summary = "查询计划任务日志")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:query')")
|
||||
public ExecLogVO getExecJobLog(@RequestParam("id") Long id) {
|
||||
return execLogService.getExecLog(id, SOURCE);
|
||||
@@ -87,7 +87,7 @@ public class ExecJobLogController {
|
||||
|
||||
@OperatorLog(ExecJobLogOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除计划执行任务日志")
|
||||
@Operation(summary = "删除计划任务日志")
|
||||
@Parameter(name = "id", description = "id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:delete')")
|
||||
public Integer deleteExecJobLog(@RequestParam("id") Long id) {
|
||||
@@ -96,7 +96,7 @@ public class ExecJobLogController {
|
||||
|
||||
@OperatorLog(ExecJobLogOperatorType.DELETE)
|
||||
@DeleteMapping("/batch-delete")
|
||||
@Operation(summary = "删除计划执行任务日志")
|
||||
@Operation(summary = "删除计划任务日志")
|
||||
@Parameter(name = "idList", description = "idList", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:delete')")
|
||||
public Integer batchDeleteExecJobLog(@RequestParam("idList") List<Long> idList) {
|
||||
@@ -113,7 +113,7 @@ public class ExecJobLogController {
|
||||
}
|
||||
|
||||
@PostMapping("/query-count")
|
||||
@Operation(summary = "查询计划执行任务日志数量")
|
||||
@Operation(summary = "查询计划任务日志数量")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:management:clear')")
|
||||
public Long getExecJobLogCount(@RequestBody ExecLogQueryRequest request) {
|
||||
request.setSource(SOURCE);
|
||||
@@ -122,7 +122,7 @@ public class ExecJobLogController {
|
||||
|
||||
@OperatorLog(ExecJobLogOperatorType.CLEAR)
|
||||
@PostMapping("/clear")
|
||||
@Operation(summary = "清空计划执行任务日志")
|
||||
@Operation(summary = "清空计划任务日志")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:management:clear')")
|
||||
public Integer clearExecJobLog(@RequestBody ExecLogQueryRequest request) {
|
||||
request.setSource(SOURCE);
|
||||
@@ -130,8 +130,8 @@ public class ExecJobLogController {
|
||||
}
|
||||
|
||||
@PostMapping("/tail")
|
||||
@Operation(summary = "查看计划执行任务日志")
|
||||
@PreAuthorize("@ss.hasAnyPermission('asset:exec-job-log:query', 'asset:exec-job:exec')")
|
||||
@Operation(summary = "查看计划任务日志")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:query')")
|
||||
public String getExecJobLogTailToken(@Validated @RequestBody ExecLogTailRequest request) {
|
||||
request.setSource(SOURCE);
|
||||
return execLogService.getExecLogTailToken(request);
|
||||
@@ -139,8 +139,8 @@ public class ExecJobLogController {
|
||||
|
||||
@OperatorLog(ExecJobLogOperatorType.DOWNLOAD)
|
||||
@GetMapping("/download")
|
||||
@Operation(summary = "下载计划执行任务日志")
|
||||
@PreAuthorize("@ss.hasAnyPermission('asset:exec-job-log:query', 'asset:exec-job:exec')")
|
||||
@Operation(summary = "下载计划任务日志")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:query')")
|
||||
public void downloadExecJobLogFile(@RequestParam("id") Long id, HttpServletResponse response) {
|
||||
execLogService.downloadLogFile(id, SOURCE, response);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.mapstruct.factory.Mappers;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务 内部对象转换器
|
||||
* 计划任务 内部对象转换器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 计划执行任务 Mapper 接口
|
||||
* 计划任务 Mapper 接口
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务主机 Mapper 接口
|
||||
* 计划任务主机 Mapper 接口
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ExecCommandLogOperatorType extends InitializingOperatorTypes {
|
||||
new OperatorType(H, DELETE, "删除批量执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(H, DELETE_HOST, "删除批量执行主机日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
new OperatorType(H, CLEAR, "清理批量执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(L, DOWNLOAD, "下载主机执行日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
new OperatorType(L, DOWNLOAD, "下载批量执行日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLe
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.L;
|
||||
|
||||
/**
|
||||
* 计划执行日志 操作记录类型
|
||||
* 计划任务执行日志 操作记录类型
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.1
|
||||
@@ -28,10 +28,10 @@ public class ExecJobLogOperatorType extends InitializingOperatorTypes {
|
||||
@Override
|
||||
public OperatorType[] types() {
|
||||
return new OperatorType[]{
|
||||
new OperatorType(H, DELETE, "删除计划执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(H, DELETE_HOST, "删除计划执行主机日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
new OperatorType(H, CLEAR, "清理计划执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(L, DOWNLOAD, "下载主机执行日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除计划任务执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(H, DELETE_HOST, "删除计划任务执行主机日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
new OperatorType(H, CLEAR, "清理计划任务执行日志 <sb>${count}</sb> 条"),
|
||||
new OperatorType(L, DOWNLOAD, "下载计划任务执行日志 <sb>${logId}</sb> <sb>${hostName}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orion.ops.framework.biz.operator.log.core.model.OperatorType;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.*;
|
||||
|
||||
/**
|
||||
* 计划执行任务 操作日志类型
|
||||
* 计划任务 操作日志类型
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -29,11 +29,11 @@ public class ExecJobOperatorType extends InitializingOperatorTypes {
|
||||
@Override
|
||||
public OperatorType[] types() {
|
||||
return new OperatorType[]{
|
||||
new OperatorType(L, CREATE, "创建计划执行任务 <sb>${name}</sb>"),
|
||||
new OperatorType(M, UPDATE, "更新计划执行任务 <sb>${before}</sb>"),
|
||||
new OperatorType(M, UPDATE_STATUS, "<sb>${statusName}</sb>计划执行任务 <sb>${name}</sb>"),
|
||||
new OperatorType(M, TRIGGER, "手动触发计划执行任务 <sb>${name}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除计划执行任务 <sb>${name}</sb>"),
|
||||
new OperatorType(L, CREATE, "创建计划任务 <sb>${name}</sb>"),
|
||||
new OperatorType(M, UPDATE, "更新计划任务 <sb>${before}</sb>"),
|
||||
new OperatorType(M, UPDATE_STATUS, "<sb>${statusName}</sb>计划任务 <sb>${name}</sb>"),
|
||||
new OperatorType(M, TRIGGER, "手动触发计划任务 <sb>${name}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除计划任务 <sb>${name}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 计划执行任务 实体对象
|
||||
* 计划任务 实体对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -21,7 +21,7 @@ import lombok.*;
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "exec_job", autoResultMap = true)
|
||||
@Schema(name = "ExecJobDO", description = "计划执行任务 实体对象")
|
||||
@Schema(name = "ExecJobDO", description = "计划任务 实体对象")
|
||||
public class ExecJobDO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 计划执行任务主机 实体对象
|
||||
* 计划任务主机 实体对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -21,7 +21,7 @@ import lombok.*;
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "exec_job_host", autoResultMap = true)
|
||||
@Schema(name = "ExecJobHostDO", description = "计划执行任务主机 实体对象")
|
||||
@Schema(name = "ExecJobHostDO", description = "计划任务主机 实体对象")
|
||||
public class ExecJobHostDO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务 创建请求对象
|
||||
* 计划任务 创建请求对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobCreateRequest", description = "计划执行任务 创建请求对象")
|
||||
@Schema(name = "ExecJobCreateRequest", description = "计划任务 创建请求对象")
|
||||
public class ExecJobCreateRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.*;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 计划执行任务 查询请求对象
|
||||
* 计划任务 查询请求对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -18,7 +18,7 @@ import javax.validation.constraints.Size;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(name = "ExecJobQueryRequest", description = "计划执行任务 查询请求对象")
|
||||
@Schema(name = "ExecJobQueryRequest", description = "计划任务 查询请求对象")
|
||||
public class ExecJobQueryRequest extends PageRequest {
|
||||
|
||||
@Schema(description = "id")
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 计划执行任务 手动触发请求对象
|
||||
* 计划任务 手动触发请求对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobTriggerRequest", description = "计划执行任务 手动触发请求对象")
|
||||
@Schema(name = "ExecJobTriggerRequest", description = "计划任务 手动触发请求对象")
|
||||
public class ExecJobTriggerRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务 更新请求对象
|
||||
* 计划任务 更新请求对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobUpdateRequest", description = "计划执行任务 更新请求对象")
|
||||
@Schema(name = "ExecJobUpdateRequest", description = "计划任务 更新请求对象")
|
||||
public class ExecJobUpdateRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 计划执行任务 更新状态请求对象
|
||||
* 计划任务 更新状态请求对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobUpdateStatusRequest", description = "计划执行任务 更新状态请求对象")
|
||||
@Schema(name = "ExecJobUpdateStatusRequest", description = "计划任务 更新状态请求对象")
|
||||
public class ExecJobUpdateStatusRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 计划执行任务主机 视图响应对象
|
||||
* 计划任务主机 视图响应对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -20,7 +20,7 @@ import java.util.Date;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobHostVO", description = "计划执行任务主机 视图响应对象")
|
||||
@Schema(name = "ExecJobHostVO", description = "计划任务主机 视图响应对象")
|
||||
public class ExecJobHostVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务 视图响应对象
|
||||
* 计划任务 视图响应对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecJobVO", description = "计划执行任务 视图响应对象")
|
||||
@Schema(name = "ExecJobVO", description = "计划任务 视图响应对象")
|
||||
public class ExecJobVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -15,7 +15,7 @@ public enum ExecSourceEnum {
|
||||
BATCH,
|
||||
|
||||
/**
|
||||
* 计划执行
|
||||
* 计划任务
|
||||
*/
|
||||
JOB,
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
/**
|
||||
* 计划执行命令任务
|
||||
* 计划命令任务
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.orion.ops.module.asset.service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计划执行任务主机 服务类
|
||||
* 计划任务主机 服务类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.orion.ops.module.asset.entity.request.exec.*;
|
||||
import com.orion.ops.module.asset.entity.vo.ExecJobVO;
|
||||
|
||||
/**
|
||||
* 计划执行任务 服务类
|
||||
* 计划任务 服务类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
@@ -14,7 +14,7 @@ import com.orion.ops.module.asset.entity.vo.ExecJobVO;
|
||||
public interface ExecJobService {
|
||||
|
||||
/**
|
||||
* 创建计划执行任务
|
||||
* 创建计划任务
|
||||
*
|
||||
* @param request request
|
||||
* @return id
|
||||
@@ -22,7 +22,7 @@ public interface ExecJobService {
|
||||
Long createExecJob(ExecJobCreateRequest request);
|
||||
|
||||
/**
|
||||
* 更新计划执行任务
|
||||
* 更新计划任务
|
||||
*
|
||||
* @param request request
|
||||
* @return effect
|
||||
@@ -30,7 +30,7 @@ public interface ExecJobService {
|
||||
Integer updateExecJobById(ExecJobUpdateRequest request);
|
||||
|
||||
/**
|
||||
* 更新计划执行任务状态
|
||||
* 更新计划任务状态
|
||||
*
|
||||
* @param request request
|
||||
* @return effect
|
||||
@@ -38,7 +38,7 @@ public interface ExecJobService {
|
||||
Integer updateExecJobStatus(ExecJobUpdateStatusRequest request);
|
||||
|
||||
/**
|
||||
* 查询计划执行任务
|
||||
* 查询计划任务
|
||||
*
|
||||
* @param id id
|
||||
* @return row
|
||||
@@ -46,7 +46,7 @@ public interface ExecJobService {
|
||||
ExecJobVO getExecJobById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询计划执行任务
|
||||
* 分页查询计划任务
|
||||
*
|
||||
* @param request request
|
||||
* @return rows
|
||||
@@ -62,7 +62,7 @@ public interface ExecJobService {
|
||||
Integer getNextExecSeq(Long id);
|
||||
|
||||
/**
|
||||
* 删除计划执行任务
|
||||
* 删除计划任务
|
||||
*
|
||||
* @param id id
|
||||
* @return effect
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 计划执行任务主机 服务实现类
|
||||
* 计划任务主机 服务实现类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -43,7 +43,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 计划执行任务 服务实现类
|
||||
* 计划任务 服务实现类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.3
|
||||
|
||||
@@ -217,7 +217,7 @@ public class HostServiceImpl implements HostService {
|
||||
log.info("HostService-deleteHostRelByIdAsync id: {}", id);
|
||||
// 删除主机配置
|
||||
hostConfigDAO.deleteByHostId(id);
|
||||
// 删除计划执行任务主机
|
||||
// 删除计划任务主机
|
||||
execJobHostService.deleteByHostId(id);
|
||||
// 删除分组
|
||||
dataGroupRelApi.deleteByRelId(DataGroupTypeEnum.HOST, id);
|
||||
|
||||
@@ -4,7 +4,7 @@ import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
|
||||
/**
|
||||
* 计划执行日志查询请求
|
||||
* 计划任务日志查询请求
|
||||
*/
|
||||
export interface ExecJobLogQueryRequest extends Pagination {
|
||||
id?: number;
|
||||
@@ -16,7 +16,7 @@ export interface ExecJobLogQueryRequest extends Pagination {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行日志查询响应
|
||||
* 计划任务日志查询响应
|
||||
*/
|
||||
export interface ExecJobLogQueryResponse extends TableData, ExecJobLogQueryExtraResponse {
|
||||
id: number;
|
||||
@@ -34,14 +34,14 @@ export interface ExecJobLogQueryResponse extends TableData, ExecJobLogQueryExtra
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行日志查询响应 拓展
|
||||
* 计划任务日志查询响应 拓展
|
||||
*/
|
||||
export interface ExecJobLogQueryExtraResponse {
|
||||
hosts: Array<ExecJobHostLogQueryResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机计划执行日志查询响应
|
||||
* 主机计划任务日志查询响应
|
||||
*/
|
||||
export interface ExecJobHostLogQueryResponse extends TableData {
|
||||
id: number;
|
||||
@@ -59,7 +59,7 @@ export interface ExecJobHostLogQueryResponse extends TableData {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行状态查询响应
|
||||
* 计划任务状态查询响应
|
||||
*/
|
||||
export interface ExecJobLogStatusResponse {
|
||||
logList: Array<ExecJobLogQueryResponse>;
|
||||
@@ -67,7 +67,7 @@ export interface ExecJobLogStatusResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行日志 tail 请求
|
||||
* 计划任务日志 tail 请求
|
||||
*/
|
||||
export interface ExecJobLogTailRequest {
|
||||
execId?: number;
|
||||
@@ -75,21 +75,21 @@ export interface ExecJobLogTailRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询计划执行日志
|
||||
* 分页查询计划任务日志
|
||||
*/
|
||||
export function getExecJobLogPage(request: ExecJobLogQueryRequest) {
|
||||
return axios.post<DataGrid<ExecJobLogQueryResponse>>('/asset/exec-job-log/query', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划执行日志
|
||||
* 查询计划任务日志
|
||||
*/
|
||||
export function getExecJobLog(id: number) {
|
||||
return axios.get<ExecJobLogQueryResponse>('/asset/exec-job-log/get', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询主机计划执行日志
|
||||
* 查询主机计划任务日志
|
||||
*/
|
||||
export function getExecJobHostLogList(logId: number) {
|
||||
return axios.get<Array<ExecJobHostLogQueryResponse>>('/asset/exec-job-log/host-list', { params: { logId } });
|
||||
@@ -108,14 +108,14 @@ export function getExecJobLogStatus(idList: Array<number>) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划执行日志
|
||||
* 删除计划任务日志
|
||||
*/
|
||||
export function deleteExecJobLog(id: number) {
|
||||
return axios.delete('/asset/exec-job-log/delete', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划执行日志
|
||||
* 批量删除计划任务日志
|
||||
*/
|
||||
export function batchDeleteExecJobLog(idList: Array<number>) {
|
||||
return axios.delete('/asset/exec-job-log/batch-delete', {
|
||||
@@ -127,35 +127,35 @@ export function batchDeleteExecJobLog(idList: Array<number>) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除主机计划执行日志
|
||||
* 删除主机计划任务日志
|
||||
*/
|
||||
export function deleteExecJobHostLog(id: number) {
|
||||
return axios.delete('/asset/exec-job-log/delete-host', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划执行日志数量
|
||||
* 查询计划任务日志数量
|
||||
*/
|
||||
export function getExecJobLogCount(request: ExecJobLogQueryRequest) {
|
||||
return axios.post<number>('/asset/exec-job-log/query-count', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空计划执行日志
|
||||
* 清空计划任务日志
|
||||
*/
|
||||
export function clearExecJobLog(request: ExecJobLogQueryRequest) {
|
||||
return axios.post<number>('/asset/exec-job-log/clear', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看计划执行日志
|
||||
* 查看计划任务日志
|
||||
*/
|
||||
export function getExecJobLogTailToken(request: ExecJobLogTailRequest) {
|
||||
return axios.post<string>('/asset/exec-job-log/tail', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载计划执行日志文件
|
||||
* 下载计划任务日志文件
|
||||
*/
|
||||
export function downloadExecJobLogFile(id: number) {
|
||||
return axios.get('/asset/exec-job-log/download', { unwrap: true, params: { id } });
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { HostQueryResponse } from '@/api/asset/host';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 计划执行创建请求
|
||||
* 计划任务创建请求
|
||||
*/
|
||||
export interface ExecJobCreateRequest {
|
||||
name?: string;
|
||||
@@ -16,14 +16,14 @@ export interface ExecJobCreateRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行更新请求
|
||||
* 计划任务更新请求
|
||||
*/
|
||||
export interface ExecJobUpdateRequest extends ExecJobCreateRequest {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行状态更新请求
|
||||
* 计划任务状态更新请求
|
||||
*/
|
||||
export interface ExecJobUpdateStatusRequest {
|
||||
id: number;
|
||||
@@ -31,7 +31,7 @@ export interface ExecJobUpdateStatusRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行查询请求
|
||||
* 计划任务查询请求
|
||||
*/
|
||||
export interface ExecJobQueryRequest extends Pagination {
|
||||
id?: number;
|
||||
@@ -42,7 +42,7 @@ export interface ExecJobQueryRequest extends Pagination {
|
||||
}
|
||||
|
||||
/**
|
||||
* 计划执行查询响应
|
||||
* 计划任务查询响应
|
||||
*/
|
||||
export interface ExecJobQueryResponse extends TableData {
|
||||
id: number;
|
||||
@@ -62,49 +62,49 @@ export interface ExecJobQueryResponse extends TableData {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建计划执行
|
||||
* 创建计划任务
|
||||
*/
|
||||
export function createExecJob(request: ExecJobCreateRequest) {
|
||||
return axios.post('/asset/exec-job/create', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新计划执行
|
||||
* 更新计划任务
|
||||
*/
|
||||
export function updateExecJob(request: ExecJobUpdateRequest) {
|
||||
return axios.put('/asset/exec-job/update', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新计划执行状态
|
||||
* 更新计划任务状态
|
||||
*/
|
||||
export function updateExecJobStatus(request: ExecJobUpdateStatusRequest) {
|
||||
return axios.put('/asset/exec-job/update-status', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划执行
|
||||
* 查询计划任务
|
||||
*/
|
||||
export function getExecJob(id: number) {
|
||||
return axios.get<ExecJobQueryResponse>('/asset/exec-job/get', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询计划执行
|
||||
* 分页查询计划任务
|
||||
*/
|
||||
export function getExecJobPage(request: ExecJobQueryRequest) {
|
||||
return axios.post<DataGrid<ExecJobQueryResponse>>('/asset/exec-job/query', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划执行
|
||||
* 删除计划任务
|
||||
*/
|
||||
export function deleteExecJob(id: number) {
|
||||
return axios.delete('/asset/exec-job/delete', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动触发计划执行任务
|
||||
* 手动触发计划任务
|
||||
*/
|
||||
export function triggerExecJob(id: number) {
|
||||
return axios.post('/asset/exec-job/trigger', { id });
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="table-left-bar-handle">
|
||||
<!-- 标题 -->
|
||||
<div class="table-title">
|
||||
计划执行列表
|
||||
计划任务列表
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧操作 -->
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { TemplateParam } from '@/components/view/exec-editor/const';
|
||||
// cron 下次执行次数
|
||||
export const CronNextTimes = 5;
|
||||
|
||||
// 计划执行状态
|
||||
// 计划任务状态
|
||||
export const ExecJobStatus = {
|
||||
// 禁用
|
||||
DISABLED: 0,
|
||||
@@ -22,7 +22,7 @@ export const jobBuiltinsParams: Array<TemplateParam> = [
|
||||
},
|
||||
];
|
||||
|
||||
// 计划执行状态 字典项
|
||||
// 计划任务状态 字典项
|
||||
export const execJobStatusKey = 'execJobStatus';
|
||||
|
||||
// 执行状态 字典项
|
||||
|
||||
Reference in New Issue
Block a user