浏览代码

任务分组管理,修改为执行器管理

xueli.xue 8 年前
父节点
当前提交
087cd1d435

+ 5 - 4
db/tables_xxl_job.sql 查看文件

204
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
204
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
205
 
205
 
206
 CREATE TABLE XXL_JOB_QRTZ_TRIGGER_GROUP (
206
 CREATE TABLE XXL_JOB_QRTZ_TRIGGER_GROUP (
207
-  `group_name` varchar(255) NOT NULL,
208
-  `group_desc` varchar(255) NOT NULL,
209
-  `order` int(11) NOT NULL,
210
-  PRIMARY KEY (`group_name`)
207
+  `app_name` varchar(64) NOT NULL,
208
+  `title` varchar(12) NOT NULL,
209
+  `order` tinyint(4) NOT NULL,
210
+  PRIMARY KEY (`app_name`)
211
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
211
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
212
+INSERT INTO XXL_JOB_QRTZ_TRIGGER_GROUP VALUES ('xxl-job-executor-example', '示例项目', '1');
212
 
213
 
213
 commit;
214
 commit;
214
 
215
 

+ 39 - 9
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java 查看文件

2
 
2
 
3
 import com.xxl.job.admin.core.model.ReturnT;
3
 import com.xxl.job.admin.core.model.ReturnT;
4
 import com.xxl.job.admin.core.model.XxlJobGroup;
4
 import com.xxl.job.admin.core.model.XxlJobGroup;
5
+import com.xxl.job.admin.core.thread.JobRegistryHelper;
5
 import com.xxl.job.admin.dao.IXxlJobGroupDao;
6
 import com.xxl.job.admin.dao.IXxlJobGroupDao;
6
 import com.xxl.job.admin.dao.IXxlJobInfoDao;
7
 import com.xxl.job.admin.dao.IXxlJobInfoDao;
8
+import com.xxl.job.core.registry.RegistHelper;
9
+import org.apache.commons.collections.CollectionUtils;
7
 import org.apache.commons.lang.StringUtils;
10
 import org.apache.commons.lang.StringUtils;
8
 import org.springframework.stereotype.Controller;
11
 import org.springframework.stereotype.Controller;
9
 import org.springframework.ui.Model;
12
 import org.springframework.ui.Model;
30
 	@RequestMapping
33
 	@RequestMapping
31
 	public String index(Model model) {
34
 	public String index(Model model) {
32
 		List<XxlJobGroup> list = xxlJobGroupDao.findAll();
35
 		List<XxlJobGroup> list = xxlJobGroupDao.findAll();
36
+
37
+		if (CollectionUtils.isNotEmpty(list)) {
38
+			for (XxlJobGroup group: list) {
39
+				List<String> registryList = JobRegistryHelper.discover(RegistHelper.RegistType.EXECUTOR.name(), group.getAppName());
40
+				group.setRegistryList(registryList);
41
+			}
42
+		}
43
+
33
 		model.addAttribute("list", list);
44
 		model.addAttribute("list", list);
34
 		return "jobgroup/jobgroup.index";
45
 		return "jobgroup/jobgroup.index";
35
 	}
46
 	}
39
 	public ReturnT<String> save(XxlJobGroup xxlJobGroup){
50
 	public ReturnT<String> save(XxlJobGroup xxlJobGroup){
40
 
51
 
41
 		// valid
52
 		// valid
42
-		if (xxlJobGroup.getGroupName()==null || StringUtils.isBlank(xxlJobGroup.getGroupName())) {
43
-			return new ReturnT<String>(500, "请输入分组");
53
+		if (xxlJobGroup.getAppName()==null || StringUtils.isBlank(xxlJobGroup.getAppName())) {
54
+			return new ReturnT<String>(500, "请输入AppName");
44
 		}
55
 		}
45
-		if (xxlJobGroup.getGroupDesc()==null || StringUtils.isBlank(xxlJobGroup.getGroupDesc())) {
46
-			return new ReturnT<String>(500, "请输入描述");
56
+		if (xxlJobGroup.getAppName().length()>64) {
57
+			return new ReturnT<String>(500, "AppName长度限制为4~64");
58
+		}
59
+		if (xxlJobGroup.getTitle()==null || StringUtils.isBlank(xxlJobGroup.getTitle())) {
60
+			return new ReturnT<String>(500, "请输入名称");
47
 		}
61
 		}
48
 
62
 
49
 		// check repeat
63
 		// check repeat
50
-		XxlJobGroup group = xxlJobGroupDao.load(xxlJobGroup.getGroupName());
64
+		XxlJobGroup group = xxlJobGroupDao.load(xxlJobGroup.getAppName());
51
 		if (group!=null) {
65
 		if (group!=null) {
52
-			return new ReturnT<String>(500, "分组已存在, 请勿重复添加");
66
+			return new ReturnT<String>(500, "AppName对应的执行器已存在, 请勿重复添加");
53
 		}
67
 		}
54
 
68
 
55
 		int ret = xxlJobGroupDao.save(xxlJobGroup);
69
 		int ret = xxlJobGroupDao.save(xxlJobGroup);
59
 	@RequestMapping("/update")
73
 	@RequestMapping("/update")
60
 	@ResponseBody
74
 	@ResponseBody
61
 	public ReturnT<String> update(XxlJobGroup xxlJobGroup){
75
 	public ReturnT<String> update(XxlJobGroup xxlJobGroup){
76
+		// valid
77
+		if (xxlJobGroup.getAppName()==null || StringUtils.isBlank(xxlJobGroup.getAppName())) {
78
+			return new ReturnT<String>(500, "请输入AppName");
79
+		}
80
+		if (xxlJobGroup.getAppName().length()>64) {
81
+			return new ReturnT<String>(500, "AppName长度限制为4~64");
82
+		}
83
+		if (xxlJobGroup.getTitle()==null || StringUtils.isBlank(xxlJobGroup.getTitle())) {
84
+			return new ReturnT<String>(500, "请输入名称");
85
+		}
86
+
62
 		int ret = xxlJobGroupDao.update(xxlJobGroup);
87
 		int ret = xxlJobGroupDao.update(xxlJobGroup);
63
 		return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL;
88
 		return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL;
64
 	}
89
 	}
65
 
90
 
66
 	@RequestMapping("/remove")
91
 	@RequestMapping("/remove")
67
 	@ResponseBody
92
 	@ResponseBody
68
-	public ReturnT<String> remove(String groupName){
93
+	public ReturnT<String> remove(String appName){
69
 
94
 
70
 		// valid
95
 		// valid
71
-		int count = xxlJobInfoDao.pageListCount(0, 10, groupName, null);
96
+		int count = xxlJobInfoDao.pageListCount(0, 10, appName, null);
72
 		if (count > 0) {
97
 		if (count > 0) {
73
 			return new ReturnT<String>(500, "该分组使用中, 不可删除");
98
 			return new ReturnT<String>(500, "该分组使用中, 不可删除");
74
 		}
99
 		}
75
 
100
 
76
-		int ret = xxlJobGroupDao.remove(groupName);
101
+		List<XxlJobGroup> allList = xxlJobGroupDao.findAll();
102
+		if (allList.size() == 1) {
103
+			return new ReturnT<String>(500, "删除失败, 系统需要至少预留一个默认分组");
104
+		}
105
+
106
+		int ret = xxlJobGroupDao.remove(appName);
77
 		return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL;
107
 		return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL;
78
 	}
108
 	}
79
 
109
 

+ 23 - 10
xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobGroup.java 查看文件

1
 package com.xxl.job.admin.core.model;
1
 package com.xxl.job.admin.core.model;
2
 
2
 
3
+import java.util.List;
4
+
3
 /**
5
 /**
4
  * Created by xuxueli on 16/9/30.
6
  * Created by xuxueli on 16/9/30.
5
  */
7
  */
6
 public class XxlJobGroup {
8
 public class XxlJobGroup {
7
 
9
 
8
-    private String groupName;
9
-    private String groupDesc;
10
+    private String appName;
11
+    private String title;
10
     private int order;
12
     private int order;
11
 
13
 
12
-    public String getGroupName() {
13
-        return groupName;
14
+    // registry list
15
+    private List<String> registryList;
16
+
17
+    public String getAppName() {
18
+        return appName;
14
     }
19
     }
15
 
20
 
16
-    public void setGroupName(String groupName) {
17
-        this.groupName = groupName;
21
+    public void setAppName(String appName) {
22
+        this.appName = appName;
18
     }
23
     }
19
 
24
 
20
-    public String getGroupDesc() {
21
-        return groupDesc;
25
+    public String getTitle() {
26
+        return title;
22
     }
27
     }
23
 
28
 
24
-    public void setGroupDesc(String groupDesc) {
25
-        this.groupDesc = groupDesc;
29
+    public void setTitle(String title) {
30
+        this.title = title;
26
     }
31
     }
27
 
32
 
28
     public int getOrder() {
33
     public int getOrder() {
32
     public void setOrder(int order) {
37
     public void setOrder(int order) {
33
         this.order = order;
38
         this.order = order;
34
     }
39
     }
40
+
41
+    public List<String> getRegistryList() {
42
+        return registryList;
43
+    }
44
+
45
+    public void setRegistryList(List<String> registryList) {
46
+        this.registryList = registryList;
47
+    }
35
 }
48
 }

+ 5 - 5
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryHelper.java 查看文件

42
 						if (list != null) {
42
 						if (list != null) {
43
 							for (XxlJobRegistry item: list) {
43
 							for (XxlJobRegistry item: list) {
44
 								String groupKey = makeGroupKey(item.getRegistryGroup(), item.getRegistryKey());
44
 								String groupKey = makeGroupKey(item.getRegistryGroup(), item.getRegistryKey());
45
-								List<String> dataSet = temp.get(groupKey);
46
-								if (dataSet == null) {
47
-									dataSet = new ArrayList<String>();
45
+								List<String> registryList = temp.get(groupKey);
46
+								if (registryList == null) {
47
+									registryList = new ArrayList<String>();
48
 								}
48
 								}
49
-								dataSet.add(item.getRegistryValue());
50
-								temp.put(groupKey, dataSet);
49
+								registryList.add(item.getRegistryValue());
50
+								temp.put(groupKey, registryList);
51
 							}
51
 							}
52
 						}
52
 						}
53
 						registMap = temp;
53
 						registMap = temp;

+ 2 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobGroupDao.java 查看文件

15
 
15
 
16
     public int update(XxlJobGroup xxlJobGroup);
16
     public int update(XxlJobGroup xxlJobGroup);
17
 
17
 
18
-    public int remove(String groupName);
18
+    public int remove(String appName);
19
 
19
 
20
-    public XxlJobGroup load(String groupName);
20
+    public XxlJobGroup load(String appName);
21
 }
21
 }

+ 4 - 4
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobGroupDaoImpl.java 查看文件

33
     }
33
     }
34
 
34
 
35
     @Override
35
     @Override
36
-    public int remove(String groupName) {
37
-        return sqlSessionTemplate.delete("XxlJobGroupMapper.remove", groupName);
36
+    public int remove(String appName) {
37
+        return sqlSessionTemplate.delete("XxlJobGroupMapper.remove", appName);
38
     }
38
     }
39
 
39
 
40
     @Override
40
     @Override
41
-    public XxlJobGroup load(String groupName) {
42
-        return sqlSessionTemplate.selectOne("XxlJobGroupMapper.load", groupName);
41
+    public XxlJobGroup load(String appName) {
42
+        return sqlSessionTemplate.selectOne("XxlJobGroupMapper.load", appName);
43
     }
43
     }
44
 
44
 
45
 
45
 

+ 10 - 10
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml 查看文件

4
 <mapper namespace="XxlJobGroupMapper">
4
 <mapper namespace="XxlJobGroupMapper">
5
 	
5
 	
6
 	<resultMap id="XxlJobGroup" type="com.xxl.job.admin.core.model.XxlJobGroup" >
6
 	<resultMap id="XxlJobGroup" type="com.xxl.job.admin.core.model.XxlJobGroup" >
7
-	    <result column="group_name" property="groupName" />
8
-	    <result column="group_desc" property="groupDesc" />
7
+	    <result column="app_name" property="appName" />
8
+	    <result column="title" property="title" />
9
 	    <result column="order" property="order" />
9
 	    <result column="order" property="order" />
10
 	</resultMap>
10
 	</resultMap>
11
 
11
 
12
 	<sql id="Base_Column_List">
12
 	<sql id="Base_Column_List">
13
-		t.group_name,
14
-		t.group_desc,
13
+		t.app_name,
14
+		t.title,
15
 		t.order
15
 		t.order
16
 	</sql>
16
 	</sql>
17
 
17
 
22
 	</select>
22
 	</select>
23
 
23
 
24
 	<insert id="save" parameterType="java.util.Map" >
24
 	<insert id="save" parameterType="java.util.Map" >
25
-		INSERT INTO XXL_JOB_QRTZ_TRIGGER_GROUP ( `group_name`, `group_desc`, `order`)
26
-		values ( #{groupName}, #{groupDesc}, #{order});
25
+		INSERT INTO XXL_JOB_QRTZ_TRIGGER_GROUP ( `app_name`, `title`, `order`)
26
+		values ( #{appName}, #{title}, #{order});
27
 	</insert>
27
 	</insert>
28
 
28
 
29
 	<update id="update" parameterType="java.util.Map" >
29
 	<update id="update" parameterType="java.util.Map" >
30
 		UPDATE XXL_JOB_QRTZ_TRIGGER_GROUP
30
 		UPDATE XXL_JOB_QRTZ_TRIGGER_GROUP
31
-		SET `group_desc` = #{groupDesc},
31
+		SET `title` = #{title},
32
 			`order` = #{order}
32
 			`order` = #{order}
33
-		WHERE group_name = #{groupName}
33
+		WHERE app_name = #{appName}
34
 	</update>
34
 	</update>
35
 
35
 
36
 	<delete id="remove" parameterType="java.lang.String" >
36
 	<delete id="remove" parameterType="java.lang.String" >
37
 		DELETE FROM XXL_JOB_QRTZ_TRIGGER_GROUP
37
 		DELETE FROM XXL_JOB_QRTZ_TRIGGER_GROUP
38
-		WHERE group_name = #{groupName}
38
+		WHERE app_name = #{appName}
39
 	</delete>
39
 	</delete>
40
 
40
 
41
 	<select id="load" parameterType="java.lang.String" resultMap="XxlJobGroup">
41
 	<select id="load" parameterType="java.lang.String" resultMap="XxlJobGroup">
42
 		SELECT <include refid="Base_Column_List" />
42
 		SELECT <include refid="Base_Column_List" />
43
 		FROM XXL_JOB_QRTZ_TRIGGER_GROUP AS t
43
 		FROM XXL_JOB_QRTZ_TRIGGER_GROUP AS t
44
-		WHERE t.group_name = #{groupName}
44
+		WHERE t.app_name = #{appName}
45
 	</select>
45
 	</select>
46
 
46
 
47
 </mapper>
47
 </mapper>

+ 2 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl 查看文件

85
 				<li class="header">常用模块</li>
85
 				<li class="header">常用模块</li>
86
 				<li class="nav-click" ><a href="${request.contextPath}/jobinfo"><i class="fa fa-circle-o text-red"></i> <span>调度管理</span></a></li>
86
 				<li class="nav-click" ><a href="${request.contextPath}/jobinfo"><i class="fa fa-circle-o text-red"></i> <span>调度管理</span></a></li>
87
 				<li class="nav-click" ><a href="${request.contextPath}/joblog"><i class="fa fa-circle-o text-yellow"></i><span>调度日志</span></a></li>
87
 				<li class="nav-click" ><a href="${request.contextPath}/joblog"><i class="fa fa-circle-o text-yellow"></i><span>调度日志</span></a></li>
88
-                <li class="nav-click" ><a href="${request.contextPath}/jobgroup"><i class="fa fa-circle-o text-red"></i> <span>分组管理</span></a></li>
89
-				<li class="nav-click" ><a href="${request.contextPath}/help"><i class="fa fa-circle-o text-yellow"></i><span>使用教程</span></a></li>
88
+                <li class="nav-click" ><a href="${request.contextPath}/jobgroup"><i class="fa fa-circle-o text-aqua"></i> <span>执行器管理</span></a></li>
89
+				<li class="nav-click" ><a href="${request.contextPath}/help"><i class="fa fa-circle-o text-red"></i><span>使用教程</span></a></li>
90
 			</ul>
90
 			</ul>
91
 		</section>
91
 		</section>
92
 		<!-- /.sidebar -->
92
 		<!-- /.sidebar -->

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl 查看文件

16
 	<div class="content-wrapper">
16
 	<div class="content-wrapper">
17
 		<!-- Content Header (Page header) -->
17
 		<!-- Content Header (Page header) -->
18
 		<section class="content-header">
18
 		<section class="content-header">
19
-			<h1>任务调度中心<small>使用教程</small></h1>
19
+			<h1>使用教程<small>任务调度中心</small></h1>
20
 			<!--
20
 			<!--
21
 			<ol class="breadcrumb">
21
 			<ol class="breadcrumb">
22
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
22
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>

+ 21 - 19
xxl-job-admin/src/main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl 查看文件

20
 	<div class="content-wrapper">
20
 	<div class="content-wrapper">
21
 		<!-- Content Header (Page header) -->
21
 		<!-- Content Header (Page header) -->
22
 		<section class="content-header">
22
 		<section class="content-header">
23
-			<h1>分组管理<small>任务调度中心</small></h1>
23
+			<h1>执行器管理<small>任务调度中心</small></h1>
24
 		</section>
24
 		</section>
25
 
25
 
26
 		<!-- Main content -->
26
 		<!-- Main content -->
30
 				<div class="col-xs-12">
30
 				<div class="col-xs-12">
31
 					<div class="box">
31
 					<div class="box">
32
 			            <div class="box-header">
32
 			            <div class="box-header">
33
-							<h3 class="box-title">分组管理</h3>
34
-                            <button class="btn btn-success btn-xs pull-left2 add" >+新增分组</button>
33
+							<h3 class="box-title">执行器列表</h3>&nbsp;&nbsp;
34
+                            <button class="btn btn-info btn-xs pull-left2 add" >+新增执行器</button>
35
 						</div>
35
 						</div>
36
 			            <div class="box-body">
36
 			            <div class="box-body">
37
 			              	<table id="joblog_list" class="table table-bordered table-striped display" width="100%" >
37
 			              	<table id="joblog_list" class="table table-bordered table-striped display" width="100%" >
38
 				                <thead>
38
 				                <thead>
39
 					            	<tr>
39
 					            	<tr>
40
-                                        <th name="groupDesc" >名称</th>
41
-                                        <th name="groupName" >AppName</th>
40
+                                        <th name="appName" >AppName</th>
41
+                                        <th name="title" >名称</th>
42
 					                  	<th name="order" >排序</th>
42
 					                  	<th name="order" >排序</th>
43
+                                        <th name="registryList" >OnLine</th>
43
                                         <th name="operate" >操作</th>
44
                                         <th name="operate" >操作</th>
44
 					                </tr>
45
 					                </tr>
45
 				                </thead>
46
 				                </thead>
47
 								<#if list?exists && list?size gt 0>
48
 								<#if list?exists && list?size gt 0>
48
 								<#list list as group>
49
 								<#list list as group>
49
 									<tr>
50
 									<tr>
50
-                                        <td>${group.groupDesc}</td>
51
-                                        <td>${group.groupName}</td>
51
+                                        <td>${group.appName}</td>
52
+                                        <td>${group.title}</td>
52
                                         <td>${group.order}</td>
53
                                         <td>${group.order}</td>
54
+                                        <td><#if group.registryList?exists><#list group.registryList as item><span class="badge bg-green">${item}</span><br></#list></#if></td>
53
 										<td>
55
 										<td>
54
-                                            <button class="btn btn-warning btn-xs update" groupName="${group.groupName}" groupDesc="${group.groupDesc}" order="${group.order}" >编辑</button>
55
-                                            <button class="btn btn-danger btn-xs remove" groupName="${group.groupName}" >删除</button>
56
+                                            <button class="btn btn-warning btn-xs update" appName="${group.appName}" title="${group.title}" order="${group.order}" >编辑</button>
57
+                                            <button class="btn btn-danger btn-xs remove" appName="${group.appName}" >删除</button>
56
 										</td>
58
 										</td>
57
 									</tr>
59
 									</tr>
58
 								</#list>
60
 								</#list>
71
         <div class="modal-dialog ">
73
         <div class="modal-dialog ">
72
             <div class="modal-content">
74
             <div class="modal-content">
73
                 <div class="modal-header">
75
                 <div class="modal-header">
74
-                    <h4 class="modal-title" >新增分组</h4>
76
+                    <h4 class="modal-title" >新增执行器</h4>
75
                 </div>
77
                 </div>
76
                 <div class="modal-body">
78
                 <div class="modal-body">
77
                     <form class="form-horizontal form" role="form" >
79
                     <form class="form-horizontal form" role="form" >
78
                         <div class="form-group">
80
                         <div class="form-group">
79
-                            <label for="lastname" class="col-sm-2 control-label">分组<font color="red">*</font></label>
80
-                            <div class="col-sm-10"><input type="text" class="form-control" name="groupName" placeholder="请输入“分组”" maxlength="200" ></div>
81
+                            <label for="lastname" class="col-sm-2 control-label">AppName<font color="red">*</font></label>
82
+                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="请输入“AppName”" maxlength="64" ></div>
81
                         </div>
83
                         </div>
82
                         <div class="form-group">
84
                         <div class="form-group">
83
-                            <label for="lastname" class="col-sm-2 control-label">描述<font color="red">*</font></label>
84
-                            <div class="col-sm-10"><input type="text" class="form-control" name="groupDesc" placeholder="请输入“描述”" maxlength="200" ></div>
85
+                            <label for="lastname" class="col-sm-2 control-label">名称<font color="red">*</font></label>
86
+                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="请输入“名称”" maxlength="12" ></div>
85
                         </div>
87
                         </div>
86
                         <div class="form-group">
88
                         <div class="form-group">
87
                             <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>
89
                             <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>
105
         <div class="modal-dialog ">
107
         <div class="modal-dialog ">
106
             <div class="modal-content">
108
             <div class="modal-content">
107
                 <div class="modal-header">
109
                 <div class="modal-header">
108
-                    <h4 class="modal-title" >编辑分组</h4>
110
+                    <h4 class="modal-title" >编辑执行器</h4>
109
                 </div>
111
                 </div>
110
                 <div class="modal-body">
112
                 <div class="modal-body">
111
                     <form class="form-horizontal form" role="form" >
113
                     <form class="form-horizontal form" role="form" >
112
                         <div class="form-group">
114
                         <div class="form-group">
113
-                            <label for="lastname" class="col-sm-2 control-label">分组<font color="red">*</font></label>
114
-                            <div class="col-sm-10"><input type="text" class="form-control" name="groupName" placeholder="请输入“分组”" maxlength="200" readonly ></div>
115
+                            <label for="lastname" class="col-sm-2 control-label">AppName<font color="red">*</font></label>
116
+                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="请输入“AppName”" maxlength="64" readonly ></div>
115
                         </div>
117
                         </div>
116
                         <div class="form-group">
118
                         <div class="form-group">
117
-                            <label for="lastname" class="col-sm-2 control-label">描述<font color="red">*</font></label>
118
-                            <div class="col-sm-10"><input type="text" class="form-control" name="groupDesc" placeholder="请输入“描述”" maxlength="200" ></div>
119
+                            <label for="lastname" class="col-sm-2 control-label">名称<font color="red">*</font></label>
120
+                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="请输入“名称”" maxlength="12" ></div>
119
                         </div>
121
                         </div>
120
                         <div class="form-group">
122
                         <div class="form-group">
121
                             <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>
123
                             <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl 查看文件

25
 	<div class="content-wrapper">
25
 	<div class="content-wrapper">
26
 		<!-- Content Header (Page header) -->
26
 		<!-- Content Header (Page header) -->
27
 		<section class="content-header">
27
 		<section class="content-header">
28
-			<h1>调度管理任务调度中心<small></small></h1>
28
+			<h1>调度管理<small>任务调度中心</small></h1>
29
 			<!--
29
 			<!--
30
 			<ol class="breadcrumb">
30
 			<ol class="breadcrumb">
31
 				<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
31
 				<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>

+ 25 - 21
xxl-job-admin/src/main/webapp/static/js/jobgroup.index.1.js 查看文件

2
 
2
 
3
 	// remove
3
 	// remove
4
 	$('.remove').on('click', function(){
4
 	$('.remove').on('click', function(){
5
-		var groupName = $(this).attr('groupName');
5
+		var appName = $(this).attr('appName');
6
 
6
 
7
 		ComConfirm.show("确认删除分组?", function(){
7
 		ComConfirm.show("确认删除分组?", function(){
8
 			$.ajax({
8
 			$.ajax({
9
 				type : 'POST',
9
 				type : 'POST',
10
 				url : base_url + '/jobgroup/remove',
10
 				url : base_url + '/jobgroup/remove',
11
-				data : {"groupName":groupName},
11
+				data : {"appName":appName},
12
 				dataType : "json",
12
 				dataType : "json",
13
 				success : function(data){
13
 				success : function(data){
14
 					if (data.code == 200) {
14
 					if (data.code == 200) {
15
 						ComAlert.show(1, '删除成功');
15
 						ComAlert.show(1, '删除成功');
16
 						window.location.reload();
16
 						window.location.reload();
17
 					} else {
17
 					} else {
18
-						ComAlert.show(2, '删除失败');
18
+						if (data.msg) {
19
+							ComAlert.show(2, data.msg);
20
+						} else {
21
+							ComAlert.show(2, '删除失败');
22
+						}
19
 					}
23
 					}
20
 				},
24
 				},
21
 			});
25
 			});
37
 		errorClass : 'help-block',
41
 		errorClass : 'help-block',
38
 		focusInvalid : true,
42
 		focusInvalid : true,
39
 		rules : {
43
 		rules : {
40
-			groupName : {
44
+			appName : {
41
 				required : true,
45
 				required : true,
42
-				rangelength:[4,200],
46
+				rangelength:[4,64],
43
 				myValid01 : true
47
 				myValid01 : true
44
 			},
48
 			},
45
-			groupDesc : {
49
+			title : {
46
 				required : true,
50
 				required : true,
47
 				rangelength:[4, 12]
51
 				rangelength:[4, 12]
48
 			},
52
 			},
53
 			}
57
 			}
54
 		},
58
 		},
55
 		messages : {
59
 		messages : {
56
-			groupName : {
57
-				required :"请输入“分组”",
58
-				rangelength:"长度限制为4~200",
60
+			appName : {
61
+				required :"请输入“AppName”",
62
+				rangelength:"AppName长度限制为4~64",
59
 				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
63
 				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
60
 			},
64
 			},
61
-			groupDesc : {
62
-				required :"请输入“描述”",
65
+			title : {
66
+				required :"请输入“执行器名称”",
63
 				rangelength:"长度限制为4~12"
67
 				rangelength:"长度限制为4~12"
64
 			},
68
 			},
65
 			order : {
69
 			order : {
104
 	});
108
 	});
105
 
109
 
106
 	$('.update').on('click', function(){
110
 	$('.update').on('click', function(){
107
-		$("#updateModal .form input[name='groupName']").val($(this).attr("groupName"));
108
-		$("#updateModal .form input[name='groupDesc']").val($(this).attr("groupDesc"));
111
+		$("#updateModal .form input[name='appName']").val($(this).attr("appName"));
112
+		$("#updateModal .form input[name='title']").val($(this).attr("title"));
109
 		$("#updateModal .form input[name='order']").val($(this).attr("order"));
113
 		$("#updateModal .form input[name='order']").val($(this).attr("order"));
110
 
114
 
111
 		$('#updateModal').modal({backdrop: false, keyboard: false}).modal('show');
115
 		$('#updateModal').modal({backdrop: false, keyboard: false}).modal('show');
115
 		errorClass : 'help-block',
119
 		errorClass : 'help-block',
116
 		focusInvalid : true,
120
 		focusInvalid : true,
117
 		rules : {
121
 		rules : {
118
-			groupName : {
122
+			appName : {
119
 				required : true,
123
 				required : true,
120
-				rangelength:[4,200],
124
+				rangelength:[4,64],
121
 				myValid01 : true
125
 				myValid01 : true
122
 			},
126
 			},
123
-			groupDesc : {
127
+			title : {
124
 				required : true,
128
 				required : true,
125
 				rangelength:[4, 12]
129
 				rangelength:[4, 12]
126
 			},
130
 			},
131
 			}
135
 			}
132
 		},
136
 		},
133
 		messages : {
137
 		messages : {
134
-			groupName : {
135
-				required :"请输入“分组”",
136
-				rangelength:"长度限制为4~200",
138
+			appName : {
139
+				required :"请输入“AppName”",
140
+				rangelength:"AppName长度限制为4~64",
137
 				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
141
 				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
138
 			},
142
 			},
139
-			groupDesc : {
140
-				required :"请输入“描述”",
143
+			title : {
144
+				required :"请输入“执行器名称”",
141
 				rangelength:"长度限制为4~12"
145
 				rangelength:"长度限制为4~12"
142
 			},
146
 			},
143
 			order : {
147
 			order : {