Browse Source

Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415

pull/2/head
baoliang 6 years ago
parent
commit
47abbdb41f
  1. 109
      .gitignore
  2. 5
      escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java
  3. 4
      escheduler-api/src/main/java/cn/escheduler/api/service/DataAnalysisService.java
  4. 19
      escheduler-api/src/main/java/cn/escheduler/api/service/ExecutorService.java
  5. 6
      escheduler-api/src/main/java/cn/escheduler/api/service/MonitorService.java
  6. 6
      escheduler-api/src/main/java/cn/escheduler/api/service/ServerService.java
  7. 20
      escheduler-api/src/test/java/cn/escheduler/api/controller/ExecutorControllerTest.java
  8. 27
      escheduler-common/src/main/java/cn/escheduler/common/task/sql/SqlParameters.java
  9. 54
      escheduler-dao/readme.txt
  10. 22
      escheduler-server/src/main/java/cn/escheduler/server/ResInfo.java
  11. 7
      escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java
  12. 1
      escheduler-ui/src/js/conf/home/index.js
  13. 1
      escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue
  14. 62
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gauge.vue
  15. 234
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
  16. 81
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/list.vue
  17. 125
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue
  18. 2
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue
  19. 179
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue
  20. 71
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/mysql.vue
  21. 103
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/servers.scss
  22. 177
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue
  23. 20
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
  24. 2
      escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue
  25. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
  26. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue
  27. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
  28. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
  29. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
  30. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
  31. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
  32. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
  33. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
  34. 2
      escheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
  35. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
  36. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue
  37. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue
  38. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/account/_source/info.vue
  39. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue
  40. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue
  41. 4
      escheduler-ui/src/js/conf/home/store/index.js
  42. 57
      escheduler-ui/src/js/conf/home/store/monitor/actions.js
  43. 19
      escheduler-ui/src/js/conf/home/store/monitor/getters.js
  44. 30
      escheduler-ui/src/js/conf/home/store/monitor/index.js
  45. 19
      escheduler-ui/src/js/conf/home/store/monitor/mutations.js
  46. 18
      escheduler-ui/src/js/conf/home/store/monitor/state.js
  47. 164
      sql/upgrade/1.0.2_schema/mysql/escheduler_ddl.sql

109
.gitignore vendored

@ -35,3 +35,112 @@ config.gypi
test/coverage
/docs/zh_CN/介绍
/docs/zh_CN/贡献代码.md
/escheduler-common/src/main/resources/zookeeper.properties
escheduler-alert/logs/
escheduler-alert/src/main/resources/alert.properties_bak
escheduler-alert/src/main/resources/logback.xml
escheduler-server/src/main/resources/logback.xml
escheduler-ui/dist/css/common.16ac5d9.css
escheduler-ui/dist/css/home/index.b444b91.css
escheduler-ui/dist/css/login/index.5866c64.css
escheduler-ui/dist/js/0.ac94e5d.js
escheduler-ui/dist/js/0.ac94e5d.js.map
escheduler-ui/dist/js/1.0b043a3.js
escheduler-ui/dist/js/1.0b043a3.js.map
escheduler-ui/dist/js/10.1bce3dc.js
escheduler-ui/dist/js/10.1bce3dc.js.map
escheduler-ui/dist/js/11.79f04d8.js
escheduler-ui/dist/js/11.79f04d8.js.map
escheduler-ui/dist/js/12.420daa5.js
escheduler-ui/dist/js/12.420daa5.js.map
escheduler-ui/dist/js/13.e5bae1c.js
escheduler-ui/dist/js/13.e5bae1c.js.map
escheduler-ui/dist/js/14.f2a0dca.js
escheduler-ui/dist/js/14.f2a0dca.js.map
escheduler-ui/dist/js/15.45373e8.js
escheduler-ui/dist/js/15.45373e8.js.map
escheduler-ui/dist/js/16.fecb0fc.js
escheduler-ui/dist/js/16.fecb0fc.js.map
escheduler-ui/dist/js/17.84be279.js
escheduler-ui/dist/js/17.84be279.js.map
escheduler-ui/dist/js/18.307ea70.js
escheduler-ui/dist/js/18.307ea70.js.map
escheduler-ui/dist/js/19.144db9c.js
escheduler-ui/dist/js/19.144db9c.js.map
escheduler-ui/dist/js/2.8b4ef29.js
escheduler-ui/dist/js/2.8b4ef29.js.map
escheduler-ui/dist/js/20.4c527e9.js
escheduler-ui/dist/js/20.4c527e9.js.map
escheduler-ui/dist/js/21.831b2a2.js
escheduler-ui/dist/js/21.831b2a2.js.map
escheduler-ui/dist/js/22.2b4bb2a.js
escheduler-ui/dist/js/22.2b4bb2a.js.map
escheduler-ui/dist/js/23.81467ef.js
escheduler-ui/dist/js/23.81467ef.js.map
escheduler-ui/dist/js/24.54a00e4.js
escheduler-ui/dist/js/24.54a00e4.js.map
escheduler-ui/dist/js/25.8d7bd36.js
escheduler-ui/dist/js/25.8d7bd36.js.map
escheduler-ui/dist/js/26.2ec5e78.js
escheduler-ui/dist/js/26.2ec5e78.js.map
escheduler-ui/dist/js/27.3ab48c2.js
escheduler-ui/dist/js/27.3ab48c2.js.map
escheduler-ui/dist/js/28.363088a.js
escheduler-ui/dist/js/28.363088a.js.map
escheduler-ui/dist/js/29.6c5853a.js
escheduler-ui/dist/js/29.6c5853a.js.map
escheduler-ui/dist/js/3.a0edb5b.js
escheduler-ui/dist/js/3.a0edb5b.js.map
escheduler-ui/dist/js/30.940fdd3.js
escheduler-ui/dist/js/30.940fdd3.js.map
escheduler-ui/dist/js/31.168a460.js
escheduler-ui/dist/js/31.168a460.js.map
escheduler-ui/dist/js/32.8df6594.js
escheduler-ui/dist/js/32.8df6594.js.map
escheduler-ui/dist/js/33.4480bbe.js
escheduler-ui/dist/js/33.4480bbe.js.map
escheduler-ui/dist/js/34.b407fe1.js
escheduler-ui/dist/js/34.b407fe1.js.map
escheduler-ui/dist/js/35.f340b0a.js
escheduler-ui/dist/js/35.f340b0a.js.map
escheduler-ui/dist/js/36.8880c2d.js
escheduler-ui/dist/js/36.8880c2d.js.map
escheduler-ui/dist/js/37.ea2a25d.js
escheduler-ui/dist/js/37.ea2a25d.js.map
escheduler-ui/dist/js/38.98a59ee.js
escheduler-ui/dist/js/38.98a59ee.js.map
escheduler-ui/dist/js/39.a5e958a.js
escheduler-ui/dist/js/39.a5e958a.js.map
escheduler-ui/dist/js/4.4ca44db.js
escheduler-ui/dist/js/4.4ca44db.js.map
escheduler-ui/dist/js/40.e187b1e.js
escheduler-ui/dist/js/40.e187b1e.js.map
escheduler-ui/dist/js/41.0e89182.js
escheduler-ui/dist/js/41.0e89182.js.map
escheduler-ui/dist/js/42.341047c.js
escheduler-ui/dist/js/42.341047c.js.map
escheduler-ui/dist/js/43.27b8228.js
escheduler-ui/dist/js/43.27b8228.js.map
escheduler-ui/dist/js/44.e8869bc.js
escheduler-ui/dist/js/44.e8869bc.js.map
escheduler-ui/dist/js/45.8d54901.js
escheduler-ui/dist/js/45.8d54901.js.map
escheduler-ui/dist/js/5.e1ed7f3.js
escheduler-ui/dist/js/5.e1ed7f3.js.map
escheduler-ui/dist/js/6.241ba07.js
escheduler-ui/dist/js/6.241ba07.js.map
escheduler-ui/dist/js/7.ab2e297.js
escheduler-ui/dist/js/7.ab2e297.js.map
escheduler-ui/dist/js/8.83ff814.js
escheduler-ui/dist/js/8.83ff814.js.map
escheduler-ui/dist/js/9.39cb29f.js
escheduler-ui/dist/js/9.39cb29f.js.map
escheduler-ui/dist/js/common.733e342.js
escheduler-ui/dist/js/common.733e342.js.map
escheduler-ui/dist/js/home/index.78a5d12.js
escheduler-ui/dist/js/home/index.78a5d12.js.map
escheduler-ui/dist/js/login/index.291b8e3.js
escheduler-ui/dist/js/login/index.291b8e3.js.map
escheduler-ui/dist/lib/external/
escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue
/escheduler-dao/src/main/resources/dao/data_source.properties

5
escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java

@ -149,10 +149,11 @@ public class ExecutorController extends BaseController {
@GetMapping(value = "/get-receiver-cc")
@ResponseStatus(HttpStatus.OK)
public Result getReceiverCc(@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "processDefinitionId") int processDefinitionId){
@RequestParam(value = "processDefinitionId",required = false) Integer processDefinitionId,
@RequestParam(value = "processInstanceId",required = false) Integer processInstanceId) {
logger.info("login user {}, get process definition receiver and cc", loginUser.getUserName());
try {
Map<String, Object> result = execService.getReceiverCc(processDefinitionId);
Map<String, Object> result = execService.getReceiverCc(processDefinitionId,processInstanceId);
return returnDataList(result);
} catch (Exception e) {
logger.error(QUERY_RECIPIENTS_AND_COPYERS_BY_PROCESS_DEFINITION_ERROR.getMsg(),e);

4
escheduler-api/src/main/java/cn/escheduler/api/service/DataAnalysisService.java

@ -370,8 +370,8 @@ public class DataAnalysisService {
taskQueueCount = taskInstanceMapper.countTask(loginUser.getId(),loginUser.getUserType(),projectId, tasksQueueIds);
}
if (tasksQueueIds.length != 0){
taskKillCount = taskInstanceMapper.countTask(loginUser.getId(),loginUser.getUserType(),projectId, tasksQueueIds);
if (tasksKillIds.length != 0){
taskKillCount = taskInstanceMapper.countTask(loginUser.getId(),loginUser.getUserType(),projectId, tasksKillIds);
}

19
escheduler-api/src/main/java/cn/escheduler/api/service/ExecutorService.java

@ -361,18 +361,29 @@ public class ExecutorService extends BaseService{
}
/**
* query recipients and copyers by process definition id
* query recipients and copyers by process definition id or processInstanceId
*
* @param processDefineId
* @return
*/
public Map<String, Object> getReceiverCc(int processDefineId) {
public Map<String, Object> getReceiverCc(Integer processDefineId,Integer processInstanceId) {
Map<String, Object> result = new HashMap<>();
logger.info("processInstanceId {}",processInstanceId);
if(processDefineId == null && processInstanceId == null){
throw new RuntimeException("You must set values for parameters processDefineId or processInstanceId");
}
if(processDefineId == null && processInstanceId != null) {
ProcessInstance processInstance = processInstanceMapper.queryById(processInstanceId);
if (processInstance == null) {
throw new RuntimeException("processInstanceId is not exists");
}
processDefineId = processInstance.getProcessDefinitionId();
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByDefineId(processDefineId);
if (processDefinition == null){
throw new RuntimeException("processDefineId is not exists");
throw new RuntimeException(String.format("processDefineId %d is not exists",processDefineId));
}
String receivers = processDefinition.getReceivers();
String receiversCc = processDefinition.getReceiversCc();
Map<String,String> dataMap = new HashMap<>();

6
escheduler-api/src/main/java/cn/escheduler/api/service/MonitorService.java

@ -42,9 +42,6 @@ public class MonitorService extends BaseService{
*/
public Map<String,Object> queryDatabaseState(User loginUser) {
Map<String, Object> result = new HashMap<>(5);
if (checkAdmin(loginUser, result)){
return result;
}
List<MonitorRecord> monitorRecordList = MonitorDBDao.queryDatabaseState();
@ -63,9 +60,6 @@ public class MonitorService extends BaseService{
*/
public Map<String,Object> queryZookeeperState(User loginUser) {
Map<String, Object> result = new HashMap<>(5);
if (checkAdmin(loginUser, result)){
return result;
}
List<ZookeeperRecord> zookeeperRecordList = ZookeeperMonitorUtils.zookeeperInfoList();

6
escheduler-api/src/main/java/cn/escheduler/api/service/ServerService.java

@ -52,9 +52,6 @@ public class ServerService extends BaseService{
public Map<String,Object> queryMaster(User loginUser) {
Map<String, Object> result = new HashMap<>(5);
if (checkAdmin(loginUser, result)){
return result;
}
List<MasterServer> masterList = masterServerMapper.queryAllMaster();
result.put(Constants.DATA_LIST, masterList);
@ -71,9 +68,6 @@ public class ServerService extends BaseService{
*/
public Map<String,Object> queryWorker(User loginUser) {
Map<String, Object> result = new HashMap<>();
if (checkAdmin(loginUser, result)){
return result;
}
List<WorkerServer> workerList = workerServerMapper.queryAllWorker();
result.put(Constants.DATA_LIST, workerList);

20
escheduler-api/src/test/java/cn/escheduler/api/controller/ExecutorControllerTest.java

@ -32,8 +32,11 @@ import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.context.WebApplicationContext;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@ -66,4 +69,21 @@ public class ExecutorControllerTest {
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void getReceiverCc() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
//paramsMap.add("processDefinitionId","4");
paramsMap.add("processInstanceId","13");
//paramsMap.add("processInstanceId","13");
MvcResult mvcResult = mockMvc.perform(get("/projects/{projectName}/executors/get-receiver-cc","li_sql_test")
.header("sessionId", "e79b3353-e227-4680-88c0-544194e64025")
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
}

27
escheduler-common/src/main/java/cn/escheduler/common/task/sql/SqlParameters.java

@ -65,6 +65,16 @@ public class SqlParameters extends AbstractParameters {
*/
private String connParams;
/**
* receivers
*/
private String receivers;
/**
* receivers cc
*/
private String receiversCc;
public String getType() {
return type;
}
@ -121,6 +131,21 @@ public class SqlParameters extends AbstractParameters {
this.connParams = connParams;
}
public String getReceivers() {
return receivers;
}
public void setReceivers(String receivers) {
this.receivers = receivers;
}
public String getReceiversCc() {
return receiversCc;
}
public void setReceiversCc(String receiversCc) {
this.receiversCc = receiversCc;
}
@Override
public boolean checkParameters() {
@ -142,6 +167,8 @@ public class SqlParameters extends AbstractParameters {
", udfs='" + udfs + '\'' +
", showType='" + showType + '\'' +
", connParams='" + connParams + '\'' +
", receivers='" + receivers + '\'' +
", receiversCc='" + receiversCc + '\'' +
'}';
}
}

54
escheduler-dao/readme.txt

@ -1,54 +0,0 @@
-- 用户指定队列
alter table t_escheduler_user add queue varchar(64);
-- 访问token
CREATE TABLE `t_escheduler_access_token` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) DEFAULT NULL COMMENT '用户id',
`token` varchar(64) DEFAULT NULL COMMENT 'token令牌',
`expire_time` datetime DEFAULT NULL COMMENT 'token有效结束时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `t_escheduler_error_command` (
`id` int(11) NOT NULL COMMENT '主键',
`command_type` tinyint(4) NULL DEFAULT NULL COMMENT '命令类型:0 启动工作流,1 从当前节点开始执行,2 恢复被容错的工作流,3 恢复暂停流程,4 从失败节点开始执行,5 补数,6 调度,7 重跑,8 暂停,9 停止,10 恢复等待线程',
`executor_id` int(11) NULL DEFAULT NULL COMMENT '命令执行者',
`process_definition_id` int(11) NULL DEFAULT NULL COMMENT '流程定义id',
`command_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '命令的参数(json格式)',
`task_depend_type` tinyint(4) NULL DEFAULT NULL COMMENT '节点依赖类型',
`failure_strategy` tinyint(4) NULL DEFAULT 0 COMMENT '失败策略:0结束,1继续',
`warning_type` tinyint(4) NULL DEFAULT 0 COMMENT '告警类型',
`warning_group_id` int(11) NULL DEFAULT NULL COMMENT '告警组',
`schedule_time` datetime(0) NULL DEFAULT NULL COMMENT '预期运行时间',
`start_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`dependence` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '依赖字段',
`process_instance_priority` int(11) NULL DEFAULT NULL COMMENT '流程实例优先级:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
`message` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `t_escheduler_worker_group` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '组名称',
`ip_list` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'worker地址列表',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `t_escheduler_task_instance`
ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' AFTER `task_instance_priority`;
ALTER TABLE `t_escheduler_command`
ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' NULL AFTER `process_instance_priority`;
ALTER TABLE `t_escheduler_error_command`
ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' NULL AFTER `process_instance_priority`;
ALTER TABLE `t_escheduler_schedules`
ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' NULL AFTER `process_instance_priority`;

22
escheduler-server/src/main/java/cn/escheduler/server/ResInfo.java

@ -35,6 +35,11 @@ public class ResInfo {
*/
private double memoryUsage;
/**
* loadAverage
*/
private double loadAverage;
public ResInfo(){}
public ResInfo(double cpuUsage , double memoryUsage){
@ -42,6 +47,12 @@ public class ResInfo {
this.memoryUsage = memoryUsage;
}
public ResInfo(double cpuUsage, double memoryUsage, double loadAverage) {
this.cpuUsage = cpuUsage;
this.memoryUsage = memoryUsage;
this.loadAverage = loadAverage;
}
public double getCpuUsage() {
return cpuUsage;
}
@ -58,12 +69,21 @@ public class ResInfo {
this.memoryUsage = memoryUsage;
}
public double getLoadAverage() {
return loadAverage;
}
public void setLoadAverage(double loadAverage) {
this.loadAverage = loadAverage;
}
/**
* get CPU and memory usage
* add cpu load average by lidong for service monitor
* @return
*/
public static String getResInfoJson(){
ResInfo resInfo = new ResInfo(OSUtils.cpuUsage(), OSUtils.memoryUsage());
ResInfo resInfo = new ResInfo(OSUtils.cpuUsage(), OSUtils.memoryUsage(),OSUtils.loadAverage());
return JSONUtils.toJson(resInfo);
}

7
escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java

@ -305,7 +305,7 @@ public class SqlTask extends AbstractTask {
receviersList.add(user.getEmail());
}
// custom receiver
String receivers = processDefine.getReceivers();
String receivers = sqlParameters.getReceivers();
if (StringUtils.isNotEmpty(receivers)){
String[] splits = receivers.split(Constants.COMMA);
for (String receiver : splits){
@ -315,11 +315,8 @@ public class SqlTask extends AbstractTask {
// copy list
List<String> receviersCcList = new ArrayList<String>();
// Custom Copier
String receiversCc = processDefine.getReceiversCc();
String receiversCc = sqlParameters.getReceiversCc();
if (StringUtils.isNotEmpty(receiversCc)){
String[] splits = receiversCc.split(Constants.COMMA);
for (String receiverCc : splits){

1
escheduler-ui/src/js/conf/home/index.js

@ -25,6 +25,7 @@ import store from './store'
import i18n from '@/module/i18n'
import { sync } from 'vuex-router-sync'
import Chart from '~/@analysys/ana-charts'
import '@/module/filter/formatDate'
import themeData from '@/module/echarts/themeData.json'
import Permissions from '@/module/permissions'
import '~/@analysys/ans-ui/lib/ans-ui.min.css'

1
escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue

@ -90,7 +90,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
import mTooltipsJSON from '@/module/components/tooltipsJSON/tooltipsJSON'

62
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gauge.vue

@ -0,0 +1,62 @@
<template>
<div class="gauge-model">
<div class="gauge-echart">
<div :id="id" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -104px;">
{{name}}
</div>
</div>
</template>
<script>
import gaugeOption from './gaugeOption'
export default {
name: 'gauge',
data () {
return {}
},
props: {
id: String,
name: String,
value: Number
},
methods: {},
created () {
},
mounted () {
const gauge = echarts.init(document.getElementById(this.id)) // eslint-disable-line
gauge.setOption(gaugeOption(this.value), true)
},
components: {}
}
</script>
<style lang="scss" rel="stylesheet/scss">
.gauge-model {
width: 100%;
height: 360px;
overflow: hidden;
margin: 0 auto;
.gauge-echart {
width: 350px;
margin: auto;
margin-bottom: -80px;
}
.text-1 {
width: 100%;
margin: 0 auto;
font-size: 32px;
text-align: center;
}
.value-p {
height: 254px;
line-height: 254px;
text-align: center;
>b {
font-size: 100px;
color: #333;
}
}
}
</style>

234
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js

@ -1,121 +1,123 @@
export default {
series: [
{
type: 'gauge',
center: ['50%', '45%'], // 仪表位置
radius: '80%', // 仪表大小
startAngle: 200, // 开始角度
endAngle: -20, // 结束角度
axisLine: {
show: false,
lineStyle: { // 属性lineStyle控制线条样式
color: [
[ 0.5, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#E75F25' // 50% 处的颜色
}, {
offset: 0.8,
color: '#D9452C' // 40% 处的颜色
}], false) ], // 100% 处的颜色
[ 0.7, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#FFC539' // 70% 处的颜色
}, {
offset: 0.8,
color: '#FE951E' // 66% 处的颜色
}, {
offset: 0,
color: '#E75F25' // 50% 处的颜色
}], false) ],
[ 0.9, new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // eslint-disable-line
offset: 1,
color: '#C7DD6B' // 90% 处的颜色
}, {
offset: 0.8,
color: '#FEEC49' // 86% 处的颜色
}, {
offset: 0,
color: '#FFC539' // 70% 处的颜色
}], false) ],
[1, new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { // eslint-disable-line
offset: 0.2,
color: '#1CAD52' // 92% 处的颜色
}, {
offset: 0,
color: '#C7DD6B' // 90% 处的颜色
}], false) ]
],
width: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
pointer: { // 指针样式
length: '45%'
},
detail: {
show: false
}
},
{
type: 'gauge',
center: ['50%', '45%'], // 默认全局居中
radius: '70%',
startAngle: 200,
endAngle: -20,
axisLine: {
show: true,
lineStyle: { // 属性lineStyle控制线条样式
color: [ // 表盘颜色
[ 0.5, '#DA462C' ], // 0-50%处的颜色
[ 0.7, '#FF9618' ], // 51%-70%处的颜色
[ 0.9, '#FFED44' ], // 70%-90%处的颜色
[ 1, '#20AE51' ]// 90%-100%处的颜色
],
width: 30// 表盘宽度
}
},
splitLine: { // 分割线样式(及10、20等长线样式)
length: 30,
lineStyle: { // 属性lineStyle控制线条样式
width: 2
}
},
axisTick: { // 刻度线样式(及短线样式)
length: 20
},
axisLabel: { // 文字样式(及“10”、“20”等文字样式)
color: 'black',
distance: 5 // 文字离表盘的距离
},
detail: {
formatter: '{score|{value}%}',
offsetCenter: [0, '50%'],
backgroundColor: '#2D8BF0',
height: 30,
rich: {
score: {
color: 'white',
fontFamily: '微软雅黑',
fontSize: 32
export default function (value) {
return {
series: [
{
type: 'gauge',
center: ['50%', '45%'], // 仪表位置
radius: '80%', // 仪表大小
startAngle: 200, // 开始角度
endAngle: -20, // 结束角度
axisLine: {
show: false,
lineStyle: { // 属性lineStyle控制线条样式
color: [
[ 0.5, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#E75F25' // 50% 处的颜色
}, {
offset: 0.8,
color: '#D9452C' // 40% 处的颜色
}], false) ], // 100% 处的颜色
[ 0.7, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#FFC539' // 70% 处的颜色
}, {
offset: 0.8,
color: '#FE951E' // 66% 处的颜色
}, {
offset: 0,
color: '#E75F25' // 50% 处的颜色
}], false) ],
[ 0.9, new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // eslint-disable-line
offset: 1,
color: '#C7DD6B' // 90% 处的颜色
}, {
offset: 0.8,
color: '#FEEC49' // 86% 处的颜色
}, {
offset: 0,
color: '#FFC539' // 70% 处的颜色
}], false) ],
[1, new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { // eslint-disable-line
offset: 0.2,
color: '#1CAD52' // 92% 处的颜色
}, {
offset: 0,
color: '#C7DD6B' // 90% 处的颜色
}], false) ]
],
width: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
pointer: { // 指针样式
length: '45%'
},
detail: {
show: false
}
},
data: [{
value: 70,
label: {
textStyle: {
fontSize: 12
{
type: 'gauge',
center: ['50%', '45%'], // 默认全局居中
radius: '70%',
startAngle: 200,
endAngle: -20,
axisLine: {
show: true,
lineStyle: { // 属性lineStyle控制线条样式
color: [ // 表盘颜色
[ 0.5, '#DA462C' ], // 0-50%处的颜色
[ 0.7, '#FF9618' ], // 51%-70%处的颜色
[ 0.9, '#FFED44' ], // 70%-90%处的颜色
[ 1, '#20AE51' ]// 90%-100%处的颜色
],
width: 30// 表盘宽度
}
}
}]
}
]
},
splitLine: { // 分割线样式(及10、20等长线样式)
length: 30,
lineStyle: { // 属性lineStyle控制线条样式
width: 2
}
},
axisTick: { // 刻度线样式(及短线样式)
length: 20
},
axisLabel: { // 文字样式(及“10”、“20”等文字样式)
color: 'black',
distance: 5 // 文字离表盘的距离
},
detail: {
formatter: '{score|{value}%}',
offsetCenter: [0, '50%'],
backgroundColor: '#2D8BF0',
height: 30,
rich: {
score: {
color: 'white',
fontFamily: '微软雅黑',
fontSize: 32
}
}
},
data: [{
value: value || 0,
label: {
textStyle: {
fontSize: 12
}
}
}]
}
]
}
}

81
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/list.vue

@ -1,81 +0,0 @@
<template>
<div class="list-model">
<div class="table-box">
<table>
<tr>
<th>
<span>{{$t('#')}}</span>
</th>
<th>
<span>node</span>
</th>
<th>
<span>ip</span>
</th>
<th>
<span>模式</span>
</th>
<th>
<span>连接数</span>
</th>
<th>
<span>watch数</span>
</th>
<th>
<span>数据量</span>
</th>
<th>
<span>Sent/Received</span>
</th>
<th>
<span>节点自检状态</span>
</th>
</tr>
<tr v-for="(item, $index) in list" :key="$index">
<td>
<span>{{$index + 1}}</span>
</td>
<td>
<span>
<a href="javascript:" class="links">task1</a>
</span>
</td>
<td><span>192.11.1.1</span></td>
<td>
<span>2222</span>
</td>
<td>
<span>3333</span>
</td>
<td>
<span>4444</span>
</td>
<td><span>5555</span></td>
<td>
<span>6666</span>
</td>
<td>
<span>7777</span>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import '@/module/filter/formatDate'
export default {
name: 'tenement-list',
data () {
return {
list: []
}
},
props: {
list: Array
},
methods: {
}
}
</script>

125
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue

@ -0,0 +1,125 @@
<template>
<div class="list-model zookeeper-list">
<div class="table-box">
<table>
<tr>
<th>
<span>{{$t('#')}}</span>
</th>
<th>
<span>host</span>
</th>
<th>
<span>连接数</span>
</th>
<th>
<span>watches数量</span>
</th>
<th>
<span>发送量</span>
</th>
<th>
<span>接收量</span>
</th>
<th>
<span>leader/follower</span>
</th>
<th>
<span>最低延时</span>
</th>
<th>
<span>平均延时</span>
</th>
<th>
<span>最大延时</span>
</th>
<th>
<span>节点数</span>
</th>
<th>
<span>当前查询时间戳</span>
</th>
<th style="text-align: center">
<span>节点自检状态</span>
</th>
</tr>
<tr v-for="(item, $index) in list" :key="$index">
<td>
<span>{{$index + 1}}</span>
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.hostname}}</a>
</span>
</td>
<td><span>{{item.connections}}</span></td>
<td>
<span>{{item.watches}}</span>
</td>
<td>
<span>{{item.sent}}</span>
</td>
<td>
<span>{{item.received}}</span>
</td>
<td><span>{{item.mode}}</span></td>
<td>
<span>{{item.minLatency}}</span>
</td>
<td>
<span>{{item.avgLatency}}</span>
</td>
<td>
<span>{{item.maxLatency}}</span>
</td>
<td>
<span>{{item.nodeCount}}</span>
</td>
<td>
<span>{{item.date | formatDate}}</span>
</td>
<td>
<span class="state">
<i class="iconfont success" v-if="item.state">&#xe607;</i>
<i class="iconfont error" v-else>&#xe626;</i>
</span>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
export default {
name: 'zookeeper-list',
data () {
return {
list: []
}
},
props: {
list: Array
},
methods: {
}
}
</script>
<style lang="scss" rel="stylesheet/scss">
.zookeeper-list {
.state {
text-align: center;
display: block;
>i {
font-size: 18px;
}
.success {
color: #33cc00;
}
.error {
color: #ff0000;
}
}
}
</style>

2
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue

@ -13,7 +13,7 @@
</template>
<script>
import { mapActions } from 'vuex'
import mList from './_source/list'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction'

179
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue

@ -2,171 +2,90 @@
<m-list-construction :title="'Master管理'">
<template slot="content">
<div class="servers-wrapper">
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a1" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="row-box" v-for="(item,$index) in masterList">
<div class="row-title">
<div class="left">
<span class="sp">IP: {{item.host}}</span>
<span class="sp">端口: {{item.port}}</span>
<span class="sp">zk注册目录: {{item.zkDirectory}}</span>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a2" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="right">
<span class="sp">创建时间: {{item.createTime | formatDate}}</span>
<span class="sp">最后心跳时间: {{item.lastHeartbeatTime | formatDate}}</span>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #0098e1;">12</b>
</div>
<div class="text-1">
cpu
</div>
<div class="row-cont">
<div class="col-md-4">
<m-gauge
:value="(item.resInfo.cpuUsage * 100).toFixed(2)"
:name="'cpuUsage'"
:id="'gauge-cpu-' + item.id">
</m-gauge>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a3" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="col-md-4">
<m-gauge
:value="(item.resInfo.memoryUsage * 100).toFixed(2)"
:name="'memoryUsage'"
:id="'gauge-memory-' + item.id">
</m-gauge>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a4" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #7a56b8;">72</b>
</div>
<div class="text-1">
cpu
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a5" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a6" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #e84d80;">44</b>
</div>
<div class="text-1">
cpu
<div class="col-md-4">
<div class="text-num-model">
<div class="value-p">
<b :style="{color:color[$index]}">{{item.resInfo.loadAverage}}</b>
</div>
<div class="text-1">
loadAverage
</div>
</div>
</div>
</div>
</div>
</div>
<m-spin :is-spin="isLoading"></m-spin>
</template>
</m-list-construction>
</template>
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import mList from './_source/list'
import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption'
import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
name: 'servers-master',
data () {
return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
masterList: [],
color: themeData.color
}
},
props: {},
methods: {
...mapActions('security', ['getProcessMasterList'])
...mapActions('monitor', ['getMasterData'])
},
watch: {},
created () {
},
mounted () {
let b = {}
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6']
a.forEach((v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line
b[v].setOption(gaugeOption, true)
this.isLoading = true
this.getMasterData().then(res => {
this.masterList = _.map(res, (v, i) => {
return _.assign(v, {
resInfo: JSON.parse(v.resInfo)
})
})
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
},
components: { mList, mListConstruction, mSpin, mNoData }
components: { mList, mListConstruction, mSpin, mNoData, mGauge }
}
</script>
<style lang="scss" rel="stylesheet/scss">

71
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/mysql.vue

@ -1,77 +1,112 @@
<template>
<m-list-construction :title="'Mysql管理'">
<template slot="content">
<div class="servers-wrapper">
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="servers-wrapper mysql-model">
<div class="row" v-for="(item,$index) in mysqlList">
<div class="col-md-2">
<div class="text-num-model text">
<div class="title">
<span>正常与否</span>
</div>
<div class="value-p">
<b style="color: #0098e1;">78</b>
<span class="state">
<i class="iconfont success" v-if="item.state">&#xe607;</i>
<i class="iconfont error" v-else>&#xe626;</i>
</span>
</div>
<div class="text-1">
正常与否
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="col-md-3">
<div class="text-num-model text">
<div class="title">
<span>最大连接数</span>
</div>
<div class="value-p">
<b style="color: #ffcf3d;">55</b>
<b :style="{color:color[0]}">{{item.maxConnections}}</b>
</div>
<div class="text-1">
最大连接数
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="col-md-3">
<div class="text-num-model text">
<div class="title">
<span>当前活跃连接</span>
</div>
<div class="value-p">
<b style="color: #f07d7d;">32</b>
<b :style="{color:color[8]}">{{item.threadsConnections}}</b>
</div>
<div class="text-1">
当前活跃连接
</div>
</div>
</div>
<div class="col-md-2">
<div class="text-num-model text">
<div class="title">
<span>最大连接数</span>
</div>
<div class="value-p">
<b :style="{color:color[2]}">{{item.maxUsedConnections}}</b>
</div>
<div class="text-1">
最大连接数
</div>
</div>
</div>
<div class="col-md-2">
<div class="text-num-model text">
<div class="title">
<span>线程运行连接</span>
</div>
<div class="value-p">
<b :style="{color:color[4]}">{{item.threadsRunningConnections}}</b>
</div>
<div class="text-1">
线程运行连接
</div>
</div>
</div>
</div>
</div>
<m-spin :is-spin="isLoading" ></m-spin>
</template>
</m-list-construction>
</template>
<script>
import { mapActions } from 'vuex'
import mList from './_source/list'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
name: 'servers-mysql',
data () {
return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
mysqlList: [],
color: themeData.color
}
},
props: {},
methods: {
...mapActions('security', ['getProcessMasterList'])
...mapActions('monitor', ['getDatabaseData'])
},
watch: {},
created () {
this.isLoading = true
this.getDatabaseData().then(res => {
this.mysqlList = res
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
},
mounted () {
},

103
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/servers.scss

@ -1,23 +1,10 @@
.servers-wrapper {
padding: 16px;
>.row {
margin-bottom: 20px;
}
.gridb-model {
.gauge-model {
width: 100%;
height: 360px;
overflow: hidden;
border: 1px solid #E8E8E8;
margin: 0 auto;
>.title {
height: 36px;
line-height: 36px;
background: #F9F9F9;
border-bottom: 1px solid #E8E8E8;
span {
padding-left: 8px;
}
}
.gauge-echart {
width: 350px;
margin: auto;
@ -29,16 +16,96 @@
font-size: 32px;
text-align: center;
}
}
.text-num-model {
&.text {
width: 100%;
height: 380px;
overflow: hidden;
border: 1px solid #E8E8E8;
margin: 0 auto;
margin-bottom: 16px;
>.title {
height: 36px;
line-height: 36px;
background: #F9F9F9;
border-bottom: 1px solid #E8E8E8;
padding-left: 10px;
}
}
.value-p {
height: 254px;
line-height: 254px;
height: 276px;
line-height: 276px;
text-align: center;
>b {
font-size: 140px;
font-size: 100px;
color: #333;
}
}
.text-1 {
width: 100%;
margin: 0 auto;
font-size: 32px;
text-align: center;
}
}
&.mysql-model {
.text-num-model {
height: 260px;
.text-1 {
font-size: 20px;
}
.value-p {
height: 160px;
line-height: 160px;
>b {
font-size: 80px;
}
>.state {
>i {
font-size: 50px;
}
.success {
color: #33cc00;
}
.error {
color: #ff0000;
}
}
}
}
}
.row-box {
width: 100%;
height: 380px;
overflow: hidden;
border: 1px solid #E8E8E8;
margin: 0 auto;
margin-bottom: 16px;
.row-title {
height: 36px;
line-height: 36px;
background: #F9F9F9;
border-bottom: 1px solid #E8E8E8;
position: relative;
span {
font-size: 12px;
color: #444;
&.sp {
margin-right: 10px;
}
}
.left {
position: absolute;
left: 10px;
top: 0;
}
.right {
position: absolute;
right: 10px;
top: 0;
}
}
}
}

177
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue

@ -2,170 +2,91 @@
<m-list-construction :title="'Worker管理'">
<template slot="content">
<div class="servers-wrapper">
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a1" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a2" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="row-box" v-for="(item,$index) in workerList">
<div class="row-title">
<div class="left">
<span class="sp">IP: {{item.host}}</span>
<span class="sp">端口: {{item.port}}</span>
<span class="sp">zk注册目录: {{item.zkDirectory}}</span>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #0098e1;">83</b>
</div>
<div class="text-1">
cpu
</div>
<div class="right">
<span class="sp">创建时间: {{item.createTime | formatDate}}</span>
<span class="sp">最后心跳时间: {{item.lastHeartbeatTime | formatDate}}</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a3" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="row-cont">
<div class="col-md-4">
<m-gauge
:value="(item.resInfo.cpuUsage * 100).toFixed(2)"
:name="'cpuUsage'"
:id="'gauge-cpu-' + item.id">
</m-gauge>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a4" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
<div class="col-md-4">
<m-gauge
:value="(item.resInfo.memoryUsage * 100).toFixed(2)"
:name="'memoryUsage'"
:id="'gauge-memory-' + item.id">
</m-gauge>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #7281c2;">18</b>
</div>
<div class="text-1">
cpu
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a5" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a6" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #f2ac6f;">15</b>
</div>
<div class="text-1">
cpu
<div class="col-md-4">
<div class="text-num-model">
<div class="value-p">
<b :style="{color:color[$index]}">{{item.resInfo.loadAverage}}</b>
</div>
<div class="text-1">
loadAverage
</div>
</div>
</div>
</div>
</div>
</div>
<m-spin :is-spin="isLoading"></m-spin>
</template>
</m-list-construction>
</template>
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import mList from './_source/list'
import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption'
import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
name: 'servers-worker',
data () {
return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
workerList: [],
color: themeData.color
}
},
props: {},
methods: {
...mapActions('security', ['getProcessMasterList'])
...mapActions('monitor', ['getWorkerData'])
},
watch: {},
created () {
},
mounted () {
let b = {}
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6']
a.forEach((v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line
b[v].setOption(gaugeOption, true)
this.isLoading = true
this.getWorkerData().then(res => {
this.workerList = _.map(res, (v, i) => {
return _.assign(v, {
resInfo: JSON.parse(v.resInfo)
})
})
this.isLoading = false
}).catch(() => {
this.isLoading = true
})
},
components: { mList, mListConstruction, mSpin, mNoData }
components: { mList, mListConstruction, mSpin, mNoData, mGauge }
}
</script>
<style lang="scss" rel="stylesheet/scss">

20
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue

@ -13,7 +13,7 @@
</template>
<script>
import { mapActions } from 'vuex'
import mList from './_source/list'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
@ -22,24 +22,30 @@
name: 'servers-zookeeper',
data () {
return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
zookeeperList: []
}
},
props: {},
methods: {
...mapActions('security', ['getProcessMasterList'])
...mapActions('monitor', ['getZookeeperData'])
},
watch: {},
created () {
this.zookeeperList = [{ id: 1 }, { id: 1 }, { id: 1 }, { id: 1 }]
this.isLoading = true
this.getZookeeperData().then(res => {
this.zookeeperList = res
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
},
mounted () {
},
components: { mList, mListConstruction, mSpin, mNoData }
}
</script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

2
escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue

@ -67,8 +67,6 @@
</div>
</template>
<script>
import '@/module/filter/formatDate'
export default {
name: 'list',
data () {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue

@ -72,7 +72,6 @@
import mStart from './start'
import mTiming from './timing'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { publishStatus } from '@/conf/home/pages/dag/_source/config'
export default {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue

@ -116,7 +116,6 @@
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mSpin from '@/module/components/spin/spin'
import mTiming from '../../pages/list/_source/timing'
import mNoData from '@/module/components/noData/noData'

1
escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue

@ -250,7 +250,6 @@
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { tasksState, runningType } from '@/conf/home/pages/dag/_source/config'
export default {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue

@ -82,7 +82,6 @@
</div>
</template>
<script>
import '@/module/filter/formatDate'
import { mapActions, mapMutations } from 'vuex'
import localStore from '@/module/util/localStorage'
import { findComponentDownward } from '@/module/util/'

1
escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue

@ -77,7 +77,6 @@
</div>
</template>
<script>
import '@/module/filter/formatDate'
import Permissions from '@/module/permissions'
import mLog from '@/conf/home/pages/dag/_source/formModel/log'
import { tasksState } from '@/conf/home/pages/dag/_source/config'

1
escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue

@ -107,7 +107,6 @@
import _ from 'lodash'
import mRename from './rename'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { filtTypeArr } from '../../_source/common'
import { bytesToSize } from '@/module/util/util'
import { downloadFile } from '@/module/download'

1
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue

@ -102,7 +102,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mCreateUdf from './createUdf'
export default {

1
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue

@ -101,7 +101,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mRename from './rename'
import { downloadFile } from '@/module/download'
import { bytesToSize } from '@/module/util/util'

1
escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue

@ -79,7 +79,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default {
name: 'tenement-list',

2
escheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue

@ -85,7 +85,7 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default {
name: 'tenement-list',

1
escheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue

@ -98,7 +98,6 @@
import _ from 'lodash'
import i18n from '@/module/i18n'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mTransfer from '@/module/components/transfer/transfer'
export default {

1
escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue

@ -71,7 +71,6 @@
import _ from 'lodash'
import i18n from '@/module/i18n'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mTransfer from '@/module/components/transfer/transfer'
export default {

1
escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue

@ -65,7 +65,6 @@
// import _ from 'lodash'
// import i18n from '@/module/i18n'
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default {
name: 'user-list',

1
escheduler-ui/src/js/conf/home/pages/user/pages/account/_source/info.vue

@ -58,7 +58,6 @@
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import '@/module/filter/formatDate'
import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mCreateUser from '@/conf/home/pages/security/pages/users/_source/createUser'

1
escheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue

@ -39,7 +39,6 @@
<script>
import i18n from '@/module/i18n'
import { mapState, mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mListBoxF from '@/module/components/listBoxF/listBoxF'
export default {

1
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue

@ -71,7 +71,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default {
name: 'token-list',

4
escheduler-ui/src/js/conf/home/store/index.js

@ -22,6 +22,7 @@ import resource from './resource'
import security from './security'
import datasource from './datasource'
import user from './user'
import monitor from './monitor'
export default new Vuex.Store({
modules: {
@ -30,6 +31,7 @@ export default new Vuex.Store({
resource,
security,
datasource,
user
user,
monitor
}
})

57
escheduler-ui/src/js/conf/home/store/monitor/actions.js

@ -0,0 +1,57 @@
/*
* 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.
*/
import io from '@/module/io'
export default {
getMasterData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/master/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getWorkerData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/worker/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getDatabaseData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/database`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getZookeeperData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/zookeeper/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
}
}

19
escheduler-ui/src/js/conf/home/store/monitor/getters.js

@ -0,0 +1,19 @@
/*
* 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.
*/
export default {
}

30
escheduler-ui/src/js/conf/home/store/monitor/index.js

@ -0,0 +1,30 @@
/*
* 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.
*/
import actions from './actions'
import getters from './getters'
import mutations from './mutations'
import state from './state'
export default {
strict: true,
namespaced: true,
state,
getters,
mutations,
actions
}

19
escheduler-ui/src/js/conf/home/store/monitor/mutations.js

@ -0,0 +1,19 @@
/*
* 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.
*/
export default {
}

18
escheduler-ui/src/js/conf/home/store/monitor/state.js

@ -0,0 +1,18 @@
/*
* 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.
*/
export default {
}

164
sql/upgrade/1.0.2_schema/mysql/escheduler_ddl.sql

@ -18,4 +18,166 @@ d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_version;
DROP PROCEDURE ac_escheduler_T_t_escheduler_version;
DROP PROCEDURE ac_escheduler_T_t_escheduler_version;
-- ac_escheduler_T_t_escheduler_user_C_queue
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_user_C_queue;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_user_C_queue()
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_escheduler_user'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='queue')
THEN
ALTER TABLE t_escheduler_user ADD COLUMN queue varchar(64) COMMENT '队列' AFTER update_time;
END IF;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_user_C_queue;
DROP PROCEDURE ac_escheduler_T_t_escheduler_user_C_queue;
-- ac_escheduler_T_t_escheduler_access_token
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_access_token;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_access_token()
BEGIN
drop table if exists t_escheduler_access_token;
CREATE TABLE IF NOT EXISTS `t_escheduler_access_token` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) DEFAULT NULL COMMENT '用户id',
`token` varchar(64) DEFAULT NULL COMMENT 'token令牌',
`expire_time` datetime DEFAULT NULL COMMENT 'token有效结束时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_access_token;
DROP PROCEDURE ac_escheduler_T_t_escheduler_access_token;
-- ac_escheduler_T_t_escheduler_error_command
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_error_command;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_error_command()
BEGIN
drop table if exists t_escheduler_error_command;
CREATE TABLE IF NOT EXISTS `t_escheduler_error_command` (
`id` int(11) NOT NULL COMMENT '主键',
`command_type` tinyint(4) NULL DEFAULT NULL COMMENT '命令类型:0 启动工作流,1 从当前节点开始执行,2 恢复被容错的工作流,3 恢复暂停流程,4 从失败节点开始执行,5 补数,6 调度,7 重跑,8 暂停,9 停止,10 恢复等待线程',
`executor_id` int(11) NULL DEFAULT NULL COMMENT '命令执行者',
`process_definition_id` int(11) NULL DEFAULT NULL COMMENT '流程定义id',
`command_param` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '命令的参数(json格式)',
`task_depend_type` tinyint(4) NULL DEFAULT NULL COMMENT '节点依赖类型',
`failure_strategy` tinyint(4) NULL DEFAULT 0 COMMENT '失败策略:0结束,1继续',
`warning_type` tinyint(4) NULL DEFAULT 0 COMMENT '告警类型',
`warning_group_id` int(11) NULL DEFAULT NULL COMMENT '告警组',
`schedule_time` datetime(0) NULL DEFAULT NULL COMMENT '预期运行时间',
`start_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`dependence` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '依赖字段',
`process_instance_priority` int(11) NULL DEFAULT NULL COMMENT '流程实例优先级:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
`worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组',
`message` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT=1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_error_command;
DROP PROCEDURE ac_escheduler_T_t_escheduler_error_command;
-- ac_escheduler_T_t_escheduler_worker_group
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_worker_group;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_worker_group()
BEGIN
drop table if exists t_escheduler_worker_group;
CREATE TABLE IF NOT EXISTS `t_escheduler_worker_group` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '组名称',
`ip_list` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'worker地址列表',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT=1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_worker_group;
DROP PROCEDURE ac_escheduler_T_t_escheduler_worker_group;
-- ac_escheduler_T_t_escheduler_task_instance_C_worker_group_id
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_task_instance_C_worker_group_id;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_task_instance_C_worker_group_id()
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_escheduler_task_instance'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='worker_group_id')
THEN
ALTER TABLE t_escheduler_task_instance ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' AFTER `task_instance_priority`;
END IF;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_task_instance_C_worker_group_id;
DROP PROCEDURE ac_escheduler_T_t_escheduler_task_instance_C_worker_group_id;
-- ac_escheduler_T_t_escheduler_command_C_worker_group_id
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_command_C_worker_group_id;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_command_C_worker_group_id()
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_escheduler_command'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='worker_group_id')
THEN
ALTER TABLE t_escheduler_command ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' AFTER `process_instance_priority`;
END IF;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_command_C_worker_group_id;
DROP PROCEDURE ac_escheduler_T_t_escheduler_command_C_worker_group_id;
-- ac_escheduler_T_t_escheduler_schedules_C_worker_group_id
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_schedules_C_worker_group_id;
delimiter d//
CREATE PROCEDURE ac_escheduler_T_t_escheduler_schedules_C_worker_group_id()
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_escheduler_schedules'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='worker_group_id')
THEN
ALTER TABLE t_escheduler_schedules ADD COLUMN `worker_group_id` int(11) NULL DEFAULT -1 COMMENT '任务指定运行的worker分组' AFTER `process_instance_priority`;
END IF;
END;
d//
delimiter ;
CALL ac_escheduler_T_t_escheduler_schedules_C_worker_group_id;
DROP PROCEDURE ac_escheduler_T_t_escheduler_schedules_C_worker_group_id;
Loading…
Cancel
Save