← Back
Editing: column-legacy.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 n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){r(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 r(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return n};var e,n={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:P(t,n,u)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h="suspendedStart",v="suspendedYield",m="executing",y="completed",b={};function g(){}function w(){}function x(){}var k={};f(k,l,(function(){return this}));var C=Object.getPrototypeOf,O=C&&C(C(H([])));O&&O!==r&&i.call(O,l)&&(k=O);var j=x.prototype=g.prototype=Object.create(k);function L(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,n){function r(o,a,u,l){var c=d(e[o],e,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,u,l)}),(function(t){r("throw",t,u,l)})):n.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return r("throw",t,u,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new n((function(n,o){r(t,e,n,o)}))}return o=o?o.then(i,i):i()}})}function P(t,n,r){var o=h;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var l=_(u,r);if(l){if(l===b)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=d(t,n,r);if("normal"===c.type){if(o=r.done?y:v,c.arg===b)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function _(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,_(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function S(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 V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function H(n){if(n||""===n){var r=n[l];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(i.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(n)+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},L(E.prototype),f(E.prototype,c,(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()}))},L(j),f(j,s,"Generator"),f(j,l,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=H,N.prototype={constructor:N,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(V),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function r(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;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,b):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),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),V(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:H(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},n}function i(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var r,a,u,l,c,s,f,p,d,h,v,m,y,b,g,w,x,k,C,O,j,L,E,P,_,S,V;return{setters:[function(t){r=t.bj,a=t.aA,u=t.r,l=t.bk,c=t.b,s=t.bl,f=t.A,p=t._,d=t.q,h=t.aV,v=t.w,m=t.bm},function(t){y=t.c,b=t.r,g=t.aG,w=t.w,x=t.g,k=t.e,C=t.B,O=t.m,j=t.T,L=t.an,E=t.ao,P=t.ap,_=t.aB,S=t.i},function(t){V=t._}],execute:function(){var e=c(),N=function(){var t,n=(t=o().mark((function t(n,r){var i,a,u,c;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.id,a=n.ps,u=e.load("正在修改备注信息,请稍后..."),t.prev=2,t.next=5,l({id:i,table:r,ps:a});case 5:c=t.sent,e.request(c),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2);case 12:return t.prev=12,u.close(),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[2,9,12,15]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function u(t){i(a,r,o,u,l,"next",t)}function l(t){i(a,r,o,u,l,"throw",t)}u(void 0)}))});return function(t,e){return n.apply(this,arguments)}}(),H=t("o",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"path";r(),a("Path",t[e]),u.push({path:"/files"})})),B=y({props:{onClickPwd:{type:Function,required:!0},modelValue:{type:String,default:""}},setup:function(t){var e=s("copy",16),n=b(!1),r=b(!0);g((function(){r.value=!!t.modelValue})),w((function(){return t.modelValue}),(function(){n.value=!1}));var o=x((function(){return n.value?"svgtofont-icon-eye-close":"svgtofont-icon-browse"})),i=function(){return t.onClickPwd()};return function(){return k("div",null,[r.value?k("div",{class:"flex items-center"},[n.value?k("span",{class:"block truncate max-w-[140px]"},[t.modelValue]):k("span",null,[C("**********")]),k("i",{class:"mx-4 cursor-pointer text-[#333] text-[15px] ".concat(o.value),title:"显示密码",onClick:function(){return n.value=!n.value}},null),k("i",{id:e,"data-clipboard-text":t.modelValue,class:"svgtofont-el-document-copy cursor-pointer text-[#333] text-[15px] copy svgtofont-icon-copy",title:"复制密码",onClick:function(){return e=t.modelValue,void f({value:e});var e}},null)]):k("div",null,[k("span",{class:"text-[#999]"},[C("无法获取密码,请点击"),k("span",{class:"text-danger cursor-pointer",onClick:i},[C("改密")]),C("重置密码!")])])])}}}),T=t("B",y({name:"BtTableStatus",props:{data:{type:Array,default:function(){return["未启动","运行中"]}},isIcon:{type:Boolean,default:!0},modelValue:{type:[Boolean,Number],default:!0}},setup:function(t,e){var n=e.attrs;return function(){return k("span",O({class:"bt-".concat(t.modelValue?"link":"danger")},n),[k("span",{class:"flex items-center"},[k("span",null,[t.data[Number(t.modelValue)]]),t.isIcon&&k("i",{class:"ml-[2px] text-[1.2rem] svgtofont-icon-".concat(t.modelValue?"start":"stop")},null)])])}}}));t("a",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"page",key:"id",isHide:!1,disableds:function(){}};return{type:"CheckBox",width:"all"===t.type?42:36,isHide:t.isHide,renderHeader:function(e,n){var r=[{label:"全选当前页",command:"page-select"},{label:"全选所有项",command:"all-select"},{label:"清空选中项",command:"clear-select"}],o=n.checkAllCheckbox,i=n.checkAllIndeterminate,a=n.handleAllChange,u=n.handleCommandChange;return k("div",{class:"flex items-center justify-center"},[k(j,{modelValue:o.value,"onUpdate:modelValue":function(t){return o.value=t},indeterminate:i.value,onChange:function(e){return a(e,!1,t.key)},class:"!mr-[4px]"},null),"all"===(null==t?void 0:t.type)?k(L,{onCommand:u},{default:function(){return k(p,{icon:"el-arrow-down"},null)},dropdown:function(){var t,e;return k(E,null,"function"==typeof(e=t=r.map((function(t){return k(P,t,{default:function(){return[t.label]}})})))||"[object Object]"===Object.prototype.toString.call(e)&&!S(e)?t:{default:function(){return[t]}})}}):null])},render:function(e,n,r){var o,i=r.handleScopeChange,a=(null===(o=t.disabled)||void 0===o?void 0:o.call(t,e))||!1;return a&&(e.disable_check=!0),k(j,{modelValue:e.keys_scopes_status,"onUpdate:modelValue":function(t){return e.keys_scopes_status=t},disabled:a,onChange:function(r){return i(r,e,n,t.key||"")}},null)}}})),t("d",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{prop:"path"};return{label:t.label||"根目录",prop:t.prop,minWidth:t.width||200,isCustom:!0,render:function(e){return k("span",{class:"flex !justify-start inline-block bt-link leading-[16px]",onClick:function(){return H(e,t.prop)},title:"点击打开目录"},[e[t.prop]])}}})),t("e",(function(t,e){return{width:22,type:"toping",label:t.label||"",subtitle:"置顶",className:"cols-toping",render:function(n){e||(e="sort");var r=t.param||e||"",o=Boolean(n[r])&&"0"!==n[r];return k("div",{onClick:function(){return t.event(n,o?"untop":"top")}},[k("i",{style:"color:".concat(o?"#EFB958":"#C7BDA9"),class:"svgtofont-icon-top cursor-pointer text-[1.6rem] ".concat(o?"":"table-no-top opacity-80")},null)])}}})),t("g",(function(t){return{label:"备注",prop:"ps",isCustom:!0,showOverflowTooltip:!1,width:t.width||120,minWidth:t.minWidth||120,render:function(e){var n,r={lt:"<",gt:">",nbsp:" ",amp:"&",quot:'"',"#x27":"'",apos:"'"},o=t.prop?t.prop:"ps",i=(null===(n=e[o])||void 0===n?void 0:n.replace(/&(lt|gt|nbsp|amp|quot|#x27);/gi,(function(t,e){return r[e]})))||"";return k("input",{type:"text",value:i,class:"bt-table-input w-full",placeholder:"点击编辑备注",onBlur:function(n){var r=n.target;i!==(null==r?void 0:r.value)&&(i=r.value,t.request?t.request(e,i):N({id:e.id,ps:i},t.table))},onKeyup:function(t){if("Enter"===t.key){var e=t.target;null==e||e.blur()}}},null)}}})),t("b",(function(t){return d(t.prop)&&(t.prop="status"),d(t.data)&&(t.data=["未启动","运行中"]),{label:"状态",prop:t.prop,width:t.width||80,minWidth:t.sortable?80:70,isCustom:!0,sortable:t.sortable||!1,render:function(e){var n=!!Number(e[t.prop]);return t.function?t.function(e):(["running","start"].includes(e[t.prop])&&(n=!0),["exited","stop","created"].indexOf(e[t.prop])>-1&&(n=!1),k(T,{modelValue:n,data:t.data,onClick:function(){return t.event(e)}},null))}}})),t("i",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{prop:"password"};return{label:"密码",prop:t.prop||"password",minWidth:130,width:t.width,isCustom:!0,render:function(e){return k(B,{modelValue:e[t.prop||"password"],onClickPwd:function(){return t.event&&t.event(e)}},null)}}})),t("k",(function(t){return{label:"容量",isLtd:!0,minWidth:80,width:t.width||"auto",isCustom:null==t||!t.hasOwnProperty("isCustom")||t.isCustom,render:function(e){var n;if("PHPMOD"===(null==e||null===(n=e.project_config)||void 0===n?void 0:n.type))return"--";var r=!1,o=e.quota,i=!(null!=o&&o.size);if(i)return k("span",{class:"bt-link",onClick:function(){t.event(e,i)}},["未配置"]);var a=1024*o.size*1024,u=Number((o.used/a*100).toFixed(2))||0,l=o.used/1024/1024>0?(o.used/1024/1024).toFixed(2):"0.00";return o.size>0&&o.used>=a&&(r=!0),r?k("span",{class:"bt-link !text-danger",onClick:function(){t.event(e,i)}},["容量已满"]):k("span",{class:u>80?"el-link--danger bt-link":"el-link--primary bt-link",onClick:function(){t.event(e,i)}},[l,C(" / "),o.size,C(" MB")])}}})),t("f",(function(t){return{label:"备份",prop:t.prop,minWidth:180,isCustom:!0,render:function(e){return k("div",{class:"flex items-center"},[k("span",{class:e.backup_count>0?"text-primary cursor-pointer":"text-[#f0ad4e] cursor-pointer",onClick:function(){return t.event?t.event(e,"back"):null}},[e.backup_count>0?"有备份(".concat(e.backup_count,")"):"点击备份"]),k("span",{class:"mx-[4px]"},[C("|")]),k("span",{class:"bt-link",onClick:function(){return t.event?t.event(e,"import"):null}},[C("导入")])])}}})),t("j",(function(t){return n(n({isCustom:!0},t),{},{render:function(e){return k("span",{class:"bt-link",onClick:function(){return t.event?t.event(e):null},title:t.title},[t.text])}})})),t("u",(function(t,e){var n=0;return h(t)||(n=t.reduce((function(t,e){return t+(e.width||40)}),0)+20),{label:(null==e?void 0:e.label)||"操作",align:"right",fixed:e&&"boolean"==typeof e.fixed?e.fixed:"right",width:(null==e?void 0:e.width)||n,render:function(e,n){var r=[],o=t;return h(t)&&(o=t(e)),o.forEach((function(t,i){if(t.render)return r.push(t.render(e,n));if(t.isHide&&t.isHide(e))return!1;if(t.isMore){var a=t.menu.filter((function(t){return"function"==typeof t.isHide?!t.isHide(e):!t.isHide}));return r.push(k(L,{class:"h-[1.6rem]",onCommand:function(n){return t.onClick(n,e)}},{default:function(){return k("span",{class:"text-primary flex items-center"},[C("更多"),k("span",{class:"svgtofont-el-arrow-down"},null)])},dropdown:function(){return k(E,null,{default:function(){return a.map((function(t){return k(P,{command:t.key},{default:function(){return[t.title]}})}))}})}})),!1}var u="function"==typeof t.isHide&&t.isHide(e);r.push(k("span",{onClick:function(r){return t.onClick(e,n,r)},title:t.title,class:u?"hidden":"bt-link"},[t.title])),o.length-1!==i&&r.push(k(V,null,null))})),_("div",r)}}})),t("h",(function(t){return{label:"大小",prop:t.prop,width:t.width||80,render:function(e){return v(Number(e[t.prop||"size"]),!0)}}})),t("c",(function(){return{label:"操作结果",prop:"batchStatus",width:124,showOverflowTooltip:!0,render:function(t){var e={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'"},n=function(){switch(t.batchStatus){case 0:return"等待执行";case 1:return"执行成功";case 2:return(null==t?void 0:t.message)||(null==t?void 0:t.msg)||"执行失败"}return"-"}().replace(/&|<|>|"|'|'/g,(function(t){return e[t]}));return k("div",{innerHTML:n,class:"inline-clock truncate !w-[10rem] ".concat(t.batchStatus?1===t.batchStatus?"text-primary":"text-danger":"text-warning")},null)}}})),t("l",(function(t){return{label:t.label||"状态",prop:t.prop||"status",width:80,render:function(e){var n=t.prop||"status";return k(m,{modelValue:e[n],"onUpdate:modelValue":function(t){return e[n]=t},onChange:function(n){return t.event(n,e)},size:t.size||"small"},null)}}}))}}}))}();
Save File
Cancel