← Back
Editing: index-legacy64.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={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=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 a=t&&t.prototype instanceof b?t:b,o=Object.create(a.prototype),u=new I(n||[]);return i(o,"_invoke",{value:S(e,r,u)}),o}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",m="executing",y="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,c,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(C([])));j&&j!==a&&o.call(j,c)&&(_=j);var L=x.prototype=b.prototype=Object.create(_);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,r){function n(a,i,u,c){var l=d(t[a],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,u,c)}),(function(e){n("throw",e,u,c)})):r.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,c)}))}c(l.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(o,o):o()}})}function S(e,t,n){var a=h;return function(o,i){if(a===m)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:r,done:!0}}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var c=T(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(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var l=d(e,t,n);if("normal"===l.type){if(a=n.done?y:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=y,n.method="throw",n.arg=l.arg)}}}function T(e,t){var n=t.method,a=e.iterator[n];if(a===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(a,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,g;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function E(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 I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function e(){for(;++a<t.length;)if(o.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=x,i(L,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,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,x):(e.__proto__=x,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},P(O.prototype),f(O.prototype,l,(function(){return this})),n.AsyncIterator=O,n.async=function(e,t,r,a,o){void 0===o&&(o=Promise);var i=new O(p(e,t,r,a),o);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(L),f(L,s,"Generator"),f(L,c,(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=C,I.prototype={constructor:I,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)&&o.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,a){return u.type="throw",u.arg=e,t.next=n,a&&(t.method="next",t.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),l=o.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(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},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 a=n.arg;N(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(e,t,r,n,a,o,i){try{var u=e[o](i),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,a)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var i=e.apply(t,n);function u(e){r(i,a,o,u,c,"next",e)}function c(e){r(i,a,o,u,c,"throw",e)}u(void 0)}))}}function a(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 o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(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 a=n.call(t,r||"default");if("object"!=e(a))return a;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}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./file-icon-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./store-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./files-path-legacy.js?v=VERSION_NUMBER","./useStore-legacy9.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./files-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./store-legacy2.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var a,i,u,c,l,s,f,p,d,h,v,m,y,g,b,w,x,_,k,j,L,P,O,S,T,E,N,I,C,z,D,R,F,q,G,A,B,V,H,J,K,M,Q,Y,U,W,Z,X,$,ee,te;return{setters:[function(e){a=e.r,i=e.o,u=e.g,c=e.e,l=e.ar,s=e.c,f=e.ay,p=e.Z,d=e.w,h=e.B,v=e.q,m=e.v,y=e.y,g=e.A,b=e.F,w=e.a_,x=e.x,_=e.K,k=e.z,j=e.Q,L=e.aj,P=e.D,O=e.aQ,S=e.M,T=e.ai,E=e.bI,N=e.p},null,function(e){I=e.K,C=e.f7,z=e.p,D=e.f8,R=e.n,F=e.L,q=e.G,G=e.b,A=e.ah,B=e.f9,V=e.fa,H=e.aj,J=e.fb,K=e.u,M=e.w,Q=e.a6,Y=e.e},function(e){U=e.a,W=e.u},function(e){Z=e.b},function(e){X=e.V},function(e){$=e._},function(e){ee=e.F},function(e){te=e.u},null,null,null,null,null,null],execute:function(){var re=G(),ne=function(e){return e.map((function(e){return o(o({},e),{},{isLocal:"local"===e.api_key&&"local"===e.app_key,label:e.remarks,value:e.id})}))},ae=function(){var e=n(t().mark((function e(r){var n,a,i,u,c,s,f,p,d,h,v,m,y,g,b,w,x,_,k,j;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.nodeId,a=r.path,i=r.p,u=r.showRow,c=r.search,n){e.next=3;break}return e.abrupt("return",{data:[]});case 3:return e.prev=3,e.next=6,I({request:V({p:i,showRow:u,node_id:n,path:a,search:c})});case 6:for(s=e.sent,f=s.data,p=f.path,d=f.dir,h=f.files,v=f.bt_sync,m=f.tamper_data,g=(y=m||{dirs:[],files:[],msg:""}).dirs,b=y.files,w=y.msg,x=new Array(d.length+h.length),_=0,k=0;k<d.length;k++)x[_++]=o(o({},X("dir",d[k],w?"":g[k],p,v)),{},{vid:"dir".concat(_),nodeId:n,loading:l(!1)});for(j=0;j<h.length;j++)x[_++]=o(o({},X("file",h[j],w?"":b[j],p)),{},{vid:"file".concat(_),nodeId:n});return e.abrupt("return",{data:x,total:H(f.page),path:p});case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return",{data:[],path:a});case 21:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=n(t().mark((function e(r){var n,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.loading&&!r.dirSize){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,r.loading=!0,e.next=6,I({request:C({node_id:r.nodeId,path:r.path})});case 6:n=e.sent,a=n.data,r.dirSize=a.size,r.loading=!1,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.loading=!1;case 15:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}(),ie=function(){var e=n(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z({title:"删除文件",content:'确定要删除文件 "'.concat(r.fileName,'" 吗?')});case 2:return e.next=4,I({message:!0,loading:"删除中...",request:D({node_id:r.nodeId,path:r.path,is_dir:r.isFile?0:1})});case 4:n();case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ue=a(null),ce=i((function(){re.error("不能直接上传文件到系统根目录!")}),2e3),le=function(e,t,r,n){var a,o;(e.preventDefault(),"/"!==t)?null!=e&&null!==(a=e.dataTransfer)&&void 0!==a&&a.items&&Array.from(null==e||null===(o=e.dataTransfer)||void 0===o?void 0:o.items).some((function(e){return"file"===e.kind}))&&(ue.value||se(t,r,n)):ce()},se=function(e,t,n){"/"!==e?ue.value=R({title:"上传文件到【".concat(e,"】"),area:"72",component:function(){return F((function(){return r.import("./node-upload-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{path:e,nodeId:t,refresh:n},onCancel:function(){n(),ue.value=null}}):re.error("不能直接上传文件到系统根目录!")},fe=function(e,t){var r="node_file_path_".concat(e);return void 0!==t?(localStorage.setItem(r,t),t):localStorage.getItem(r)||"/"},pe=function(e){return!!e.lpver},de=null,he=function(){var e=n(t().mark((function e(r){var n,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!pe(r.sourceNode)||!pe(r.targetNode)){e.next=5;break}return re.error("当前两节点均为1panel节点,无法创建文件分发任务"),r.callback(),e.abrupt("return");case 5:return e.next=7,me(r);case 7:return n=e.sent,e.next=10,I({message:!0,loading:"创建传输任务...",request:J({source_node_id:r.sourceNode.id,target_node_id:r.targetNode.id,source_path_list:JSON.stringify(r.sourcePathList.value.map((function(e){return{path:e.path,is_dir:!e.isFile,size:e.size}}))),target_path:r.targetPath,default_mode:n})});case 10:a=e.sent,r.callback(),a.status&&ve(r.complete),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),r.callback();case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}(),ve=function(){var e=n(t().mark((function e(i){var u,c,l,s,f,p,d=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=d.length>1&&void 0!==d[1]&&d[1],c=a({source_path:"",target_path:"",target_node:"",source_node:"",file_count:0,file_complete:0,file_error:0,fileList:[]}),l=null,s=function(){var e,t;null===(e=de)||void 0===e||e.close(),null===(t=de=A({route:"/ws_modsoc",onMessage:function(e,t){var r,n=JSON.parse(t.data);if("end"===n.type)return null===(r=de)||void 0===r||r.close(),l&&l.unmount(),void(u||(c.value=o(o({},n.task),{},{fileList:n.file_status_list}),p(),re.success("文件传输完成"),i()));"error"===n.type&&re.error(n.msg),l||f(),n.task&&(c.value=o(o({},n.task),{},{fileList:n.file_status_list}))}}))||void 0===t||t.send({mod_name:"node",sub_mod_name:"file_transfer",def_name:"transfer_status",callback:"xxxxxxo",data:{}})},f=function(){var e=n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R({title:"文件传输日志",area:75,component:function(){return F((function(){return r.import("./index-legacy354.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:c,onCancel:function(){var e;null===(e=de)||void 0===e||e.close(),l=null},btns:!1});case 2:l=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),p=function(){var e=n(t().mark((function e(){var n,o,i,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,o=0,i=[],u=[],c.value.fileList.forEach((function(e){"complete"===e.status?(n++,u.push(e)):(o++,i.push(e))})),R({title:"文件传输结果",area:45,component:function(){return F((function(){return r.import("./transfer-result-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{success:n,fail:o,sendList:a([].concat(i,u))}});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=function(){var e=n(t().mark((function e(n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){R({title:"文件传输",area:45,component:function(){return F((function(){return r.import("./transfer-confirm-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},btn:!0,compData:o(o({},n),{},{complete:function(t){e(t)}}),onCancel:function(){t(!1)}})})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ye=function(){var e=n(t().mark((function e(r,a,o){var i,l,s,f,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=n(t().mark((function e(n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,I({message:!0,loading:"创建中...",request:B({node_id:a.toString(),path:"".concat(r,"/").concat(n.value.name).replace(/\/\//g,"/")})});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",!1);case 10:return e.prev=10,o(),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,6,10,13]])})));return function(t){return e.apply(this,arguments)}}(),l=null,s=q({data:function(){return{name:""}},options:function(e){return u((function(){return[Z("名称","name",{attrs:{class:"!w-[23rem]",placeholder:"请输入文件夹名称",onkeydown:(e=n(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==r.key){e.next=7;break}return r.preventDefault(),r.stopPropagation(),e.next=5,p();case 5:e.sent&&(null===(n=l)||void 0===n||n.unmount());case 7:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})},rules:[{required:!0,message:"请输入文件夹名称"},{validator:function(e,t,r){RegExp(/[\*\|\:\\\"\/\<\>\?]+/).test(t)?r(new Error("文件夹名称不能包含特殊字符")):r()},trigger:["blur","change"]}]})];var e}))},submit:function(){var e=n(t().mark((function e(r,n,a){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n();case 3:return e.next=5,i(r);case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t,r,n){return e.apply(this,arguments)}}()}),f=s.BtForm,p=s.submit,e.next=5,R({title:"新建文件夹【".concat(r,"】"),area:45,component:function(){return c("div",{class:"p-[2rem]"},[c(f,null,null)])},btn:!0,onConfirm:p});case 5:l=e.sent;case 6:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),ge={class:"flex items-center mb-[1.6rem]"},be={class:"flex flex-col !h-[5rem] pt-[1rem]"},we={class:"mb-0 leading-[1.2rem] !vertical-middle"},xe={class:"text-[#999] text-[1rem]"},_e={class:"flex items-center gap-3"},ke={class:"flex items-center gap-3"},je={class:"text-[#999]"},Le=s({__name:"files-list-card",props:{panelType:{type:String,required:!0}},setup:function(e,r){var o=r.expose,i=e,u=K().mainHeight,E=te().currentNodes,N=a([]),I=f("nodeList",a([])),C=f("createTask",(function(e,t,r){})),z=a([]),D=a(fe(E.value[i.panelType]));p("currentPath",D);var R=a({p:1,showRow:200,path:l(D),search:""}),F=function(e){switch(i.panelType){case"source":return e===E.value.target;case"target":return e===E.value.source}},q=function(e){z.value=e?I.value.filter((function(t){return t.label.includes(e)||t.server_ip.includes(e)})):I.value};d(I,(function(e){z.value=e})),d((function(){return E.value[i.panelType]}),(function(){A(),re.value.limit=100,ue(fe(E.value[i.panelType])),Z()}));var G,A=function(){var e=E.value[i.panelType];e&&localStorage.setItem("fileTransfer_".concat(i.panelType,"_nodeId"),e)},B=[U({key:"vid"}),{label:"文件名称",prop:"name",minWidth:200,showOverflowTooltip:!0,render:function(e){return c("div",{class:"flex items-center files-list"},[c("i",{class:"icon-bg ".concat(["zip","rar","7z","gz","tar.gz","tgz","war"].includes(e.ext)?"compress":e.ext,"-icon")},null),c("span",{onClick:function(){return ce(e)},class:"cursor-pointer hover:text-primary truncate ml-[4px] fileName ".concat(e.isReName?"hidden":""),title:e.fileName+e.isLink},[e.fileName+e.isLink])])}},{label:"文件大小",prop:"size",width:120,render:function(e){return"folder"===e.ext?c(he,{row:e},null):M(e.size)}},W([{title:"source"===i.panelType?"发送到右侧":"发送到左侧",width:100,onClick:function(e){return pe(e)}},{title:"删除",onClick:function(e){return ie(e,Z)}}])],V=Q({request:(G=n(t().mark((function e(r){var n,a,o,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.p,a=r.limit,o=r.search,e.next=3,ae({nodeId:E.value[i.panelType],path:R.value.path,p:n,showRow:a,search:o});case 3:return u=e.sent,fe(E.value[i.panelType],u.path),ue(u.path),X.value.clearAllSelect(),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)}))),function(e){return G.apply(this,arguments)}),columns:B,extension:[]}),H=V.BtTable,J=V.BtSearch,Y=V.BtPage,Z=(V.BtColumn,V.refresh),X=V.ref,re=V.param,ne=function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ue(r),Z();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(e){switch(D.value=e,i.panelType){case"source":E.value.sourcePath=e;break;case"target":E.value.targetPath=e}},ce=function(e){e.isFile||(D.value="".concat(e.path),Z())},pe=function(){var e=n(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n="all"===r?N.value:[r],C(i.panelType,n,(function(){X.value.clearAllSelect()}))}catch(t){X.value.clearAllSelect()}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),de=function(e){N.value=e},he=s({props:{row:{type:Object,required:!0}},setup:function(e){return function(){return c("a",{class:"flex items-center",title:"点击计算大小",onClick:function(){return oe(e.row)}},[e.row.loading&&c("span",{class:"svgtofont-el-loading animate-spin mr-2px"},null),e.row.loading&&c("span",{class:""},[h("计算中")]),!e.row.loading&&c("div",{class:"text-primary cursor-pointer"},[void 0===e.row.dirSize?"计算":e.row.dirSize])])}}});return o({refresh:Z}),function(e,t){var r=T,n=L,a=P,o=O;return v(),m("div",{class:"rounded-[.5rem] module-ui shadow-[0 1px 3px 1px rgba(0, 0, 0, 0.05)]",onDragenter:t[4]||(t[4]=j((function(){}),["prevent"])),onDragover:t[5]||(t[5]=j((function(e){return x(le)(e,x(D),x(E)[i.panelType],x(Z))}),["prevent"]))},[y("div",ge,[c(n,{class:"!w-[16rem] mr-[1.6rem]",modelValue:x(E)[i.panelType],"onUpdate:modelValue":t[0]||(t[0]=function(e){return x(E)[i.panelType]=e}),filterable:"","filter-method":q,onChange:e.handleNodeChange},{default:g((function(){return[(v(!0),m(b,null,w(x(z),(function(e){return v(),S(r,{class:"!h-[5rem]",key:e.value,label:e.label,value:e.value,disabled:F(e.value)},{default:g((function(){return[y("div",be,[y("span",we,k(e.label),1),y("span",xe,k(e.server_ip),1)])]})),_:2},1032,["label","value","disabled"])})),128))]})),_:1},8,["modelValue","onChange"]),c(ee,{initialPath:x(D),onPathChange:ne,onRefresh:x(Z)},null,8,["initialPath","onRefresh"])]),c(x($),null,{"header-left":g((function(){return[c(a,{type:"primary",onClick:t[1]||(t[1]=function(e){return x(se)(x(D),x(E)[i.panelType],x(Z))})},{default:g((function(){return t[6]||(t[6]=[h(" 上传文件 ")])})),_:1}),c(a,{type:"default",onClick:t[2]||(t[2]=function(e){return x(ye)(x(D),x(E)[i.panelType],x(Z))})},{default:g((function(){return t[7]||(t[7]=[h(" 新建文件夹 ")])})),_:1})]})),"header-right":g((function(){return[y("div",_e,[c(x(J),{placeholder:"请输入文件名称"})])]})),content:g((function(){return[c(x(H),{style:_("height:".concat(x(u)-290,"px")),onSelectionChange:de},null,8,["style"])]})),"footer-left":g((function(){return[y("div",ke,[c(o,{content:"请先选择文件",placement:"top",disabled:x(N).length>0},{default:g((function(){return[c(a,{type:"primary",disabled:0===x(N).length,onClick:t[3]||(t[3]=function(e){return pe("all")})},{default:g((function(){return[h("发送到"+k("source"===i.panelType?"右侧":"左侧"),1)]})),_:1},8,["disabled"])]})),_:1},8,["disabled"]),y("span",je,"当前选中"+k(x(N).length)+"个文件",1)])]})),"footer-right":g((function(){return[c(x(Y),{layout:"prev, pager, next"})]})),_:1})],32)}}}),Pe={class:"file-transfer"},Oe={class:"transfer-container"},Se={class:"transfer-panel left-panel"},Te={class:"transfer-panel right-panel"},Ee=s({__name:"index",setup:function(e){var r=te(),o=r.getNodeList,i=r.currentNodes,u=G(),s=a([]);p("nodeList",s);var f=E("leftPanelRef"),d=E("rightPanelRef"),h=function(){var e=n(t().mark((function e(){var r,n,a,u,c,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:for(r=e.sent,s.value=ne(r.data),n=Number(localStorage.getItem("fileTransfer_source_nodeId")),a=Number(localStorage.getItem("fileTransfer_target_nodeId")),u=null,c=null,l=null,f=0;f<s.value.length;f++)s.value[f].isLocal?(l=s.value[f].id,i.value.localNodeId=l):c||(c=s.value[f].id),s.value[f].id===n&&(u=s.value[f].id),s.value[f].id===a&&(c=s.value[f].id);u||(u=l),i.value.source=u,i.value.target=c;case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=function(){var e=n(t().mark((function e(r,n,a){var o,c,p,h,v;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=i.value[r],c=i.value["source"===r?"target":"source"],p=null,h=null,v=0;case 5:if(!(v<s.value.length)){e.next=13;break}if(s.value[v].id===o&&(p=s.value[v]),s.value[v].id===c&&(h=s.value[v]),!p||!h){e.next=10;break}return e.abrupt("break",13);case 10:v++,e.next=5;break;case 13:if(h){e.next=17;break}return u.error("请选择目标节点"),a(),e.abrupt("return");case 17:he({sourceNode:p,targetNode:h,sourcePathList:l(n),targetPath:i.value["source"===r?"targetPath":"sourcePath"],callback:a,complete:function(){var e,t;"source"===r?null===(e=d.value)||void 0===e||e.refresh():null===(t=f.value)||void 0===t||t.refresh()}});case 18:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();return p("refreshNodeList",h),p("createTask",g),N((function(){h(),ve((function(){}),!0)})),function(e,t){return v(),m("div",Pe,[y("div",Oe,[y("div",Se,[c(Le,{ref_key:"leftPanelRef",ref:f,"panel-type":"source"},null,512)]),y("div",Te,[c(Le,{ref_key:"rightPanelRef",ref:d,"panel-type":"target"},null,512)])])])}}});e("default",Y(Ee,[["__scopeId","data-v-358159e0"]]))}}}))}();
Save File
Cancel