Przeglądaj źródła

# 新版本 V1.3.x,新特性

xueli.xue 9 lat temu
rodzic
commit
e6c239eca0

+ 2 - 1
README.md Wyświetl plik

@@ -43,7 +43,8 @@ git.osc地址:http://git.oschina.net/xuxueli0323/xxl-job
43 43
 # 新版本 V1.3.x,新特性
44 44
 	1、遗弃“本地任务”开发模式,推荐使用“远程任务”,易于系统解耦;
45 45
 	2、遗弃“servlet”方式底层系统通讯,推荐使用JETTY方式,重构通讯逻辑;
46
-	3、【重要】“远程任务”细分为:BEAN、GLUE两种开发模式,其中GLUE方式“远程任务”的逻辑代码托管至云端,详情请前往博客查看;
46
+	3、【重要】“远程任务”细分为:BEAN、GLUE两种开发模式,其中GLUE方式“远程任务”的逻辑代码托管至云端,动态编译生效,详情请前往博客查看;
47
+	4、UI交互优化:左侧菜单展开状态优化,菜单项选中状态优化,任务列表打开表格有压缩优化;
47 48
 		
48 49
 	
49 50
 # 其他说明

+ 1 - 1
pom.xml Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 	<modelVersion>4.0.0</modelVersion>
4 4
 	<groupId>com.xxl</groupId>
5 5
 	<artifactId>xxl-job</artifactId>
6
-	<version>1.2.0-SNAPSHOT</version>
6
+	<version>1.3.0-SNAPSHOT</version>
7 7
 	<packaging>pom</packaging>
8 8
 	<modules>
9 9
 		<module>xxl-job-admin</module>

+ 3 - 3
xxl-job-admin/pom.xml Wyświetl plik

@@ -4,10 +4,10 @@
4 4
 	<parent>
5 5
 		<groupId>com.xxl</groupId>
6 6
 		<artifactId>xxl-job</artifactId>
7
-		<version>1.2.0-SNAPSHOT</version>
7
+		<version>1.3.0-SNAPSHOT</version>
8 8
 	</parent>
9 9
 	<artifactId>xxl-job-admin</artifactId>
10
-	<version>1.2.1-SNAPSHOT</version>
10
+	<version>1.3.1-SNAPSHOT</version>
11 11
 	<packaging>war</packaging>
12 12
 
13 13
 	<properties>
@@ -148,7 +148,7 @@
148 148
 		<dependency>
149 149
 			<groupId>com.xxl</groupId>
150 150
 			<artifactId>xxl-job-client</artifactId>
151
-			<version>1.2.1-SNAPSHOT</version>
151
+			<version>1.3.1</version>
152 152
 		</dependency>
153 153
 
154 154
 	</dependencies>

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/controller/IndexController.java Wyświetl plik

@@ -69,7 +69,7 @@ public class IndexController {
69 69
 	}
70 70
 	
71 71
 	@RequestMapping("/help")
72
-	public String help(Model model) {
72
+	public String help() {
73 73
 		return "help";
74 74
 	}
75 75
 	

+ 34 - 0
xxl-job-admin/src/main/java/com/xxl/job/controller/interceptor/CookieInterceptor.java Wyświetl plik

@@ -0,0 +1,34 @@
1
+package com.xxl.job.controller.interceptor;
2
+
3
+import java.util.HashMap;
4
+
5
+import javax.servlet.http.Cookie;
6
+import javax.servlet.http.HttpServletRequest;
7
+import javax.servlet.http.HttpServletResponse;
8
+
9
+import org.apache.commons.lang.ArrayUtils;
10
+import org.springframework.web.servlet.ModelAndView;
11
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
12
+
13
+/**
14
+ * push cookies to model as cookieMap
15
+ * @author xuxueli 2015-12-12 18:09:04
16
+ */
17
+public class CookieInterceptor extends HandlerInterceptorAdapter {
18
+
19
+	@Override
20
+	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
21
+			ModelAndView modelAndView) throws Exception {
22
+		
23
+		if (modelAndView!=null && ArrayUtils.isNotEmpty(request.getCookies())) {
24
+			HashMap<String, Cookie> cookieMap = new HashMap<String, Cookie>();
25
+			for (Cookie ck : request.getCookies()) {
26
+				cookieMap.put(ck.getName(), ck);
27
+			}
28
+			modelAndView.addObject("cookieMap", cookieMap);
29
+		}
30
+		
31
+		super.postHandle(request, response, handler, modelAndView);
32
+	}
33
+	
34
+}

+ 4 - 0
xxl-job-admin/src/main/resources/springmvc-context.xml Wyświetl plik

@@ -43,6 +43,10 @@
43 43
 			<mvc:mapping path="/**"/>
44 44
 			<bean class="com.xxl.job.controller.interceptor.PermissionInterceptor"/>
45 45
 		</mvc:interceptor>
46
+		<mvc:interceptor>
47
+			<mvc:mapping path="/**"/>
48
+			<bean class="com.xxl.job.controller.interceptor.CookieInterceptor"/>
49
+		</mvc:interceptor>
46 50
 	</mvc:interceptors>
47 51
 	<bean id="exceptionResolver" class="com.xxl.job.controller.resolver.WebExceptionResolver" />
48 52
 	

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl Wyświetl plik

@@ -5,7 +5,7 @@
5 5
   	<#import "/common/common.macro.ftl" as netCommon>
6 6
 	<@netCommon.commonStyle />
7 7
 </head>
8
-<body class="hold-transition skin-blue sidebar-mini">
8
+<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && "off" == cookieMap["adminlte_settings"].value >sidebar-collapse</#if> ">
9 9
 <div class="wrapper">
10 10
 	<!-- header -->
11 11
 	<@netCommon.commonHeader />

+ 2 - 3
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/index.ftl Wyświetl plik

@@ -10,8 +10,7 @@
10 10
 		.CodeMirror {
11 11
       		border: 0px solid black;
12 12
       		font-size:16px;
13
-      		height: 95%;
14
-      		row:200;
13
+      		height: 100%;
15 14
 		}
16 15
     </style>
17 16
 </head>
@@ -71,7 +70,7 @@
71 70
 	<@netCommon.commonFooter />
72 71
 </div>
73 72
 
74
-<textarea id="demoCode" >
73
+<textarea id="demoCode" style="display:none;" >
75 74
 package com.xxl.job.service.handler;
76 75
 
77 76
 import org.slf4j.Logger;

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/index.ftl Wyświetl plik

@@ -8,7 +8,7 @@
8 8
   	<link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/datatables/dataTables.bootstrap.css">
9 9
   
10 10
 </head>
11
-<body class="hold-transition skin-blue sidebar-mini">
11
+<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && "off" == cookieMap["adminlte_settings"].value >sidebar-collapse</#if>">
12 12
 <div class="wrapper">
13 13
 	<!-- header -->
14 14
 	<@netCommon.commonHeader />

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/index.ftl Wyświetl plik

@@ -9,7 +9,7 @@
9 9
   	<!-- daterangepicker -->
10 10
   	<link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
11 11
 </head>
12
-<body class="hold-transition skin-blue sidebar-mini">
12
+<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && "off" == cookieMap["adminlte_settings"].value >sidebar-collapse</#if> ">
13 13
 <div class="wrapper">
14 14
 	<!-- header -->
15 15
 	<@netCommon.commonHeader />

+ 7 - 3
xxl-job-admin/src/main/webapp/static/js/common.1.js Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 $(function(){
2 2
 	
3
-	// 导航栏,选中样式处理
3
+	// 导航栏,选中样式处理,js遍历匹配url(遗弃)
4 4
 	$(".nav-click").removeClass("active");
5 5
 	$(".nav-click").each(function(){
6 6
 		if( window.location.href.indexOf( $(this).find("a").attr("href") ) > -1){
@@ -30,9 +30,9 @@ $(function(){
30 30
 		});
31 31
 	});
32 32
 	
33
-	// adminlte_settings
33
+	// 左侧菜单状态,js + 后端 + cookie方式(新)
34 34
 	$('.sidebar-toggle').click(function(){
35
-		var adminlte_settings = $.cookie('adminlte_settings');
35
+		var adminlte_settings = $.cookie('adminlte_settings');	// 左侧菜单展开状态[adminlte_settings]:on=展开,off=折叠
36 36
 		if ('off' == adminlte_settings) {
37 37
 			adminlte_settings = 'on';
38 38
 		} else {
@@ -40,8 +40,12 @@ $(function(){
40 40
 		}
41 41
 		$.cookie('adminlte_settings', adminlte_settings, { expires: 7 });	//$.cookie('the_cookie', '', { expires: -1 });
42 42
 	});
43
+	// 左侧菜单状态,js + cookie方式(遗弃)
44
+	/*
43 45
 	var adminlte_settings = $.cookie('adminlte_settings');
44 46
 	if (adminlte_settings == 'off') {
45 47
 		$('body').addClass('sidebar-collapse');
46 48
 	}
49
+	*/
50
+	
47 51
 });

+ 6 - 3
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js Wyświetl plik

@@ -8,17 +8,20 @@ $(function() {
8 8
 	});
9 9
 	codeEditor.setValue( $("#demoCode").val() );
10 10
 	
11
+	var height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight);
12
+	$(".CodeMirror").attr('style', 'height:'+ height +'px');
13
+	
11 14
 	
12 15
 	$("#save").click(function() {
13 16
 		var codeSource = codeEditor.getValue();
14 17
 		var codeRemark = $("#codeRemark").val();
15 18
 		
16 19
 		if (!codeRemark) {
17
-			ComAlert.show(1, "请输入备注");
20
+			ComAlert.show(2, "请输入备注");
18 21
 			return;
19 22
 		}
20 23
 		if (codeRemark.length < 6|| codeRemark.length > 100) {
21
-			ComAlert.show(1, "备注长度应该在6至100之间");
24
+			ComAlert.show(2, "备注长度应该在6至100之间");
22 25
 			return;
23 26
 		}
24 27
 		
@@ -34,7 +37,7 @@ $(function() {
34 37
 				dataType : "json",
35 38
 				success : function(data){
36 39
 					if (data.code == 200) {
37
-						ComAlert.show(1, '提交成功', function(){
40
+						ComAlert.show(1, '保存成功', function(){
38 41
 							//$(window).unbind('beforeunload');
39 42
 							window.location.reload();
40 43
 						});

+ 3 - 3
xxl-job-client-demo/pom.xml Wyświetl plik

@@ -4,10 +4,10 @@
4 4
 	<parent>
5 5
 		<groupId>com.xxl</groupId>
6 6
 		<artifactId>xxl-job</artifactId>
7
-		<version>1.2.0-SNAPSHOT</version>
7
+		<version>1.3.0-SNAPSHOT</version>
8 8
 	</parent>
9 9
 	<artifactId>xxl-job-client-demo</artifactId>
10
-	<version>1.2.1-SNAPSHOT</version>
10
+	<version>1.3.1-SNAPSHOT</version>
11 11
 	<packaging>war</packaging>
12 12
 
13 13
 	<properties>
@@ -55,7 +55,7 @@
55 55
 		<dependency>
56 56
 			<groupId>com.xxl</groupId>
57 57
 			<artifactId>xxl-job-client</artifactId>
58
-			<version>1.2.1-SNAPSHOT</version>
58
+			<version>1.3.1</version>
59 59
 		</dependency>
60 60
 		
61 61
 	</dependencies>

+ 2 - 2
xxl-job-client/pom.xml Wyświetl plik

@@ -4,10 +4,10 @@
4 4
 	<parent>
5 5
 		<groupId>com.xxl</groupId>
6 6
 		<artifactId>xxl-job</artifactId>
7
-		<version>1.2.0-SNAPSHOT</version>
7
+		<version>1.3.0-SNAPSHOT</version>
8 8
 	</parent>
9 9
 	<artifactId>xxl-job-client</artifactId>
10
-	<version>1.2.1-SNAPSHOT</version>
10
+	<version>1.3.1</version>
11 11
 
12 12
 	<dependencies>
13 13