← Back
Editing: index-legacy89.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=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(r){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof x?e:x,i=Object.create(o.prototype),u=new D(n||[]);return a(i,"_invoke",{value:P(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function x(){}function b(){}function w(){}var _={};f(_,c,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(F([])));O&&O!==o&&i.call(O,c)&&(_=O);var L=w.prototype=x.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,r){function n(o,a,u,c){var s=h(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function P(t,e,n){var o=d;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===g)continue;return c}}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=y;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?m:v,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function N(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return b.prototype=w,a(L,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},n.awrap=function(t){return{__await:t}},k(E.prototype),f(E.prototype,s,(function(){return this})),n.AsyncIterator=E,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new E(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(L),f(L,l,"Generator"),f(L,c,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),n.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}},n.values=F,D.prototype={constructor:D,reset:function(t){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),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},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 e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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&&i.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 a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),g},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),T(r),g}},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;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:F(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}function o(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 i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(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}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy399.js?v=VERSION_NUMBER","./version-compare.vue_vue_type_script_setup_true_lang-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,a,u,c,s,l,f,p,h,d,v,y,m,g,x,b,w,_,j,O,L,k,E,P,S,N,T,D,F,G,I;return{setters:[function(t){o=t.c,a=t.bR,u=t.e,c=t.m,s=t.aV,l=t.i,f=t.s,p=t.j,h=t.r,d=t.B,v=t.F,y=t.w,m=t.q,g=t.v,x=t.A,b=t.y,w=t.z,_=t.x,j=t.C},function(t){O=t._},function(t){L=t._},function(t){k=t.w,E=t.fI,P=t.fJ,S=t.b,N=t.fr,T=t.N,D=t.u,F=t.fj},function(t){G=t.u},function(t){I=t.A},null,null],execute:function(){var r=o({name:"BtCard",props:i({},a),setup:function(t,e){var r=e.attrs,n=e.slots;return function(){return u(s,c(r,t),"function"==typeof(e=n)||"[object Object]"===Object.prototype.toString.call(e)&&!l(e)?n:{default:function(){return[n]}});var e}}}),q=S().request,C=p("VHOST-STORAGE-STORE",(function(){var t=h({device:"",mountpoint:"",fstype:"",total:0,used:0,free:0,used_percent:0,inodes_total:0,inodes_used:0,inodes_free:0,inodes_used_percent:0,is_group_quota:!1,is_user_quota:!1,is_default:!1,account_allocate:0,account_percent:0}),r=h(0),o=h(!1),a=h([{label:"挂载点",prop:"mountpoint",minWidth:120},{label:"装置",prop:"device",minWidth:120},{label:"磁盘配额",prop:"is_group_quota",minWidth:140,render:function(t){return t.is_user_quota?u("span",null,[d("是")]):u("div",null,[u("span",{class:"text-warning"},[d("否")]),d(" |")," ",u("span",{class:"text-primary cursor-pointer",onClick:function(){return f(t)}},[d("设置磁盘配额")])])}},{label:"总大小",prop:"total",minWidth:60,render:function(t){return k(t.total)}},{label:"已使用",prop:"used",minWidth:180,render:function(t){var e=Math.round(t.used_percent);return u(v,null,[u("div",{class:"mr-[10px]"},[e,d("% / "),k(t.used)]),u(O,{class:"w-[100px]",percentage:Number(e.toFixed(2)),"text-inside":!0,"stroke-width":14,status:c(e)},null)])}},G([{width:100,disabled:!0,isHide:function(t){return t.is_default&&!o.value},render:function(){return u("span",null,[d("默认磁盘")])}},{title:"重启服务",width:100,onClick:function(){return I()},isHide:function(t){return t.is_default&&!o.value}},{title:"设置默认磁盘",width:100,onClick:function(t){return p(t)},isHide:function(t){return t.is_default&&!o.value}}])]),c=function(t){var e=Math.round(t);return e>80?"exception":e>60?"warning":"success"},s=function(){var r=n(e().mark((function r(){var n,o,a,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:if(n=e.sent,o=n.data,!T(o)){e.next=8;break}return(a=o.find((function(t){return t.is_default})))&&((u=i({},a)).account_percent=Math.round(u.account_allocate/u.total*100),t.value=u),e.abrupt("return",{data:o,total:o.length});case 8:return e.abrupt("return",{data:[],total:0});case 9:case"end":return e.stop()}}),r)})));return function(){return r.apply(this,arguments)}}(),l=function(){r.value=(new Date).getTime()},f=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E(r.mountpoint);case 2:return n=t.sent,t.next=5,q(n);case 5:l();case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,P({mountpoint:r.mountpoint});case 2:return n=t.sent,t.next=5,q(n);case 5:l(),o.value=!0;case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return{defaultDiskInfo:t,columns:a,diskColor:c,refreshInfo:r,refreshList:l,getDiskList:s}})),H={class:"p-[10px]"},A={class:"flex items-center mb-[16px]"},W={class:"flex-1"},B={class:"flex items-center mb-[16px]"},M={class:"flex-1"},R={class:"flex items-center mb-[16px]"},V={class:"flex w-[50rem]"},Y={class:"mr-[2rem] max-w-[20rem] w-[16rem]"},z={class:"flex-1"},J={class:"flex items-center mb-[16px]"},K={class:"flex w-[50rem]"},Q={class:"mr-[2rem] max-w-[20rem] w-[16rem]"},U={class:"flex-1"},X={key:0,class:"text-center text-danger"};t("default",o({__name:"index",setup:function(t){var e,n,o=D().mainHeight,a=(e=C(),n=f(e),i(i({},e),n)),c=a.columns,s=a.getDiskList,l=a.defaultDiskInfo,p=a.diskColor,h=a.refreshInfo,d=F({request:s,columns:c.value}),v=d.BtTable,E=d.refresh;return y((function(){return h.value}),E),function(t,e){var n=O,i=r;return m(),g("div",null,[u(L),u(i,{class:"!border-none mb-[20px]"},{header:x((function(){return e[0]||(e[0]=[b("div",{class:"card-header"},[b("span",null,"预设存储盘")],-1)])})),default:x((function(){return[e[5]||(e[5]=b("div",{class:"p-[16px] text-[14px]"},"创建用户时,用户信息将存储在此空间中",-1)),b("div",H,[b("div",A,[e[1]||(e[1]=b("div",{class:"w-[150px] font-black text-[14px] text-right h-[24px]"},"默认磁盘配额:",-1)),b("div",W,w(_(l).mountpoint),1)]),b("div",B,[e[2]||(e[2]=b("div",{class:"w-[150px] font-black text-[14px] text-right h-[24px]"},"装配:",-1)),b("div",M,w(_(l).device),1)]),b("div",R,[e[3]||(e[3]=b("div",{class:"w-[150px] font-black text-[14px] text-right h-[24px]"},"已使用:",-1)),b("div",V,[b("div",Y,w(_(k)(_(l).used))+"/ "+w(_(k)(_(l).total)),1),b("div",z,[u(n,{percentage:Number(_(l).used_percent.toFixed(2)),"text-inside":"","stroke-width":18,status:_(p)(_(l).used_percent)},null,8,["percentage","status"])])])]),b("div",J,[e[4]||(e[4]=b("div",{class:"w-[150px] font-black text-[14px] text-right h-[24px]"},"已分配:",-1)),b("div",K,[b("div",Q,w(_(k)(_(l).account_allocate))+"/ "+w(_(k)(_(l).total)),1),b("div",U,[u(n,{percentage:Number((_(l).account_allocate/_(l).total*100).toFixed(2)),"text-inside":"","stroke-width":18,status:_(p)(_(l).account_percent)},null,8,["percentage","status"]),_(l).account_percent>100?(m(),g("div",X,"PS:您的空间分配已达上限")):j("",!0)])])])])]})),_:1}),u(i,{class:"!border-none"},{header:x((function(){return e[6]||(e[6]=[b("div",{class:"card-header"},[b("span",null,"可用存储盘")],-1)])})),default:x((function(){return[u(_(v),{class:"mt-[16px]","min-height":_(o)},null,8,["min-height"])]})),_:1})])}}}))}}}))}();
Save File
Cancel