← Back
Editing: index-legacy422.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var e,r={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=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,a=Object.create(o.prototype),u=new V(n||[]);return i(a,"_invoke",{value:P(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,c,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(N([])));_&&_!==n&&a.call(_,c)&&(k=_);var O=x.prototype=b.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,r){function n(o,i,u,c){var l=h(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&a.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){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function P(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){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 l=h(t,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function S(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,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;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,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function C(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 V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],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=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"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,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},L(E.prototype),f(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new E(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(O),f(O,s,"Generator"),f(O,c,(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=N,V.prototype={constructor:V,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)&&a.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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){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&&a.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 i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):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),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),q(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;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function a(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy112.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useMethod-legacy4.js?v=VERSION_NUMBER","./database-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./useStore-legacy2.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var n,a,u,c,l,s,f,p,h,d,v,y,m,g,b,w,x,k,j,_,O,L,E,P,S,C,q,V,N,A,D,G,F,T,U,B,I,M,z,R,H,Y,J,K,Q,W,X,Z,$;return{setters:[function(t){n=t.u,a=t.R,u=t.w,c=t.K,l=t.M,s=t.p,f=t.gC,p=t.S,h=t.l,d=t.j,v=t.k,y=t.e},function(t){m=t._},function(t){g=t.c,b=t.U,w=t.r,x=t.k,k=t.aB,j=t.p,_=t.G,O=t.q,L=t.v,E=t.e,P=t.A,S=t.B,C=t.x,q=t.H,V=t.P,N=t.y,A=t.F,D=t.a_,G=t.M,F=t.Q,T=t.C,U=t.D,B=t.ai,I=t.aj},function(t){M=t._},function(t){z=t.h,R=t.u,H=t.a},function(t){Y=t.v,J=t.g},function(t){K=t.getBackupDatabase,Q=t.getMysqlCloudServer,W=t.getMysqlBackupInfo,X=t.inputDatabase,Z=t.getMysqlAllBackup,$=t.backupDatabase},null,null,null,null],execute:function(){var e={class:"p-20px"},tt={class:"p-20px flex flex-col"},et={key:0},rt={class:"p-16px flex flex-col bg-[#f0f0f0]"},nt=g({__name:"index",setup:function(t,y){var g,nt=y.expose,ot=n().panel,at=b([]),it=w(null===(g=at.value[0])||void 0===g?void 0:g.id),ut=w(!1),ct=w([]),lt=x({p:1,limit:10,total:0}),st=w({}),ft=w(""),pt=w("detail"),ht=w(!1),dt=w([]),vt=w(!1),yt=w(),mt=w(!1),gt=w([]),bt=[{label:"数据库名称",prop:"name"},{label:"大小",prop:"size",render:function(t){return u(t.size)}}],wt=(ot.value.backupPath+"/database/mysql/all_backup/").replace(/\/\//g,"/"),xt=function(){var t=i(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c({request:K({sid:it.value}),loading:vt,data:{status:Boolean,msg:String,data:[Array,dt]}});case 2:(e=t.sent).status||(l.error(e.msg||"获取数据库备份列表失败"),dt.value=[]);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),kt=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jt();case 2:return t.next=4,xt();case 4:Vt.value=[H(),{label:"数据库名称",prop:"name",width:200},{label:"表数量",prop:"table_num"},J(at.value,"mysql"),{label:"大小",prop:"size"}],ht.value=!0;case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),jt=function(){var t=i(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c({loading:"正在获取服务器数据,请稍后...",request:Q(),data:[Array,at]});case 2:it.value=null===(e=at.value[0])||void 0===e?void 0:e.id;case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_t=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c({request:W({file:e.path}),loading:"正在获取数据库详情,请稍后...",data:{data:[Array,gt],msg:String},success:function(t){"ok"!==t.msg?l.error(t.msg):(pt.value="detail",mt.value=!0)}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ot=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s({title:"删除文件",content:"删除选中数据库备份文件后,该数据库备份文件将永久消失,是否继续操作?",icon:"warning-filled"});case 2:return t.next=4,c({request:f({path:e.path}),loading:"正在删除文件,请稍后...",message:!0});case 4:St();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Lt=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return st.value=e,t.next=3,c({request:W({file:e.path}),loading:"正在获取数据库详情,请稍后...",data:{data:[Array,gt]}});case 3:mt.value=!0,pt.value="restore";case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Et=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("detail"!==pt.value){t.next=2;break}return t.abrupt("return",e());case 2:if("我已知晓"===ft.value){t.next=5;break}return l.error("输入错误,请重新输入!"),t.abrupt("return",!1);case 5:return t.next=7,c({request:X({file:st.value.path}),loading:"正在导入数据库,请稍后...",message:!0});case 7:ft.value="";case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Pt=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.open("/download?filename="+encodeURIComponent(e.path),"_blank","noopener,noreferrer");case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),St=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c({request:Z(r({},lt)),loading:ut,data:{data:[Array,ct],page:p(lt)}});case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ct=function(){var t=i(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=yt.value.tableSelectList).length){t.next=4;break}return l.error("请选择需要备份的数据库"),t.abrupt("return",!1);case 4:return t.next=6,c({request:$({sid:it.value,db_list:JSON.stringify(e.map((function(t){return t.name})))}),loading:"正在备份中,请稍后...",message:!0});case 6:ht.value=!1,St();case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),qt=[{label:"文件名称",prop:"name"},{label:"备份时间",prop:"mtime",width:200,render:function(t){var e=new Date(1e3*t.mtime);return k("span",a(e))}},z({prop:"size",width:100}),R([{onClick:_t,title:"详情"},{onClick:Lt,title:"恢复"},{onClick:Pt,title:"下载"},{onClick:Ot,title:"删除"}])],Vt=w();return j(St),nt({init:St}),function(t,r){var n=U,o=h,a=M,i=B,u=I,c=m,l=d,s=v,f=_("bt-loading"),p=_("focus");return O(),L("div",null,[E(c,null,{"header-left":P((function(){return[E(n,{onClick:kt,type:"primary"},{default:P((function(){return r[10]||(r[10]=[S("数据库备份")])})),_:1}),E(n,{onClick:r[0]||(r[0]=function(t){return C(Y)((function(){return St()}),C(wt))})},{default:P((function(){return r[11]||(r[11]=[S("从本地上传")])})),_:1})]})),content:P((function(){return[q(E(o,{column:qt,data:C(ct)},null,8,["data"]),[[f,C(ut)]])]})),"footer-right":P((function(){return[E(a,{total:C(lt).total,page:C(lt).p,"onUpdate:page":r[1]||(r[1]=function(t){return C(lt).p=t}),row:C(lt).limit,"onUpdate:row":r[2]||(r[2]=function(t){return C(lt).limit=t}),onChange:r[3]||(r[3]=function(t){return St()})},null,8,["total","page","row"])]})),popup:P((function(){return[E(l,{title:"数据库备份",modelValue:C(ht),"onUpdate:modelValue":r[5]||(r[5]=function(t){return V(ht)?ht.value=t:null}),onConfirm:Ct,showFooter:"",area:60},{default:P((function(){return[N("div",e,[E(c,null,{"header-right":P((function(){return[E(u,{class:"!w-[16rem]",modelValue:C(it),"onUpdate:modelValue":r[4]||(r[4]=function(t){return V(it)?it.value=t:null}),onChange:xt},{default:P((function(){return[(O(!0),L(A,null,D(C(at),(function(t,e){return O(),G(i,{key:e,label:t.ps,value:t.id},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"])]})),content:P((function(){return[q(E(o,{ref_key:"backupTableRef",ref:yt,column:C(Vt),data:C(dt),"max-height":"360"},null,8,["column","data"]),[[f,C(vt)],[f,"正在加载列表,请稍后...","title"]])]})),_:1})])]})),_:1},8,["modelValue"]),E(l,{title:"restore"===C(pt)?"恢复数据库":"数据库详情",modelValue:C(mt),"onUpdate:modelValue":r[8]||(r[8]=function(t){return V(mt)?mt.value=t:null}),showFooter:"",area:60,onConfirm:Et,onCancel:r[9]||(r[9]=function(t){return ft.value=""})},{default:P((function(){return[N("div",tt,[E(o,{column:bt,data:C(gt),"max-height":"360"},null,8,["data"]),"restore"===C(pt)?(O(),L("div",et,[r[13]||(r[13]=N("div",{class:"flex items-center my-12px text-[1.4rem]"},[N("i",{class:"text-orange svgtofont-el-warning-filled !text-[4rem] mr-8px"}),N("span",null,"恢复后会覆盖当前数据库数据,此操作不可逆,是否继续操作?")],-1)),N("div",rt,[r[12]||(r[12]=N("span",{class:"mb-4px"},[S("请手动输入 "),N("span",{class:"text-danger"},'"我已知晓"'),S(" ,完成验证")],-1)),q(E(s,{modelValue:C(ft),"onUpdate:modelValue":r[6]||(r[6]=function(t){return V(ft)?ft.value=t:null}),width:"52rem",onPasteCapture:r[7]||(r[7]=F((function(){}),["prevent"]))},null,8,["modelValue"]),[[p]])])])):T("",!0)])]})),_:1},8,["title","modelValue"])]})),_:1}),r[14]||(r[14]=N("ul",{class:"mt-16px leading-8 text-[1.2rem] list-disc ml-20px"},[N("li",null,"恢复仅限于在本页面进行的备份进行恢复,非本页面的备份数据可能无法正确恢复,请注意。")],-1))])}}});t("default",y(nt,[["__scopeId","data-v-e649dda0"]]))}}}))}();
Save File
Cancel