Преглед изворни кода

执行器界面,完整国际化定制

xuxueli пре 7 година
родитељ
комит
e7b61fb75c

+ 18 - 3
xxl-job-admin/src/main/resources/i18n/message.properties Прегледај датотеку

@@ -24,6 +24,8 @@ system_show=查看
24 24
 system_empty=无
25 25
 system_opt_suc=操作成功
26 26
 system_opt_fail=操作失败
27
+system_opt_edit=编辑
28
+system_opt_del=删除
27 29
 
28 30
 ## daterangepicker
29 31
 daterangepicker_ranges_recent_hour=最近一小时
@@ -117,8 +119,6 @@ jobinfo_opt_pause=暂停
117 119
 jobinfo_opt_resume=恢复
118 120
 jobinfo_opt_log=日志
119 121
 jobinfo_opt_run=执行
120
-jobinfo_opt_edit=编辑
121
-jobinfo_opt_del=删除
122 122
 
123 123
 ## job log
124 124
 joblog_name=调度日志
@@ -157,7 +157,22 @@ joblog_rolling_log_failoften=终止请求Rolling日志,请求失败次数超上
157 157
 
158 158
 ## job group
159 159
 jobgroup_name=执行器管理
160
-
160
+jobgroup_list=执行器列表
161
+jobgroup_add=新增执行器
162
+jobgroup_edit=编辑执行器
163
+jobgroup_del=删除执行器
164
+jobgroup_field_order=排序
165
+jobgroup_field_title=名称
166
+jobgroup_field_addressType=注册方式
167
+jobgroup_field_addressType_0=自动注册
168
+jobgroup_field_addressType_1=手动录入
169
+jobgroup_field_registryList=机器地址
170
+jobgroup_field_registryList_placeholder=请输入执行器地址列表,多地址逗号分隔
171
+jobgroup_field_appName_limit=限制以小写字母开头,由小写字母、数字和中划线组成
172
+jobgroup_field_appName_length=AppName长度限制为4~64
173
+jobgroup_field_title_length=名称长度限制为4~12
174
+jobgroup_field_order_digits=请输入整数
175
+jobgroup_field_orderrange=取值范围为1~1000
161 176
 
162 177
 ## help
163 178
 job_help=使用教程

+ 36 - 36
xxl-job-admin/src/main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl Прегледај датотеку

@@ -28,20 +28,20 @@
28 28
 				<div class="col-xs-12">
29 29
 					<div class="box">
30 30
 			            <div class="box-header">
31
-							<h3 class="box-title">执行器列表</h3>&nbsp;&nbsp;
32
-                            <button class="btn btn-info btn-xs pull-left2 add" >+新增执行器</button>
31
+							<h3 class="box-title">${I18n.jobgroup_list}</h3>&nbsp;&nbsp;
32
+                            <button class="btn btn-info btn-xs pull-left2 add" >${I18n.jobgroup_add}</button>
33 33
 						</div>
34 34
 			            <div class="box-body">
35 35
 			              	<table id="joblog_list" class="table table-bordered table-striped display" width="100%" >
36 36
 				                <thead>
37 37
 					            	<tr>
38 38
                                         <#--<th name="id" >ID</th>-->
39
-                                        <th name="order" >排序</th>
39
+                                        <th name="order" >${I18n.jobgroup_field_order}</th>
40 40
                                         <th name="appName" >AppName</th>
41
-                                        <th name="title" >名称</th>
42
-                                        <th name="addressType" >注册方式</th>
43
-                                        <th name="registryList" >OnLine 机器</th>
44
-                                        <th name="operate" >操作</th>
41
+                                        <th name="title" >${I18n.jobgroup_field_title}</th>
42
+                                        <th name="addressType" >${I18n.jobgroup_field_addressType}</th>
43
+                                        <th name="registryList" >OnLine ${I18n.jobgroup_field_registryList}</th>
44
+                                        <th name="operate" >${I18n.system_opt}</th>
45 45
 					                </tr>
46 46
 				                </thead>
47 47
                                 <tbody>
@@ -52,7 +52,7 @@
52 52
                                         <td>${group.order}</td>
53 53
                                         <td>${group.appName}</td>
54 54
                                         <td>${group.title}</td>
55
-                                        <td><#if group.addressType==0>自动注册<#else>手动录入</#if></td>
55
+                                        <td><#if group.addressType==0>${I18n.jobgroup_field_addressType_0}<#else>${I18n.jobgroup_field_addressType_1}</#if></td>
56 56
                                         <td>
57 57
                                             <#if group.registryList?exists>
58 58
                                                 <#list group.registryList as item>
@@ -74,8 +74,8 @@
74 74
                                                     title="${group.title}"
75 75
                                                     order="${group.order}"
76 76
                                                     addressType="${group.addressType}"
77
-                                                    addressList="${group.addressList}" >编辑</button>
78
-                                            <button class="btn btn-danger btn-xs remove" id="${group.id}" >删除</button>
77
+                                                    addressList="${group.addressList}" >${I18n.system_opt_edit}</button>
78
+                                            <button class="btn btn-danger btn-xs remove" id="${group.id}" >${I18n.system_opt_del}</button>
79 79
 										</td>
80 80
 									</tr>
81 81
 								</#list>
@@ -94,41 +94,41 @@
94 94
         <div class="modal-dialog ">
95 95
             <div class="modal-content">
96 96
                 <div class="modal-header">
97
-                    <h4 class="modal-title" >新增执行器</h4>
97
+                    <h4 class="modal-title" >${I18n.jobgroup_add}</h4>
98 98
                 </div>
99 99
                 <div class="modal-body">
100 100
                     <form class="form-horizontal form" role="form" >
101 101
                         <div class="form-group">
102 102
                             <label for="lastname" class="col-sm-2 control-label">AppName<font color="red">*</font></label>
103
-                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="请输入“AppName”" maxlength="64" ></div>
103
+                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="${I18n.system_please_input}AppName" maxlength="64" ></div>
104 104
                         </div>
105 105
                         <div class="form-group">
106
-                            <label for="lastname" class="col-sm-2 control-label">名称<font color="red">*</font></label>
107
-                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="请输入“名称”" maxlength="12" ></div>
106
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_title}<font color="red">*</font></label>
107
+                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_title}" maxlength="12" ></div>
108 108
                         </div>
109 109
                         <div class="form-group">
110
-                            <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>
111
-                            <div class="col-sm-10"><input type="text" class="form-control" name="order" placeholder="请输入“排序”" maxlength="50" ></div>
110
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_order}<font color="red">*</font></label>
111
+                            <div class="col-sm-10"><input type="text" class="form-control" name="order" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_order}" maxlength="50" ></div>
112 112
                         </div>
113 113
                         <div class="form-group">
114
-                            <label for="lastname" class="col-sm-2 control-label">注册方式<font color="red">*</font></label>
114
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_addressType}<font color="red">*</font></label>
115 115
                             <div class="col-sm-10">
116
-                                <input type="radio" name="addressType" value="0" checked />自动注册
116
+                                <input type="radio" name="addressType" value="0" checked />${I18n.jobgroup_field_addressType_0}
117 117
                                 &nbsp;&nbsp;&nbsp;&nbsp;
118
-                                <input type="radio" name="addressType" value="1" />手动录入
118
+                                <input type="radio" name="addressType" value="1" />${I18n.jobgroup_field_addressType_1}
119 119
                             </div>
120 120
                         </div>
121 121
                         <div class="form-group">
122
-                            <label for="lastname" class="col-sm-2 control-label">机器地址<font color="red">*</font></label>
122
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_registryList}<font color="red">*</font></label>
123 123
                             <div class="col-sm-10">
124
-                                <textarea class="textarea" name="addressList" maxlength="512" placeholder="请输入执行器地址列表,多地址逗号分隔" readonly="readonly" style="background-color:#eee; width: 100%; height: 100px; font-size: 14px; line-height: 10px; border: 1px solid #dddddd; padding: 10px;"></textarea>
124
+                                <textarea class="textarea" name="addressList" maxlength="512" placeholder="${I18n.jobgroup_field_registryList_placeholder}" readonly="readonly" style="background-color:#eee; width: 100%; height: 100px; font-size: 14px; line-height: 10px; border: 1px solid #dddddd; padding: 10px;"></textarea>
125 125
                             </div>
126 126
                         </div>
127 127
                         <hr>
128 128
                         <div class="form-group">
129 129
                             <div class="col-sm-offset-3 col-sm-6">
130
-                                <button type="submit" class="btn btn-primary"  >保存</button>
131
-                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
130
+                                <button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
131
+                                <button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
132 132
                             </div>
133 133
                         </div>
134 134
                     </form>
@@ -142,41 +142,41 @@
142 142
         <div class="modal-dialog ">
143 143
             <div class="modal-content">
144 144
                 <div class="modal-header">
145
-                    <h4 class="modal-title" >编辑执行器</h4>
145
+                    <h4 class="modal-title" >${I18n.jobgroup_edit}</h4>
146 146
                 </div>
147 147
                 <div class="modal-body">
148 148
                     <form class="form-horizontal form" role="form" >
149 149
                         <div class="form-group">
150 150
                             <label for="lastname" class="col-sm-2 control-label">AppName<font color="red">*</font></label>
151
-                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="请输入“AppName”" maxlength="64" ></div>
151
+                            <div class="col-sm-10"><input type="text" class="form-control" name="appName" placeholder="${I18n.system_please_input}AppName" maxlength="64" ></div>
152 152
                         </div>
153 153
                         <div class="form-group">
154
-                            <label for="lastname" class="col-sm-2 control-label">名称<font color="red">*</font></label>
155
-                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="请输入“名称”" maxlength="12" ></div>
154
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_title}<font color="red">*</font></label>
155
+                            <div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_title}" maxlength="12" ></div>
156 156
                         </div>
157 157
                         <div class="form-group">
158
-                            <label for="lastname" class="col-sm-2 control-label">排序<font color="red">*</font></label>
159
-                            <div class="col-sm-10"><input type="text" class="form-control" name="order" placeholder="请输入“排序”" maxlength="50" ></div>
158
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_order}<font color="red">*</font></label>
159
+                            <div class="col-sm-10"><input type="text" class="form-control" name="order" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_order}" maxlength="50" ></div>
160 160
                         </div>
161 161
                         <div class="form-group">
162
-                            <label for="lastname" class="col-sm-2 control-label">注册方式<font color="red">*</font></label>
162
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_addressType}<font color="red">*</font></label>
163 163
                             <div class="col-sm-10">
164
-                                <input type="radio" name="addressType" value="0" />自动注册
164
+                                <input type="radio" name="addressType" value="0" />${I18n.jobgroup_field_addressType_0}
165 165
                                 &nbsp;&nbsp;&nbsp;&nbsp;
166
-                                <input type="radio" name="addressType" value="1" />手动录入
166
+                                <input type="radio" name="addressType" value="1" />${I18n.jobgroup_field_addressType_1}
167 167
                             </div>
168 168
                         </div>
169 169
                         <div class="form-group">
170
-                            <label for="lastname" class="col-sm-2 control-label">机器地址<font color="red">*</font></label>
170
+                            <label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_registryList}<font color="red">*</font></label>
171 171
                             <div class="col-sm-10">
172
-                                <textarea class="textarea" name="addressList" maxlength="512" placeholder="请输入执行器地址列表,多地址逗号分隔" readonly="readonly" style="background-color:#eee; width: 100%; height: 100px; font-size: 14px; line-height: 10px; border: 1px solid #dddddd; padding: 10px;"></textarea>
172
+                                <textarea class="textarea" name="addressList" maxlength="512" placeholder="${I18n.jobgroup_field_registryList_placeholder}" readonly="readonly" style="background-color:#eee; width: 100%; height: 100px; font-size: 14px; line-height: 10px; border: 1px solid #dddddd; padding: 10px;"></textarea>
173 173
                             </div>
174 174
                         </div>
175 175
                         <hr>
176 176
                         <div class="form-group">
177 177
                             <div class="col-sm-offset-3 col-sm-6">
178
-                                <button type="submit" class="btn btn-primary"  >保存</button>
179
-                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
178
+                                <button type="submit" class="btn btn-primary"  >${I18n.system_save}</button>
179
+                                <button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
180 180
                                 <input type="hidden" name="id" >
181 181
                             </div>
182 182
                         </div>

+ 36 - 36
xxl-job-admin/src/main/webapp/static/js/jobgroup.index.1.js Прегледај датотеку

@@ -4,7 +4,7 @@ $(function() {
4 4
 	$('.remove').on('click', function(){
5 5
 		var id = $(this).attr('id');
6 6
 
7
-		layer.confirm('确认删除分组?', {icon: 3, title:'系统提示'}, function(index){
7
+		layer.confirm( (I18n.system_ok + I18n.jobgroup_del + '?') , {icon: 3, title: I18n.system_tips }, function(index){
8 8
 			layer.close(index);
9 9
 
10 10
 			$.ajax({
@@ -15,8 +15,8 @@ $(function() {
15 15
 				success : function(data){
16 16
 					if (data.code == 200) {
17 17
 						layer.open({
18
-							title: '系统提示',
19
-							content: '删除成功',
18
+							title: I18n.system_tips ,
19
+							content: (I18n.jobgroup_del + I18n.system_success),
20 20
 							icon: '1',
21 21
 							end: function(layero, index){
22 22
 								window.location.reload();
@@ -24,8 +24,8 @@ $(function() {
24 24
 						});
25 25
 					} else {
26 26
 						layer.open({
27
-							title: '系统提示',
28
-							content: (data.msg || "删除失败"),
27
+							title: I18n.system_tips,
28
+							content: (data.msg || (I18n.jobgroup_del + I18n.system_fail)),
29 29
 							icon: '2'
30 30
 						});
31 31
 					}
@@ -40,7 +40,7 @@ $(function() {
40 40
 		var length = value.length;
41 41
 		var valid = /^[a-z][a-zA-Z0-9-]*$/;
42 42
 		return this.optional(element) || valid.test(value);
43
-	}, "限制以小写字母开头,由小写字母、数字和中划线组成");
43
+	}, I18n.jobgroup_field_appName_limit );
44 44
 
45 45
 	$('.add').on('click', function(){
46 46
 		$('#addModal').modal({backdrop: false, keyboard: false}).modal('show');
@@ -67,18 +67,18 @@ $(function() {
67 67
 		},
68 68
 		messages : {
69 69
 			appName : {
70
-				required :"请输入“AppName",
71
-				rangelength:"AppName长度限制为4~64",
72
-				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
70
+				required : I18n.system_please_input+"AppName",
71
+				rangelength: I18n.jobgroup_field_appName_length ,
72
+				myValid01: I18n.jobgroup_field_appName_limit
73 73
 			},
74 74
 			title : {
75
-				required :"请输入“执行器名称”",
76
-				rangelength:"长度限制为4~12"
75
+				required : I18n.system_please_input + I18n.jobgroup_field_title ,
76
+				rangelength: I18n.jobgroup_field_title_length
77 77
 			},
78 78
 			order : {
79
-				required :"请输入“排序”",
80
-				digits: "请输入整数",
81
-				range: "取值范围为1~1000"
79
+				required : I18n.system_please_input + I18n.jobgroup_field_order ,
80
+				digits: I18n.jobgroup_field_order_digits ,
81
+				range: I18n.jobgroup_field_orderrange
82 82
 			}
83 83
 		},
84 84
 		highlight : function(element) {
@@ -96,8 +96,8 @@ $(function() {
96 96
 				if (data.code == "200") {
97 97
 					$('#addModal').modal('hide');
98 98
 					layer.open({
99
-						title: '系统提示',
100
-						content: '新增成功',
99
+						title: I18n.system_tips ,
100
+						content: I18n.system_add_suc ,
101 101
 						icon: '1',
102 102
 						end: function(layero, index){
103 103
 							window.location.reload();
@@ -105,8 +105,8 @@ $(function() {
105 105
 					});
106 106
 				} else {
107 107
 					layer.open({
108
-						title: '系统提示',
109
-						content: (data.msg || "新增失败"),
108
+						title: I18n.system_tips,
109
+						content: (data.msg || I18n.system_add_fail  ),
110 110
 						icon: '2'
111 111
 					});
112 112
 				}
@@ -171,20 +171,20 @@ $(function() {
171 171
 			}
172 172
 		},
173 173
 		messages : {
174
-			appName : {
175
-				required :"请输入“AppName”",
176
-				rangelength:"AppName长度限制为4~64",
177
-				myValid01: "限制以小写字母开头,由小写字母、数字和中划线组成"
178
-			},
179
-			title : {
180
-				required :"请输入“执行器名称”",
181
-				rangelength:"长度限制为4~12"
182
-			},
183
-			order : {
184
-				required :"请输入“排序”",
185
-				digits: "请输入整数",
186
-				range: "取值范围为1~1000"
187
-			}
174
+            appName : {
175
+                required : I18n.system_please_input+"AppName",
176
+                rangelength: I18n.jobgroup_field_appName_length ,
177
+                myValid01: I18n.jobgroup_field_appName_limit
178
+            },
179
+            title : {
180
+                required : I18n.system_please_input + I18n.jobgroup_field_title ,
181
+                rangelength: I18n.jobgroup_field_title_length
182
+            },
183
+            order : {
184
+                required : I18n.system_please_input + I18n.jobgroup_field_order ,
185
+                digits: I18n.jobgroup_field_order_digits ,
186
+                range: I18n.jobgroup_field_orderrange
187
+            }
188 188
 		},
189 189
 		highlight : function(element) {
190 190
 			$(element).closest('.form-group').addClass('has-error');
@@ -202,8 +202,8 @@ $(function() {
202 202
 					$('#addModal').modal('hide');
203 203
 
204 204
 					layer.open({
205
-						title: '系统提示',
206
-						content: '更新成功',
205
+						title: I18n.system_tips ,
206
+						content: I18n.system_update_suc ,
207 207
 						icon: '1',
208 208
 						end: function(layero, index){
209 209
 							window.location.reload();
@@ -211,8 +211,8 @@ $(function() {
211 211
 					});
212 212
 				} else {
213 213
 					layer.open({
214
-						title: '系统提示',
215
-						content: (data.msg || "更新失败"),
214
+						title: I18n.system_tips,
215
+						content: (data.msg || I18n.system_update_fail  ),
216 216
 						icon: '2'
217 217
 					});
218 218
 				}

+ 3 - 3
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js Прегледај датотеку

@@ -125,9 +125,9 @@ $(function() {
125 125
 									'<button class="btn btn-primary btn-xs job_operate" _type="job_trigger" type="button">'+ I18n.jobinfo_opt_run +'</button>  '+
126 126
 									pause_resume +
127 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>  '+
128
+									'<button class="btn btn-warning btn-xs update" type="button">'+ I18n.system_opt_edit +'</button>  '+
129 129
 									codeBtn +
130
-									'<button class="btn btn-danger btn-xs job_operate" _type="job_del" type="button">'+ I18n.jobinfo_opt_del +'</button>  '+
130
+									'<button class="btn btn-danger btn-xs job_operate" _type="job_del" type="button">'+ I18n.system_opt_del +'</button>  '+
131 131
 									'</p>';
132 132
 
133 133
 	                			return html;
@@ -192,7 +192,7 @@ $(function() {
192 192
 			url = base_url + "/jobinfo/resume";
193 193
 			needFresh = true;
194 194
 		} else if ("job_del" == type) {
195
-			typeName = I18n.jobinfo_opt_del ;
195
+			typeName = I18n.system_opt_del ;
196 196
 			url = base_url + "/jobinfo/remove";
197 197
 			needFresh = true;
198 198
 		} else if ("job_trigger" == type) {