← Back
Editing: index-legacy304.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t)||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 a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return r};var e,r={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",c=u.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(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new I(n||[]);return a(i,"_invoke",{value:N(t,r,u)}),i}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",m="suspendedYield",g="executing",y="completed",d={};function b(){}function w(){}function j(){}var x={};f(x,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(k([])));E&&E!==n&&o.call(E,s)&&(x=E);var O=j.prototype=b.prototype=Object.create(x);function _(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(a,i,u,s){var l=v(e[a],e,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,s)}),(function(t){n("throw",t,u,s)})):r.resolve(f).then((function(t){c.value=t,u(c)}),(function(t){return n("throw",t,u,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return i=i?i.then(o,o):o()}})}function N(t,r,n){var o=h;return function(a,i){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var s=z(u,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=v(t,r,n);if("normal"===l.type){if(o=n.done?y:m,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function z(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,z(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=v(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function P(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 q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,i=function t(){for(;++a<r.length;)if(o.call(r,a))return t.value=r[a],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=j,a(O,"constructor",{value:j,configurable:!0}),a(j,"constructor",{value:w,configurable:!0}),w.displayName=f(j,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,f(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},_(L.prototype),f(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new L(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(O),f(O,c,"Generator"),f(O,s,(function(){return this})),f(O,"toString",(function(){return"[object Generator]"})),r.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}},r.values=k,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(q),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){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(!l)throw 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&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):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),d},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),q(r),d}},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;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},r}function u(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useStore-legacy8.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var n,a,s,l,c,f,p,v,h,m,g,y,d,b,w,j,x,S,E,O,_,L,N,z,P;return{setters:[function(t){n=t.M,a=t.K,s=t.G,l=t.a5,c=t.e},function(t){f=t.s,p=t.j,v=t.r,h=t.k,m=t.c,g=t.g,y=t.e,d=t.B,b=t.p,w=t.a4,j=t.q,x=t.v,S=t.x},function(t){E=t.aH},function(t){O=t.u,_=t.v},function(t){L=t.b,N=t.o,z=t.h,P=t.f},null,null,null],execute:function(){var e=p("FTP-CAPACITY-STORE",(function(){var t=v();return{capacityData:v({used:0,size:0,status:!1,alarmSize:5,alarmNum:1,alarmModel:[],module:[],option:{}}),capFtpInfo:t,useSize:v()}})),q=function(){return f(e())},I=O().rowData,k=q(),T=k.capacityData,A=(k.capFtpInfo,k.useSize);h({size:[{required:!0,message:"容量不能为空",trigger:["blur"]},{validator:function(t,e,r){Number.isInteger(1*T.value.size)?r():r(new Error("容量必须为整数"))},trigger:["blur","change"]}],alarmSize:[{required:!0,message:"触发告警大小不能为空",trigger:["blur"]},{validator:function(t,e,r){T.value.status?Number.isInteger(1*T.value.alarmNum)?r():r(new Error("触发告警大小必须为整数")):r()},trigger:["blur","change"]}],alarmNum:[{required:!0,message:"告警次数不能为空",trigger:["blur"]},{validator:function(t,e,r){T.value.status?Number.isInteger(1*T.value.alarmNum)?r():r(new Error("告警次数必须为整数")):r()},trigger:["blur","change"]}],module:[{required:!0,validator:function(t,e,r){T.value.status&&0===T.value.module.length?r(new Error("请选择告警方式")):r()},trigger:["blur","change"]}]});var F=function(){var t=I.value.quota,e=t.quota_storage,r=t.quota_push;e&&(T.value.used=e.used,T.value.size=e.size),r&&void 0!==r.module&&(T.value.status=r.status,T.value.alarmSize=r.size,T.value.alarmNum=r.push_count,T.value.module=r.module.split(",")),function(){if(0===T.value.size)return A.value="未配置",void(T.value.useSize=A.value);var t=1024*T.value.size*1024;if(T.value.size>0&&T.value.used>=t)return A.value="当前容量已用完",void(T.value.useSize=A.value);A.value=(T.value.used/1024/1024).toFixed(2)||0,T.value.useSize=A.value}()},G=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.value;return{path:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.value).path,quota_type:"ftp",quota_push:{status:e.status,size:Number(e.alarmSize),push_count:Number(e.alarmNum),module:null===(t=e.module)||void 0===t?void 0:t.join(",")},quota_storage:{size:Number(e.size)}}},D=function(){var t,e=(t=i().mark((function t(e,r){var o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r();case 2:if(!(o=G(e.value)).quota_push.status||0!==o.quota_push.module.length){t.next=6;break}return n.error("请选择至少一种告警方式"),t.abrupt("return",!1);case 6:return t.next=8,a({loading:"正在提交,请稍候...",request:_({data:JSON.stringify(o)}),data:{status:Boolean,msg:String}});case 8:return(u=t.sent).status?n.success(u.msg):n.msg({message:u.msg,showClose:!0,dangerouslyUseHTMLString:!0,type:"error",customClass:"bt-message-error-html",duration:0}),t.abrupt("return",u.status);case 11:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){u(a,n,o,i,s,"next",t)}function s(t){u(a,n,o,i,s,"throw",t)}i(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),M=function(){T.value={used:0,size:0,status:!1,alarmSize:0,alarmNum:0,alarmModel:[],module:[],option:{}},I.value={}},B={class:"p-[2rem] container-dialog"},C=m({__name:"index",setup:function(t,e){var n=e.expose,a=q(),i=a.capacityData,u=a.useSize,c=s({data:i.value,options:function(t){var e={class:"!w-[220px]",clearable:!0};return g((function(){return[L("当前已用容量","useSize",{attrs:r(r({},e),{},{disabled:!0}),slots:l(u)?{append:function(){return y("span",{class:"text-gray-500"},[d("MB")])}}:{}}),L("当前容量配额","size",{attrs:r(r({},e),{},{type:"number",min:0}),slots:{append:function(){return y("span",{class:"text-gray-500"},[d("MB")])}},rules:[{required:!0,message:"容量不能为空",trigger:["blur"]},{validator:function(t,e,r){Number.isInteger(1*i.value.size)?r():r(new Error("容量必须为整数"))},trigger:["blur","change"]}]}),N("设置告警","status",{})].concat(o(t.value.status?[L("触发告警大小","alarmSize",{attrs:r(r({},e),{},{type:"number",min:0}),slots:{append:function(){return y("span",{class:"text-gray-500"},[d("MB")])}},rules:[{required:!0,message:"触发告警大小不能为空",trigger:["blur"]},{validator:function(t,e,r){i.value.status?Number.isInteger(1*i.value.alarmNum)?r():r(new Error("触发告警大小必须为整数")):r()},trigger:["blur","change"]}]}),L("触发次数","alarmNum",{attrs:r(r({},e),{},{type:"number",min:0}),slots:{append:function(){return y("span",{class:"text-gray-500"},[d("次")])}},rules:[{required:!0,message:"告警次数不能为空",trigger:["blur"]},{validator:function(t,e,r){i.value.status?Number.isInteger(1*i.value.alarmNum)?r():r(new Error("告警次数必须为整数")):r()},trigger:["blur","change"]}]}),z("告警方式",(function(){return y(E,{class:"!w-[24rem]",modelValue:t.value.module,"onUpdate:modelValue":function(e){return t.value.module=e}},null)}))]:[]),[P("",[{content:"需要XFS文件系统,且包含prjquota挂载参数才能使用"},{content:"fstab配置示例:/dev/vdc1 /data xfs defaults,prjquota 0 0"},{content:"配额容量:如需取消容量配额,请设为“0”"}])])}))},submit:D}),f=c.BtForm;return n({onConfirm:c.submit}),b(F),w(M),function(t,e){return j(),x("div",B,[y(S(f),{"label-width":"10rem"})])}}});t("default",c(C,[["__scopeId","data-v-ee69391d"]]))}}}))}();
Save File
Cancel