← Back
Editing: index-legacy451.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={},a=Object.prototype,o=a.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.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 h(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,o=Object.create(a.prototype),i=new P(n||[]);return u(o,"_invoke",{value:z(e,r,i)}),o}function v(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var p="suspendedStart",d="suspendedYield",m="executing",y="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,s,(function(){return this}));var k=Object.getPrototypeOf,L=k&&k(k(T([])));L&&L!==a&&o.call(L,s)&&(_=L);var j=x.prototype=b.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(t,r){function n(a,u,i,s){var c=v(t[a],t,u);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):r.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(c.arg)}var a;u(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(o,o):o()}})}function z(e,t,n){var a=p;return function(o,u){if(a===m)throw Error("Generator is already running");if(a===y){if("throw"===o)throw u;return{value:r,done:!0}}for(n.method=o,n.arg=u;;){var i=n.delegate;if(i){var s=q(i,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===p)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var c=v(e,t,n);if("normal"===c.type){if(a=n.done?y:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=y,n.method="throw",n.arg=c.arg)}}}function q(e,t){var n=t.method,a=e.iterator[n];if(a===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,q(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=v(a,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,g;var u=o.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,u=function e(){for(;++a<t.length;)if(o.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=r,e.done=!0,e};return u.next=u}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=x,u(j,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"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,l,"GeneratorFunction")),e.prototype=Object.create(j),e},n.awrap=function(e){return{__await:e}},E(S.prototype),f(S.prototype,c,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,a,o){void 0===o&&(o=Promise);var u=new S(h(e,t,r,a),o);return n.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},E(j),f(j,l,"Generator"),f(j,s,(function(){return this})),f(j,"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=T,P.prototype={constructor:P,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(O),!e)for(var t in this)"t"===t.charAt(0)&&o.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,a){return i.type="throw",i.arg=e,t.next=n,a&&(t.method="next",t.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var s=o.call(u,"catchLoc"),c=o.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.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&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},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),O(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 a=n.arg;O(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(e,t,r,n,a,o,u){try{var i=e[o](u),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,a)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var u=e.apply(t,n);function i(e){r(u,a,o,i,s,"next",e)}function s(e){r(u,a,o,i,s,"throw",e)}i(void 0)}))}}function a(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./cataluge-setting-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var o,u,i,s,c,l,f,h,v,p,d,m,y,g,b,w,x,_,k,L,j,E,S,z,q,N,O,P,T;return{setters:[function(e){o=e.u,u=e.L,i=e.at,s=e.K,c=e.p,l=e.M,f=e.al},function(e){h=e.getWebdavConf,v=e.removeAuth,p=e.setNginxAuth,d=e.setWebdav,m=e.removeWebdav,y=e.addWebdav,g=e.getXfsDisk,b=e.getPathQuota,w=e.setSiteQuota,x=e.setClientMaxBodySize},function(e){_=e.e,k=e.g,L=e.r,j=e.k,E=e.c,S=e.q,z=e.v,q=e.x,N=e.P},function(e){O=e.p},function(e){P=e.u},function(e){T=e.default}],execute:function(){var A=P().siteInfo,I=o(),G=I.payment,F=I.enterpriseRec,M=G.value.authType,W=[{label:"网站目录",name:"catalugeTab",lazy:!0,render:function(){return _(T,null,null)}}].concat(a(F.value?[{label:"网站配额",lazy:!0,name:"flowQuota",render:function(){return u((function(){return r.import("./capacity-quota-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}}]:[]),[{label:"nginx WebDav",lazy:!0,name:"nginxWebDav",render:function(){return u((function(){return r.import("./nginx-web-dav-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}}]),B=k((function(){var e;return(null===(e=A.value)||void 0===e?void 0:e.tabName)||"catalugeTab"})),C=e("j",L(!1)),D=L(!1),Q=e("w",L(!1)),U=e("n",L({auth:!1,site_name:"",site_path:"",domain:"",status:!1,user:"",pass:"",client_max_body_size:""})),V=e("k",L({domain:""})),Y=e("g",n(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,h({site_name:A.value.name});case 3:if(r=e.sent,n=r.data,Q.value=!n.need_create||!1,D.value=n.status,!n.need_create){e.next=9;break}return e.abrupt("return");case 9:U.value=Object.assign(U.value,n),U.value.auth=!!n.auth,n.auth&&(U.value.user=n.auth.auth_name,U.value.pass=n.auth.auth_value),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),i(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})))),H=(e("e",function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:U.value.auth=Boolean(r),r||(U.value.user="",U.value.pass="",s({loading:"正在设置状态,请稍后...",request:v({site_name:A.value.name}),message:!0}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e("s",n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s({loading:"正在保存,请稍后...",request:p({site_name:A.value.name,auth_name:U.value.user,auth_value:U.value.pass}),message:!0});case 1:case"end":return e.stop()}}),e)})))),e("h",function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U.value.status=!Boolean(r),e.next=3,s({loading:"正在设置状态,请稍后...",request:d({site_name:A.value.name,option:r?1:0}),message:!0});case 3:e.sent.status&&(U.value.status=Boolean(r));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e("d",n(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=A.value.name,e.next=3,c({title:"删除【".concat(r,"】webdav"),content:"是否删除【".concat(r,"】webdav,删除后将不再对域名进行限制?"),icon:"warning-filled"});case 3:return e.next=5,s({loading:"正在删除webdav,请稍后...",request:m({site_name:r}),message:!0});case 5:e.sent.status&&Y();case 7:case"end":return e.stop()}}),e)})))),e("p",n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({loading:"正在添加,请稍后...",request:y({domain:V.value.domain,site_id:A.value.id}),message:!0});case 2:H(),Y();case 4:case"end":return e.stop()}}),e)})))),e("l",(function(){C.value=!1,V.value.domain=""}))),J=e("a",L()),K=e("v",L(!1)),R=e("m",L(!1)),X=e("b",L([])),$=(e("r",{size:[{required:!0,message:"容量不能为空",trigger:["blur"]},{validator:function(e,t,r){Number.isInteger(1*$.size)?r():r(new Error("容量必须为整数"))},trigger:["blur","change"]}],alarmSize:[{required:!0,message:"触发告警大小不能为空",trigger:["blur"]},{validator:function(e,t,r){$.status?Number.isInteger(1*$.alarmNum)?r():r(new Error("触发告警大小必须为整数")):r()},trigger:["blur","change"]}],alarmNum:[{required:!0,message:"告警次数不能为空",trigger:["blur"]},{validator:function(e,t,r){$.status?Number.isInteger(1*$.alarmNum)?r():r(new Error("告警次数必须为整数")):r()},trigger:["blur","change"]}],module:[{required:!0,validator:function(e,t,r){$.status&&0===$.module.length?r(new Error("请选择告警方式")):r()},trigger:["blur","change"]}]}),e("c",j({used:0,size:0,status:!1,alarmSize:0,alarmNum:0,alarmModel:[],module:[],option:{}}))),Z=e("u",L()),ee=L(!1),te=function(){if(0!==$.size){var e=1024*$.size*1024;$.size>0&&$.used>=e?Z.value="当前容量已用完":Z.value=($.used/1024/1024).toFixed(2)||0}else Z.value="未配置"},re=(e("i",function(){var e=n(t().mark((function e(r){var n,a,o,u,s,c,l,f,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(K.value=!0,e.prev=1,R.value=!1,X.value=[],n=r||A.value,a=n.quota,r){e.next=24;break}return e.prev=6,e.next=9,g({path:A.value.path});case 9:if(o=e.sent,(u=o.data).status){e.next=15;break}return R.value=!0,X.value=null===(s=u.msg)||void 0===s?void 0:s.split("\n"),e.abrupt("return");case 15:return e.next=17,b({path:A.value.path});case 17:c=e.sent,a=c.data,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(6),i(e.t0);case 24:f=(l=a).quota_storage,h=l.quota_push,f&&($.used=f.used,$.size=f.size),h&&void 0!==h.module&&($.status=h.status,$.alarmSize=h.size,$.alarmNum=h.push_count,$.module=""===h.module?[]:h.module.split(",")),te(),K.value=!1,e.next=34;break;case 31:e.prev=31,e.t1=e.catch(1),i(e.t1);case 34:return e.prev=34,K.value=!1,e.finish(34);case 37:case"end":return e.stop()}}),e,null,[[1,31,34,37],[6,21]])})));return function(t){return e.apply(this,arguments)}}()),e("o",n(t().mark((function e(){var r,n,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=A.value.path,"ltd"===M){e.next=4;break}return O({sourceId:183,disablePro:!0}),e.abrupt("return");case 4:if(n={path:r,quota_type:"site",quota_push:{status:$.status,size:Number($.alarmSize),push_count:Number($.alarmNum),module:$.module.join(",")},quota_storage:{size:Number($.size)}},!$.status||0!==n.quota_push.module.length){e.next=7;break}return e.abrupt("return",l.error("请选择至少一种告警方式"));case 7:if(!(n.quota_storage.size<n.quota_push.size)){e.next=9;break}return e.abrupt("return",l.error("容量配额必须大于触发告警大小"));case 9:return e.next=11,J.value.validate();case 11:return e.prev=11,ee.value=!0,e.next=15,w({data:JSON.stringify(n)});case 15:(a=e.sent).status?l.request(a):l.msg({dangerouslyUseHTMLString:!0,message:a.msg,type:"error",duration:0,showClose:!0}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),i(e.t0);case 22:return e.prev=22,ee.value=!1,e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[11,19,22,25]])})))),e("f",n(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.load("正在设置,请稍后..."),e.prev=1,e.next=4,x({site_name:A.value.name,client_max_body_size:U.value.client_max_body_size});case 4:n=e.sent,l.request(n),Y(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1);case 12:return e.prev=12,r.close(),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})))),E({__name:"index",setup:function(e){return function(e,t){var r=f;return S(),z("div",null,[_(r,{type:"card",modelValue:q(B),"onUpdate:modelValue":t[0]||(t[0]=function(e){return N(B)?B.value=e:null}),options:q(W)},null,8,["modelValue","options"])])}}})),ne=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));e("q",ne)}}}))}();
Save File
Cancel