Browse Source

[Fix-14907]Fix click to view the history in the task node of the workflow instance (#14909)

3.2.1-prepare
Kerwin 1 year ago committed by GitHub
parent
commit
4938470d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/docs/en/guide/project/workflow-instance.md
  2. 2
      docs/docs/zh/guide/project/workflow-instance.md
  3. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java
  4. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java
  5. 3
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskInstance/TaskInstanceQueryRequest.java
  6. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java
  7. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java
  8. 5
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java
  9. 3
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2ControllerTest.java
  10. 20
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskInstanceServiceTest.java
  11. 2
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java
  12. 6
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml
  13. 1
      dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
  14. 1
      dolphinscheduler-ui/src/locales/en_US/project.ts
  15. 1
      dolphinscheduler-ui/src/locales/zh_CN/project.ts
  16. 5
      dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
  17. 15
      dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx
  18. 9
      dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts

2
docs/docs/en/guide/project/workflow-instance.md

@ -24,7 +24,7 @@ Click "View Log", a log window pops up, as shown in the figure below, you can al
Click `Project Management -> Workflow -> Workflow Instance` to enter the workflow instance page, click the workflow name to enter the workflow DAG page; Click `Project Management -> Workflow -> Workflow Instance` to enter the workflow instance page, click the workflow name to enter the workflow DAG page;
Double-click the task node, click `View History` to jump to the task instance page, and display the list of task instances run by the workflow instance. Double-click the task node, click `View History` to jump to the task instance page, and display the list of task instances run by the task definition.
![instance-history](../../../../img/new_ui/dev/project/instance-history.png) ![instance-history](../../../../img/new_ui/dev/project/instance-history.png)

2
docs/docs/zh/guide/project/workflow-instance.md

@ -23,7 +23,7 @@
## 查看任务历史记录 ## 查看任务历史记录
- 点击项目管理->工作流->工作流实例,进入工作流实例页面,点击工作流名称,进入工作流 DAG 页面; - 点击项目管理->工作流->工作流实例,进入工作流实例页面,点击工作流名称,进入工作流 DAG 页面;
- 双击任务节点,如下图所示,点击"查看历史",跳转到任务实例页面,并展示该工作流实例运行的任务实例列表 - 双击任务节点,如下图所示,点击"查看历史",跳转到任务实例页面,并展示该任务定义运行的任务实例列表
![instance-history](../../../../img/new_ui/dev/project/instance-history.png) ![instance-history](../../../../img/new_ui/dev/project/instance-history.png)

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java

@ -81,16 +81,17 @@ public class TaskInstanceController extends BaseController {
*/ */
@Operation(summary = "queryTaskListPaging", description = "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") @Operation(summary = "queryTaskListPaging", description = "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES")
@Parameters({ @Parameters({
@Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = false, schema = @Schema(implementation = int.class, example = "100")), @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", schema = @Schema(implementation = int.class, example = "100")),
@Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema = @Schema(implementation = String.class)), @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskName", description = "TASK_NAME", schema = @Schema(implementation = String.class)), @Parameter(name = "taskName", description = "TASK_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskCode", description = "TASK_CODE", schema = @Schema(implementation = Long.class)),
@Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)), @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = TaskExecutionStatus.class)), @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = TaskExecutionStatus.class)),
@Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)), @Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)),
@Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)),
@Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema = @Schema(implementation = TaskExecuteType.class, example = "STREAM")), @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", schema = @Schema(implementation = TaskExecuteType.class, example = "STREAM")),
@Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")),
@Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")),
}) })
@ -104,6 +105,7 @@ public class TaskInstanceController extends BaseController {
@RequestParam(value = "processDefinitionName", required = false) String processDefinitionName, @RequestParam(value = "processDefinitionName", required = false) String processDefinitionName,
@RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam(value = "taskName", required = false) String taskName, @RequestParam(value = "taskName", required = false) String taskName,
@RequestParam(value = "taskCode", required = false) Long taskCode,
@RequestParam(value = "executorName", required = false) String executorName, @RequestParam(value = "executorName", required = false) String executorName,
@RequestParam(value = "stateType", required = false) TaskExecutionStatus stateType, @RequestParam(value = "stateType", required = false) TaskExecutionStatus stateType,
@RequestParam(value = "host", required = false) String host, @RequestParam(value = "host", required = false) String host,
@ -124,6 +126,7 @@ public class TaskInstanceController extends BaseController {
processInstanceName, processInstanceName,
processDefinitionName, processDefinitionName,
taskName, taskName,
taskCode,
executorName, executorName,
startTime, startTime,
endTime, endTime,

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java

@ -77,6 +77,7 @@ public class TaskInstanceV2Controller extends BaseController {
@Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", schema = @Schema(implementation = String.class)), @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskName", description = "TASK_NAME", schema = @Schema(implementation = String.class)), @Parameter(name = "taskName", description = "TASK_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskCode", description = "TASK_CODE", schema = @Schema(implementation = Long.class)),
@Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)), @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = TaskExecutionStatus.class)), @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = TaskExecutionStatus.class)),
@Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)), @Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)),
@ -100,7 +101,8 @@ public class TaskInstanceV2Controller extends BaseController {
result = taskInstanceService.queryTaskListPaging(loginUser, projectCode, result = taskInstanceService.queryTaskListPaging(loginUser, projectCode,
taskInstanceQueryReq.getProcessInstanceId(), taskInstanceQueryReq.getProcessInstanceName(), taskInstanceQueryReq.getProcessInstanceId(), taskInstanceQueryReq.getProcessInstanceName(),
taskInstanceQueryReq.getProcessDefinitionName(), taskInstanceQueryReq.getProcessDefinitionName(),
taskInstanceQueryReq.getTaskName(), taskInstanceQueryReq.getExecutorName(), taskInstanceQueryReq.getTaskName(), taskInstanceQueryReq.getTaskCode(),
taskInstanceQueryReq.getExecutorName(),
taskInstanceQueryReq.getStartTime(), taskInstanceQueryReq.getEndTime(), searchVal, taskInstanceQueryReq.getStartTime(), taskInstanceQueryReq.getEndTime(), searchVal,
taskInstanceQueryReq.getStateType(), taskInstanceQueryReq.getHost(), taskInstanceQueryReq.getStateType(), taskInstanceQueryReq.getHost(),
taskInstanceQueryReq.getTaskExecuteType(), taskInstanceQueryReq.getPageNo(), taskInstanceQueryReq.getTaskExecuteType(), taskInstanceQueryReq.getPageNo(),

3
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskInstance/TaskInstanceQueryRequest.java

@ -50,6 +50,9 @@ public class TaskInstanceQueryRequest extends PageQueryDto {
@Schema(name = "taskName", example = "TASK-NAME") @Schema(name = "taskName", example = "TASK-NAME")
String taskName; String taskName;
@Schema(name = "taskCode", example = "TASK-CODE")
Long taskCode;
@Schema(name = "executorName", example = "EXECUTOR-NAME") @Schema(name = "executorName", example = "EXECUTOR-NAME")
String executorName; String executorName;

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java

@ -37,6 +37,7 @@ public interface TaskInstanceService {
* @param processInstanceId process instance id * @param processInstanceId process instance id
* @param searchVal search value * @param searchVal search value
* @param taskName task name * @param taskName task name
* @param taskCode task code
* @param stateType state type * @param stateType state type
* @param host host * @param host host
* @param startDate start time * @param startDate start time
@ -52,6 +53,7 @@ public interface TaskInstanceService {
String processInstanceName, String processInstanceName,
String processDefinitionName, String processDefinitionName,
String taskName, String taskName,
Long taskCode,
String executorName, String executorName,
String startDate, String startDate,
String endDate, String endDate,

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java

@ -117,6 +117,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
* @param processInstanceId process instance id * @param processInstanceId process instance id
* @param searchVal search value * @param searchVal search value
* @param taskName task name * @param taskName task name
* @param taskCode task code
* @param stateType state type * @param stateType state type
* @param host host * @param host host
* @param startDate start time * @param startDate start time
@ -132,6 +133,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
String processInstanceName, String processInstanceName,
String processDefinitionName, String processDefinitionName,
String taskName, String taskName,
Long taskCode,
String executorName, String executorName,
String startDate, String startDate,
String endDate, String endDate,
@ -162,6 +164,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
processDefinitionName, processDefinitionName,
searchVal, searchVal,
taskName, taskName,
taskCode,
executorName, executorName,
statusArray, statusArray,
host, host,
@ -176,6 +179,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
processInstanceName, processInstanceName,
searchVal, searchVal,
taskName, taskName,
taskCode,
executorName, executorName,
statusArray, statusArray,
host, host,

5
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java

@ -66,11 +66,12 @@ public class TaskInstanceControllerTest extends AbstractControllerTest {
result.setCode(Status.SUCCESS.getCode()); result.setCode(Status.SUCCESS.getCode());
result.setMsg(Status.SUCCESS.getMsg()); result.setMsg(Status.SUCCESS.getMsg());
when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(1), eq(""), eq(""), eq(""), eq(""), any(), any(), when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(1), eq(""), eq(""), eq(""), any(), eq(""), any(),
any(),
eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any())) eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any()))
.thenReturn(result); .thenReturn(result);
Result taskResult = taskInstanceController.queryTaskListPaging(null, 1L, 1, "", "", "", Result taskResult = taskInstanceController.queryTaskListPaging(null, 1L, 1, "", "", "",
"", "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", 1L, "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", "2020-01-01 00:00:00", "2020-01-02 00:00:00",
TaskExecuteType.BATCH, pageNo, pageSize); TaskExecuteType.BATCH, pageNo, pageSize);
Assertions.assertEquals(Integer.valueOf(Status.SUCCESS.getCode()), taskResult.getCode()); Assertions.assertEquals(Integer.valueOf(Status.SUCCESS.getCode()), taskResult.getCode());
} }

3
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2ControllerTest.java

@ -74,7 +74,8 @@ public class TaskInstanceV2ControllerTest extends AbstractControllerTest {
when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(taskInstanceQueryReq.getProcessInstanceId()), when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(taskInstanceQueryReq.getProcessInstanceId()),
eq(taskInstanceQueryReq.getProcessInstanceName()), eq(taskInstanceQueryReq.getProcessInstanceName()), eq(taskInstanceQueryReq.getProcessInstanceName()), eq(taskInstanceQueryReq.getProcessInstanceName()),
eq(taskInstanceQueryReq.getTaskName()), eq(taskInstanceQueryReq.getExecutorName()), any(), any(), eq(taskInstanceQueryReq.getTaskName()), Mockito.any(), eq(taskInstanceQueryReq.getExecutorName()),
any(), any(),
eq(taskInstanceQueryReq.getSearchVal()), Mockito.any(), eq(taskInstanceQueryReq.getHost()), eq(taskInstanceQueryReq.getSearchVal()), Mockito.any(), eq(taskInstanceQueryReq.getHost()),
eq(taskInstanceQueryReq.getTaskExecuteType()), any(), any())).thenReturn(result); eq(taskInstanceQueryReq.getTaskExecuteType()), any(), any())).thenReturn(result);
Result taskResult = taskInstanceV2Controller.queryTaskListPaging(null, 1L, taskInstanceQueryReq); Result taskResult = taskInstanceV2Controller.queryTaskListPaging(null, 1L, taskInstanceQueryReq);

20
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskInstanceServiceTest.java

@ -117,6 +117,7 @@ public class TaskInstanceServiceTest {
"", "",
"", "",
"", "",
null,
"test_user", "test_user",
"2019-02-26 19:48:00", "2019-02-26 19:48:00",
"2019-02-26 19:48:22", "2019-02-26 19:48:22",
@ -137,6 +138,7 @@ public class TaskInstanceServiceTest {
"", "",
"", "",
"", "",
null,
"test_user", "test_user",
"20200101 00:00:00", "20200101 00:00:00",
"2020-01-02 00:00:00", "2020-01-02 00:00:00",
@ -174,6 +176,7 @@ public class TaskInstanceServiceTest {
Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any(),
Mockito.any(),
Mockito.any())) Mockito.any()))
.thenReturn(pageReturn); .thenReturn(pageReturn);
when(usersService.queryUser(processInstance.getExecutorId())).thenReturn(loginUser); when(usersService.queryUser(processInstance.getExecutorId())).thenReturn(loginUser);
@ -181,18 +184,19 @@ public class TaskInstanceServiceTest {
.thenReturn(Optional.of(processInstance)); .thenReturn(Optional.of(processInstance));
Result successRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "", Result successRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "",
"test_user", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS, null, "test_user", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS,
"192.168.xx.xx", TaskExecuteType.BATCH, 1, 20); "192.168.xx.xx", TaskExecuteType.BATCH, 1, 20);
Assertions.assertEquals(Status.SUCCESS.getCode(), (int) successRes.getCode()); Assertions.assertEquals(Status.SUCCESS.getCode(), (int) successRes.getCode());
// executor name empty // executor name empty
when(taskInstanceMapper.queryTaskInstanceListPaging( when(taskInstanceMapper.queryTaskInstanceListPaging(
Mockito.any(Page.class), eq(project.getCode()), eq(1), Mockito.any(Page.class), eq(project.getCode()), eq(1),
eq(""), eq(""), eq(""), eq(""), eq(""), eq(""), eq(null),
eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), eq(start), eq(end))) eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), eq(start), eq(end)))
.thenReturn(pageReturn); .thenReturn(pageReturn);
Result executorEmptyRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "", Result executorEmptyRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "",
"", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", null, "", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS,
"192.168.xx.xx",
TaskExecuteType.BATCH, 1, 20); TaskExecuteType.BATCH, 1, 20);
Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorEmptyRes.getCode()); Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorEmptyRes.getCode());
@ -201,22 +205,22 @@ public class TaskInstanceServiceTest {
when(usersService.getUserIdByName(loginUser.getUserName())).thenReturn(-1); when(usersService.getUserIdByName(loginUser.getUserName())).thenReturn(-1);
Result executorNullRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "", Result executorNullRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "",
"test_user", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS, null, "test_user", "2020-01-01 00:00:00", "2020-01-02 00:00:00", "", TaskExecutionStatus.SUCCESS,
"192.168.xx.xx", TaskExecuteType.BATCH, 1, 20); "192.168.xx.xx", TaskExecuteType.BATCH, 1, 20);
Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorNullRes.getCode()); Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorNullRes.getCode());
// start/end date null // start/end date null
when(taskInstanceMapper.queryTaskInstanceListPaging(Mockito.any(Page.class), eq(project.getCode()), eq(1), when(taskInstanceMapper.queryTaskInstanceListPaging(Mockito.any(Page.class), eq(project.getCode()), eq(1),
eq(""), eq(""), eq(""), eq(""), eq(""), eq(""), eq(null),
eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any())) eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any()))
.thenReturn(pageReturn); .thenReturn(pageReturn);
Result executorNullDateRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "", Result executorNullDateRes = taskInstanceService.queryTaskListPaging(loginUser, projectCode, 1, "", "", "",
"", null, null, "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", TaskExecuteType.BATCH, 1, 20); null, "", null, null, "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", TaskExecuteType.BATCH, 1, 20);
Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorNullDateRes.getCode()); Assertions.assertEquals(Status.SUCCESS.getCode(), (int) executorNullDateRes.getCode());
// start date error format // start date error format
when(taskInstanceMapper.queryTaskInstanceListPaging(Mockito.any(Page.class), eq(project.getCode()), eq(1), when(taskInstanceMapper.queryTaskInstanceListPaging(Mockito.any(Page.class), eq(project.getCode()), eq(1),
eq(""), eq(""), eq(""), eq(""), eq(""), eq(""), eq(null),
eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any())) eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any()))
.thenReturn(pageReturn); .thenReturn(pageReturn);
@ -227,6 +231,7 @@ public class TaskInstanceServiceTest {
"", "",
"", "",
"", "",
null,
"", "",
"error date", "error date",
null, null,
@ -244,6 +249,7 @@ public class TaskInstanceServiceTest {
"", "",
"", "",
"", "",
null,
"", "",
null, null,
"error date", "error date",

2
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java

@ -136,6 +136,7 @@ public interface TaskInstanceMapper extends BaseMapper<TaskInstance> {
@Param("processInstanceName") String processInstanceName, @Param("processInstanceName") String processInstanceName,
@Param("searchVal") String searchVal, @Param("searchVal") String searchVal,
@Param("taskName") String taskName, @Param("taskName") String taskName,
@Param("taskCode") Long taskCode,
@Param("executorName") String executorName, @Param("executorName") String executorName,
@Param("states") int[] statusArray, @Param("states") int[] statusArray,
@Param("host") String host, @Param("host") String host,
@ -148,6 +149,7 @@ public interface TaskInstanceMapper extends BaseMapper<TaskInstance> {
@Param("processDefinitionName") String processDefinitionName, @Param("processDefinitionName") String processDefinitionName,
@Param("searchVal") String searchVal, @Param("searchVal") String searchVal,
@Param("taskName") String taskName, @Param("taskName") String taskName,
@Param("taskCode") Long taskCode,
@Param("executorName") String executorName, @Param("executorName") String executorName,
@Param("states") int[] statusArray, @Param("states") int[] statusArray,
@Param("host") String host, @Param("host") String host,

6
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml

@ -267,6 +267,9 @@
<if test="taskName != null and taskName != ''"> <if test="taskName != null and taskName != ''">
and name = #{taskName} and name = #{taskName}
</if> </if>
<if test="taskCode != null">
and task_code = #{taskCode}
</if>
<if test="states != null and states.length != 0"> <if test="states != null and states.length != 0">
and state in and state in
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> <foreach collection="states" index="index" item="i" open="(" separator="," close=")">
@ -304,6 +307,9 @@
<if test="taskName != null and taskName != ''"> <if test="taskName != null and taskName != ''">
and name=#{taskName} and name=#{taskName}
</if> </if>
<if test="taskCode != null">
and task_code = #{taskCode}
</if>
<if test="states != null and states.length != 0"> <if test="states != null and states.length != 0">
and state in and state in
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> <foreach collection="states" index="index" item="i" open="(" separator="," close=")">

1
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java

@ -375,6 +375,7 @@ public class TaskInstanceMapperTest extends BaseDaoTest {
"", "",
"", "",
"", "",
null,
"", "",
new int[0], new int[0],
"", "",

1
dolphinscheduler-ui/src/locales/en_US/project.ts

@ -243,6 +243,7 @@ export default {
online: 'Online', online: 'Online',
offline: 'Offline', offline: 'Offline',
task_name: 'Task Name', task_name: 'Task Name',
task_code: 'Task Code',
task_type: 'Task Type', task_type: 'Task Type',
create_task: 'Create Task', create_task: 'Create Task',
workflow_instance: 'Workflow Instance', workflow_instance: 'Workflow Instance',

1
dolphinscheduler-ui/src/locales/zh_CN/project.ts

@ -241,6 +241,7 @@ export default {
online: '已上线', online: '已上线',
offline: '已下线', offline: '已下线',
task_name: '任务名称', task_name: '任务名称',
task_code: '任务编码',
task_type: '任务类型', task_type: '任务类型',
task_instance: '任务实例', task_instance: '任务实例',
create_task: '创建任务', create_task: '创建任务',

5
dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx

@ -158,9 +158,8 @@ const NodeDetailModal = defineComponent({
action: () => { action: () => {
router.push({ router.push({
name: 'task-instance', name: 'task-instance',
params: { query: {
processInstanceId: processInstance.id, taskCode: props.data.code
taskName: props.data.name
} }
}) })
}, },

15
dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx

@ -54,6 +54,7 @@ const BatchTaskInstance = defineComponent({
pageSize: variables.pageSize, pageSize: variables.pageSize,
pageNo: variables.page, pageNo: variables.page,
searchVal: variables.searchVal, searchVal: variables.searchVal,
taskCode: variables.taskCode,
processInstanceId: variables.processInstanceId, processInstanceId: variables.processInstanceId,
host: variables.host, host: variables.host,
stateType: variables.stateType, stateType: variables.stateType,
@ -73,6 +74,11 @@ const BatchTaskInstance = defineComponent({
requestTableData() requestTableData()
} }
const onClearSearchTaskCode = () => {
variables.taskCode = null
onSearch()
}
const onClearSearchTaskName = () => { const onClearSearchTaskName = () => {
variables.searchVal = '' variables.searchVal = ''
onSearch() onSearch()
@ -182,6 +188,7 @@ const BatchTaskInstance = defineComponent({
requestTableData, requestTableData,
onUpdatePageSize, onUpdatePageSize,
onSearch, onSearch,
onClearSearchTaskCode,
onClearSearchTaskName, onClearSearchTaskName,
onClearSearchProcessInstanceName, onClearSearchProcessInstanceName,
onClearSearchExecutorName, onClearSearchExecutorName,
@ -208,6 +215,14 @@ const BatchTaskInstance = defineComponent({
<NSpace vertical> <NSpace vertical>
<Card> <Card>
<NSpace justify='end' wrap={false}> <NSpace justify='end' wrap={false}>
<NInput
allowInput={this.trim}
v-model={[this.taskCode, 'value']}
size='small'
placeholder={t('project.task.task_code')}
clearable
onClear={this.onClearSearchTaskCode}
/>
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
v-model={[this.searchVal, 'value']} v-model={[this.searchVal, 'value']}

9
dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts

@ -44,9 +44,11 @@ export function useTable() {
const { t } = useI18n() const { t } = useI18n()
const route = useRoute() const route = useRoute()
const router: Router = useRouter() const router: Router = useRouter()
const projectCode = Number(route.params.projectCode) const projectCode = Number(route.params.projectCode)
const processInstanceId = Number(route.params.processInstanceId) const processInstanceId = Number(route.query.processInstanceId)
const taskName = route.params.taskName const taskName = route.query.taskName
const taskCode = route.query.taskCode
const variables = reactive({ const variables = reactive({
columns: [], columns: [],
@ -55,6 +57,7 @@ export function useTable() {
page: ref(1), page: ref(1),
pageSize: ref(10), pageSize: ref(10),
searchVal: ref(taskName || null), searchVal: ref(taskName || null),
taskCode: ref(taskCode || null),
processInstanceId: ref(processInstanceId ? processInstanceId : null), processInstanceId: ref(processInstanceId ? processInstanceId : null),
host: ref(null), host: ref(null),
stateType: ref(null), stateType: ref(null),
@ -293,6 +296,7 @@ export function useTable() {
? variables.page - 1 ? variables.page - 1
: variables.page, : variables.page,
searchVal: variables.searchVal, searchVal: variables.searchVal,
taskCode: variables.taskCode,
processInstanceId: variables.processInstanceId, processInstanceId: variables.processInstanceId,
host: variables.host, host: variables.host,
stateType: variables.stateType, stateType: variables.stateType,
@ -310,6 +314,7 @@ export function useTable() {
pageSize: params.pageSize, pageSize: params.pageSize,
pageNo: params.pageNo, pageNo: params.pageNo,
searchVal: params.searchVal, searchVal: params.searchVal,
taskCode: params.taskCode,
processInstanceId: params.processInstanceId, processInstanceId: params.processInstanceId,
host: params.host, host: params.host,
stateType: params.stateType, stateType: params.stateType,

Loading…
Cancel
Save