← Back
Editing: backup-view-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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var n,r={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(n){s=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),u=new G(r||[]);return i(a,"_invoke",{value:S(t,n,u)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var d="suspendedStart",v="suspendedYield",m="executing",y="completed",g={};function w(){}function b(){}function _(){}var k={};s(k,c,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x(N([])));L&&L!==o&&a.call(L,c)&&(k=L);var E=_.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,n){function r(o,i,u,c){var l=h(e[o],e,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&a.call(s,"__await")?n.resolve(s.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,c)}))}c(l.arg)}var o;i(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 S(t,e,r){var o=d;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:n,done:!0}}for(r.method=a,r.arg=i;;){var u=r.delegate;if(u){var c=z(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(t,e,r);if("normal"===l.type){if(o=r.done?y:v,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function z(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=h(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,g;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return b.prototype=_,i(E,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:b,configurable:!0}),b.displayName=s(_,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},j(O.prototype),s(O.prototype,l,(function(){return this})),r.AsyncIterator=O,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new O(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(E),s(E,f,"Generator"),s(E,c,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),r.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}},r.values=N,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},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 r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("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 r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.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 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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},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;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function n(t,e,n,r,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function r(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var i=t.apply(e,r);function u(t){n(i,o,a,u,c,"next",t)}function c(t){n(i,o,a,u,c,"throw",t)}u(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var o,a,i,u,c,l,f,s,p,h,d,v,m,y,g,w,b,_,k,x,L,E,j,O,S,z,C,P,G,N,V,F,q,T,I,D,U,A,R,H;return{setters:[function(t){o=t._},function(t){a=t.ay,i=t.R,u=t.w,c=t.K,l=t.h2,f=t.h3,s=t.p,p=t.h4,h=t.h5,d=t.l,v=t.j,m=t.b},function(t){y=t.c,g=t.r,w=t.k,b=t.U,_=t.e,k=t.p,x=t.G,L=t.q,E=t.v,j=t.A,O=t.B,S=t.H,z=t.x,C=t.P,P=t.y,G=t.Q,N=t.I,V=t.z,F=t.M,q=t.C,T=t.D,I=t.b0,D=t.a9,U=t.T,A=t.a7},function(t){R=t.d,H=t.u},null,null],execute:function(){var n={class:"p-2rem"},Y={class:"p-[2rem]"},B={class:"flex items-center"};t("default",y({__name:"backup-view",props:{compData:{default:function(){}}},setup:function(t){var y=t,K=a().refs.isRefreshInstallList,M={"x-http-token":window.vite_public_request_token},Q=g(!1),$=g(null),J=g(null),W=window.location.protocol+"//"+window.location.host+"/mod/docker/com/upload_backup",X=w({id:y.compData.id,restore_backup:!1,backup:!1,f_size:0,f_path:"/www/dk_project/backup/apps",f_name:"",f_start:0}),Z=y.compData.id,tt=g(!1),et=m(),nt=b([]),rt=b(!1),ot=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c({request:l({id:Z}),loading:rt,success:function(t){nt.value=t.data.data}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),at=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c({request:f({id:Z}),loading:"正在备份中,请稍后...",message:!0,success:ot});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),it=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s({content:"即将删除备份文件,是否继续?",title:"删除备份-"+n.file_name,icon:"warning-filled"});case 2:c({request:p({id:Z,file_name:n.file_name}),loading:"正在删除中,请稍后...",message:!0,success:ot});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ut=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.open("/download?filename="+n.backup_path+"/"+n.file_name,"_blank","noopener,noreferrer");case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ct=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s({content:"恢复备份将会覆盖已有数据,是否继续?",title:"恢复备份-"+n.file_name,icon:"warning-filled",type:"check",check:{content:"备份覆盖前的数据",onConfirm:function(){var t=r(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c({request:h({id:Z,file_name:n.file_name,backup:r}),loading:"正在恢复中,请稍后...",message:!0});case 2:ot(),K.value=!0;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),lt=function(){var t=r(e().mark((function t(){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(X.f_name){t.next=3;break}return et.error("请选择文件"),t.abrupt("return");case 3:return tt.value=et.load("正在上传中,请稍后..."),t.next=6,null===(n=$.value)||void 0===n?void 0:n.submit();case 6:return t.abrupt("return",!1);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ft=function(t){var e;et.request(t),Q.value=!1,X.f_name="",ot(),null===(e=tt.value)||void 0===e||e.close(),t.status&&(Q.value=!1)},st=function(t){X.f_size=t.size,X.f_name=t.name},pt=function(){var t;et.error("导入失败"),X.f_name="",null===(t=tt.value)||void 0===t||t.close(),ot()},ht=function(){J.value.$el.click()},dt=function(){var t;null===(t=$.value)||void 0===t||t.clearFiles(),Q.value=!1,X.f_name="",X.restore_backup=!1},vt=[{label:"备份名称",prop:"file_name",width:160},{label:"类型",render:function(t){return _("span",null,["local"===t.backup_type?"本地":t.backup_type])}},{label:"备份时间",width:140,render:function(t){return _("span",null,[i(Number(t.backup_time))])}},R({prop:"backup_path",label:"备份目录"}),{label:"大小",render:function(t){return _("span",null,[u(t.size)])}},H([{title:"恢复",onClick:ct},{title:"下载",onClick:ut},{title:"删除",onClick:it}])];return k(ot),function(t,e){var r=T,a=d,i=I,u=D,c=U,l=A,f=v,s=o,p=x("bt-loading");return L(),E("div",n,[_(s,null,{"header-left":j((function(){return[_(r,{type:"primary",onClick:at},{default:j((function(){return e[5]||(e[5]=[O("点击备份")])})),_:1}),_(r,{onClick:e[0]||(e[0]=function(t){return Q.value=!0})},{default:j((function(){return e[6]||(e[6]=[O("上传备份")])})),_:1})]})),content:j((function(){return[S(_(a,{column:vt,data:z(nt),"max-height":500},null,8,["data"]),[[p,z(rt)]])]})),popup:j((function(){return[_(f,{title:"上传文件",modelValue:z(Q),"onUpdate:modelValue":e[4]||(e[4]=function(t){return C(Q)?Q.value=t:null}),area:50,onConfirm:lt,onCancel:dt,showFooter:""},{default:j((function(){return[P("div",Y,[_(l,{ref:"cmdFormRef",size:"default",model:z(X),class:"relative w-full","label-position":"right",onSubmit:e[3]||(e[3]=G((function(){}),["prevent"]))},{default:j((function(){return[_(u,{prop:"dep_zip",label:"上传文件"},{default:j((function(){return[P("div",B,[_(i,{class:"upload-demo h-[0] w-[0]",ref_key:"upload",ref:$,name:"blob",data:z(X),action:W,headers:M,accept:".zip,.gz,.tar","show-file-list":!1,"on-error":pt,multiple:!1,"auto-upload":!1,"on-success":ft,"on-change":st},{default:j((function(){return[S(_(r,{ref_key:"open",ref:J,size:"default",type:"default"},{default:j((function(){return e[7]||(e[7]=[O(" 选择文件 ")])})),_:1},512),[[N,!1]])]})),_:1},8,["data"]),_(r,{title:"导入项目",size:"default",class:"!mr-[.5rem]",onClick:ht},{default:j((function(){return e[8]||(e[8]=[O(" 选择文件 ")])})),_:1}),P("span",null,V(z(X).f_name||"未选择"),1)])]})),_:1}),_(u,{label:" "},{default:j((function(){return[_(c,{modelValue:z(X).restore_backup,"onUpdate:modelValue":e[1]||(e[1]=function(t){return z(X).restore_backup=t})},{default:j((function(){return e[9]||(e[9]=[O(" 是否立即导入备份文件 ")])})),_:1},8,["modelValue"])]})),_:1}),z(X).restore_backup?(L(),F(u,{key:0,label:" "},{default:j((function(){return[_(c,{modelValue:z(X).backup,"onUpdate:modelValue":e[2]||(e[2]=function(t){return z(X).backup=t})},{default:j((function(){return e[10]||(e[10]=[O(" 是否备份覆盖前的数据 ")])})),_:1},8,["modelValue"])]})),_:1})):q("",!0),e[11]||(e[11]=P("ul",{class:"mt-[.8rem] leading-8 text-[1.2rem] list-disc ml-[2rem]"},[P("li",null,"立即导入备份文件将覆盖现有文件数据,请做好相关数据备份")],-1))]})),_:1},8,["model"])])]})),_:1},8,["modelValue"])]})),_:1})])}}}))}}}))}();
Save File
Cancel