Bladeren bron

任务操作界面,界面操作完整国际化迁移

xuxueli 7 jaren geleden
bovenliggende
commit
844f51c549

+ 78 - 1
xxl-job-admin/src/main/resources/i18n/message.properties Bestand weergeven

@@ -6,6 +6,49 @@ admin_version=1.9.1(快照版本)
6 6
 system_tips=系统提示
7 7
 system_ok=确定
8 8
 system_close=关闭
9
+system_save=保存
10
+system_cancel=取消
11
+system_search=搜索
12
+system_status=状态
13
+system_opt=操作
14
+system_please_input=请输入
15
+system_success=成功
16
+system_fail=失败
17
+system_add_suc=新增成功
18
+system_add_fail=新增失败
19
+system_update_suc=更新成功
20
+system_update_fail=更新失败
21
+
22
+## daterangepicker
23
+daterangepicker_ranges_today=今日
24
+daterangepicker_ranges_yesterday=昨日
25
+daterangepicker_ranges_this_month=本月
26
+daterangepicker_ranges_last_month=上个月
27
+daterangepicker_ranges_recent_week=最近1周
28
+daterangepicker_ranges_recent_month=最近1月
29
+daterangepicker_custom_name=自定义
30
+daterangepicker_custom_starttime=起始时间
31
+daterangepicker_custom_endtime=结束时间
32
+daterangepicker_custom_daysofweek=日,一,二,三,四,五,六
33
+daterangepicker_custom_monthnames=一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月
34
+
35
+## dataTable
36
+dataTable_sProcessing=处理中...
37
+dataTable_sLengthMenu=每页 _MENU_ 条记录
38
+dataTable_sZeroRecords=没有匹配结果
39
+dataTable_sInfo=第 _PAGE_ 页 ( 总共 _PAGES_ 页,_TOTAL_ 条记录 )
40
+dataTable_sInfoEmpty=无记录
41
+dataTable_sInfoFiltered=(由 _MAX_ 项结果过滤)
42
+dataTable_sSearch=搜索
43
+dataTable_sEmptyTable=表中数据为空
44
+dataTable_sLoadingRecords=载入中...
45
+dataTable_sFirst=首页
46
+dataTable_sPrevious=上页
47
+dataTable_sNext=下页
48
+dataTable_sLast=末页
49
+dataTable_sSortAscending=: 以升序排列此列
50
+dataTable_sSortDescending=: 以降序排列此列
51
+
9 52
 
10 53
 ## login
11 54
 login_btn=登录
@@ -33,12 +76,46 @@ job_dashboard_trigger_num=调度次数
33 76
 job_dashboard_trigger_num_tip=调度中心触发的调度次数
34 77
 job_dashboard_jobgroup_num=执行器数量
35 78
 job_dashboard_jobgroup_num_tip=调度中心在线的执行器机器数量
36
-
37 79
 job_dashboard_report=调度报表
80
+job_dashboard_report_loaddata_fail=调度报表数据加载异常
81
+job_dashboard_date_report=日期分布图
82
+job_dashboard_date_report_suc_count=成功调度次数
83
+job_dashboard_date_report_fail_count=失败调度次数
84
+job_dashboard_rate_report=成功比例图
85
+job_dashboard_rate_report_suc_count=成功调度次数
86
+job_dashboard_rate_report_fail_count=失败调度次数
38 87
 
39 88
 ## job info
40 89
 jobinfo_name=任务管理
90
+jobinfo_field_add=新增任务
91
+jobinfo_field_update=更新任务
92
+jobinfo_field_id=任务ID
93
+jobinfo_field_jobgroup=执行器
94
+jobinfo_field_jobdesc=任务描述
95
+jobinfo_field_gluetype=运行模式
96
+jobinfo_field_executorparam=执行参数
97
+jobinfo_field_author=负责人
98
+jobinfo_field_alarmemail=报警邮件
99
+jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔
100
+jobinfo_field_executorRouteStrategy=路由策略
101
+jobinfo_field_childJobId=子任务ID
102
+jobinfo_field_childJobId_placeholder=请输入子任务的任务ID,如存在多个则逗号分隔
103
+jobinfo_field_executorBlockStrategy=阻塞处理策略
104
+jobinfo_field_executorFailStrategy=失败处理策略
105
+jobinfo_script_location=脚本位置
106
+jobinfo_shard_index=分片序号
107
+jobinfo_shard_total=分片总数
108
+jobinfo_opt_pause=暂停
109
+jobinfo_opt_resume=恢复
110
+jobinfo_opt_log=日志
111
+jobinfo_opt_run=执行
112
+jobinfo_opt_edit=编辑
113
+jobinfo_opt_del=删除
114
+
115
+## job log
41 116
 joblog_name=调度日志
117
+
118
+## job group
42 119
 jobgroup_name=执行器管理
43 120
 
44 121
 

+ 71 - 77
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl Bestand weergeven

@@ -19,12 +19,6 @@
19 19
 		<!-- Content Header (Page header) -->
20 20
 		<section class="content-header">
21 21
 			<h1>${I18n.jobinfo_name}</h1>
22
-			<!--
23
-			<ol class="breadcrumb">
24
-				<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
25
-				<li class="active">调度中心</li>
26
-			</ol>
27
-			-->
28 22
 		</section>
29 23
 		
30 24
 		<!-- Main content -->
@@ -33,7 +27,7 @@
33 27
 	    	<div class="row">
34 28
 	    		<div class="col-xs-3">
35 29
 	              	<div class="input-group">
36
-	                	<span class="input-group-addon">执行器</span>
30
+	                	<span class="input-group-addon">${I18n.jobinfo_field_jobgroup}</span>
37 31
                 		<select class="form-control" id="jobGroup" >
38 32
                 			<#list JobGroupList as group>
39 33
                 				<option value="${group.id}" <#if jobGroup==group.id>selected</#if> >${group.title}</option>
@@ -43,7 +37,7 @@
43 37
 	            </div>
44 38
                 <div class="col-xs-3">
45 39
                     <div class="input-group">
46
-                        <span class="input-group-addon">任务描述</span>
40
+                        <span class="input-group-addon">${I18n.jobinfo_field_jobdesc}</span>
47 41
                         <input type="text" class="form-control" id="jobDesc" autocomplete="on" >
48 42
                     </div>
49 43
                 </div>
@@ -54,36 +48,35 @@
54 48
                     </div>
55 49
                 </div>
56 50
 	            <div class="col-xs-1">
57
-	            	<button class="btn btn-block btn-info" id="searchBtn">搜索</button>
51
+	            	<button class="btn btn-block btn-info" id="searchBtn">${I18n.system_search}</button>
58 52
 	            </div>
59 53
 	            <div class="col-xs-2">
60
-	            	<button class="btn btn-block btn-success add" type="button">+新增任务</button>
54
+	            	<button class="btn btn-block btn-success add" type="button">${I18n.jobinfo_field_add}</button>
61 55
 	            </div>
62 56
           	</div>
63 57
 	    	
64 58
 			<div class="row">
65 59
 				<div class="col-xs-12">
66 60
 					<div class="box">
67
-			            <div class="box-header hide">
61
+			            <#--<div class="box-header hide">
68 62
 			            	<h3 class="box-title">调度列表</h3>
69
-			            </div>
63
+			            </div>-->
70 64
 			            <div class="box-body" >
71 65
 			              	<table id="job_list" class="table table-bordered table-striped" width="100%" >
72 66
 				                <thead>
73 67
 					            	<tr>
74
-					            		<th name="id" >任务ID</th>
75
-					                	<th name="jobGroup" >jobGroup</th>
76
-					                  	<th name="jobDesc" >描述</th>
77
-                                        <th name="glueType" >运行模式</th>
78
-					                  	<th name="executorParam" >任务参数</th>
68
+					            		<th name="id" >${I18n.jobinfo_field_id}</th>
69
+					                	<th name="jobGroup" >${I18n.jobinfo_field_jobgroup}</th>
70
+					                  	<th name="jobDesc" >${I18n.jobinfo_field_jobdesc}</th>
71
+                                        <th name="glueType" >${I18n.jobinfo_field_gluetype}</th>
72
+					                  	<th name="executorParam" >${I18n.jobinfo_field_executorparam}</th>
79 73
                                         <th name="jobCron" >Cron</th>
80
-					                  	<th name="addTime" >新增时间</th>
81
-					                  	<th name="updateTime" >更新时间</th>
82
-					                  	<th name="author" >负责人</th>
83
-					                  	<th name="alarmEmail" >报警邮件</th>
84
-					                  	<th name="glueType" >运行模式</th>
85
-					                  	<th name="jobStatus" >状态</th>
86
-					                  	<th>操作</th>
74
+					                  	<th name="addTime" >addTime</th>
75
+					                  	<th name="updateTime" >updateTime</th>
76
+					                  	<th name="author" >${I18n.jobinfo_field_author}</th>
77
+					                  	<th name="alarmEmail" >${I18n.jobinfo_field_alarmemail}</th>
78
+					                  	<th name="jobStatus" >${I18n.system_status}</th>
79
+					                  	<th>${I18n.system_opt}</th>
87 80
 					                </tr>
88 81
 				                </thead>
89 82
 				                <tbody></tbody>
@@ -105,12 +98,12 @@
105 98
 	<div class="modal-dialog modal-lg">
106 99
 		<div class="modal-content">
107 100
 			<div class="modal-header">
108
-            	<h4 class="modal-title" >新增任务</h4>
101
+            	<h4 class="modal-title" >${I18n.jobinfo_field_add}</h4>
109 102
          	</div>
110 103
          	<div class="modal-body">
111 104
 				<form class="form-horizontal form" role="form" >
112 105
 					<div class="form-group">
113
-						<label for="firstname" class="col-sm-2 control-label">执行器<font color="red">*</font></label>
106
+						<label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_jobgroup}<font color="red">*</font></label>
114 107
 						<div class="col-sm-4">
115 108
 							<select class="form-control" name="jobGroup" >
116 109
 		            			<#list JobGroupList as group>
@@ -118,11 +111,11 @@
118 111
 		            			</#list>
119 112
 		                  	</select>
120 113
 						</div>
121
-                        <label for="lastname" class="col-sm-2 control-label">任务描述<font color="red">*</font></label>
122
-                        <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="50" ></div>
114
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_jobdesc}<font color="red">*</font></label>
115
+                        <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_jobdesc}" maxlength="50" ></div>
123 116
 					</div>
124 117
                     <div class="form-group">
125
-                        <label for="firstname" class="col-sm-2 control-label">路由策略<font color="red">*</font></label>
118
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorRouteStrategy}<font color="red">*</font></label>
126 119
                         <div class="col-sm-4">
127 120
                             <select class="form-control" name="executorRouteStrategy" >
128 121
 							<#list ExecutorRouteStrategyEnum as item>
@@ -131,10 +124,10 @@
131 124
                             </select>
132 125
                         </div>
133 126
                         <label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label>
134
-                        <div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="128" ></div>
127
+                        <div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="${I18n.system_please_input}Cron" maxlength="128" ></div>
135 128
                     </div>
136 129
                     <div class="form-group">
137
-                        <label for="firstname" class="col-sm-2 control-label">运行模式<font color="red">*</font></label>
130
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_gluetype}<font color="red">*</font></label>
138 131
                         <div class="col-sm-4">
139 132
                             <select class="form-control glueType" name="glueType" >
140 133
 								<#list GlueTypeEnum as item>
@@ -143,16 +136,16 @@
143 136
                             </select>
144 137
                         </div>
145 138
                         <label for="firstname" class="col-sm-2 control-label">JobHandler<font color="black">*</font></label>
146
-                        <div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" ></div>
139
+                        <div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="${I18n.system_please_input}JobHandler" maxlength="100" ></div>
147 140
                     </div>
148 141
                     <div class="form-group">
149
-                        <label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
150
-                        <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="512" ></div>
151
-                        <label for="lastname" class="col-sm-2 control-label">子任务ID<font color="black">*</font></label>
152
-                        <div class="col-sm-4"><input type="text" class="form-control" name="childJobId" placeholder="请输入子任务的任务ID,如存在多个逗号分隔" maxlength="100" ></div>
142
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorparam}<font color="black">*</font></label>
143
+                        <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_executorparam}" maxlength="512" ></div>
144
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_childJobId}<font color="black">*</font></label>
145
+                        <div class="col-sm-4"><input type="text" class="form-control" name="childJobId" placeholder="${I18n.jobinfo_field_childJobId_placeholder}" maxlength="100" ></div>
153 146
                     </div>
154 147
                     <div class="form-group">
155
-                        <label for="firstname" class="col-sm-2 control-label">阻塞处理策略<font color="red">*</font></label>
148
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorBlockStrategy}<font color="red">*</font></label>
156 149
                         <div class="col-sm-4">
157 150
                             <select class="form-control" name="executorBlockStrategy" >
158 151
 								<#list ExecutorBlockStrategyEnum as item>
@@ -160,7 +153,7 @@
160 153
 								</#list>
161 154
                             </select>
162 155
 						</div>
163
-                        <label for="lastname" class="col-sm-2 control-label">失败处理策略<font color="red">*</font></label>
156
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorFailStrategy}<font color="red">*</font></label>
164 157
                         <div class="col-sm-4">
165 158
                             <select class="form-control" name="executorFailStrategy" >
166 159
 								<#list ExecutorFailStrategyEnum as item>
@@ -170,17 +163,17 @@
170 163
 						</div>
171 164
                     </div>
172 165
 					<div class="form-group">
173
-                        <label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
174
-                        <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
175
-						<label for="lastname" class="col-sm-2 control-label">报警邮件<font color="black">*</font></label>
176
-						<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="100" ></div>
166
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label>
167
+                        <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div>
168
+						<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmemail}<font color="black">*</font></label>
169
+						<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div>
177 170
 					</div>
178 171
 
179 172
                     <hr>
180 173
 					<div class="form-group">
181 174
 						<div class="col-sm-offset-3 col-sm-6">
182
-							<button type="submit" class="btn btn-primary"  >保存</button>
183
-							<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
175
+							<button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
176
+							<button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
184 177
 						</div>
185 178
 					</div>
186 179
 
@@ -207,10 +200,10 @@ public class DemoGlueJobHandler extends IJobHandler {
207 200
 #!/bin/bash
208 201
 echo "xxl-job: hello shell"
209 202
 
210
-echo "脚本位置:$0"
211
-echo "任务参数:$1"
212
-echo "分片序号 = $2"
213
-echo "分片总数 = $3"
203
+echo "${I18n.jobinfo_script_location}:$0"
204
+echo "${I18n.jobinfo_field_executorparam}:$1"
205
+echo "${I18n.jobinfo_shard_index} = $2"
206
+echo "${I18n.jobinfo_shard_total} = $3"
214 207
 <#--echo "参数数量:$#"
215 208
 for param in $*
216 209
 do
@@ -229,10 +222,10 @@ import sys
229 222
 
230 223
 print "xxl-job: hello python"
231 224
 
232
-print "脚本文件:", sys.argv[0]
233
-print "任务参数:", sys.argv[1]
234
-print "分片序号:", sys.argv[2]
235
-print "分片总数:", sys.argv[3]
225
+print "${I18n.jobinfo_script_location}:", sys.argv[0]
226
+print "${I18n.jobinfo_field_executorparam}:", sys.argv[1]
227
+print "${I18n.jobinfo_shard_index}:", sys.argv[2]
228
+print "${I18n.jobinfo_shard_total}:", sys.argv[3]
236 229
 <#--for i in range(1, len(sys.argv)):
237 230
 	time.sleep(1)
238 231
 	print "参数", i, sys.argv[i]-->
@@ -251,10 +244,10 @@ console.log("xxl-job: hello nodejs")
251 244
 
252 245
 var arguments = process.argv
253 246
 
254
-console.log("脚本文件: " + arguments[1])
255
-console.log("任务参数: " + arguments[2])
256
-console.log("分片序号: " + arguments[3])
257
-console.log("分片总数: " + arguments[4])
247
+console.log("${I18n.jobinfo_script_location}: " + arguments[1])
248
+console.log("${I18n.jobinfo_field_executorparam}: " + arguments[2])
249
+console.log("${I18n.jobinfo_shard_index}: " + arguments[3])
250
+console.log("${I18n.jobinfo_shard_total}: " + arguments[4])
258 251
 <#--for (var i = 2; i < arguments.length; i++){
259 252
 	console.log("参数 %s = %s", (i-1), arguments[i]);
260 253
 }-->
@@ -273,12 +266,12 @@ process.exit(0)
273 266
 	<div class="modal-dialog modal-lg">
274 267
 		<div class="modal-content">
275 268
 			<div class="modal-header">
276
-            	<h4 class="modal-title" >更新任务</h4>
269
+            	<h4 class="modal-title" >${I18n.jobinfo_field_update}</h4>
277 270
          	</div>
278 271
          	<div class="modal-body">
279 272
 				<form class="form-horizontal form" role="form" >
280
-                    <div class="form-group">
281
-                        <label for="firstname" class="col-sm-2 control-label">执行器<font color="red">*</font></label>
273
+					<div class="form-group">
274
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_jobgroup}<font color="red">*</font></label>
282 275
                         <div class="col-sm-4">
283 276
                             <select class="form-control" name="jobGroup" disabled >
284 277
 							<#list JobGroupList as group>
@@ -286,11 +279,11 @@ process.exit(0)
286 279
 							</#list>
287 280
                             </select>
288 281
                         </div>
289
-                        <label for="lastname" class="col-sm-2 control-label">任务描述<font color="red">*</font></label>
290
-                        <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="50" ></div>
282
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_jobdesc}<font color="red">*</font></label>
283
+                        <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_jobdesc}" maxlength="50" ></div>
291 284
                     </div>
292 285
                     <div class="form-group">
293
-                        <label for="firstname" class="col-sm-2 control-label">路由策略<font color="red">*</font></label>
286
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorRouteStrategy}<font color="red">*</font></label>
294 287
                         <div class="col-sm-4">
295 288
                             <select class="form-control" name="executorRouteStrategy" >
296 289
 							<#list ExecutorRouteStrategyEnum as item>
@@ -299,10 +292,10 @@ process.exit(0)
299 292
                             </select>
300 293
                         </div>
301 294
                         <label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label>
302
-                        <div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="128" ></div>
295
+                        <div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="${I18n.system_please_input}Cron" maxlength="128" ></div>
303 296
                     </div>
304 297
                     <div class="form-group">
305
-                        <label for="firstname" class="col-sm-2 control-label">运行模式<font color="red">*</font></label>
298
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_gluetype}<font color="red">*</font></label>
306 299
                         <div class="col-sm-4">
307 300
                             <select class="form-control glueType" name="glueType" disabled >
308 301
 							<#list GlueTypeEnum as item>
@@ -311,16 +304,16 @@ process.exit(0)
311 304
                             </select>
312 305
                         </div>
313 306
                         <label for="firstname" class="col-sm-2 control-label">JobHandler<font color="black">*</font></label>
314
-                        <div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" ></div>
307
+                        <div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="${I18n.system_please_input}JobHandler" maxlength="100" ></div>
315 308
                     </div>
316 309
                     <div class="form-group">
317
-                        <label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
318
-                        <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="512" ></div>
319
-                        <label for="lastname" class="col-sm-2 control-label">子任务ID<font color="black">*</font></label>
320
-                        <div class="col-sm-4"><input type="text" class="form-control" name="childJobId" placeholder="请输入子任务的任务ID,如存在多个逗号分隔" maxlength="100" ></div>
310
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorparam}<font color="black">*</font></label>
311
+                        <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_executorparam}" maxlength="512" ></div>
312
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_childJobId}<font color="black">*</font></label>
313
+                        <div class="col-sm-4"><input type="text" class="form-control" name="childJobId" placeholder="${I18n.jobinfo_field_childJobId_placeholder}" maxlength="100" ></div>
321 314
                     </div>
322 315
                     <div class="form-group">
323
-                        <label for="firstname" class="col-sm-2 control-label">阻塞处理策略<font color="red">*</font></label>
316
+                        <label for="firstname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorBlockStrategy}<font color="red">*</font></label>
324 317
                         <div class="col-sm-4">
325 318
                             <select class="form-control" name="executorBlockStrategy" >
326 319
 							<#list ExecutorBlockStrategyEnum as item>
@@ -328,7 +321,7 @@ process.exit(0)
328 321
 							</#list>
329 322
                             </select>
330 323
                         </div>
331
-                        <label for="lastname" class="col-sm-2 control-label">失败处理策略<font color="red">*</font></label>
324
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_executorFailStrategy}<font color="red">*</font></label>
332 325
                         <div class="col-sm-4">
333 326
                             <select class="form-control" name="executorFailStrategy" >
334 327
 							<#list ExecutorFailStrategyEnum as item>
@@ -338,20 +331,21 @@ process.exit(0)
338 331
                         </div>
339 332
                     </div>
340 333
                     <div class="form-group">
341
-                        <label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
342
-                        <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
343
-                        <label for="lastname" class="col-sm-2 control-label">报警邮件<font color="black">*</font></label>
344
-                        <div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="100" ></div>
334
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label>
335
+                        <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div>
336
+                        <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmemail}<font color="black">*</font></label>
337
+                        <div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div>
345 338
                     </div>
346 339
 
347 340
 					<hr>
348 341
 					<div class="form-group">
349 342
                         <div class="col-sm-offset-3 col-sm-6">
350
-							<button type="submit" class="btn btn-primary"  >保存</button>
351
-							<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
343
+							<button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
344
+							<button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
352 345
                             <input type="hidden" name="id" >
353 346
 						</div>
354 347
 					</div>
348
+
355 349
 				</form>
356 350
          	</div>
357 351
 		</div>

+ 29 - 28
xxl-job-admin/src/main/webapp/static/js/index.js Bestand weergeven

@@ -4,8 +4,17 @@
4 4
 $(function () {
5 5
 
6 6
     // filter Time
7
-    var _startDate = moment().subtract(1, 'months');    // 默认,最近一月
7
+    var _startDate = moment().subtract(1, 'months');    // default,recent_month
8 8
     var _endDate = moment();
9
+
10
+    var rangesConf = {};
11
+    rangesConf[I18n.daterangepicker_ranges_today] = [moment().startOf('day'), moment().endOf('day')];
12
+    rangesConf[I18n.daterangepicker_ranges_yesterday] = [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')];
13
+    rangesConf[I18n.daterangepicker_ranges_this_month] = [moment().startOf('month'), moment().endOf('month')];
14
+    rangesConf[I18n.daterangepicker_ranges_last_month] = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')];
15
+    rangesConf[I18n.daterangepicker_ranges_recent_week] = [moment().subtract(1, 'weeks'), moment()];
16
+    rangesConf[I18n.daterangepicker_ranges_recent_month] = [_startDate, _endDate];
17
+
9 18
     $('#filterTime').daterangepicker({
10 19
         autoApply:false,
11 20
         singleDatePicker:false,
@@ -14,25 +23,17 @@ $(function () {
14 23
         timePickerIncrement: 10, 	// 时间的增量,单位为分钟
15 24
         timePicker24Hour : true,
16 25
         opens : 'left', //日期选择框的弹出位置
17
-        ranges: {
18
-            //'最近1小时': [moment().subtract(1, 'hours'), moment()],
19
-            '今日': [moment().startOf('day'), moment().endOf('day')],
20
-            '昨日': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
21
-            '本月': [moment().startOf('month'), moment().endOf('month')],
22
-            '上个月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')],
23
-            '最近1周': [moment().subtract(1, 'weeks'), moment()],
24
-            '最近1月': [_startDate, _endDate]
25
-        },
26
+        ranges: rangesConf,
26 27
         locale : {
27 28
             format: 'YYYY-MM-DD HH:mm:ss',
28 29
             separator : ' - ',
29
-            customRangeLabel : '自定义',
30
-            applyLabel : '确定',
31
-            cancelLabel : '取消',
32
-            fromLabel : '起始时间',
33
-            toLabel : '结束时间',
34
-            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
35
-            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ],
30
+            customRangeLabel : I18n.daterangepicker_custom_name ,
31
+            applyLabel : I18n.system_ok ,
32
+            cancelLabel : I18n.system_cancel ,
33
+            fromLabel : I18n.daterangepicker_custom_starttime ,
34
+            toLabel : I18n.daterangepicker_custom_endtime ,
35
+            daysOfWeek : I18n.daterangepicker_custom_daysofweek.split(',') ,        // '日', '一', '二', '三', '四', '五', '六'
36
+            monthNames : I18n.daterangepicker_custom_monthnames.split(',') ,        // '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
36 37
             firstDay : 1
37 38
         },
38 39
         startDate:_startDate,
@@ -64,7 +65,7 @@ $(function () {
64 65
                 } else {
65 66
                     layer.open({
66 67
                         title: I18n.system_tips ,
67
-                        content: (data.msg || '调度报表数据加载异常'),
68
+                        content: (data.msg || I18n.job_dashboard_report_loaddata_fail ),
68 69
                         icon: '2'
69 70
                     });
70 71
                 }
@@ -78,7 +79,7 @@ $(function () {
78 79
     function lineChartInit(data) {
79 80
         var option = {
80 81
                title: {
81
-                   text: '日期分布图'
82
+                   text: I18n.job_dashboard_date_report
82 83
                },
83 84
                tooltip : {
84 85
                    trigger: 'axis',
@@ -90,7 +91,7 @@ $(function () {
90 91
                    }
91 92
                },
92 93
                legend: {
93
-                   data:['成功调度次数','失败调度次数']
94
+                   data:[I18n.job_dashboard_date_report_suc_count, I18n.job_dashboard_date_report_fail_count]
94 95
                },
95 96
                toolbox: {
96 97
                    feature: {
@@ -117,16 +118,16 @@ $(function () {
117 118
                ],
118 119
                series : [
119 120
                    {
120
-                       name:'成功调度次数',
121
+                       name:I18n.job_dashboard_date_report_suc_count,
121 122
                        type:'line',
122
-                       stack: '总量',
123
+                       stack: 'Total',
123 124
                        areaStyle: {normal: {}},
124 125
                        data: data.content.triggerDayCountSucList
125 126
                    },
126 127
                    {
127
-                       name:'失败调度次数',
128
+                       name:I18n.job_dashboard_date_report_fail_count,
128 129
                        type:'line',
129
-                       stack: '总量',
130
+                       stack: 'Total',
130 131
                        label: {
131 132
                            normal: {
132 133
                                show: true,
@@ -150,7 +151,7 @@ $(function () {
150 151
     function pieChartInit(data) {
151 152
         var option = {
152 153
             title : {
153
-                text: '成功比例图',
154
+                text: I18n.job_dashboard_rate_report ,
154 155
                 /*subtext: 'subtext',*/
155 156
                 x:'center'
156 157
             },
@@ -161,7 +162,7 @@ $(function () {
161 162
             legend: {
162 163
                 orient: 'vertical',
163 164
                 left: 'left',
164
-                data: ['成功调度次数','失败调度次数']
165
+                data: [I18n.job_dashboard_rate_report_suc_count, I18n.job_dashboard_rate_report_fail_count ]
165 166
             },
166 167
             series : [
167 168
                 {
@@ -172,11 +173,11 @@ $(function () {
172 173
                     data:[
173 174
                         {
174 175
                             value:data.content.triggerCountSucTotal,
175
-                            name:'成功调度次数'
176
+                            name:I18n.job_dashboard_rate_report_suc_count
176 177
                         },
177 178
                         {
178 179
                             value:data.content.triggerCountFailTotal,
179
-                            name:'失败调度次数'
180
+                            name:I18n.job_dashboard_rate_report_fail_count
180 181
                         }
181 182
                     ],
182 183
                     itemStyle: {

+ 75 - 64
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js Bestand weergeven

@@ -52,18 +52,12 @@ $(function() {
52 52
 						"width":'20%',
53 53
 						"visible" : true,
54 54
 						"render": function ( data, type, row ) {
55
-							if ('GLUE_GROOVY'==row.glueType) {
56
-								return "GLUE模式(Java)";
57
-							} else if ('GLUE_SHELL'==row.glueType) {
58
-								return "GLUE模式(Shell)";
59
-							} else if ('GLUE_PYTHON'==row.glueType) {
60
-								return "GLUE模式(Python)";
61
-							}else if  ('GLUE_NODEJS'==row.glueType){
62
-								return "GLUE模式(Nodejs)";
63
-							} else if ('BEAN'==row.glueType) {
64
-								return "BEAN模式:" + row.executorHandler;
65
-							}
66
-							return row.executorHandler;
55
+							var glueTypeTitle = findGlueTypeTitle(row.glueType);
56
+                            if (row.executorHandler) {
57
+                                return glueTypeTitle +":" + row.executorHandler;
58
+                            } else {
59
+                                return glueTypeTitle;
60
+                            }
67 61
 						}
68 62
 					},
69 63
 	                { "data": 'executorParam', "visible" : false},
@@ -88,7 +82,6 @@ $(function() {
88 82
 	                },
89 83
 	                { "data": 'author', "visible" : true, "width":'10%'},
90 84
 	                { "data": 'alarmEmail', "visible" : false},
91
-	                { "data": 'glueType', "visible" : false},
92 85
 	                { 
93 86
 	                	"data": 'jobStatus',
94 87
 						"width":'10%',
@@ -97,24 +90,24 @@ $(function() {
97 90
 	                		if ('NORMAL' == data) {
98 91
 	                			return '<small class="label label-success" ><i class="fa fa-clock-o"></i>'+ data +'</small>'; 
99 92
 							} else if ('PAUSED' == data){
100
-								return '<small class="label label-default" title="暂停" ><i class="fa fa-clock-o"></i>'+ data +'</small>'; 
93
+								return '<small class="label label-default" ><i class="fa fa-clock-o"></i>'+ data +'</small>';
101 94
 							} else if ('BLOCKED' == data){
102
-								return '<small class="label label-default" title="阻塞[串行]" ><i class="fa fa-clock-o"></i>'+ data +'</small>'; 
95
+								return '<small class="label label-default" ><i class="fa fa-clock-o"></i>'+ data +'</small>';
103 96
 							}
104 97
 	                		return data;
105 98
 	                	}
106 99
 	                },
107 100
 	                {
108
-						"data": '操作' ,
101
+						"data": I18n.system_opt ,
109 102
 						"width":'15%',
110 103
 	                	"render": function ( data, type, row ) {
111 104
 	                		return function(){
112 105
 	                			// status
113 106
 	                			var pause_resume = "";
114 107
 	                			if ('NORMAL' == row.jobStatus) {
115
-	                				pause_resume = '<button class="btn btn-primary btn-xs job_operate" _type="job_pause" type="button">暂停</button>  ';
108
+	                				pause_resume = '<button class="btn btn-primary btn-xs job_operate" _type="job_pause" type="button">'+ I18n.jobinfo_opt_pause +'</button>  ';
116 109
 								} else if ('PAUSED' == row.jobStatus){
117
-									pause_resume = '<button class="btn btn-primary btn-xs job_operate" _type="job_resume" type="button">恢复</button>  ';
110
+									pause_resume = '<button class="btn btn-primary btn-xs job_operate" _type="job_resume" type="button">'+ I18n.jobinfo_opt_resume +'</button>  ';
118 111
 								}
119 112
 	                			// log url
120 113
 	                			var logUrl = base_url +'/joblog?jobId='+ row.id;
@@ -129,12 +122,12 @@ $(function() {
129 122
 								// html
130 123
                                 tableData['key'+row.id] = row;
131 124
 								var html = '<p id="'+ row.id +'" >'+
132
-									'<button class="btn btn-primary btn-xs job_operate" _type="job_trigger" type="button">执行</button>  '+
125
+									'<button class="btn btn-primary btn-xs job_operate" _type="job_trigger" type="button">'+ I18n.jobinfo_opt_run +'</button>  '+
133 126
 									pause_resume +
134
-									'<button class="btn btn-primary btn-xs" type="job_del" type="button" onclick="javascript:window.open(\'' + logUrl + '\')" >日志</button><br>  '+
135
-									'<button class="btn btn-warning btn-xs update" type="button">编辑</button>  '+
127
+									'<button class="btn btn-primary btn-xs" type="job_del" type="button" onclick="javascript:window.open(\'' + logUrl + '\')" >'+ I18n.jobinfo_opt_log +'</button><br>  '+
128
+									'<button class="btn btn-warning btn-xs update" type="button">'+ I18n.jobinfo_opt_edit +'</button>  '+
136 129
 									codeBtn +
137
-									'<button class="btn btn-danger btn-xs job_operate" _type="job_del" type="button">删除</button>  '+
130
+									'<button class="btn btn-danger btn-xs job_operate" _type="job_del" type="button">'+ I18n.jobinfo_opt_del +'</button>  '+
138 131
 									'</p>';
139 132
 
140 133
 	                			return html;
@@ -143,27 +136,27 @@ $(function() {
143 136
 	                }
144 137
 	            ],
145 138
 		"language" : {
146
-			"sProcessing" : "处理中...",
147
-			"sLengthMenu" : "每页 _MENU_ 条记录",
148
-			"sZeroRecords" : "没有匹配结果",
149
-			"sInfo" : "第 _PAGE_ 页 ( 总共 _PAGES_ 页,_TOTAL_ 条记录 )",
150
-			"sInfoEmpty" : "无记录",
151
-			"sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
139
+			"sProcessing" : I18n.dataTable_sProcessing ,
140
+			"sLengthMenu" : I18n.dataTable_sLengthMenu ,
141
+			"sZeroRecords" : I18n.dataTable_sZeroRecords ,
142
+			"sInfo" : I18n.dataTable_sInfo ,
143
+			"sInfoEmpty" : I18n.dataTable_sInfoEmpty ,
144
+			"sInfoFiltered" : I18n.dataTable_sInfoFiltered ,
152 145
 			"sInfoPostFix" : "",
153
-			"sSearch" : "搜索:",
146
+			"sSearch" : I18n.dataTable_sSearch ,
154 147
 			"sUrl" : "",
155
-			"sEmptyTable" : "表中数据为空",
156
-			"sLoadingRecords" : "载入中...",
148
+			"sEmptyTable" : I18n.dataTable_sEmptyTable ,
149
+			"sLoadingRecords" : I18n.dataTable_sLoadingRecords ,
157 150
 			"sInfoThousands" : ",",
158 151
 			"oPaginate" : {
159
-				"sFirst" : "首页",
160
-				"sPrevious" : "上页",
161
-				"sNext" : "下页",
162
-				"sLast" : "末页"
152
+				"sFirst" : I18n.dataTable_sFirst ,
153
+				"sPrevious" : I18n.dataTable_sPrevious ,
154
+				"sNext" : I18n.dataTable_sNext ,
155
+				"sLast" : I18n.dataTable_sLast
163 156
 			},
164 157
 			"oAria" : {
165
-				"sSortAscending" : ": 以升序排列此列",
166
-				"sSortDescending" : ": 以降序排列此列"
158
+				"sSortAscending" : I18n.dataTable_sSortAscending ,
159
+				"sSortDescending" : I18n.dataTable_sSortDescending
167 160
 			}
168 161
 		}
169 162
 	});
@@ -191,19 +184,19 @@ $(function() {
191 184
 
192 185
 		var type = $(this).attr("_type");
193 186
 		if ("job_pause" == type) {
194
-			typeName = "暂停";
187
+			typeName = I18n.jobinfo_opt_pause ;
195 188
 			url = base_url + "/jobinfo/pause";
196 189
 			needFresh = true;
197 190
 		} else if ("job_resume" == type) {
198
-			typeName = "恢复";
191
+			typeName = I18n.jobinfo_opt_resume ;
199 192
 			url = base_url + "/jobinfo/resume";
200 193
 			needFresh = true;
201 194
 		} else if ("job_del" == type) {
202
-			typeName = "删除";
195
+			typeName = I18n.jobinfo_opt_del ;
203 196
 			url = base_url + "/jobinfo/remove";
204 197
 			needFresh = true;
205 198
 		} else if ("job_trigger" == type) {
206
-			typeName = "执行";
199
+			typeName = I18n.jobinfo_opt_run ;
207 200
 			url = base_url + "/jobinfo/trigger";
208 201
 		} else {
209 202
 			return;
@@ -211,7 +204,7 @@ $(function() {
211 204
 		
212 205
 		var id = $(this).parent('p').attr("id");
213 206
 
214
-		layer.confirm('确认' + typeName + '?', {icon: 3, title:'系统提示'}, function(index){
207
+		layer.confirm( I18n.system_ok + typeName + '?', {icon: 3, title: I18n.system_tips }, function(index){
215 208
 			layer.close(index);
216 209
 
217 210
 			$.ajax({
@@ -225,8 +218,9 @@ $(function() {
225 218
 					if (data.code == 200) {
226 219
 
227 220
 						layer.open({
228
-							title: '系统提示',
229
-							content: typeName + "成功",
221
+							title: I18n.system_tips,
222
+                            btn: [ I18n.system_ok , I18n.system_close ],
223
+							content: typeName + I18n.system_success ,
230 224
 							icon: '1',
231 225
 							end: function(layero, index){
232 226
 								if (needFresh) {
@@ -237,8 +231,9 @@ $(function() {
237 231
 						});
238 232
 					} else {
239 233
 						layer.open({
240
-							title: '系统提示',
241
-							content: (data.msg || typeName + "失败"),
234
+							title: I18n.system_tips,
235
+                            btn: [ I18n.system_ok , I18n.system_close ],
236
+							content: (data.msg || typeName + I18n.system_fail ),
242 237
 							icon: '2'
243 238
 						});
244 239
 					}
@@ -269,13 +264,13 @@ $(function() {
269 264
         }, 
270 265
         messages : {  
271 266
             jobDesc : {
272
-            	required :"请输入“描述”."
267
+            	required : I18n.system_please_input + I18n.jobinfo_field_jobdesc
273 268
             },
274 269
             jobCron : {
275
-            	required :"请输入“Cron”."
270
+            	required : I18n.system_please_input + "Cron"
276 271
             },
277 272
             author : {
278
-            	required : "请输入“负责人”."
273
+            	required : I18n.system_please_input + I18n.jobinfo_field_author
279 274
             }
280 275
         },
281 276
 		highlight : function(element) {  
@@ -293,8 +288,8 @@ $(function() {
293 288
     			if (data.code == "200") {
294 289
 					$('#addModal').modal('hide');
295 290
 					layer.open({
296
-						title: '系统提示',
297
-						content: '新增任务成功',
291
+						title: I18n.system_tips ,
292
+						content: I18n.system_add_suc ,
298 293
 						icon: '1',
299 294
 						end: function(layero, index){
300 295
 							jobTable.fnDraw();
@@ -303,8 +298,8 @@ $(function() {
303 298
 					});
304 299
     			} else {
305 300
 					layer.open({
306
-						title: '系统提示',
307
-						content: (data.msg || "新增失败"),
301
+						title: I18n.system_tips ,
302
+						content: (data.msg || I18n.system_add_fail),
308 303
 						icon: '2'
309 304
 					});
310 305
     			}
@@ -353,14 +348,14 @@ $(function() {
353 348
 
354 349
         var id = $(this).parent('p').attr("id");
355 350
         var row = tableData['key'+id];
356
-        if (!row) {
351
+        /*if (!row) {
357 352
             layer.open({
358
-                title: '系统提示',
359
-                content: ("任务信息加载失败,请刷新页面"),
353
+                title: I18n.system_tips ,
354
+                content: ("数据加载失败,请刷新页面"),
360 355
                 icon: '2'
361 356
             });
362 357
             return;
363
-        }
358
+        }*/
364 359
 
365 360
 		// base data
366 361
 		$("#updateModal .form input[name='id']").val( row.id );
@@ -401,13 +396,13 @@ $(function() {
401 396
 		},
402 397
 		messages : {
403 398
 			jobDesc : {
404
-				required :"请输入“描述”."
399
+                required : I18n.system_please_input + I18n.jobinfo_field_jobdesc
405 400
 			},
406 401
 			jobCron : {
407
-				required :"请输入“Cron”."
402
+				required : I18n.system_please_input + "Cron"
408 403
 			},
409 404
 			author : {
410
-				required : "请输入“负责人”."
405
+				required : I18n.system_please_input + I18n.jobinfo_field_author
411 406
 			}
412 407
 		},
413 408
 		highlight : function(element) {
@@ -426,8 +421,8 @@ $(function() {
426 421
     			if (data.code == "200") {
427 422
 					$('#updateModal').modal('hide');
428 423
 					layer.open({
429
-						title: '系统提示',
430
-						content: '更新成功',
424
+						title: I18n.system_tips ,
425
+						content: I18n.system_update_suc ,
431 426
 						icon: '1',
432 427
 						end: function(layero, index){
433 428
 							//window.location.reload();
@@ -436,8 +431,8 @@ $(function() {
436 431
 					});
437 432
     			} else {
438 433
 					layer.open({
439
-						title: '系统提示',
440
-						content: (data.msg || "更新失败"),
434
+						title: I18n.system_tips ,
435
+						content: (data.msg || I18n.system_update_fail ),
441 436
 						icon: '2'
442 437
 					});
443 438
     			}
@@ -448,4 +443,20 @@ $(function() {
448 443
 		$("#updateModal .form")[0].reset()
449 444
 	});
450 445
 
446
+    /**
447
+	 * find title by name, GlueType
448
+     */
449
+	function findGlueTypeTitle(glueType) {
450
+		var glueTypeTitle;
451
+        $("#addModal .form select[name=glueType] option").each(function () {
452
+            var name = $(this).val();
453
+            var title = $(this).text();
454
+            if (glueType == name) {
455
+                glueTypeTitle = title;
456
+                return false
457
+            }
458
+        });
459
+        return glueTypeTitle;
460
+    }
461
+
451 462
 });