diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskGroupService.java index 465f2efa79..e950589d2f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskGroupService.java @@ -35,7 +35,7 @@ public interface TaskGroupService { * @param groupSize task group total size * @return the result code and msg */ - Map createTaskGroup(User loginUser, long projectcode,String name, + Map createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize); /** diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java index 28da3e1182..c73249467f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java @@ -17,8 +17,10 @@ package org.apache.dolphinscheduler.api.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.dolphinscheduler.api.dto.gantt.Task; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.TaskGroupQueueService; import org.apache.dolphinscheduler.api.service.TaskGroupService; @@ -68,7 +70,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe * @return the result code and msg */ @Override - public Map createTaskGroup(User loginUser, long projectcode, String name, String description, int groupSize) { + public Map createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { return result; @@ -86,7 +88,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe putMsg(result, Status.TASK_GROUP_NAME_EXSIT); return result; } - TaskGroup taskGroup = new TaskGroup(name, projectcode, description, + TaskGroup taskGroup = new TaskGroup(name, projectCode, description, groupSize, loginUser.getId(), Flag.YES.getCode()); taskGroup.setCreateTime(new Date()); @@ -116,6 +118,19 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe if (isNotAdmin(loginUser, result)) { return result; } + if (name == null) { + putMsg(result, Status.NAME_NULL); + return result; + } + if (groupSize <= 0) { + putMsg(result, Status.TASK_GROUP_SIZE_ERROR); + return result; + } + Integer exists = taskGroupMapper.selectCount(new QueryWrapper().lambda().eq(TaskGroup::getName, name).ne(TaskGroup::getId, id)); + if (exists > 0) { + putMsg(result, Status.TASK_GROUP_NAME_EXSIT); + return result; + } TaskGroup taskGroup = taskGroupMapper.selectById(id); if (taskGroup.getStatus() != Flag.YES.getCode()) { putMsg(result, Status.TASK_GROUP_STATUS_ERROR); @@ -177,7 +192,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe * @param loginUser login user * @param pageNo page no * @param pageSize page size - * @param name name + * @param projectCode project code * @return the result code and msg */ @Override diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskGroupServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskGroupServiceTest.java index c3084f008e..69bc3cbce4 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskGroupServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskGroupServiceTest.java @@ -109,7 +109,7 @@ public class TaskGroupServiceTest { TaskGroup taskGroup = getTaskGroup(); Mockito.when(taskGroupMapper.insert(taskGroup)).thenReturn(1); Mockito.when(taskGroupMapper.queryByName(loginUser.getId(), taskGroupName)).thenReturn(null); - Map result = taskGroupService.createTaskGroup(loginUser,0, taskGroupName, taskGroupDesc, 100); + Map result = taskGroupService.createTaskGroup(loginUser,0L, taskGroupName, taskGroupDesc, 100); Assert.assertNotNull(result); } diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java index 5841fa3d60..699b2ecdef 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java @@ -472,7 +472,9 @@ public class TaskDefinition { && timeoutFlag == that.timeoutFlag && timeoutNotifyStrategy == that.timeoutNotifyStrategy && Objects.equals(resourceIds, that.resourceIds) - && environmentCode == that.environmentCode; + && environmentCode == that.environmentCode + && taskGroupId == that.taskGroupId + && taskGroupPriority == that.taskGroupPriority; } @Override @@ -496,6 +498,8 @@ public class TaskDefinition { + ", workerGroup='" + workerGroup + '\'' + ", failRetryTimes=" + failRetryTimes + ", environmentCode='" + environmentCode + '\'' + + ", taskGroupId='" + taskGroupId + '\'' + + ", taskGroupPriority='" + taskGroupPriority + '\'' + ", failRetryInterval=" + failRetryInterval + ", timeoutFlag=" + timeoutFlag + ", timeoutNotifyStrategy=" + timeoutNotifyStrategy diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskGroup.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskGroup.java index 3c2e0210f7..7994f6c392 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskGroup.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskGroup.java @@ -56,7 +56,7 @@ public class TaskGroup implements Serializable { /** * 0 not available, 1 available */ - private int status; + private Integer status; /** * create time */ diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.xml index 7caddc16bb..212b213607 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.xml @@ -21,7 +21,7 @@ id, code, name, version, description, project_code, user_id, task_type, task_params, flag, task_priority, worker_group, environment_code, fail_retry_times, fail_retry_interval, timeout_flag, timeout_notify_strategy, timeout, delay_time, - resource_ids, operator, operate_time, create_time, update_time,task_group_id + resource_ids, operator, operate_time, create_time, update_time,task_group_id,task_group_priority select diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupMapper.xml index 3dd654a531..7db5607f6b 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupMapper.xml @@ -32,7 +32,7 @@ - id,name,description,project_code,group_size,use_size,create_time,update_time + id,name,description,project_code,group_size,use_size,status,create_time,update_time select - queue.id, queue.task_name, queue.group_id, queue.process_id, queue.priority, queue.status - , queue.force_start, queue.create_time, queue.update_time, - process.name as processInstanceName,p.name as projectName,p.code as projectCode + queue.id, queue.task_name, queue.group_id, queue.process_id, queue.priority, queue.status + , queue.force_start, queue.create_time, queue.update_time, + process.name as processInstanceName,p.name as projectName,p.code as projectCode from t_ds_task_group_queue queue - left join t_ds_process_instance process on queue.process_id = process.id - left join t_ds_process_definition p_f on process.process_definition_code = p_f.code - and process.process_definition_version = p_f.version - join t_ds_project as p on p_f.project_code = p.code + left join t_ds_process_instance process on queue.process_id = process.id + left join t_ds_process_definition p_f on process.process_definition_code = p_f.code + and process.process_definition_version = p_f.version + join t_ds_project as p on p_f.project_code = p.code where queue.group_id = #{groupId} and task_name =#{taskName} diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue index 9130b08e54..a1f5e05e04 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue @@ -32,6 +32,7 @@ + + + + + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue index 1c6e1f2c20..24e2640030 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue @@ -151,6 +151,30 @@ + + +
{{ $t("Task group name") }}
+
+ + + + {{ $t("Task group queue priority") }} + + +
+
+
{{ $t("Number of failed retries") }}
@@ -478,6 +502,7 @@ import mDependentTimeout from './_source/dependentTimeout' import mWorkerGroups from './_source/workerGroups' import mRelatedEnvironment from './_source/relatedEnvironment' + import mTaskGroups from './_source/taskGroups' import mPreTasks from './tasks/pre_tasks' import clickoutside from '@/module/util/clickoutside' import disabledState from '@/module/mixin/disabledState' @@ -539,6 +564,8 @@ // selected environment environmentCode: '', selectedWorkerGroup: '', + taskGroupId: '', + taskGroupPriority: 0, stateList: [ { value: 'success', @@ -575,7 +602,10 @@ type: String, default: '' }, - taskDefinition: Object + taskDefinition: Object, + projectCode: { + type: Number + } }, inject: ['dagChart'], methods: { @@ -619,7 +649,9 @@ type: task.taskType, waitStartTimeout: task.taskParams.waitStartTimeout, workerGroup: task.workerGroup, - environmentCode: task.environmentCode + environmentCode: task.environmentCode, + taskGroupId: task.taskGroupId, + taskGroupPriority: task.taskGroupPriority } }, /** @@ -723,6 +755,15 @@ _onUpdateEnvironmentCode (o) { this.environmentCode = o }, + _onUpdateTaskGroupId (o) { + this.taskGroupId = o + if (this.taskGroupId === '') { + this.taskGroupPriority = 0 + } + }, + _onUpdateTaskGroupPriority (o) { + this.taskGroupPriority = o + }, /** * _onCacheParams is reserved */ @@ -837,7 +878,9 @@ timeoutNotifyStrategy: this.timeout.strategy, timeout: this.timeout.interval || 0, delayTime: this.delayTime, - environmentCode: this.environmentCode || -1 + environmentCode: this.environmentCode || -1, + taskGroupId: this.taskGroupId, + taskGroupPriority: this.taskGroupPriority }, fromThis: this }) @@ -952,6 +995,8 @@ this.params = o.params || {} this.dependence = o.dependence || {} this.cacheDependence = o.dependence || {} + this.taskGroupId = o.taskGroupId + this.taskGroupPriority = o.taskGroupPriority } else { this.workerGroup = this.store.state.security.workerGroupsListAll[0].id } @@ -966,7 +1011,6 @@ // Backfill data let o = {} this.code = this.nodeData.id - if (this.fromTaskDefinition) { if (this.taskDefinition) { const backfillItem = this.taskToBackfillItem(this.taskDefinition) @@ -1061,7 +1105,8 @@ mPriority, mWorkerGroups, mRelatedEnvironment, - mPreTasks + mPreTasks, + mTaskGroups // ReferenceFromTask } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/index.vue new file mode 100644 index 0000000000..02e700ebb4 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/index.vue @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/createTaskGroup.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/createTaskGroup.vue new file mode 100644 index 0000000000..3fea8b772c --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/createTaskGroup.vue @@ -0,0 +1,202 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/list.vue new file mode 100644 index 0000000000..0b57bcdc7d --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/_source/list.vue @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/index.vue new file mode 100644 index 0000000000..76cbc3afb0 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupOption/index.vue @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/_source/list.vue new file mode 100644 index 0000000000..30f8c695cd --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/_source/list.vue @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/index.vue new file mode 100644 index 0000000000..3f2952fec0 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/taskGroups/taskGroupQueue/index.vue @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/environment/_source/createEnvironment.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/environment/_source/createEnvironment.vue index 8e5ee8de34..3b137ffdb2 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/environment/_source/createEnvironment.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/environment/_source/createEnvironment.vue @@ -116,8 +116,6 @@ _getWorkerGroupList () { this.getWorkerGroupsAll().then(res => { this.workerGroups = res - console.log('get Worker Group List') - console.log(this.workerGroups) }) }, _ok () { diff --git a/dolphinscheduler-ui/src/js/conf/home/router/module/resource.js b/dolphinscheduler-ui/src/js/conf/home/router/module/resource.js index 6543995625..0d262cec4f 100644 --- a/dolphinscheduler-ui/src/js/conf/home/router/module/resource.js +++ b/dolphinscheduler-ui/src/js/conf/home/router/module/resource.js @@ -152,6 +152,35 @@ const resource = [ } } ] + }, + { + path: '/resource/task-group', + name: 'task-group-manage', + component: resolve => require(['../../pages/resource/pages/taskGroups'], resolve), + meta: { + title: `${i18n.$t('Task group manage')}`, + refreshInSwitchedTab: config.refreshInSwitchedTab + }, + children: [ + { + path: '/resource/task-group', + name: 'task-group-option', + component: resolve => require(['../../pages/resource/pages/taskGroups/taskGroupOption'], resolve), + meta: { + title: `${i18n.$t('Task group option')}`, + refreshInSwitchedTab: config.refreshInSwitchedTab + } + }, + { + path: '/resource/task-group-queue', + name: 'task-group-queue', + component: resolve => require(['../../pages/resource/pages/taskGroups/taskGroupQueue'], resolve), + meta: { + title: `${i18n.$t('Task group queue')}`, + refreshInSwitchedTab: config.refreshInSwitchedTab + } + } + ] } ] } diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js index 51470288b3..6341d78a9e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js @@ -183,7 +183,9 @@ export default { 'timeoutFlag', 'timeoutNotifyStrategy', 'timeout', - 'environmentCode' + 'environmentCode', + 'taskGroupId', + 'taskGroupPriority' ])) resolve(res.data) diff --git a/dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js index 0ab83e2600..06e2835c0e 100755 --- a/dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/resource/actions.js @@ -192,6 +192,114 @@ export default { reject(e) }) }) + }, + /** + * get task group list pages + */ + getTaskGroupListPaging ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('task-group/list-paging', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * get task group list pages + */ + getTaskGroupListPagingByProjectCode ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('task-group/query-list-by-projectCode', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * create task group + */ + createTaskGroup ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/create', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * update task group + */ + updateTaskGroup ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/update', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * close task group + */ + closeTaskGroup ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/close-task-group', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * start task group + */ + startTaskGroup ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/start-task-group', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * query the details of task group through group id + */ + getTaskListInTaskGroupQueueById ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('task-group/query-list-by-group-id', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * modify the priority of the task in the queue + */ + modifyPriority ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/modifyPriority', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * force to start the task in the queue + */ + forceStartTaskInQueue ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('task-group/forceStart', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) } } diff --git a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js index 09395cafb4..f58f98d3e4 100644 --- a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js +++ b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js @@ -196,6 +196,28 @@ const menu = { enabled: true } ] + }, + { + name: `${i18n.$t('Task group manage')}`, + id: 2, + path: '', + isOpen: true, + enabled: true, + icon: 'el-icon-setting', + children: [ + { + name: `${i18n.$t('Task group option')}`, + path: 'task-group-option', + id: 0, + enabled: true + }, + { + name: `${i18n.$t('Task group queue')}`, + path: 'task-group-queue', + id: 1, + enabled: true + } + ] } ], user: [ diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index 7f3c6549c9..52473c8d8c 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -764,5 +764,35 @@ export default { scheduleEndTime: 'Schedule End Time', crontabExpression: 'Crontab', workflowPublishStatus: 'Workflow Publish Status', - schedulePublishStatus: 'Schedule Publish Status' + schedulePublishStatus: 'Schedule Publish Status', + 'Task group manage': 'Task group manage', + 'Task group option': 'Task group option', + 'Create task group': 'Create task group', + 'Edit task group': 'Edit task group', + 'Delete task group': 'Delete task group', + 'Task group code': 'Task group code', + 'Task group name': 'Task group name', + 'Task group resource pool size': 'Resource pool size', + 'Task group resource pool size be a number': 'The size of the task group resource pool should be more than 1', + 'Task group resource used pool size': 'Used resource', + 'Task group desc': 'Task group desc', + 'Task group status': 'Task group status', + 'Task group enable status': 'Enable', + 'Task group disable status': 'Disable', + 'Please enter task group desc': 'Please enter task group description', + 'Please enter task group resource pool size': 'Please enter task group resource pool size', + 'Please select project': 'Please select a project', + 'Task group queue': 'Task group queue', + 'Task group queue priority': 'Priority', + 'Task group queue priority be a number': 'The priority of the task group queue should be a positive number', + 'Task group queue force starting status': 'Starting status', + 'Task group in queue': 'In queue', + 'Task group queue status': 'Task status', + 'View task group queue': 'View task group queue', + 'Task group queue the status of waiting': 'Waiting into the queue', + 'Task group queue the status of queuing': 'Queuing', + 'Task group queue the status of releasing': 'Released', + 'Modify task group queue priority': 'Edit the priority of the task group queue', + 'Priority not empty': 'The value of priority can not be empty', + 'Priority must be number': 'The value of priority should be number' } diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index 5171a00d15..e6f63499dc 100644 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -765,5 +765,36 @@ export default { scheduleEndTime: '定时结束时间', crontabExpression: 'Crontab', workflowPublishStatus: '工作流上线状态', - schedulePublishStatus: '定时状态' + schedulePublishStatus: '定时状态', + 'Task group manage': '任务组管理', + 'Task group option': '任务组配置', + 'Create task group': '创建任务组', + 'Edit task group': '编辑任务组', + 'Delete task group': '删除任务组', + 'Task group code': '任务组编号', + 'Task group name': '任务组名称', + 'Task group resource pool size': '资源容量', + 'Task group resource used pool size': '已用资源', + 'Task group desc': '描述信息', + 'Task group status': '任务组状态', + 'Task group enable status': '启用', + 'Task group disable status': '不可用', + 'Please enter task group desc': '请输入任务组描述', + 'Please enter task group resource pool size': '请输入资源容量大小', + 'Task group resource pool size be a number': '资源容量大小必须大于等于1的数值', + 'Please select project': '请选择项目', + 'Task group queue': '任务组队列', + 'Task group queue priority': '组内优先级', + 'Task group queue priority be a number': '优先级必须是大于等于0的数值', + 'Task group queue force starting status': '是否强制启动', + 'Task group in queue': '是否排队中', + 'Task group queue status': '任务状态', + 'View task group queue': '查看任务组队列', + 'Task group queue the status of waiting': '等待入队', + 'Task group queue the status of queuing': '排队中', + 'Task group queue the status of releasing': '已释放', + 'Modify task group queue priority': '修改优先级', + 'Force to start task': '强制启动', + 'Priority not empty': '优先级不能为空', + 'Priority must be number': '优先级必须是数值' }