
1、https://gitee.com/aizuda/easy-retry/issues/I8GRJP 2、Dashboard 添加任务调度数据展示 3、新增重试、定时饼图、任务列表 4、根据后台mode配置动态重试、定时权限
3 lines
17 KiB
JavaScript
3 lines
17 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4a530ef8","chunk-672e297b"],{"119c":function(t,e,r){"use strict";r.r(e);r("ac1f"),r("5319"),r("b0c0");var n=function(){var t=this,e=this,r=e._self._c;return r("div",[e.showHeader?r("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return e.$router.replace("/job/batch/list")}}},[r("div")]):e._e(),null!==e.jobBatchInfo?r("a-card",{attrs:{bordered:!1}},[r("a-descriptions",{attrs:{title:"",column:e.column,bordered:""}},[r("a-descriptions-item",{attrs:{label:"组名称"}},[e._v(" "+e._s(e.jobBatchInfo.groupName)+" ")]),r("a-descriptions-item",{attrs:{label:"任务名称"}},[e._v(" "+e._s(e.jobBatchInfo.jobName)+" ")]),r("a-descriptions-item",{attrs:{label:"状态"}},[r("a-tag",{attrs:{color:e.taskBatchStatus[e.jobBatchInfo.taskBatchStatus].color}},[e._v(" "+e._s(e.taskBatchStatus[e.jobBatchInfo.taskBatchStatus].name)+" ")])],1),r("a-descriptions-item",{attrs:{label:"执行器类型"}},[r("a-tag",{attrs:{color:e.executorType[e.jobBatchInfo.executorType].color}},[e._v(" "+e._s(e.executorType[e.jobBatchInfo.executorType].name)+" ")])],1),r("a-descriptions-item",{attrs:{label:"操作原因"}},[r("a-tag",{attrs:{color:e.operationReason[e.jobBatchInfo.operationReason].color}},[e._v(" "+e._s(e.operationReason[e.jobBatchInfo.operationReason].name)+" ")])],1),r("a-descriptions-item",{attrs:{label:"开始执行时间"}},[e._v(" "+e._s(e.jobBatchInfo.executionAt)+" ")]),r("a-descriptions-item",{attrs:{label:"执行器名称",span:"4"}},[e._v(" "+e._s(e.jobBatchInfo.executorInfo)+" ")]),r("a-descriptions-item",{attrs:{label:"创建时间"}},[e._v(" "+e._s(e.jobBatchInfo.createDt)+" ")])],1)],1):e._e(),r("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[r("span",{staticStyle:{"padding-left":"18px"}},[e._v("任务项列表")]),r("span",{staticStyle:{"padding-left":"18px"}},[r("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.JobTaskListRef.refreshTable(t.queryParam)}}})],1)]),r("JobTaskList",{ref:"JobTaskListRef"})],1)},o=[],a=(r("a9e3"),r("3b7a")),i=r("c1df"),c=r.n(i),s=r("38b7"),u=r.n(s),l=r("36e8"),f={name:"JobInfo",components:{JobTaskList:l["default"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{jobBatchInfo:null,taskBatchStatus:u.a.taskBatchStatus,operationReason:u.a.operationReason,taskType:u.a.taskType,triggerType:u.a.triggerType,blockStrategy:u.a.blockStrategy,executorType:u.a.executorType,queryParam:{}}},created:function(){var t=this.$route.query.id,e=this.$route.query.groupName;t&&e?this.jobBatchDetail(t):this.showHeader&&this.$router.push({path:"/404"})},methods:{parseDate:function(t){return c()(t).format("YYYY-MM-DD HH:mm:ss")},jobBatchDetail:function(t){var e=this;Object(a["d"])(t).then((function(r){e.jobBatchInfo=r.data,e.queryParam={groupName:e.jobBatchInfo.groupName,taskBatchId:t},e.$refs.JobTaskListRef.refreshTable(e.queryParam)}))}}},d=f,h=r("2877"),p=Object(h["a"])(d,n,o,!1,null,"aa07bd40",null);e["default"]=p.exports},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("d3b7");function n(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var i=t.apply(e,r);function c(t){n(i,o,a,c,s,"next",t)}function s(t){n(i,o,a,c,s,"throw",t)}c(void 0)}))}}},"36e8":function(t,e,r){"use strict";r.r(e);r("b0c0");var n=function(){var t=this,e=t._self._c;return e("a-card",{attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{layout:"inline"}},[e("a-row",{attrs:{gutter:48}})],1)],1),e("div",{staticClass:"table-operator"},[t.selectedRowKeys.length>0?e("a-dropdown",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}]},[e("a-button",{staticStyle:{"margin-left":"8px"}},[t._v(" 批量操作 "),e("a-icon",{attrs:{type:"down"}})],1)],1):t._e()],1),e("a-table",{attrs:{columns:t.columns,dataSource:t.data,pagination:t.pagination,loading:t.memberLoading,scroll:{x:1200},rowKey:"id"},on:{expand:t.getRows},scopedSlots:t._u([{key:"serial",fn:function(r,n){return e("span",{},[t._v(" "+t._s(n.id)+" ")])}},{key:"taskStatus",fn:function(r){return e("span",{},[e("a-tag",{attrs:{color:t.taskStatus[r].color}},[t._v(" "+t._s(t.taskStatus[r].name)+" ")])],1)}},{key:"clientInfo",fn:function(r){return e("span",{},[t._v(" "+t._s(""!==r?r.split("@")[1]:"")+" ")])}},{key:"expandedRowRender",fn:function(r){return e("a-table",{attrs:{columns:t.logColumns,"data-source":r.logData,pagination:!1,rowKey:"id"},scopedSlots:t._u([{key:"serial",fn:function(r,n){return e("span",{},[t._v(" "+t._s(n.id)+" ")])}}])})}}])})],1)},o=[],a=r("5530"),i=r("c7eb"),c=r("1da1"),s=(r("4de4"),r("d3b7"),r("261e")),u=r("27e3"),l=r("2af9"),f=r("3b7a"),d=r("38b7"),h=r.n(d),p=r("c1df"),b=r.n(p),m={name:"JobTaskList",components:{AInput:u["a"],ATextarea:s["a"],STable:l["i"]},data:function(){var t=this;return{currentComponet:"List",visible:!1,advanced:!1,queryParam:{},data:[],logData:[],taskStatus:h.a.taskStatus,columns:[{title:"ID",scopedSlots:{customRender:"serial"},width:"8%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo",scopedSlots:{customRender:"clientInfo"}},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus",scopedSlots:{customRender:"taskStatus"}},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"10%"}],logColumns:[{title:"#",scopedSlots:{customRender:"serial"},width:"5%"},{title:"信息",dataIndex:"message",width:"50%"},{title:"执行时间",dataIndex:"createDt",sorter:!0,customRender:function(t){return b()(t).format("YYYY-MM-DD HH:mm:ss")},width:"10%"}],selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){t.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},optionAlertShow:!1,groupNameList:[],sceneList:[],memberLoading:!1,pagination:{},logPagination:{}}},created:function(){},methods:{loadData:function(t){var e=this.logData.filter((function(e){return e.taskId===t.id}));return e},handleChange:function(t){},toggleAdvanced:function(){this.advanced=!this.advanced},getRows:function(t,e){var r=this;return Object(c["a"])(Object(i["a"])().mark((function n(){return Object(i["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!t){n.next=4;break}return n.next=3,r.fetchLog({taskBatchId:e.taskBatchId,jobId:e.jobId,taskId:e.id},e);case 3:r.$forceUpdate();case 4:case"end":return n.stop()}}),n)})))()},handleOk:function(t){},queryChange:function(){this.fetch()},fetch:function(){var t=this;this.loading=!0,Object(f["h"])(this.queryParam).then((function(e){t.data=e.data;var r=Object(a["a"])({},t.pagination);r.pageSize=e.size,r.current=e.page,r.total=e.total,t.pagination=r,t.loading=!1}))},refreshTable:function(t){this.queryParam=t,this.queryChange()},fetchLog:function(t,e){return Object(c["a"])(Object(i["a"])().mark((function r(){var n;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(f["f"])(t);case 2:n=r.sent,e.logData=n.data;case 4:case"end":return r.stop()}}),r)})))()},onSelectChange:function(t,e){this.selectedRowKeys=t,this.selectedRows=e}}},g=m,y=r("2877"),v=Object(y["a"])(g,n,o,!1,null,null,null);e["default"]=v.exports},"38b7":function(t,e){var r={jobStatusEnum:{0:{name:"关闭",color:"#9c1f1f"},1:{name:"开启",color:"#f5a22d"}},taskType:{1:{name:"集群模式",color:"#d06892"},2:{name:"广播模式",color:"#f5a22d"},3:{name:"分片模式",color:"#e1f52d"}},triggerType:{1:{name:"CRON表达式",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"}},blockStrategy:{1:{name:"丢弃策略",color:"#d06892"},2:{name:"覆盖",color:"#f5a22d"},3:{name:"并行",color:"#e1f52d"}},executorType:{1:{name:"Java",color:"#d06892"}},routeKey:{4:{name:"轮询",color:"#8f68d2"},1:{name:"一致性Hash",color:"#d06892"},2:{name:"随机",color:"#f5a22d"},3:{name:"LRU",color:"#e1f52d"}},taskBatchStatus:{1:{name:"待处理",color:"#64a6ea"},2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"},6:{name:"取消",color:"#f5732d"}},operationReason:{0:{name:""},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"}},taskStatus:{2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"}}};t.exports=r},"3b7a":function(t,e,r){"use strict";r.d(e,"l",(function(){return a})),r.d(e,"j",(function(){return i})),r.d(e,"g",(function(){return c})),r.d(e,"k",(function(){return s})),r.d(e,"a",(function(){return u})),r.d(e,"n",(function(){return l})),r.d(e,"f",(function(){return f})),r.d(e,"h",(function(){return d})),r.d(e,"e",(function(){return h})),r.d(e,"d",(function(){return p})),r.d(e,"c",(function(){return b})),r.d(e,"b",(function(){return m})),r.d(e,"i",(function(){return g})),r.d(e,"m",(function(){return y}));var n=r("b775"),o={jobList:"/job/list",jobDetail:"/job/",saveJob:"/job/",updateJob:"/job/",updateJobStatus:"/job/status",delJob:"/job/",timeByCron:"/job/cron",jobNameList:"/job/job-name/list",triggerJob:"/job/trigger/",jobBatchList:"/job/batch/list",jobBatchDetail:"/job/batch/",stop:"/job/batch/stop/",jobTaskList:"/job/task/list",jobLogList:"/job/log/list"};function a(t){return Object(n["b"])({url:o.triggerJob+t,method:"post"})}function i(t){return Object(n["b"])({url:o.stop+t,method:"post"})}function c(t){return Object(n["b"])({url:o.jobNameList,method:"get",params:t})}function s(t){return Object(n["b"])({url:o.timeByCron,method:"get",params:t})}function u(t){return Object(n["b"])({url:o.delJob+t,method:"delete"})}function l(t){return Object(n["b"])({url:o.updateJobStatus,method:"put",data:t})}function f(t){return Object(n["b"])({url:o.jobLogList,method:"get",params:t})}function d(t){return Object(n["b"])({url:o.jobTaskList,method:"get",params:t})}function h(t){return Object(n["b"])({url:o.jobBatchList,method:"get",params:t})}function p(t){return Object(n["b"])({url:o.jobBatchDetail+t,method:"get"})}function b(t){return Object(n["b"])({url:o.jobList,method:"get",params:t})}function m(t){return Object(n["b"])({url:o.jobDetail+t,method:"get"})}function g(t){return Object(n["b"])({url:o.saveJob,method:"post",data:t})}function y(t){return Object(n["b"])({url:o.updateJob,method:"put",data:t})}},c7eb:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var n=r("53ca");function o(){
|
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
o=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),c=new E(n||[]);return i(a,"_invoke",{value:I(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",b="suspendedYield",m="executing",g="completed",y={};function v(){}function j(){}function w(){}var x={};f(x,s,(function(){return this}));var k=Object.getPrototypeOf,L=k&&k(k(D([])));L&&L!==r&&a.call(L,s)&&(x=L);var _=w.prototype=v.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,c,s){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Object(n["a"])(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function I(e,r,n){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=B(c,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var u=h(e,r,n);if("normal"===u.type){if(o=n.done?g:b,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=g,n.method="throw",n.arg=u.arg)}}}function B(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,B(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Object(n["a"])(e)+" is not iterable")}return j.prototype=w,i(_,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:j,configurable:!0}),j.displayName=f(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===j||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(O.prototype),f(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new O(d(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}}}]); |