← Back
Editing: index-legacy396.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",s=u.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),u=new D(n||[]);return i(a,"_invoke",{value:S(e,r,u)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,l,(function(){return this}));var j=Object.getPrototypeOf,k=j&&j(j(G([])));k&&k!==o&&a.call(k,l)&&(_=k);var L=x.prototype=b.prototype=Object.create(_);function O(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function E(t,r){function n(o,i,u,l){var c=h(t[o],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,u,l)}),(function(e){n("throw",e,u,l)})):r.resolve(f).then((function(e){s.value=e,u(s)}),(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 S(e,t,n){var o=d;return function(a,i){if(o===v)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=P(u,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,t,n);if("normal"===c.type){if(o=n.done?m:y,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function P(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,P(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,g;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,g):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function V(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 T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(V,this),this.reset(!0)}function G(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 w.prototype=x,i(L,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},O(E.prototype),f(E.prototype,c,(function(){return this})),n.AsyncIterator=E,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new E(p(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(L),f(L,s,"Generator"),f(L,l,(function(){return this})),f(L,"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=G,D.prototype={constructor:D,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(T),!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,g):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),g},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),T(r),g}},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;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:G(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(t,r,n){return(r=function(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function a(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)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./ssl-legacy.js?v=VERSION_NUMBER","./index-legacy84.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./index-legacy145.js?v=VERSION_NUMBER","./we-com-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy13.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./useStore-legacy12.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useController-legacy5.js?v=VERSION_NUMBER","./useMethod-legacy5.js?v=VERSION_NUMBER","./useController-legacy4.js?v=VERSION_NUMBER","./useStore-legacy10.js?v=VERSION_NUMBER","./useMethod-legacy11.js?v=VERSION_NUMBER","./useStore-legacy11.js?v=VERSION_NUMBER","./useMethod-legacy10.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var o,a,u,l,c,s,f,p,h,d,y,v,m,g,b,w,x,_,j,k,L,O,E,S,P,V,T,D,G,N,q,C,F,U,A;return{setters:[function(e){o=e.c,a=e.K,u=e.fP,l=e.ag,c=e.W},function(e){s=e.c,f=e.s,p=e.r,h=e.e,d=e.B,y=e.p,v=e.n,m=e.a4,g=e.G,b=e.q,w=e.v,x=e.A,_=e.x,j=e.H,k=e.M,L=e.F,O=e.a_,E=e.y,S=e.z,P=e.S,V=e.a9,T=e.a$,D=e.ai,G=e.a7},function(e){N=e.T,q=e.U,C=e.A,F=e.V},function(e){U=e.u,A=e.o},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],execute:function(){var r={class:"p-[16px]"},M={class:"flex items-center"};e("default",s({__name:"index",props:{compData:{}},emits:["close"],setup:function(e,s){var I=s.expose,H=s.emit,R=e.compData,Y=R.isEdit,z=R.row,B=f(U()),K=B.deployFormData,W=B.siteList,$=B.certificateDeployTaskList,J=B.isRefreshDeployTaskList,Q=p(),X=p(!1),Z=p(!1),ee=[{content:"提示:请先在宝塔官网->SSL模块->自动同步中创建同步任务,请不要泄露同步任务的密钥"},{content:h(o,{class:"inline-block",onClick:A},{default:function(){return[h("div",{class:"flex items-center"},[h("span",{class:"text-[1.2rem]"},[">>"]),h("span",null,[d("使用说明")])])]}})}],te={task_name:[{required:!0,message:"请输入名称",trigger:"blur"},{min:2,max:50,message:"长度在 2 到 50 个字符之间",trigger:"blur"}],cloud_id:[{required:!0,message:"请选择证书部署任务",trigger:["blur","change"]}],private_key:[{required:!0,message:"请输入密钥",trigger:"blur"}],sites:[{required:!0,message:"请选择至少一个网站",trigger:"change"},{type:"array",min:1,message:"请选择至少一个网站",trigger:"change"}]},re=function(){window.open("https://www.bt.cn/admin/safe","_blank","noopener,noreferrer")},ne=function(){var e=i(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q.value){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,Q.value.validate();case 5:r=n(n({},K.value),{},{sites:K.value.sites.join(",")}),a({loading:Y?"正在修改同步任务":"正在创建同步任务",message:!0,request:Y?N(r):q(r),success:function(e){e.status&&(J.value=!0,H("close"))}}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=i(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:X.value=!0,a({request:C(),success:function(e){var t=e.data;W.value=t.map((function(e){return{label:e.name,value:e.name}})),X.value=!1}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=i(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Z.value=!0,a({request:F(),success:function(e){$.value=e.data.map((function(e){return{label:e.synchron_name,host:e.host,value:e.id}})),Z.value=!1}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return y((function(){oe(),ae(),v((function(){var e;Y?(K.value.task_id=z.id,K.value.task_name=z.task_name,K.value.cloud_id=z.cloud_id,K.value.private_key=z.private_key,K.value.sites=null===(e=z.sites)||void 0===e?void 0:e.split(",")):K.value.task_name=u(8)}))})),m((function(){K.value={}})),I({onConfirm:ne}),function(e,t){var n=P,a=V,i=T,u=D,s=l,f=o,p=G,d=c,y=g("bt-loading");return b(),w("div",r,[h(p,{ref_key:"formRef",ref:Q,model:_(K),rules:te,"label-width":"120px"},{default:x((function(){return[h(a,{label:"名称",prop:"task_name"},{default:x((function(){return[h(n,{class:"!w-[230px]",placeholder:"请输入名称",disabled:_(Y),modelValue:_(K).task_name,"onUpdate:modelValue":t[0]||(t[0]=function(e){return _(K).task_name=e})},null,8,["disabled","modelValue"])]})),_:1}),h(a,{label:"选择证书部署任务",prop:"cloud_id"},{default:x((function(){return[j((b(),k(s,{class:"!w-[230px]",placeholder:"请选择证书部署任务",modelValue:_(K).cloud_id,"onUpdate:modelValue":t[1]||(t[1]=function(e){return _(K).cloud_id=e})},{default:x((function(){return[(b(!0),w(L,null,O(_($),(function(e){return b(),k(u,{key:e.value,label:e.label,value:e.value},{default:x((function(){return[E("div",M,[E("span",null,S(e.label),1),h(i,{direction:"vertical"}),E("span",null,S(e.host),1)])]})),_:2},1032,["label","value"])})),128))]})),_:1},8,["modelValue"])),[[y,_(Z)]]),h(f,{class:"ml-[12px]",onClick:re},{default:x((function(){return t[4]||(t[4]=[E("div",{class:"flex items-center"},[E("span",{class:"text-[1.2rem]"},">>"),E("span",null,"去创建")],-1)])})),_:1})]})),_:1}),h(a,{label:"密钥",prop:"private_key"},{default:x((function(){return[h(n,{class:"!w-[230px]",placeholder:"请输入密钥",modelValue:_(K).private_key,"onUpdate:modelValue":t[2]||(t[2]=function(e){return _(K).private_key=e})},null,8,["modelValue"]),h(f,{class:"ml-[12px]",onClick:re},{default:x((function(){return t[5]||(t[5]=[E("div",{class:"flex items-center"},[E("span",{class:"text-[1.2rem]"},">>"),E("span",null,"去获取")],-1)])})),_:1})]})),_:1}),h(a,{label:"选择网站",prop:"sites"},{default:x((function(){return[j(h(s,{class:"!w-[230px]",multiple:!0,placeholder:"请选择网站",options:_(W),modelValue:_(K).sites,"onUpdate:modelValue":t[3]||(t[3]=function(e){return _(K).sites=e})},null,8,["options","modelValue"]),[[y,_(X)]])]})),_:1})]})),_:1},8,["model"]),h(d,{options:ee,listStyle:"disc",class:"ml-[20px]"})])}}}))}}}))}();
Save File
Cancel