Ver código fonte

调度报表

xueli.xue 8 anos atrás
pai
commit
783f4d5b98

+ 6 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java Ver arquivo

@@ -12,6 +12,7 @@ import com.xxl.job.core.registry.RegistHelper;
12 12
 import org.apache.commons.collections.CollectionUtils;
13 13
 import org.apache.commons.lang.StringUtils;
14 14
 import org.apache.commons.lang.time.DateUtils;
15
+import org.apache.commons.lang.time.FastDateFormat;
15 16
 import org.quartz.CronExpression;
16 17
 import org.quartz.SchedulerException;
17 18
 import org.slf4j.Logger;
@@ -329,7 +330,11 @@ public class XxlJobServiceImpl implements IXxlJobService {
329 330
 				triggerCountFailTotal += dayFailCount;
330 331
 			}
331 332
 		} else {
332
-			return new ReturnT<Map<String, Object>>(ReturnT.FAIL_CODE, null);
333
+            for (int i = 4; i > -1; i--) {
334
+                triggerDayList.add(FastDateFormat.getInstance("yyyy-MM-dd").format(DateUtils.addDays(new Date(), -i)));
335
+                triggerDayCountSucList.add(0);
336
+                triggerDayCountFailList.add(0);
337
+            }
333 338
 		}
334 339
 
335 340
 		Map<String, Object> result = new HashMap<String, Object>();

+ 4 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/index.ftl Ver arquivo

@@ -58,10 +58,12 @@
58 58
                             <span class="info-box-number">${jobLogCount}</span>
59 59
 
60 60
                             <div class="progress">
61
-                                <div class="progress-bar" style="width: ${(jobLogSuccessCount*100/jobLogCount)?string("0.00")}%"></div>
61
+                                <div class="progress-bar" <#if jobLogCount gt 0> style="width: ${(jobLogSuccessCount*100/jobLogCount)?string("0.00")}%" </#if> ></div>
62 62
                             </div>
63 63
                             <span class="progress-description">
64
-                                调度成功率:${(jobLogSuccessCount*100/jobLogCount)?string("0.00")}<small>%</small>
64
+                                <#if jobLogCount gt 0>
65
+                                    调度成功率:${(jobLogSuccessCount*100/jobLogCount)?string("0.00")}<small>%</small>
66
+                                </#if>
65 67
                             </span>
66 68
                         </div>
67 69
                     </div>

+ 1 - 1
xxl-job-admin/src/main/webapp/static/js/index.js Ver arquivo

@@ -47,7 +47,7 @@ $(function () {
47 47
                },
48 48
                toolbox: {
49 49
                    feature: {
50
-                       saveAsImage: {}
50
+                       /*saveAsImage: {}*/
51 51
                    }
52 52
                },
53 53
                grid: {