← Back
Editing: index-legacy193.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={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=u.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 p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:P(e,r,u)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,l,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(T([])));O&&O!==o&&i.call(O,l)&&(x=O);var L=_.prototype=b.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function k(t,r){function n(o,a,u,l){var c=d(t[o],t,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,u,l)}),(function(e){n("throw",e,u,l)})):r.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(e,t){function i(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(i,i):i()}})}function P(e,t,n){var o=h;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 l=S(u,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var c=d(e,t,n);if("normal"===c.type){if(o=n.done?m:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function V(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 N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function G(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(V,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(i.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=_,a(L,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,s,"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,_):(e.__proto__=_,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},E(k.prototype),f(k.prototype,c,(function(){return this})),n.AsyncIterator=k,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new k(p(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(L),f(L,s,"Generator"),f(L,l,(function(){return this})),f(L,"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,G.prototype={constructor:G,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(N),!e)for(var t in this)"t"===t.charAt(0)&&i.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,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.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 l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),N(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 o=n.arg;N(r)}return o}}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){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(t,r,n){return(r=function(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function i(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void r(e)}u.done?t(l):Promise.resolve(l).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function u(e){i(a,n,o,u,l,"next",e)}function l(e){i(a,n,o,u,l,"throw",e)}u(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./database-legacy.js?v=VERSION_NUMBER","./useMethod-legacy4.js?v=VERSION_NUMBER","./useStore-legacy2.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy9.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var o,i,u,l,c,s,f,p,d,h,v,y,m,g,b,w,_,x,j,O,L,E,k,P,S,V,N,G,T,D,F,U;return{setters:[function(e){o=e.c,i=e.r,u=e.U,l=e.g,c=e.p,s=e.q,f=e.v,p=e.e,d=e.A,h=e.x,v=e.M,y=e.C,m=e.F,g=e.a_,b=e.B,w=e.Q,_=e.a9,x=e.ai,j=e.aj,O=e.a7},function(e){L=e.x,E=e.K,k=e.M,P=e.k,S=e.c,V=e.e},function(e){N=e._},function(e){G=e.addModulesDatabase},function(e){T=e.a,D=e.m},function(e){F=e.g},function(e){U=e._},null,null,null,null],execute:function(){var r={class:"p-[24px]"},A=o({__name:"index",props:{compData:{default:function(){return{options:[]}}}},setup:function(e,o){var V=o.expose,A=F(),I=A.refs.tabActive,q=A.refreshTableList,C=e,M=i(),Y=u(!1),B=i([]),H=i({name:"",db_user:"",password:L(16),ps:"",sid:0,listen_ip:"0.0.0.0/0",host:""}),K={name:[{required:!0,message:"请输入数据库名",trigger:["blur","change"]}],db_user:[{required:!0,message:"请输入用户名",trigger:["blur","change"]}],password:[{required:!0,message:"请输入密码",trigger:["blur","change"]}]},Q=l((function(){var e;return(null===(e=B.value.find((function(e){return e.id===H.value.sid})))||void 0===e?void 0:e.db_host)||""})),R=function(e){H.value.db_user=H.value.name,H.value.ps=H.value.name},z=function(){var e=a(t().mark((function e(r){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.value.validate();case 2:return Y.value=!0,e.next=5,J();case 5:return(o=n(n({},H.value),{},{sid:String(H.value.sid)})).listen_ip="ip"===o.listen_ip?o.host:o.listen_ip,e.next=9,E({loading:"正在添加数据库,请稍后...",request:G(o,I.value),message:!0});case 9:q(),r();case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=a(t().mark((function e(){var r,n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Y.value=!0,e.next=4,D(H.value.sid);case 4:if(r=e.sent,n=r.status,o=r.msg,i=r.err_msg,n){e.next=11;break}throw k.error(i||o),new Error(i||o);case 11:Y.value=!1,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}();return c(a(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(r=C.compData)||void 0===r?void 0:r.refresh();case 2:B.value=e.sent,H.value.sid=null===(n=B.value[0])||void 0===n?void 0:n.id;case 4:case"end":return e.stop()}}),e)})))),V({onConfirm:z}),function(e,t){var n=P,o=_,i=N,a=x,u=j,l=S,c=O;return s(),f("div",r,[p(c,{disabled:h(Y),model:h(H),ref_key:"addFormRef",ref:M,rules:K,onSubmit:t[7]||(t[7]=w((function(){}),["prevent"]))},{default:d((function(){return[p(o,{label:"数据库名",prop:"name"},{default:d((function(){return[p(n,{width:"38rem",ref:"data_name",placeholder:"新的数据库名称",modelValue:h(H).name,"onUpdate:modelValue":t[0]||(t[0]=function(e){return h(H).name=e}),onInput:R},null,8,["modelValue"])]})),_:1}),p(o,{label:"用户名",prop:"db_user"},{default:d((function(){return[p(n,{width:"38rem",placeholder:"数据库用户",modelValue:h(H).db_user,"onUpdate:modelValue":t[1]||(t[1]=function(e){return h(H).db_user=e})},null,8,["modelValue"])]})),_:1}),p(o,{label:"密码",prop:"password"},{default:d((function(){return[p(i,{width:"38rem",icon:"el-refresh",modelValue:h(H).password,"onUpdate:modelValue":t[2]||(t[2]=function(e){return h(H).password=e}),modelModifiers:{sync:!0},onIconClick:t[3]||(t[3]=function(){return h(H).password=h(L)(16)}),isActive:!0},null,8,["modelValue"])]})),_:1}),p(o,{label:"访问权限",prop:"dataAccess"},{default:d((function(){return[p(u,{class:"!w-[38rem]",modelValue:h(H).listen_ip,"onUpdate:modelValue":t[4]||(t[4]=function(e){return h(H).listen_ip=e})},{default:d((function(){return[p(a,{label:"所有人",value:"0.0.0.0/0"}),p(a,{label:"本地服务器",value:"127.0.0.1/32"}),p(a,{label:"指定ip",value:"ip"})]})),_:1},8,["modelValue"]),p(o,{prop:"host"},{default:d((function(){return["ip"===h(H).listen_ip?(s(),v(n,{key:0,placeholder:"填写格式如:192.168.69.11/24",modelValue:h(H).host,"onUpdate:modelValue":t[5]||(t[5]=function(e){return h(H).host=e}),width:"38rem",class:"mt-8px w-full"},null,8,["modelValue"])):y("",!0)]})),_:1})]})),_:1}),p(o,{label:"添加至",prop:"sid",class:"!mb-0"},{default:d((function(){return[p(u,{class:"!w-[24rem]",modelValue:h(H).sid,"onUpdate:modelValue":t[6]||(t[6]=function(e){return h(H).sid=e})},{default:d((function(){return[(s(!0),f(m,null,g(h(B),(function(e,t){return s(),v(a,{key:t,label:e.ps+(e.db_host?"("+e.db_host+")":""),value:e.id},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"]),p(l,{class:"ml-[8px]",onClick:h(T)},{default:d((function(){return t[8]||(t[8]=[b(" 管理远程数据库 ")])})),_:1},8,["onClick"])]})),_:1}),p(o,{label:" ",class:"!mb-0"},{default:d((function(){return[p(U,{server:{sid:h(H).sid,ip:h(Q)}},null,8,["server"])]})),_:1})]})),_:1},8,["disabled","model"])])}}});e("default",V(A,[["__scopeId","data-v-1c688efe"]]))}}}))}();
Save File
Cancel