← Back
Editing: index-legacy19.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){return function(t){if(Array.isArray(t))return n(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 n(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)?n(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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.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 b?e:b,a=Object.create(o.prototype),i=new N(r||[]);return u(a,"_invoke",{value:C(t,n,i)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var d="suspendedStart",y="suspendedYield",v="executing",g="completed",m={};function b(){}function w(){}function x(){}var _={};f(_,c,(function(){return this}));var j=Object.getPrototypeOf,S=j&&j(j(P([])));S&&S!==o&&a.call(S,c)&&(_=S);var k=x.prototype=b.prototype=Object.create(_);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,u,i,c){var l=h(e[o],e,u);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&a.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):n.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var o;u(this,"_invoke",{value:function(t,e){function a(){return new n((function(n,o){r(t,e,n,o)}))}return o=o?o.then(a,a):a()}})}function C(t,n,r){var o=d;return function(a,u){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===a)throw u;return{value:e,done:!0}}for(r.method=a,r.arg=u;;){var i=r.delegate;if(i){var c=O(i,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var l=h(t,n,r);if("normal"===l.type){if(o=r.done?g:y,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function O(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,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var a=h(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var u=a.arg;return u?u.done?(n[t.resultName]=u.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):u:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(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(A,this),this.reset(!0)}function P(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,u=function t(){for(;++o<n.length;)if(a.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return u.next=u}}throw new TypeError(t(n)+" is not iterable")}return w.prototype=x,u(k,"constructor",{value:x,configurable:!0}),u(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(k),t},n.awrap=function(t){return{__await:t}},L(E.prototype),f(E.prototype,l,(function(){return this})),n.AsyncIterator=E,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var u=new E(p(t,e,r,o),a);return n.isGeneratorFunction(e)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},L(k),f(k,s,"Generator"),f(k,c,(function(){return this})),f(k,"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=P,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)&&a.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 i.type="throw",i.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var c=a.call(u,"catchLoc"),l=a.call(u,"finallyLoc");if(c&&l){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(c){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.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&&a.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 u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(u)},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),m},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),m}},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:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},n}function o(t,e,n,r,o,a,u){try{var i=t[a](u),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var u=t.apply(e,n);function i(t){o(u,r,a,i,c,"next",t)}function c(t){o(u,r,a,i,c,"throw",t)}i(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./index-legacy112.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy130.js?v=VERSION_NUMBER","./database-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useStore-legacy2.js?v=VERSION_NUMBER","./useMethod-legacy4.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy4.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy3.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var o,u,i,c,l,s,f,p,h,d,y,v,g,m,b,w,x,_,j,S,k,L,E,C,O,A,V,N,P,T,G,U,F,M,I,q,J,D,H,R,z,B,Y,K,$,Q,W,X,Z,tt,et,nt,rt,ot,at,ut,it,ct,lt,st,ft,pt;return{setters:[function(t){o=t.K,u=t.at,i=t.j,c=t.c,l=t.J,s=t.l,f=t.a0,p=t.S,h=t.n,d=t.L},function(t){y=t._},function(t){v=t._},function(t){g=t.c,m=t.r,b=t.q,w=t.v,x=t.e,_=t.A,j=t.B,S=t.y,k=t.x,L=t.P,E=t.D,C=t.al,O=t.k,A=t.U,V=t.g,N=t.w,P=t.p,T=t.G,G=t.M,U=t.C,F=t.J,M=t.F,I=t.a_,q=t.H,J=t.ai,D=t.aj,H=t.z},function(t){R=t._},function(t){z=t.setAuthStatus,B=t.getModulesCloudServer,Y=t.getMongodbConfig,K=t.getModulesList},function(t){$=t.a,Q=t.f,W=t.g,X=t.u},function(t){Z=t.g},function(t){tt=t.o,et=t.e,nt=t.a,rt=t.d,ot=t.f,at=t.i,ut=t.l,it=t.g,ct=t.h,lt=t.j},function(t){st=t.e},function(t){ft=t._},function(t){pt=t._},null,null,null],execute:function(){var ht={class:"p-20px"},dt={class:"flex items-center"},yt=g({__name:"index",setup:function(t){var e=Z().refs.safetyStatus,n=m(!1),c=function(){var t=a(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o({loading:"正在设置安全状态,请稍候...",request:z({data:JSON.stringify({status:e.value?"1":"0"})}),message:!0,success:function(t){t.status||(e.value=!e.value)}});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),u(t.t0,"changeSafety");case 8:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}();return function(t,r){var o=E,a=C,u=i;return b(),w("div",null,[x(o,{type:"default",onClick:r[0]||(r[0]=function(t){return n.value=!0})},{default:_((function(){return r[3]||(r[3]=[j("安全认证")])})),_:1}),x(u,{title:"安全认证",modelValue:k(n),"onUpdate:modelValue":r[2]||(r[2]=function(t){return L(n)?n.value=t:null}),area:40},{default:_((function(){return[S("div",ht,[S("div",dt,[r[4]||(r[4]=S("span",{class:"mr-8px"},"安全认证:",-1)),x(a,{modelValue:k(e),"onUpdate:modelValue":r[1]||(r[1]=function(t){return L(e)?e.value=t:null}),width:36,onChange:c},null,8,["modelValue"])]),r[5]||(r[5]=S("ul",{class:"mt-8px leading-8 text-[1.2rem] list-disc ml-20px"},[S("li",null,"安全认证:开启后访问数据需要使用帐号和密码")],-1))])]})),_:1},8,["modelValue"])])}}}),vt={class:"flex items-center"},gt={class:"w-[20rem] truncate inline-block"};t("default",g({__name:"index",setup:function(t){var u=Z(),i=u.refs,g=i.isRefreshTable,C=i.isLoading,z=i.safetyStatus,ht=i.envStatus,dt=i.isHaveServer,mt=u.resetRefresh,bt=u.refreshTableList,wt=O({total:0,page:1,row:10}),xt=m([]),_t=A([]),jt=m(null),St=m("all"),kt=m(""),Lt=m(""),Et=m([]),Ct=rt(),Ot=V((function(){return!ht.value.setup&&!dt.value})),At=function(){return[$()].concat(e(ot(at)),[Q({event:function(t,e){return ut(t,e)}}),it(Et.value,"mongodb"),W({table:"databases"}),X([{onClick:function(t){return function(t){h({title:"【".concat(t.name,"】权限配置"),area:53,compData:t,showFooter:!0,component:function(){return d((function(){return n.import("./index-legacy132.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}})}(t)},title:"权限"},{onClick:function(t){return ct(t)},title:"工具"},{onClick:function(t){return at(t)},title:"改密"},{onClick:function(t){return lt(t)},title:"删除"}])])},Vt=function(){var t=a(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o({request:B({data:JSON.stringify({type:"mongodb"})},"mongodb"),data:[Array,Et]});case 2:return Et.value.length||(dt.value=!1),t.abrupt("return",Et.value);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Nt=function(){var t=a(r().mark((function t(){var e;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return""===(e={p:wt.page,limit:wt.row,tables:"databases",search:kt.value,sid:"all"===St.value?"":St.value}).sid&&delete e.sid,t.next=4,o({loading:C,request:K({data:JSON.stringify(e)},"mongodb"),data:{data:[Array,xt],page:p(wt)}});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Pt=function(){var t=a(r().mark((function t(){var e;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o({request:Y(),data:{root:[String,Lt],authorization:[String,function(t){return{status:"enabled"===t||!1}}]}});case 2:e=t.sent,z.value=e.status;case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Tt=function(){var t=a(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Nt(),!Ot.value&&Pt(),t.next=4,Vt();case 4:_t.value=At();case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return N((function(){return g.value}),function(){var t=a(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=3;break}return t.next=3,Nt();case 3:mt();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),P((function(){return Tt()})),function(t,e){var n=R,r=E,o=c,a=J,u=D,i=l,p=s,h=f,d=v,g=y,m=T("bt-loading");return b(),w("div",null,[k(Ot)?(b(),G(n,{key:0},{content:_((function(){return[x(pt,{type:"MongoDB"})]})),_:1})):U("",!0),x(g,null,{"header-left":_((function(){return[S("div",vt,[x(r,{type:"primary",onClick:e[0]||(e[0]=function(t){return k(tt)(Vt)})},{default:_((function(){return e[7]||(e[7]=[j("添加数据库")])})),_:1}),k(z)?(b(),G(r,{key:0,onClick:e[1]||(e[1]=function(t){return k(et)(k(Lt),(function(){return Pt()}))})},{default:_((function(){return e[8]||(e[8]=[j("root密码")])})),_:1})):U("",!0),x(r,{onClick:k(nt)},{default:_((function(){return e[9]||(e[9]=[j("远程数据库")])})),_:1},8,["onClick"]),x(yt,{class:"mx-[10px]"}),x(ft,{"comp-data":k(Et)},null,8,["comp-data"]),x(o,{onClick:e[2]||(e[2]=function(t){return k(st)({name:"数据库",type:12})}),icon:"desired",class:"ml-[12px]",iconClass:"text-1.6rem"},{default:_((function(){return e[10]||(e[10]=[j("需求反馈")])})),_:1})])]})),"header-right":_((function(){return[x(u,{modelValue:k(St),"onUpdate:modelValue":e[3]||(e[3]=function(t){return L(St)?St.value=t:null}),onChange:k(bt),class:F(["!w-[14rem] mr-[8px]",{"custom-types-bg-green":"all"!==k(St)}])},{default:_((function(){return[x(a,{label:"全部",value:"all"}),(b(!0),w(M,null,I(k(Et),(function(t,e){return b(),G(a,{key:e,label:"".concat("all"!==k(St)?"已选:":"").concat(t.ps),value:t.id},{default:_((function(){return[S("span",gt,H(t.ps),1)]})),_:2},1032,["label","value"])})),128))]})),_:1},8,["modelValue","onChange","class"]),x(i,{class:"w-[26rem]",modelValue:k(kt),"onUpdate:modelValue":e[4]||(e[4]=function(t){return L(kt)?kt.value=t:null}),onSearch:k(bt),placeholder:"请输入数据库名称/备注"},null,8,["modelValue","onSearch"])]})),content:_((function(){return[q(x(p,{ref_key:"mongoDbTableRef",ref:jt,column:k(_t),data:k(xt)},null,8,["column","data"]),[[m,k(C)]])]})),"footer-left":_((function(){return[x(h,{options:k(Ct),"table-ref":k(jt)},null,8,["options","table-ref"])]})),"footer-right":_((function(){return[x(d,{total:k(wt).total,page:k(wt).page,"onUpdate:page":e[5]||(e[5]=function(t){return k(wt).page=t}),row:k(wt).row,"onUpdate:row":e[6]||(e[6]=function(t){return k(wt).row=t}),onChange:k(bt)},null,8,["total","page","row","onChange"])]})),_:1})])}}}))}}}))}();
Save File
Cancel