Sfoglia il codice sorgente

任务列表交互优化,支持查看任务所属执行器的注册节点;

xuxueli 6 anni fa
parent
commit
bee089b89b

+ 1 - 0
doc/XXL-JOB官方文档.md Vedi File

@@ -1520,6 +1520,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
1520 1520
 - 9、[ING]任务触发组件优化,常规1s预加载一次,轮空时主动休眠4s;
1521 1521
 - 10、注册监控线程优化,降低死锁几率;
1522 1522
 - 11、调度组件优化:针对永远不会触发的Cron禁止配置和启动;任务Cron最后一次触发后再也不会触发时,比如一次性任务,主动停止相关任务;
1523
+- 12、任务列表交互优化,支持查看任务所属执行器的注册节点;
1523 1524
 
1524 1525
 
1525 1526
 ### TODO LIST

+ 7 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java Vedi File

@@ -158,4 +158,11 @@ public class JobGroupController {
158 158
 		return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL;
159 159
 	}
160 160
 
161
+	@RequestMapping("/loadById")
162
+	@ResponseBody
163
+	public ReturnT<XxlJobGroup> loadById(int id){
164
+		XxlJobGroup jobGroup = xxlJobGroupDao.load(id);
165
+		return jobGroup!=null?new ReturnT<XxlJobGroup>(jobGroup):new ReturnT<XxlJobGroup>(ReturnT.FAIL_CODE, null);
166
+	}
167
+
161 168
 }

+ 3 - 2
xxl-job-admin/src/main/resources/i18n/message.properties Vedi File

@@ -125,8 +125,9 @@ jobinfo_shard_index=分片序号
125 125
 jobinfo_shard_total=分片总数
126 126
 jobinfo_opt_stop=停止
127 127
 jobinfo_opt_start=启动
128
-jobinfo_opt_log=日志
129
-jobinfo_opt_run=执行
128
+jobinfo_opt_log=查询日志
129
+jobinfo_opt_run=执行一次
130
+jobinfo_opt_registryinfo=注册节点
130 131
 jobinfo_glue_remark=源码备注
131 132
 jobinfo_glue_remark_limit=源码备注长度限制为4~100
132 133
 jobinfo_glue_rollback=版本回溯

+ 3 - 2
xxl-job-admin/src/main/resources/i18n/message_en.properties Vedi File

@@ -125,8 +125,9 @@ jobinfo_shard_index=Shard index
125 125
 jobinfo_shard_total=Shard total
126 126
 jobinfo_opt_stop=Stop
127 127
 jobinfo_opt_start=Start
128
-jobinfo_opt_log=Log
129
-jobinfo_opt_run=Run
128
+jobinfo_opt_log=Query Log
129
+jobinfo_opt_run=Run Once
130
+jobinfo_opt_registryinfo=Registry Info
130 131
 jobinfo_glue_remark=Resource Remark
131 132
 jobinfo_glue_remark_limit=Resource Remark length is limited to 4~100
132 133
 jobinfo_glue_rollback=Version Backtrack

+ 40 - 1
xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js Vedi File

@@ -133,9 +133,10 @@ $(function() {
133 133
                                     '     </button>\n' +
134 134
                                     '     <ul class="dropdown-menu" role="menu" _id="'+ row.id +'" >\n' +
135 135
                                     '       <li><a href="javascript:void(0);" class="job_trigger" >'+ I18n.jobinfo_opt_run +'</a></li>\n' +
136
-                                    start_stop_div +
137 136
                                     '       <li><a href="'+ logHref +'">'+ I18n.jobinfo_opt_log +'</a></li>\n' +
137
+                                    '       <li><a href="javascript:void(0);" class="job_registryinfo" >' + I18n.jobinfo_opt_registryinfo + '</a></li>\n' +
138 138
                                     '       <li class="divider"></li>\n' +
139
+                                    start_stop_div +
139 140
                                     codeBtn +
140 141
                                     '       <li><a href="javascript:void(0);" class="update" >'+ I18n.system_opt_edit +'</a></li>\n' +
141 142
                                     '       <li><a href="javascript:void(0);" class="job_operate" _type="job_del" >'+ I18n.system_opt_del +'</a></li>\n' +
@@ -276,6 +277,44 @@ $(function() {
276 277
         $("#jobTriggerModal .form")[0].reset();
277 278
     });
278 279
 
280
+
281
+    // job registryinfo
282
+    $("#job_list").on('click', '.job_registryinfo',function() {
283
+        var id = $(this).parents('ul').attr("_id");
284
+        var row = tableData['key'+id];
285
+
286
+        var jobGroup = row.jobGroup;
287
+
288
+        $.ajax({
289
+            type : 'POST',
290
+            url : base_url + "/jobgroup/loadById",
291
+            data : {
292
+                "id" : jobGroup
293
+            },
294
+            dataType : "json",
295
+            success : function(data){
296
+
297
+                var html = '<center>';
298
+                if (data.code == 200 && data.content.registryList) {
299
+                    for (var index in data.content.registryList) {
300
+                        html += '<span class="badge bg-green" >' + data.content.registryList[index] + '</span><br>';
301
+                    }
302
+                }
303
+                html += '</center>';
304
+
305
+                layer.open({
306
+                    title: I18n.jobinfo_opt_registryinfo ,
307
+                    btn: [ I18n.system_ok ],
308
+                    content: html
309
+                });
310
+
311
+            }
312
+        });
313
+
314
+
315
+
316
+    });
317
+
279 318
 	// add
280 319
 	$(".add").click(function(){
281 320