← Back
Editing: repair-crontab-legacy.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(r){s=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),u=new G(n||[]);return i(a,"_invoke",{value:V(e,r,u)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",w={};function g(){}function b(){}function x(){}var L={};s(L,l,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(F([])));_&&_!==o&&a.call(_,l)&&(L=_);var k=x.prototype=g.prototype=Object.create(L);function j(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,r){function n(o,i,u,l){var c=p(t[o],t,i);if("throw"!==c.type){var f=c.arg,s=f.value;return s&&"object"==e(s)&&a.call(s,"__await")?r.resolve(s.__await).then((function(e){n("next",e,u,l)}),(function(e){n("throw",e,u,l)})):r.resolve(s).then((function(e){f.value=e,u(f)}),(function(e){return n("throw",e,u,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function V(e,t,n){var o=y;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var l=S(u,n);if(l){if(l===w)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=p(e,t,n);if("normal"===c.type){if(o=n.done?m:v,c.arg===w)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var a=p(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,w;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,w):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,w)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function G(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=s(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,s(e,f,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},j(O.prototype),s(O.prototype,c,(function(){return this})),n.AsyncIterator=O,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new O(h(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},j(k),s(k,f,"Generator"),s(k,l,(function(){return this})),s(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=F,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,w):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:F(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),w}},n}function r(e,t,r,n,o,a,i){try{var u=e[a](i),l=u.value}catch(e){return void r(e)}u.done?t(l):Promise.resolve(l).then(n,o)}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var o,a,i,u,l,c,f,s,h,p,y,v,d,m,w,g,b,x,L,E,_;return{setters:[function(e){o=e.c,a=e.r,i=e.U,u=e.w,l=e.p,c=e.q,f=e.M,s=e.A,h=e.e,p=e.y,y=e.x,v=e.C,d=e.B,m=e.z,w=e.k,g=e.a9,b=e.a7},function(e){x=e.M,L=e.ag,E=e.k},function(e){_=e.bs},null],execute:function(){var n={class:"flex"};e("default",o({__name:"repair-crontab",props:{compData:{default:function(){}}},setup:function(e,o){var k=o.expose,j=e,O=a(null),V=a({type:"day",week:1,where1:1,hour:1,minute:19}),S=i([{label:"每天",value:"day"},{label:"N天",value:"day-n"},{label:"每星期",value:"week"},{label:"每月",value:"month"}]),N=i([{label:"周一",value:1},{label:"周二",value:2},{label:"周三",value:3},{label:"周四",value:4},{label:"周五",value:5},{label:"周六",value:6},{label:"周日",value:7}]);u((function(){return j.compData}),(function(e){G("day")}));var P={type:[{validator:function(e,t,r){return"day-n"!==t&&"month"!==t||!(V.value.where1<0||V.value.where1>31)?V.value.hour<0||V.value.hour>23?r(new Error("请输入正确小时范围[0-23]")):V.value.minute<0||V.value.minute>59?r(new Error("请输入正确分钟范围[0-59]")):void r():r(new Error("请输入正确天数范围[0-31]"))},trigger:["blur","change"]}]},G=function(e){V.value.type=e;var t=Math.round(5*Math.random()),r=Math.round(59*Math.random());V.value.hour=t,V.value.minute=r,"day-n"===e?V.value.where1=3:"week"===e?V.value.week=1:V.value.where1=3},F=function(){O.value.resetFields(),j.compData.refreshEvent()},M=function(){var e,n=(e=t().mark((function e(r){var n,o,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O.value.validate();case 2:return n=x.load("正在处理中,请稍后..."),e.prev=3,o=w({id:j.compData.id,type:V.value.type,hour:V.value.hour,minute:V.value.minute}),"day-n"!==V.value.type&&"month"!==V.value.type||(o.where1=V.value.where1),"week"===V.value.type&&(o.week=V.value.week),e.next=9,_({data:JSON.stringify(o)});case 9:a=e.sent,x.request(a),F(),r(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3);case 18:return e.prev=18,n.close(),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[3,15,18,21]])})),function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function u(e){r(i,o,a,u,l,"next",e)}function l(e){r(i,o,a,u,l,"throw",e)}u(void 0)}))});return function(e){return n.apply(this,arguments)}}();return l((function(){})),k({onConfirm:M,onCancel:F}),function(e,t){var r=L,o=E,a=g,i=b;return c(),f(i,{ref_key:"repairCronRef",ref:O,model:y(V),rules:P,class:"p-[2rem] addfrom","label-width":"5rem"},{default:s((function(){return[h(a,{label:"检测频率",prop:"type"},{default:s((function(){return[p("div",n,[h(r,{class:"!w-[8rem] mr-4",modelValue:y(V).type,"onUpdate:modelValue":t[0]||(t[0]=function(e){return y(V).type=e}),options:y(S),change:G},null,8,["modelValue","options"]),"week"===y(V).type?(c(),f(r,{key:0,class:"!w-[8rem] mr-4",modelValue:y(V).week,"onUpdate:modelValue":t[1]||(t[1]=function(e){return y(V).week=e}),options:y(N)},null,8,["modelValue","options"])):v("",!0),"day-n"===y(V).type||"month"===y(V).type?(c(),f(o,{key:1,type:"number",class:"mr-4",width:"12rem",min:"0",max:"31",modelValue:y(V).where1,"onUpdate:modelValue":t[2]||(t[2]=function(e){return y(V).where1=e})},{append:s((function(){return[d(m("day-n"===y(V).type?"天":"日"),1)]})),_:1},8,["modelValue"])):v("",!0),h(o,{type:"number",width:"12rem",class:"mr-4",min:"0",max:"23",modelValue:y(V).hour,"onUpdate:modelValue":t[3]||(t[3]=function(e){return y(V).hour=e})},{append:s((function(){return t[5]||(t[5]=[d("小时")])})),_:1},8,["modelValue"]),h(o,{type:"number",width:"12rem",min:"0",max:"59",modelValue:y(V).minute,"onUpdate:modelValue":t[4]||(t[4]=function(e){return y(V).minute=e})},{append:s((function(){return t[6]||(t[6]=[d("分")])})),_:1},8,["modelValue"])])]})),_:1})]})),_:1},8,["model"])}}}))}}}))}();
Save File
Cancel