filecat 5.56.1 → 5.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/{377.3f9eae1942c14e2dfb83.js → 377.70907f1eb047946b6091.js} +2 -2
- package/build/dist/505.d6a34e1202bd0d8b68df.js +2 -0
- package/build/dist/{943.c163efe0e8baac6115b3.js → 943.9b2bcf75010b6663780b.js} +2 -2
- package/build/dist/{944.91d7b0de3598960526f1.js → 944.b98b5da90cbe3166c44c.js} +2 -2
- package/build/dist/{962.3334fb4581df9e76701f.js → 962.e634766c7c6134ab292c.js} +2 -2
- package/build/dist/984.b582bf2a28d3f827efd7.js +2 -0
- package/build/dist/index.html +1 -1
- package/build/dist/{main.68ec55750d87858b0250.js → main.3016b615fbde4ee1b25c.js} +2 -2
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/505.9b7ec527801a930b5501.js +0 -2
- package/build/dist/984.e2c749b71729b6ed4532.js +0 -2
- /package/build/dist/{377.3f9eae1942c14e2dfb83.js.LICENSE.txt → 377.70907f1eb047946b6091.js.LICENSE.txt} +0 -0
- /package/build/dist/{505.9b7ec527801a930b5501.js.LICENSE.txt → 505.d6a34e1202bd0d8b68df.js.LICENSE.txt} +0 -0
- /package/build/dist/{943.c163efe0e8baac6115b3.js.LICENSE.txt → 943.9b2bcf75010b6663780b.js.LICENSE.txt} +0 -0
- /package/build/dist/{944.91d7b0de3598960526f1.js.LICENSE.txt → 944.b98b5da90cbe3166c44c.js.LICENSE.txt} +0 -0
- /package/build/dist/{962.3334fb4581df9e76701f.js.LICENSE.txt → 962.e634766c7c6134ab292c.js.LICENSE.txt} +0 -0
- /package/build/dist/{984.e2c749b71729b6ed4532.js.LICENSE.txt → 984.b582bf2a28d3f827efd7.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.68ec55750d87858b0250.js.LICENSE.txt → main.3016b615fbde4ee1b25c.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see 944.
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[944],{4188(e,t,n){n.d(t,{HK:()=>g,hF:()=>w,hf:()=>b});var r=n(3459);function o(e){return o="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},o(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l,u,f,_=function(e){var t=new Uint8Array(4);null==e?t.set([255,255,255,255]):new DataView(t.buffer).setUint32(0,e);return t},d=function(e){if(null==e){var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,4294967295),t}var n=(new TextEncoder).encode(e),r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,n.length),y([r,n])},p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"encode",value:function(t){var n=[];return n.push(new Uint8Array([e.VERSION])),n.push(_(t.cmdType)),n.push(d(t.context)),n.push(function(e){if(!e){var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,4294967295),t}var n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e.length),y([n,e])}(t.binContext)),n.push(d(t.message)),n.push(_(t.code)),n.push(d(t.randomId)),y(n)}},{key:"decode",value:function(t){var n=t instanceof Uint8Array?t:new Uint8Array(t),r=0,o=function(){var e=new DataView(n.buffer,n.byteOffset+r,4).getUint32(0);return r+=4,e},i=function(){var e=o();return 4294967295===e?null:e},a=function(){var e=o();if(4294967295===e)return null;if(r+e>n.length)throw new RangeError("decodeString 越界");var t=n.slice(r,r+e);return r+=e,(new TextDecoder).decode(t)};if(n[r++]!==e.VERSION)throw new Error("版本号不匹配");return{cmdType:i(),context:a(),binContext:function(){var e=o();if(4294967295===e)return null;if(r+e>n.length)throw new RangeError("decodeBin 越界");var t=n.slice(r,r+e);return r+=e,t}(),message:a(),code:i(),randomId:a()}}}],(n=null)&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}();function y(e,t){if("number"!=typeof t){t=0;var n,r=i(e);try{for(r.s();!(n=r.n()).done;){t+=n.value.length}}catch(e){r.e(e)}finally{r.f()}}var o,a=new Uint8Array(t),c=0,s=i(e);try{for(s.s();!(o=s.n()).done;){var l=o.value;a.set(l,c),c+=l.length}}catch(e){s.e(e)}finally{s.f()}return a}function m(e){return m="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},m(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}l=p,f=0,(u=s(u="VERSION"))in l?Object.defineProperty(l,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[u]=f;var g=function(e){return e[e.heart=0]="heart",e[e.sys_get=1]="sys_get",e[e.sys_getting=2]="sys_getting",e[e.sys_cancel=3]="sys_cancel",e[e.shell_open=4]="shell_open",e[e.shell_send=5]="shell_send",e[e.shell_getting=6]="shell_getting",e[e.shell_copy=7]="shell_copy",e[e.docker_get=8]="docker_get",e[e.docker_getting=9]="docker_getting",e[e.docker_shell_logs=10]="docker_shell_logs",e[e.docker_shell_logs_getting=11]="docker_shell_logs_getting",e[e.docker_shell_logs_cancel=12]="docker_shell_logs_cancel",e[e.docker_shell_exec_open=13]="docker_shell_exec_open",e[e.docker_shell_exec=14]="docker_shell_exec",e[e.docker_shell_exec_getting=15]="docker_shell_exec_getting",e[e.docker_shell_exec_cancel=16]="docker_shell_exec_cancel",e[e.docker_switch=17]="docker_switch",e[e.docker_del_container=18]="docker_del_container",e[e.process_get=19]="process_get",e[e.process_getting=20]="process_getting",e[e.process_close=21]="process_close",e[e.systemd_inside_get=22]="systemd_inside_get",e[e.systemd_inside_getting=23]="systemd_inside_getting",e[e.systemd_logs_get=24]="systemd_logs_get",e[e.systemd_logs_getting=25]="systemd_logs_getting",e[e.remote_shell_open=26]="remote_shell_open",e[e.remote_shell_send=27]="remote_shell_send",e[e.remote_shell_getting=28]="remote_shell_getting",e[e.remote_shell_cancel=29]="remote_shell_cancel",e[e.remote_shell_cd=30]="remote_shell_cd",e[e.infos=31]="infos",e[e.connect=32]="connect",e[e.rdp_connect=33]="rdp_connect",e[e.rdp_bitmap=34]="rdp_bitmap",e[e.rdp_close=35]="rdp_close",e[e.rdp_error=36]="rdp_error",e[e.mouse=37]="mouse",e[e.wheel=38]="wheel",e[e.scancode=39]="scancode",e[e.unicode=40]="unicode",e[e.rdp_disconnect=41]="rdp_disconnect",e[e.vir_net_serverIno_get=42]="vir_net_serverIno_get",e[e.vir_net_client_get=43]="vir_net_client_get",e[e.tcp_proxy_client_status=44]="tcp_proxy_client_status",e[e.file_info=45]="file_info",e[e.file_video_trans=46]="file_video_trans",e[e.file_video_trans_progress=47]="file_video_trans_progress",e[e.file_uncompress=48]="file_uncompress",e[e.file_uncompress_progress=49]="file_uncompress_progress",e[e.file_compress=50]="file_compress",e[e.file_compress_progress=51]="file_compress_progress",e[e.file_upload_pre=52]="file_upload_pre",e[e.file_upload=53]="file_upload",e[e.log_viewer=54]="log_viewer",e[e.log_viewer_watch=55]="log_viewer_watch",e[e.log_viewer_watch_cancel=56]="log_viewer_watch_cancel",e[e.search_file=57]="search_file",e[e.search_file_progress=58]="search_file_progress",e[e.search_file_index=59]="search_file_index",e[e.search_file_cancel=60]="search_file_cancel",e[e.http_download_water=61]="http_download_water",e[e.http_download_cancel=62]="http_download_cancel",e[e.folder_size_info=63]="folder_size_info",e[e.folder_size_info_close=64]="folder_size_info_close",e[e.rtsp_get=65]="rtsp_get",e[e.rtsp_cancel=66]="rtsp_cancel",e[e.workflow_exec=67]="workflow_exec",e[e.workflow_get=68]="workflow_get",e[e.workflow_realtime=69]="workflow_realtime",e[e.workflow_realtime_one_req=70]="workflow_realtime_one_req",e[e.workflow_realtime_one_rsq=71]="workflow_realtime_one_rsq",e[e.workflow_search_by_run_name=72]="workflow_search_by_run_name",e[e.ai_load_info=73]="ai_load_info",e[e.tcp_forward_server_load=74]="tcp_forward_server_load",e}({}),w=function(e){return e[e.data=0]="data",e[e.other=1]="other",e}({}),b=function(){function e(t,n,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cmdType=t,this.context=n,this.bin_context=o,this.code=r.m.Success,this.random_id=i}return function(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"encode",value:function(){return p.encode({cmdType:this.cmdType,context:this.context?JSON.stringify(this.context):null,code:this.code,message:this.message,binContext:this.bin_context,randomId:this.random_id})}}],[{key:"decode",value:function(t){var n=p.decode(t),r=n.context;if("string"==typeof r&&r)try{r=JSON.parse(r)}catch(e){console.log(e),r=n.context}var o=new e(n.cmdType,r,n.binContext);return o.code=n.code,o.message=n.message,o.random_id=n.randomId,o}}])}()},370(e,t,n){n.d(t,{I:()=>k});var r=n(4188),o=n(3459),i=n(2042);function a(e){return a="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},a(e)}function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var f=function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r={},(n=u(n="_events"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},t=[{key:"on",value:function(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),this}},{key:"once",value:function(e,t){var n=this,r=function(){t.apply(void 0,arguments),n.off(e,r)};return this.on(e,r)}},{key:"off",value:function(e,t){var n=this._events[e];return n?(this._events[e]=n.filter(function(e){return e!==t}),this):this}},{key:"off_all",value:function(e){return delete this._events[e],this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._events[e];return!(!o||0===o.length||(c(o).forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error('Error in listener for event "'.concat(e,'":'),t)}}),0))}}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function _(e){return _="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)}function d(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return p(l,"_invoke",function(n,r,o){var i,c,s,l=0,u=o||[],f=!1,_={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,c=0,s=e,_.n=n,a}};function d(n,r){for(c=n,s=r,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],d=_.p,p=i[2];n>3?(o=p===r)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,_.v=r,_.n=i[1]):d<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,_.n=p,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&d(u,p),c=u,s=p;(t=c<2?e:s)||!f;){i||(c?c<3?(c>1&&(_.n=-1),d(c,s)):_.n=s:_.v=s);try{if(l=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=_.n<0)?s:n.call(r,_))!==a)break}catch(t){i=e,c=1,s=t}finally{l=1}}return{value:t,done:f}}}(n,o,i),!0),l}var a={};function c(){}function s(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),f=l.prototype=c.prototype=Object.create(u);function _(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,p(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=l,p(f,"constructor",l),p(l,"constructor",s),s.displayName="GeneratorFunction",p(l,o,"GeneratorFunction"),p(f),p(f,o,"Generator"),p(f,r,function(){return this}),p(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:_}})()}function p(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}p=function(e,t,n,r){function i(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},p(e,t,n,r)}function y(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,c,"next",e)}function c(e){y(i,r,o,a,c,"throw",e)}a(void 0)})}}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function v(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_(t)?t:t+""}function w(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<e;r++)n+=t.charAt(Math.floor(62*Math.random()));return n}var b="https:"===window.location.protocol?"wss:":"ws:",k=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"_msg_event",new f),v(this,"_msgResolveMap",new Map),v(this,"_msgResolveTimeoutMap",new Map),this._url=t,this.name=n},t=[{key:"connect",value:(u=m(d().m(function e(){var t=this;return d().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(){var e=m(d().m(function e(n,a){var c,s;return d().w(function(e){for(;;)switch(e.n){case 0:if(!t._socket){e.n=1;break}return n(!0),e.a(2);case 1:if((null===(c=t._socket)||void 0===c?void 0:c.readyState)!==WebSocket.OPEN){e.n=2;break}return e.a(2,n(!0));case 2:t._socket=new WebSocket("".concat(b,"//").concat(t._url,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.data)),t._socket.binaryType="arraybuffer",t._socket.addEventListener("open",function(){console.log("WebSocket 已连接: ".concat(t._url)),n(!0),t.start_heart_interval()}),s=function(e){var n=r.hf.decode(e);n.client_wss=t._socket,n.code===o.m.Fail&&(0,i.zN)(n.message),t._msgResolveMap.has(n.random_id)&&(clearTimeout(t._msgResolveTimeoutMap.get(n.random_id)),t._msgResolveTimeoutMap.delete(n.random_id),t._msgResolveMap.get(n.random_id)(n),t._msgResolveMap.delete(n.random_id)),t.emit_message("message",n),t.emit_message("message_".concat(n.cmdType),n)},t._socket.addEventListener("message",function(){var e=m(d().m(function e(t){var n,r,o;return d().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!((n=t.data)instanceof Blob)){e.n=2;break}return e.n=1,n.arrayBuffer();case 1:n=e.v,n=new Uint8Array(n),e.n=3;break;case 2:n instanceof ArrayBuffer&&(n=new Uint8Array(n));case 3:s(n),e.n=5;break;case 4:e.p=4,o=e.v,console.error("WS 消息错误",null!==(r=null==o?void 0:o.message)&&void 0!==r?r:o);case 5:return e.a(2)}},e,null,[[0,4]])}));return function(t){return e.apply(this,arguments)}}()),t._socket.addEventListener("close",function(e){console.log("WS 已断开: ".concat(t._url),e.code,e.reason),t._socket=null,t.emit_message("close"),t.stop_heart_interval()}),t._socket.addEventListener("error",function(e){console.error("WS 错误",e)});case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()))},e)})),function(){return u.apply(this,arguments)})},{key:"start_heart_interval",value:function(){var e=this;this._heart_interval=setInterval(function(){e.sendData(r.HK.heart,{})},1e4)}},{key:"stop_heart_interval",value:function(){clearInterval(this._heart_interval)}},{key:"sendData",value:(l=m(d().m(function e(t,n,o){var i;return d().w(function(e){for(;;)if(0===e.n)return(i=new r.hf(t)).context=n,o&&(i.random_id=w(9)),e.a(2,this.send(i))},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"send",value:(s=m(d().m(function e(t){var n=this;return d().w(function(e){for(;;)switch(e.n){case 0:if(this._socket){e.n=1;break}return e.n=1,this.connect();case 1:if(this._socket.readyState===WebSocket.OPEN){e.n=2;break}return e.n=2,new Promise(function(e,t){var r=setTimeout(function(){return t(new Error("WS 连接超时"))},5e3),o=function(){clearTimeout(r),n._socket.removeEventListener("open",o),e()};n._socket.addEventListener("open",o)});case 2:return e.a(2,new Promise(function(e,r){try{t.random_id=w(9);var o=t.random_id,i=setTimeout(function(){r(!1),console.info("ws超时",t.cmdType),n._msgResolveMap.delete(o)},6e3);n._msgResolveMap.set(o,e),n._msgResolveTimeoutMap.set(o,i),n._socket.send(t.encode())}catch(e){r(e)}}))}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"subscribeUnconnect",value:function(e){this.on_message("close",e)}},{key:"close",value:(c=m(d().m(function e(){return d().w(function(e){for(;;)switch(e.n){case 0:if(this._socket){e.n=1;break}return e.a(2);case 1:this._socket.close(),this._socket=null,this.stop_heart_interval();case 2:return e.a(2)}},e,this)})),function(){return c.apply(this,arguments)})},{key:"addMsg",value:(a=m(d().m(function e(t,n){return d().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.connect();case 1:this.on_message("message_".concat(t),n);case 2:return e.a(2)}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"removeMsg",value:function(e){this._msg_event.off_all("message_".concat(e))}},{key:"on_message",value:function(e,t){this._msg_event.on(e,t)}},{key:"on_once_message",value:function(e,t){this._msg_event.once(e,t)}},{key:"off_message",value:function(e,t){this._msg_event.off(e,t)}},{key:"emit_message",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=this._msg_event).emit.apply(t,[e].concat(r))}}],n=[{key:"getOtherWebSocket",value:function(e){return new WebSocket("".concat(b,"//").concat(window.location.host+window.location.pathname,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.other,"&code=").concat(e))}},{key:"getOtherWebSocketUrl",value:function(e,t){for(var n="".concat(b,"//").concat(window.location.host+window.location.pathname,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.other,"&code=").concat(e),o=0,i=Object.keys(t);o<i.length;o++){var a=i[o];n+="&".concat(a,"=").concat(encodeURIComponent(t[a]))}return n}}],t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,a,c,s,l,u}()},4944(e,t,n){n.d(t,{ws:()=>r});var r=new(n(370).I)(window.location.host+window.location.pathname,"全局")}}]);
|
|
1
|
+
/*! For license information please see 944.b98b5da90cbe3166c44c.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[944],{4188(e,t,n){n.d(t,{HK:()=>g,hF:()=>w,hf:()=>b});var r=n(3459);function o(e){return o="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},o(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l,u,f,_=function(e){var t=new Uint8Array(4);null==e?t.set([255,255,255,255]):new DataView(t.buffer).setUint32(0,e);return t},d=function(e){if(null==e){var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,4294967295),t}var n=(new TextEncoder).encode(e),r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,n.length),y([r,n])},p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"encode",value:function(t){var n=[];return n.push(new Uint8Array([e.VERSION])),n.push(_(t.cmdType)),n.push(d(t.context)),n.push(function(e){if(!e){var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,4294967295),t}var n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e.length),y([n,e])}(t.binContext)),n.push(d(t.message)),n.push(_(t.code)),n.push(d(t.randomId)),y(n)}},{key:"decode",value:function(t){var n=t instanceof Uint8Array?t:new Uint8Array(t),r=0,o=function(){var e=new DataView(n.buffer,n.byteOffset+r,4).getUint32(0);return r+=4,e},i=function(){var e=o();return 4294967295===e?null:e},a=function(){var e=o();if(4294967295===e)return null;if(r+e>n.length)throw new RangeError("decodeString 越界");var t=n.slice(r,r+e);return r+=e,(new TextDecoder).decode(t)};if(n[r++]!==e.VERSION)throw new Error("版本号不匹配");return{cmdType:i(),context:a(),binContext:function(){var e=o();if(4294967295===e)return null;if(r+e>n.length)throw new RangeError("decodeBin 越界");var t=n.slice(r,r+e);return r+=e,t}(),message:a(),code:i(),randomId:a()}}}],(n=null)&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}();function y(e,t){if("number"!=typeof t){t=0;var n,r=i(e);try{for(r.s();!(n=r.n()).done;){t+=n.value.length}}catch(e){r.e(e)}finally{r.f()}}var o,a=new Uint8Array(t),c=0,s=i(e);try{for(s.s();!(o=s.n()).done;){var l=o.value;a.set(l,c),c+=l.length}}catch(e){s.e(e)}finally{s.f()}return a}function m(e){return m="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},m(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}l=p,f=0,(u=s(u="VERSION"))in l?Object.defineProperty(l,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[u]=f;var g=function(e){return e[e.heart=0]="heart",e[e.sys_get=1]="sys_get",e[e.sys_getting=2]="sys_getting",e[e.sys_cancel=3]="sys_cancel",e[e.shell_open=4]="shell_open",e[e.shell_send=5]="shell_send",e[e.shell_getting=6]="shell_getting",e[e.shell_copy=7]="shell_copy",e[e.docker_get=8]="docker_get",e[e.docker_getting=9]="docker_getting",e[e.docker_shell_logs=10]="docker_shell_logs",e[e.docker_shell_logs_getting=11]="docker_shell_logs_getting",e[e.docker_shell_logs_cancel=12]="docker_shell_logs_cancel",e[e.docker_shell_exec_open=13]="docker_shell_exec_open",e[e.docker_shell_exec=14]="docker_shell_exec",e[e.docker_shell_exec_getting=15]="docker_shell_exec_getting",e[e.docker_shell_exec_cancel=16]="docker_shell_exec_cancel",e[e.docker_switch=17]="docker_switch",e[e.docker_del_container=18]="docker_del_container",e[e.process_get=19]="process_get",e[e.process_getting=20]="process_getting",e[e.process_close=21]="process_close",e[e.systemd_inside_get=22]="systemd_inside_get",e[e.systemd_inside_getting=23]="systemd_inside_getting",e[e.systemd_logs_get=24]="systemd_logs_get",e[e.systemd_logs_getting=25]="systemd_logs_getting",e[e.remote_shell_open=26]="remote_shell_open",e[e.remote_shell_send=27]="remote_shell_send",e[e.remote_shell_getting=28]="remote_shell_getting",e[e.remote_shell_cancel=29]="remote_shell_cancel",e[e.remote_shell_cd=30]="remote_shell_cd",e[e.infos=31]="infos",e[e.connect=32]="connect",e[e.rdp_connect=33]="rdp_connect",e[e.rdp_bitmap=34]="rdp_bitmap",e[e.rdp_close=35]="rdp_close",e[e.rdp_error=36]="rdp_error",e[e.mouse=37]="mouse",e[e.wheel=38]="wheel",e[e.scancode=39]="scancode",e[e.unicode=40]="unicode",e[e.rdp_disconnect=41]="rdp_disconnect",e[e.vir_net_serverIno_get=42]="vir_net_serverIno_get",e[e.vir_net_client_get=43]="vir_net_client_get",e[e.tcp_proxy_client_status=44]="tcp_proxy_client_status",e[e.file_info=45]="file_info",e[e.file_video_trans=46]="file_video_trans",e[e.file_video_trans_progress=47]="file_video_trans_progress",e[e.file_uncompress=48]="file_uncompress",e[e.file_uncompress_progress=49]="file_uncompress_progress",e[e.file_compress=50]="file_compress",e[e.file_compress_progress=51]="file_compress_progress",e[e.file_upload_pre=52]="file_upload_pre",e[e.file_upload=53]="file_upload",e[e.log_viewer=54]="log_viewer",e[e.log_viewer_watch=55]="log_viewer_watch",e[e.log_viewer_watch_cancel=56]="log_viewer_watch_cancel",e[e.search_file=57]="search_file",e[e.search_file_progress=58]="search_file_progress",e[e.search_file_index=59]="search_file_index",e[e.search_file_cancel=60]="search_file_cancel",e[e.http_download_water=61]="http_download_water",e[e.http_download_cancel=62]="http_download_cancel",e[e.folder_size_info=63]="folder_size_info",e[e.folder_size_info_close=64]="folder_size_info_close",e[e.rtsp_get=65]="rtsp_get",e[e.rtsp_cancel=66]="rtsp_cancel",e[e.workflow_exec=67]="workflow_exec",e[e.workflow_get=68]="workflow_get",e[e.workflow_realtime=69]="workflow_realtime",e[e.workflow_realtime_one_req=70]="workflow_realtime_one_req",e[e.workflow_realtime_one_rsq=71]="workflow_realtime_one_rsq",e[e.workflow_search_by_run_name=72]="workflow_search_by_run_name",e[e.ai_load_info=73]="ai_load_info",e[e.tcp_forward_server_load=74]="tcp_forward_server_load",e}({}),w=function(e){return e[e.data=0]="data",e[e.other=1]="other",e}({}),b=function(){function e(t,n,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cmdType=t,this.context=n,this.bin_context=o,this.code=r.m.Success,this.random_id=i}return function(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"encode",value:function(){return p.encode({cmdType:this.cmdType,context:this.context?JSON.stringify(this.context):null,code:this.code,message:this.message,binContext:this.bin_context,randomId:this.random_id})}}],[{key:"decode",value:function(t){var n=p.decode(t),r=n.context;if("string"==typeof r&&r)try{r=JSON.parse(r)}catch(e){console.log(e),r=n.context}var o=new e(n.cmdType,r,n.binContext);return o.code=n.code,o.message=n.message,o.random_id=n.randomId,o}}])}()},370(e,t,n){n.d(t,{I:()=>k});var r=n(4188),o=n(3459),i=n(2042);function a(e){return a="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},a(e)}function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var f=function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r={},(n=u(n="_events"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},t=[{key:"on",value:function(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),this}},{key:"once",value:function(e,t){var n=this,r=function(){t.apply(void 0,arguments),n.off(e,r)};return this.on(e,r)}},{key:"off",value:function(e,t){var n=this._events[e];return n?(this._events[e]=n.filter(function(e){return e!==t}),this):this}},{key:"off_all",value:function(e){return delete this._events[e],this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._events[e];return!(!o||0===o.length||(c(o).forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error('Error in listener for event "'.concat(e,'":'),t)}}),0))}}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function _(e){return _="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)}function d(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return p(l,"_invoke",function(n,r,o){var i,c,s,l=0,u=o||[],f=!1,_={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,c=0,s=e,_.n=n,a}};function d(n,r){for(c=n,s=r,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],d=_.p,p=i[2];n>3?(o=p===r)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,_.v=r,_.n=i[1]):d<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,_.n=p,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&d(u,p),c=u,s=p;(t=c<2?e:s)||!f;){i||(c?c<3?(c>1&&(_.n=-1),d(c,s)):_.n=s:_.v=s);try{if(l=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=_.n<0)?s:n.call(r,_))!==a)break}catch(t){i=e,c=1,s=t}finally{l=1}}return{value:t,done:f}}}(n,o,i),!0),l}var a={};function c(){}function s(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),f=l.prototype=c.prototype=Object.create(u);function _(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,p(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=l,p(f,"constructor",l),p(l,"constructor",s),s.displayName="GeneratorFunction",p(l,o,"GeneratorFunction"),p(f),p(f,o,"Generator"),p(f,r,function(){return this}),p(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:_}})()}function p(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}p=function(e,t,n,r){function i(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},p(e,t,n,r)}function y(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,c,"next",e)}function c(e){y(i,r,o,a,c,"throw",e)}a(void 0)})}}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function v(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_(t)?t:t+""}function w(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<e;r++)n+=t.charAt(Math.floor(62*Math.random()));return n}var b="https:"===window.location.protocol?"wss:":"ws:",k=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"_msg_event",new f),v(this,"_msgResolveMap",new Map),v(this,"_msgResolveTimeoutMap",new Map),this._url=t,this.name=n},t=[{key:"connect",value:(u=m(d().m(function e(){var t=this;return d().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(){var e=m(d().m(function e(n,a){var c,s;return d().w(function(e){for(;;)switch(e.n){case 0:if(!t._socket){e.n=1;break}return n(!0),e.a(2);case 1:if((null===(c=t._socket)||void 0===c?void 0:c.readyState)!==WebSocket.OPEN){e.n=2;break}return e.a(2,n(!0));case 2:t._socket=new WebSocket("".concat(b,"//").concat(t._url,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.data)),t._socket.binaryType="arraybuffer",t._socket.addEventListener("open",function(){console.log("WebSocket 已连接: ".concat(t._url)),n(!0),t.start_heart_interval()}),s=function(e){var n=r.hf.decode(e);n.client_wss=t._socket,n.code===o.m.Fail&&(0,i.zN)(n.message),t._msgResolveMap.has(n.random_id)&&(clearTimeout(t._msgResolveTimeoutMap.get(n.random_id)),t._msgResolveTimeoutMap.delete(n.random_id),t._msgResolveMap.get(n.random_id)(n),t._msgResolveMap.delete(n.random_id)),t.emit_message("message",n),t.emit_message("message_".concat(n.cmdType),n)},t._socket.addEventListener("message",function(){var e=m(d().m(function e(t){var n,r,o;return d().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!((n=t.data)instanceof Blob)){e.n=2;break}return e.n=1,n.arrayBuffer();case 1:n=e.v,n=new Uint8Array(n),e.n=3;break;case 2:n instanceof ArrayBuffer&&(n=new Uint8Array(n));case 3:s(n),e.n=5;break;case 4:e.p=4,o=e.v,console.error("WS 消息错误",null!==(r=null==o?void 0:o.message)&&void 0!==r?r:o);case 5:return e.a(2)}},e,null,[[0,4]])}));return function(t){return e.apply(this,arguments)}}()),t._socket.addEventListener("close",function(e){console.log("WS 已断开: ".concat(t._url),e.code,e.reason),t._socket=null,t.emit_message("close"),t.stop_heart_interval()}),t._socket.addEventListener("error",function(e){console.error("WS 错误",e)});case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()))},e)})),function(){return u.apply(this,arguments)})},{key:"start_heart_interval",value:function(){var e=this;this._heart_interval=setInterval(function(){e.sendData(r.HK.heart,{})},601e3)}},{key:"stop_heart_interval",value:function(){clearInterval(this._heart_interval)}},{key:"sendData",value:(l=m(d().m(function e(t,n,o){var i;return d().w(function(e){for(;;)if(0===e.n)return(i=new r.hf(t)).context=n,o&&(i.random_id=w(9)),e.a(2,this.send(i))},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"send",value:(s=m(d().m(function e(t){var n=this;return d().w(function(e){for(;;)switch(e.n){case 0:if(this._socket){e.n=1;break}return e.n=1,this.connect();case 1:if(this._socket.readyState===WebSocket.OPEN){e.n=2;break}return e.n=2,new Promise(function(e,t){var r=setTimeout(function(){return t(new Error("WS 连接超时"))},5e3),o=function(){clearTimeout(r),n._socket.removeEventListener("open",o),e()};n._socket.addEventListener("open",o)});case 2:return e.a(2,new Promise(function(e,r){try{t.random_id=w(9);var o=t.random_id,i=setTimeout(function(){r(!1),console.info("ws超时",t.cmdType),n._msgResolveMap.delete(o)},6e3);n._msgResolveMap.set(o,e),n._msgResolveTimeoutMap.set(o,i),n._socket.send(t.encode())}catch(e){r(e)}}))}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"subscribeUnconnect",value:function(e){this.on_message("close",e)}},{key:"close",value:(c=m(d().m(function e(){return d().w(function(e){for(;;)switch(e.n){case 0:if(this._socket){e.n=1;break}return e.a(2);case 1:this._socket.close(),this._socket=null,this.stop_heart_interval();case 2:return e.a(2)}},e,this)})),function(){return c.apply(this,arguments)})},{key:"addMsg",value:(a=m(d().m(function e(t,n){return d().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.connect();case 1:this.on_message("message_".concat(t),n);case 2:return e.a(2)}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"removeMsg",value:function(e){this._msg_event.off_all("message_".concat(e))}},{key:"on_message",value:function(e,t){this._msg_event.on(e,t)}},{key:"on_once_message",value:function(e,t){this._msg_event.once(e,t)}},{key:"off_message",value:function(e,t){this._msg_event.off(e,t)}},{key:"emit_message",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=this._msg_event).emit.apply(t,[e].concat(r))}}],n=[{key:"getOtherWebSocket",value:function(e){return new WebSocket("".concat(b,"//").concat(window.location.host+window.location.pathname,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.other,"&code=").concat(e))}},{key:"getOtherWebSocketUrl",value:function(e,t){for(var n="".concat(b,"//").concat(window.location.host+window.location.pathname,"?token=").concat(localStorage.getItem("token"),"&type=").concat(r.hF.other,"&code=").concat(e),o=0,i=Object.keys(t);o<i.length;o++){var a=i[o];n+="&".concat(a,"=").concat(encodeURIComponent(t[a]))}return n}}],t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,a,c,s,l,u}()},4944(e,t,n){n.d(t,{ws:()=>r});var r=new(n(370).I)(window.location.host+window.location.pathname,"全局")}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see 962.
|
|
2
|
-
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[627,962],{5219(t){!function(){var e=function(t,n){var r=this;e.count=(e.count||0)+1,this.count=e.count,this.isOpened=!1,this.input=i(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls","awesomplete_list_"+this.count),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=n=n||{},function(t,e,n){for(var r in e){var i=e[r],o=t.input.getAttribute("data-"+r.toLowerCase());t[r]="number"==typeof i?parseInt(o):!1===i?null!==o:i instanceof Function?null:o,t[r]||0===t[r]||(t[r]=r in n?n[r]:i)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:e.DATA,filter:e.FILTER_CONTAINS,sort:!1!==n.sort&&e.SORT_BYLENGTH,container:e.CONTAINER,item:e.ITEM,replace:e.REPLACE,tabSelect:!1,listLabel:"Results List",statusNoResults:"No results found",statusXResults:"{0} results found",statusTypeXChar:"Type {0} or more characters for results"},n),this.index=-1,this.container=this.container(t),this.ul=i.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container,"aria-label":this.listLabel}),this.status=i.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:""}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;r.opened&&(13===e&&r.selected||9===e&&r.selected&&r.tabSelect?(t.preventDefault(),r.select(void 0,void 0,t)):27===e?r.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),r[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),r.select(e,t.target,t))}}}},i.bind(this.input,this._events.input),i.bind(this.input.form,this._events.form),i.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||n.list||[],e.all.push(this)};function n(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}e.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=i(t))&&t.children){var e=[];r.apply(t.children).forEach(function(t){if(!t.disabled){var n=t.textContent.trim(),r=t.value||n,i=t.label||n;""!==r&&e.push({label:i,value:r})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),this.input.setAttribute("aria-activedescendant",""),i.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),i.fire(this.input,"awesomplete-open")},destroy:function(){if(i.unbind(this.input,this._events.input),i.unbind(this.input.form,this._events.form),!this.options.container){var t=this.container.parentNode;t.insertBefore(this.input,this.container),t.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-owns"),this.input.removeAttribute("role");var n=e.all.indexOf(this);-1!==n&&e.all.splice(n,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,i.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e,n){if(t?this.index=i.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index];i.fire(this.input,"awesomplete-select",{text:r,origin:e||t,originalEvent:n})&&(this.replace(r),this.close({reason:"select"}),i.fire(this.input,"awesomplete-selectcomplete",{text:r,originalEvent:n}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(r){return new n(t.data(r,e))}).filter(function(n){return t.filter(n,e)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(n,r){t.ul.appendChild(t.item(n,e,r))}),0===this.ul.children.length?(this.status.textContent=this.statusNoResults,this.close({reason:"nomatches"})):(this.input.setAttribute("aria-activedescendant",""),this.open(),this.status.textContent=this.statusXResults.replaceAll("{0}",this.ul.children.length))):(this.close({reason:"nomatches"}),this.minChar<=1||e.length>=this.minChars?this.status.textContent=this.statusNoResults:this.status.textContent=this.statusTypeXChar.replaceAll("{0}",this.minChars))}},e.all=[],e.FILTER_CONTAINS=function(t,e){return RegExp(i.regExpEscape(e.trim()),"i").test(t)},e.FILTER_STARTSWITH=function(t,e){return RegExp("^"+i.regExpEscape(e.trim()),"i").test(t)},e.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},e.CONTAINER=function(t){return i.create("div",{className:"awesomplete",around:t})},e.ITEM=function(t,e,n){var r=""===e.trim()?t:t.replace(RegExp(i.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return i.create("li",{innerHTML:r,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+n})},e.REPLACE=function(t){this.input.value=t.value},e.DATA=function(t){return t},Object.defineProperty(n.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),n.prototype.toString=n.prototype.valueOf=function(){return""+this.label};var r=Array.prototype.slice;function i(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function o(t,e){return r.call((e||document).querySelectorAll(t))}function a(){o("input.awesomplete").forEach(function(t){new e(t)})}i.create=function(t,e){var n=document.createElement(t);for(var r in e){var o=e[r];if("inside"===r)i(o).appendChild(n);else if("around"===r){var a=i(o);a.parentNode.insertBefore(n,a),n.appendChild(a),null!=a.getAttribute("autofocus")&&a.focus()}else r in n?n[r]=o:n.setAttribute(r,o)}return n},i.bind=function(t,e){if(t)for(var n in e){var r=e[n];n.split(/\s+/).forEach(function(e){t.addEventListener(e,r)})}},i.unbind=function(t,e){if(t)for(var n in e){var r=e[n];n.split(/\s+/).forEach(function(e){t.removeEventListener(e,r)})}},i.fire=function(t,e,n){var r=document.createEvent("HTMLEvents");for(var i in r.initEvent(e,!0,!0),n)r[i]=n[i];return t.dispatchEvent(r)},i.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},i.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof self&&(self.Awesomplete=e),"undefined"!=typeof Document&&("loading"!==document.readyState?a():document.addEventListener("DOMContentLoaded",a)),e.$=i,e.$$=o,t.exports&&(t.exports=e)}()},2674(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>F});var r=n(6540),i=n(6417),o=n(7444),a=n(5997),s=n(7952),l=n(7022),u=n(4251);function c(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return f(u,"_invoke",function(n,r,i){var o,s,l,u=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,s=0,l=t,h.n=n,a}};function p(n,r){for(s=n,l=r,e=0;!f&&u&&!i&&e<c.length;e++){var i,o=c[e],p=h.p,d=o[2];n>3?(i=d===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,h.v=r,h.n=o[1]):p<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,h.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,c,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,d),s=c,l=d;(e=s<2?t:l)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){o=t,s=1,l=e}finally{u=1}}return{value:e,done:f}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}e=Object.getPrototypeOf;var h=[][r]?e(e([][r]())):(f(e={},r,function(){return this}),e),p=u.prototype=s.prototype=Object.create(h);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,f(t,i,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=u,f(p,"constructor",u),f(u,"constructor",l),l.displayName="GeneratorFunction",f(u,i,"GeneratorFunction"),f(p),f(p,i,"Generator"),f(p,r,function(){return this}),f(p,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:d}})()}function f(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}f=function(t,e,n,r){function o(e,n){f(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},f(t,e,n,r)}function h(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function p(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(t){h(o,r,i,a,s,"next",t)}function s(t){h(o,r,i,a,s,"throw",t)}a(void 0)})}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(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 v(t){var e=d((0,r.useState)(!1),2),n=e[0],i=e[1],o=d((0,r.useState)([]),2),a=o[0],s=o[1],f=function(t){s(t)},h=function(){var e=p(c().m(function e(){return c().w(function(e){for(;;)switch(e.n){case 0:if("folder"!==t.type){e.n=2;break}if(n||!t.click||a){e.n=1;break}return e.n=1,t.click(t,f,t.pre_path);case 1:i(!n),e.n=3;break;case 2:if(!t.click){e.n=3;break}return e.n=3,t.click(t,f,t.pre_path);case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),m=function(){var e=p(c().m(function e(){var n,r=arguments;return c().w(function(e){for(;;)switch(e.n){case 0:if(n=r.length>0&&void 0!==r[0]&&r[0],"folder"!==t.type||n){e.n=2;break}return e.n=1,t.click(t,f,t.pre_path);case 1:e.n=3;break;case 2:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)(function(){s(t.children)},[t.children]),r.createElement("div",{className:"studio-item"},r.createElement("div",{onClick:h,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===l.Iw.folder,m)},className:"studio-item-title"},r.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":n?"arrow_drop_down":"arrow_right"),r.createElement("span",{className:"file-icons"},r.createElement("span",{"data-type":(0,u.uL)(t.name),"data-dir":"folder"===t.type,"aria-label":t.name},r.createElement("i",{className:"material-icons","aria-label":t.name}))),r.createElement("span",{className:"studio-item-name"},t.name)),n&&a&&r.createElement("div",{style:{marginLeft:20}},a.map(function(e,n){return r.createElement(r.Fragment,{key:n},r.createElement(v,{type:e.type,size:e.size,click:t.click,name:e.name,key:n,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===l.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:m}))})))}function y(t){return r.createElement("div",null,t.list.map(function(e,n){return r.createElement(v,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===l.Iw.folder?"/":""),key:n,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click,size:e.size})}))}var b=n(4284),g=n(4289),w=n(3459),E=n(8247),x=n(2543),A=n.n(x),k=n(4505),_=n(2389),S=n(8815),C=n(7767);function T(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return N(u,"_invoke",function(n,r,i){var o,s,l,u=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,s=0,l=t,h.n=n,a}};function p(n,r){for(s=n,l=r,e=0;!f&&u&&!i&&e<c.length;e++){var i,o=c[e],p=h.p,d=o[2];n>3?(i=d===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,h.v=r,h.n=o[1]):p<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,h.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,c,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,d),s=c,l=d;(e=s<2?t:l)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){o=t,s=1,l=e}finally{u=1}}return{value:e,done:f}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}e=Object.getPrototypeOf;var c=[][r]?e(e([][r]())):(N(e={},r,function(){return this}),e),f=u.prototype=s.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,N(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=u,N(f,"constructor",u),N(u,"constructor",l),l.displayName="GeneratorFunction",N(u,i,"GeneratorFunction"),N(f),N(f,i,"Generator"),N(f,r,function(){return this}),N(f,"toString",function(){return"[object Generator]"}),(T=function(){return{w:o,m:h}})()}function N(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}N=function(t,e,n,r){function o(e,n){N(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},N(t,e,n,r)}function O(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=L(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function I(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function j(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(t){I(o,r,i,a,s,"next",t)}function s(t){I(o,r,i,a,s,"throw",t)}a(void 0)})}}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,e)||L(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){if(t){if("string"==typeof t)return R(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(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}var M=r.lazy(function(){return Promise.all([n.e(301),n.e(91)]).then(n.bind(n,4091))});function F(t){var e=P((0,r.useState)([]),2),n=e[0],c=e[1],f=P((0,r.useState)(""),2),h=f[0],p=f[1],d=P((0,r.useState)(""),2),m=(d[0],d[1]),v=P((0,r.useState)(!1),2),x=(v[0],v[1],P((0,r.useState)({path:"",name:""}),2)),N=x[0],I=x[1],L=P((0,r.useState)(""),2),R=L[0],F=L[1],G=P((0,o.L4)(i.A.confirm),2),D=(G[0],G[1]),z=P((0,r.useState)(!1),2),$=z[0],H=z[1],B=P((0,o.L4)(i.A.fileShellShow),2),U=B[0],X=B[1],K=P((0,o.L4)(i.A.file_shell_hidden),2),Y=K[0],W=K[1],q=(0,r.useRef)(null),Z=(0,r.useRef)(null),J=P((0,r.useState)(!1),2),Q=J[0],V=J[1],tt=P((0,r.useState)(16),2),et=tt[0],nt=tt[1],rt=P((0,o.L4)(i.A.showPrompt),2),it=(rt[0],rt[1]),ot=(0,_.Bd)().t,at=(0,C.Zp)(),st=(0,C.zy)().pathname.split("/").filter(Boolean).pop();st=decodeURIComponent(st);var lt=function(){var t=j(T().m(function t(){var e,n,r,i,o,a,s;return T().w(function(t){for(;;)switch(t.n){case 0:return e=(0,g.GG)("file",st),p(e),t.n=1,b.$M.post("studio/get/item",{path:e});case 1:if((n=t.v).code===w.m.Success){r=[],i=[],o=O(n.data.list);try{for(o.s();!(a=o.n()).done;)"folder"===(s=a.value).type?r.push(s):"file"===s.type&&i.push(s)}catch(t){o.e(t)}finally{o.f()}c([].concat(r,i))}case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}();(0,r.useEffect)(function(){m(""),I({}),H(!1),lt()},[]);var ut=function(){var t=j(T().m(function t(e,n){var r;return T().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,b.$M.get("".concat(encodeURIComponent(n)));case 1:r=t.v,m(r.data),E.xK.set_value_temp(r.data),I({path:n,name:e}),F(n);case 2:return t.a(2)}},t)}));return function(e,n){return t.apply(this,arguments)}}(),ct=function(t,e){t.size>S.o5?D({open:!0,handle:function(){ut(t.name,e),D({open:!1,handle:null}),H(!1)},title:"超过20MB了还要打开吗?"}):ut(t.name,e)},ft=function(){var t=j(T().m(function t(e,n,r){var i,o,a,s,l,u;return T().w(function(t){for(;;)switch(t.n){case 0:if("folder"!==e.type){t.n=2;break}return t.n=1,b.$M.post("studio/get/item",{path:"".concat(r)});case 1:if((i=t.v).code===w.m.Success){o=[],a=[],s=O(i.data.list);try{for(s.s();!(l=s.n()).done;)"folder"===(u=l.value).type?o.push(u):"file"===u.type&&a.push(u)}catch(t){s.e(t)}finally{s.f()}n([].concat(o,a))}t.n=4;break;case 2:if(!$){t.n=3;break}return D({open:!0,handle:function(){D({open:!1,handle:null}),H(!1),ct(e,r)},title:"确定不保存就切换吗?"}),t.a(2);case 3:ct(e,r);case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}();function ht(){return pt.apply(this,arguments)}function pt(){return(pt=j(T().m(function t(){var e;return T().w(function(t){for(;;)switch(t.n){case 0:if($){t.n=1;break}return t.a(2);case 1:return e={context:E.xK.get_editor_value()},t.n=2,b.$M.post("save/".concat(encodeURIComponent(R)),e);case 2:0===t.v.code&&H(!1);case 3:return t.a(2)}},t)}))).apply(this,arguments)}var dt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),$&&ht())};(0,r.useEffect)(function(){return document.addEventListener("keydown",dt),function(){document.removeEventListener("keydown",dt)}},[$]);var mt=(0,r.useCallback)(A().throttle(function(t){var e=parseFloat(getComputedStyle(Z.current).fontSize),n=window.innerWidth/e-4,r=t.clientX/e,i=2.25+q.current.offsetWidth/e;r<=n&&r>=i&&nt(parseFloat(r.toFixed(2)))},32),[]),vt=function(){V(!1),Z.current.removeEventListener("pointermove",mt)},yt=[{r:ot("创建文件"),v:"创建文件"},{r:ot("创建目录"),v:"创建目录"},{r:ot("重命名"),v:"重命名"},{r:ot("删除"),v:"删除"}],bt=[{r:ot("重命名"),v:"重命名"},{r:ot("删除"),v:"删除"}],gt=function(t,e,n,r,i){t.preventDefault();var o=new u.ik;o.path=n,o.filename=e,o.x=t.clientX,o.y=t.clientY,o.items=r?yt:bt,i===lt&&(o.items=o.items.slice(0,2)),o.type=r?l.Iw.studio_folder:l.Iw.studio_file;var a=function(t){i(t)};o.textClick=function(t){switch(t){case"创建文件":it({show:!0,type:k.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:a}});break;case"创建目录":it({show:!0,type:k.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:a}});break;case"删除":if($&&(N.path===n||N.path.includes(n))){it({show:!0,type:k.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:function(){a(r),H(!1),I({}),m(""),E.xK.set_value_temp("")}}});break}it({show:!0,type:k.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:r?function(){a(!0)}:a}});break;case"重命名":it({show:!0,type:k.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,g.Yp)(n),call:function(){a(!0)},filename:e}})}},it({show:!0,type:k.PromptEnum.FileMenu,overlay:!1,data:o})};return r.createElement("div",{className:"studio"},r.createElement(s.A,{ignore_tags:!0,left_children:[r.createElement(a.rA,{key:1,title:"取消",icon:"close",onClick:function(){X({show:!1,path:""}),W(void 0),at(-1)}}),r.createElement("title",{key:2},N.name)]},(0,u.zr)(N.name)&&r.createElement(a.rA,{title:"格式化",icon:"data_object",onClick:function(){var t;null===(t=E.xK.get_editor())||void 0===t||t.formatCode()}}),r.createElement(a.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===Y?U.show?X({show:!1,path:""}):(X({show:!0,path:(0,g.GG)("file",st)}),W(!1)):W(!Y)}}),$&&r.createElement(a.rA,{title:"保存",icon:"save",onClick:ht})),r.createElement("div",{className:"studio-body",ref:Z},r.createElement("div",{className:"studio-nav",style:{width:"".concat(et-1,"em")},onContextMenu:function(t){gt(t,N.name,(0,g.GG)("file",st),!0,lt)}},r.createElement(y,{pre_path:h,list:n,click:ft,handleContextMenu:gt,fatherNowToggleExpansion:lt})),r.createElement("div",{className:"studio__divider",ref:q,onPointerDown:function(){V(!0),Z.current.addEventListener("pointermove",mt)},onPointerUp:vt}),Q&&r.createElement("div",{className:"shell__overlay",onPointerUp:vt}),r.createElement("div",{className:"studio-editor",key:N.path},N.name&&r.createElement(M,{name:N.name,on_change:function(){$||H(!0)}}))))}},1028(t,e,n){"use strict";n.d(e,{A:()=>s});var r=n(1601),i=n.n(r),o=n(6314),a=n.n(o)()(i());a.push([t.id,'.awesomplete [hidden] {\n display: none;\n}\n\n.awesomplete .visually-hidden {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n}\n\n.awesomplete {\n display: inline-block;\n position: relative;\n}\n\n.awesomplete > input {\n display: block;\n}\n\n.awesomplete > ul {\n position: absolute;\n left: 0;\n z-index: 1;\n min-width: 100%;\n box-sizing: border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n background: #fff;\n}\n\n.awesomplete > ul:empty {\n display: none;\n}\n\n.awesomplete > ul {\n\tborder-radius: .3em;\n\tmargin: .2em 0 0;\n\tbackground: hsla(0,0%,100%,.9);\n\tbackground: linear-gradient(to bottom right, white, hsla(0,0%,100%,.8));\n\tborder: 1px solid rgba(0,0,0,.3);\n\tbox-shadow: .05em .2em .6em rgba(0,0,0,.2);\n\ttext-shadow: none;\n}\n\n@supports (transform: scale(0)) {\n\t.awesomplete > ul {\n\t\ttransition: .3s cubic-bezier(.4,.2,.5,1.4);\n\t\ttransform-origin: 1.43em -.43em;\n\t}\n\t\n\t.awesomplete > ul[hidden],\n\t.awesomplete > ul:empty {\n\t\topacity: 0;\n\t\ttransform: scale(0);\n\t\tdisplay: block;\n\t\tvisibility: hidden;\n\t\ttransition-timing-function: ease;\n\t}\n}\n\n\t/* Pointer */\n\t.awesomplete > ul:before {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t\ttop: -.43em;\n\t\tleft: 1em;\n\t\twidth: 0; height: 0;\n\t\tpadding: .4em;\n\t\tbackground: white;\n\t\tborder: inherit;\n\t\tborder-right: 0;\n\t\tborder-bottom: 0;\n\t\t-webkit-transform: rotate(45deg);\n\t\ttransform: rotate(45deg);\n\t}\n\n\t.awesomplete > ul > li {\n\t\tposition: relative;\n\t\tpadding: .2em .5em;\n\t\tcursor: pointer;\n\t}\n\t\n\t.awesomplete > ul > li:hover {\n\t\tbackground: hsl(200, 40%, 80%);\n\t\tcolor: black;\n\t}\n\t\n\t.awesomplete > ul > li[aria-selected="true"] {\n\t\tbackground: hsl(205, 40%, 40%);\n\t\tcolor: white;\n\t}\n\t\n\t\t.awesomplete mark {\n\t\t\tbackground: hsl(65, 100%, 50%);\n\t\t}\n\t\t\n\t\t.awesomplete li:hover mark {\n\t\t\tbackground: hsl(68, 100%, 41%);\n\t\t}\n\t\t\n\t\t.awesomplete li[aria-selected="true"] mark {\n\t\t\tbackground: hsl(86, 100%, 21%);\n\t\t\tcolor: inherit;\n\t\t}\n',""]);const s=a},9145(t,e,n){"use strict";var r=n(5072),i=n.n(r),o=n(7825),a=n.n(o),s=n(7659),l=n.n(s),u=n(5056),c=n.n(u),f=n(540),h=n.n(f),p=n(1113),d=n.n(p),m=n(1028),v={};v.styleTagTransform=d(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=h();i()(m.A,v),m.A&&m.A.locals&&m.A.locals}}]);
|
|
1
|
+
/*! For license information please see 962.e634766c7c6134ab292c.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[627,962],{5219(t){!function(){var e=function(t,n){var r=this;e.count=(e.count||0)+1,this.count=e.count,this.isOpened=!1,this.input=i(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls","awesomplete_list_"+this.count),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=n=n||{},function(t,e,n){for(var r in e){var i=e[r],o=t.input.getAttribute("data-"+r.toLowerCase());t[r]="number"==typeof i?parseInt(o):!1===i?null!==o:i instanceof Function?null:o,t[r]||0===t[r]||(t[r]=r in n?n[r]:i)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:e.DATA,filter:e.FILTER_CONTAINS,sort:!1!==n.sort&&e.SORT_BYLENGTH,container:e.CONTAINER,item:e.ITEM,replace:e.REPLACE,tabSelect:!1,listLabel:"Results List",statusNoResults:"No results found",statusXResults:"{0} results found",statusTypeXChar:"Type {0} or more characters for results"},n),this.index=-1,this.container=this.container(t),this.ul=i.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container,"aria-label":this.listLabel}),this.status=i.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:""}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;r.opened&&(13===e&&r.selected||9===e&&r.selected&&r.tabSelect?(t.preventDefault(),r.select(void 0,void 0,t)):27===e?r.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),r[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),r.select(e,t.target,t))}}}},i.bind(this.input,this._events.input),i.bind(this.input.form,this._events.form),i.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||n.list||[],e.all.push(this)};function n(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}e.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=i(t))&&t.children){var e=[];r.apply(t.children).forEach(function(t){if(!t.disabled){var n=t.textContent.trim(),r=t.value||n,i=t.label||n;""!==r&&e.push({label:i,value:r})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),this.input.setAttribute("aria-activedescendant",""),i.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),i.fire(this.input,"awesomplete-open")},destroy:function(){if(i.unbind(this.input,this._events.input),i.unbind(this.input.form,this._events.form),!this.options.container){var t=this.container.parentNode;t.insertBefore(this.input,this.container),t.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-owns"),this.input.removeAttribute("role");var n=e.all.indexOf(this);-1!==n&&e.all.splice(n,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,i.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e,n){if(t?this.index=i.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index];i.fire(this.input,"awesomplete-select",{text:r,origin:e||t,originalEvent:n})&&(this.replace(r),this.close({reason:"select"}),i.fire(this.input,"awesomplete-selectcomplete",{text:r,originalEvent:n}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(r){return new n(t.data(r,e))}).filter(function(n){return t.filter(n,e)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(n,r){t.ul.appendChild(t.item(n,e,r))}),0===this.ul.children.length?(this.status.textContent=this.statusNoResults,this.close({reason:"nomatches"})):(this.input.setAttribute("aria-activedescendant",""),this.open(),this.status.textContent=this.statusXResults.replaceAll("{0}",this.ul.children.length))):(this.close({reason:"nomatches"}),this.minChar<=1||e.length>=this.minChars?this.status.textContent=this.statusNoResults:this.status.textContent=this.statusTypeXChar.replaceAll("{0}",this.minChars))}},e.all=[],e.FILTER_CONTAINS=function(t,e){return RegExp(i.regExpEscape(e.trim()),"i").test(t)},e.FILTER_STARTSWITH=function(t,e){return RegExp("^"+i.regExpEscape(e.trim()),"i").test(t)},e.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},e.CONTAINER=function(t){return i.create("div",{className:"awesomplete",around:t})},e.ITEM=function(t,e,n){var r=""===e.trim()?t:t.replace(RegExp(i.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return i.create("li",{innerHTML:r,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+n})},e.REPLACE=function(t){this.input.value=t.value},e.DATA=function(t){return t},Object.defineProperty(n.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),n.prototype.toString=n.prototype.valueOf=function(){return""+this.label};var r=Array.prototype.slice;function i(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function o(t,e){return r.call((e||document).querySelectorAll(t))}function a(){o("input.awesomplete").forEach(function(t){new e(t)})}i.create=function(t,e){var n=document.createElement(t);for(var r in e){var o=e[r];if("inside"===r)i(o).appendChild(n);else if("around"===r){var a=i(o);a.parentNode.insertBefore(n,a),n.appendChild(a),null!=a.getAttribute("autofocus")&&a.focus()}else r in n?n[r]=o:n.setAttribute(r,o)}return n},i.bind=function(t,e){if(t)for(var n in e){var r=e[n];n.split(/\s+/).forEach(function(e){t.addEventListener(e,r)})}},i.unbind=function(t,e){if(t)for(var n in e){var r=e[n];n.split(/\s+/).forEach(function(e){t.removeEventListener(e,r)})}},i.fire=function(t,e,n){var r=document.createEvent("HTMLEvents");for(var i in r.initEvent(e,!0,!0),n)r[i]=n[i];return t.dispatchEvent(r)},i.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},i.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof self&&(self.Awesomplete=e),"undefined"!=typeof Document&&("loading"!==document.readyState?a():document.addEventListener("DOMContentLoaded",a)),e.$=i,e.$$=o,t.exports&&(t.exports=e)}()},2674(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>F});var r=n(6540),i=n(6417),o=n(7444),a=n(5997),s=n(7952),l=n(7022),u=n(4251);function c(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return f(u,"_invoke",function(n,r,i){var o,s,l,u=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,s=0,l=t,h.n=n,a}};function p(n,r){for(s=n,l=r,e=0;!f&&u&&!i&&e<c.length;e++){var i,o=c[e],p=h.p,d=o[2];n>3?(i=d===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,h.v=r,h.n=o[1]):p<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,h.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,c,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,d),s=c,l=d;(e=s<2?t:l)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){o=t,s=1,l=e}finally{u=1}}return{value:e,done:f}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}e=Object.getPrototypeOf;var h=[][r]?e(e([][r]())):(f(e={},r,function(){return this}),e),p=u.prototype=s.prototype=Object.create(h);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,f(t,i,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=u,f(p,"constructor",u),f(u,"constructor",l),l.displayName="GeneratorFunction",f(u,i,"GeneratorFunction"),f(p),f(p,i,"Generator"),f(p,r,function(){return this}),f(p,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:d}})()}function f(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}f=function(t,e,n,r){function o(e,n){f(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},f(t,e,n,r)}function h(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function p(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(t){h(o,r,i,a,s,"next",t)}function s(t){h(o,r,i,a,s,"throw",t)}a(void 0)})}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(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 v(t){var e=d((0,r.useState)(!1),2),n=e[0],i=e[1],o=d((0,r.useState)([]),2),a=o[0],s=o[1],f=function(t){s(t)},h=function(){var e=p(c().m(function e(){return c().w(function(e){for(;;)switch(e.n){case 0:if("folder"!==t.type){e.n=2;break}if(n||!t.click||a){e.n=1;break}return e.n=1,t.click(t,f,t.pre_path);case 1:i(!n),e.n=3;break;case 2:if(!t.click){e.n=3;break}return e.n=3,t.click(t,f,t.pre_path);case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),m=function(){var e=p(c().m(function e(){var n,r=arguments;return c().w(function(e){for(;;)switch(e.n){case 0:if(n=r.length>0&&void 0!==r[0]&&r[0],"folder"!==t.type||n){e.n=2;break}return e.n=1,t.click(t,f,t.pre_path);case 1:e.n=3;break;case 2:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)(function(){s(t.children)},[t.children]),r.createElement("div",{className:"studio-item"},r.createElement("div",{onClick:h,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===l.Iw.folder,m)},className:"studio-item-title"},r.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":n?"arrow_drop_down":"arrow_right"),r.createElement("span",{className:"file-icons"},r.createElement("span",{"data-type":(0,u.uL)(t.name),"data-dir":"folder"===t.type,"aria-label":t.name},r.createElement("i",{className:"material-icons","aria-label":t.name}))),r.createElement("span",{className:"studio-item-name"},t.name)),n&&a&&r.createElement("div",{style:{marginLeft:20}},a.map(function(e,n){return r.createElement(r.Fragment,{key:n},r.createElement(v,{type:e.type,size:e.size,click:t.click,name:e.name,key:n,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===l.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:m}))})))}function y(t){return r.createElement("div",null,t.list.map(function(e,n){return r.createElement(v,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===l.Iw.folder?"/":""),key:n,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click,size:e.size})}))}var b=n(4284),g=n(4289),w=n(3459),E=n(8247),x=n(2543),A=n.n(x),k=n(4505),_=n(2389),S=n(8815),C=n(7767);function T(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return N(u,"_invoke",function(n,r,i){var o,s,l,u=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,s=0,l=t,h.n=n,a}};function p(n,r){for(s=n,l=r,e=0;!f&&u&&!i&&e<c.length;e++){var i,o=c[e],p=h.p,d=o[2];n>3?(i=d===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,h.v=r,h.n=o[1]):p<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,h.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,c,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,d),s=c,l=d;(e=s<2?t:l)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){o=t,s=1,l=e}finally{u=1}}return{value:e,done:f}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}e=Object.getPrototypeOf;var c=[][r]?e(e([][r]())):(N(e={},r,function(){return this}),e),f=u.prototype=s.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,N(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=u,N(f,"constructor",u),N(u,"constructor",l),l.displayName="GeneratorFunction",N(u,i,"GeneratorFunction"),N(f),N(f,i,"Generator"),N(f,r,function(){return this}),N(f,"toString",function(){return"[object Generator]"}),(T=function(){return{w:o,m:h}})()}function N(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}N=function(t,e,n,r){function o(e,n){N(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},N(t,e,n,r)}function O(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=L(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function I(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function j(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(t){I(o,r,i,a,s,"next",t)}function s(t){I(o,r,i,a,s,"throw",t)}a(void 0)})}}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,e)||L(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){if(t){if("string"==typeof t)return R(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(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}var M=r.lazy(function(){return Promise.all([n.e(301),n.e(91)]).then(n.bind(n,4091))});function F(t){var e=P((0,r.useState)([]),2),n=e[0],c=e[1],f=P((0,r.useState)(""),2),h=f[0],p=f[1],d=P((0,r.useState)(""),2),m=(d[0],d[1]),v=P((0,r.useState)(!1),2),x=(v[0],v[1],P((0,r.useState)({path:"",name:""}),2)),N=x[0],I=x[1],L=P((0,r.useState)(""),2),R=L[0],F=L[1],G=P((0,o.L4)(i.A.confirm),2),D=(G[0],G[1]),z=P((0,r.useState)(!1),2),$=z[0],H=z[1],B=P((0,o.L4)(i.A.fileShellShow),2),U=B[0],X=B[1],K=P((0,o.L4)(i.A.file_shell_hidden),2),Y=K[0],W=K[1],q=(0,r.useRef)(null),Z=(0,r.useRef)(null),J=P((0,r.useState)(!1),2),Q=J[0],V=J[1],tt=P((0,r.useState)(16),2),et=tt[0],nt=tt[1],rt=P((0,o.L4)(i.A.showPrompt),2),it=(rt[0],rt[1]),ot=(0,_.Bd)().t,at=(0,C.Zp)(),st=(0,C.zy)().pathname.split("/").filter(Boolean).pop();st=decodeURIComponent(st);var lt=function(){var t=j(T().m(function t(){var e,n,r,i,o,a,s;return T().w(function(t){for(;;)switch(t.n){case 0:return e=(0,g.GG)("file",st),p(e),t.n=1,b.$M.post("studio/get/item",{path:e});case 1:if((n=t.v).code===w.m.Success){r=[],i=[],o=O(n.data.list);try{for(o.s();!(a=o.n()).done;)"folder"===(s=a.value).type?r.push(s):"file"===s.type&&i.push(s)}catch(t){o.e(t)}finally{o.f()}c([].concat(r,i))}case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}();(0,r.useEffect)(function(){m(""),I({}),H(!1),lt()},[]);var ut=function(){var t=j(T().m(function t(e,n){var r;return T().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,b.$M.get("".concat(encodeURIComponent(n)));case 1:r=t.v,m(r.data),E.xK.set_value_temp(r.data),I({path:n,name:e}),F(n);case 2:return t.a(2)}},t)}));return function(e,n){return t.apply(this,arguments)}}(),ct=function(t,e){t.size>S.o5?D({open:!0,handle:function(){ut(t.name,e),D({open:!1,handle:null}),H(!1)},title:"超过20MB了还要打开吗?"}):ut(t.name,e)},ft=function(){var t=j(T().m(function t(e,n,r){var i,o,a,s,l,u;return T().w(function(t){for(;;)switch(t.n){case 0:if("folder"!==e.type){t.n=2;break}return t.n=1,b.$M.post("studio/get/item",{path:"".concat(r)});case 1:if((i=t.v).code===w.m.Success){o=[],a=[],s=O(i.data.list);try{for(s.s();!(l=s.n()).done;)"folder"===(u=l.value).type?o.push(u):"file"===u.type&&a.push(u)}catch(t){s.e(t)}finally{s.f()}n([].concat(o,a))}t.n=4;break;case 2:if(!$){t.n=3;break}return D({open:!0,handle:function(){D({open:!1,handle:null}),H(!1),ct(e,r)},title:"确定不保存就切换吗?"}),t.a(2);case 3:ct(e,r);case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}();function ht(){return pt.apply(this,arguments)}function pt(){return(pt=j(T().m(function t(){var e;return T().w(function(t){for(;;)switch(t.n){case 0:if($){t.n=1;break}return t.a(2);case 1:return e={context:E.xK.get_editor_value()},t.n=2,b.$M.post("save/".concat(encodeURIComponent(R)),e);case 2:0===t.v.code&&H(!1);case 3:return t.a(2)}},t)}))).apply(this,arguments)}var dt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),$&&ht())};(0,r.useEffect)(function(){return document.addEventListener("keydown",dt),function(){document.removeEventListener("keydown",dt)}},[$]);var mt=(0,r.useCallback)(A().throttle(function(t){var e=parseFloat(getComputedStyle(Z.current).fontSize),n=window.innerWidth/e-4,r=t.clientX/e,i=2.25+q.current.offsetWidth/e;r<=n&&r>=i&&nt(parseFloat(r.toFixed(2)))},32),[]),vt=function(){V(!1),Z.current.removeEventListener("pointermove",mt)},yt=[{r:ot("创建文件"),v:"创建文件"},{r:ot("创建目录"),v:"创建目录"},{r:ot("重命名"),v:"重命名"},{r:ot("删除"),v:"删除"}],bt=[{r:ot("重命名"),v:"重命名"},{r:ot("删除"),v:"删除"}],gt=function(t,e,n,r,i){t.preventDefault();var o=new u.ik;o.path=n,o.filename=e,o.x=t.clientX,o.y=t.clientY,o.items=r?yt:bt,i===lt&&(o.items=o.items.slice(0,2)),o.type=r?l.Iw.studio_folder:l.Iw.studio_file;var a=function(t){i(t)};o.textClick=function(t){switch(t){case"创建文件":it({show:!0,type:k.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:a}});break;case"创建目录":it({show:!0,type:k.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:a}});break;case"删除":if($&&(N.path===n||N.path.includes(n))){it({show:!0,type:k.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:function(){a(r),H(!1),I({}),m(""),E.xK.set_value_temp("")},filename:e}});break}it({show:!0,type:k.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:e,call:r?function(){a(!0)}:a}});break;case"重命名":it({show:!0,type:k.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,g.Yp)(n),call:function(){a(!0)},filename:e}})}},it({show:!0,type:k.PromptEnum.FileMenu,overlay:!1,data:o})};return r.createElement("div",{className:"studio"},r.createElement(s.A,{ignore_tags:!0,left_children:[r.createElement(a.rA,{key:1,title:"取消",icon:"close",onClick:function(){X({show:!1,path:""}),W(void 0),at(-1)}}),r.createElement("title",{key:2},N.name)]},(0,u.zr)(N.name)&&r.createElement(a.rA,{title:"格式化",icon:"data_object",onClick:function(){var t;null===(t=E.xK.get_editor())||void 0===t||t.formatCode()}}),r.createElement(a.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===Y?U.show?X({show:!1,path:""}):(X({show:!0,path:(0,g.GG)("file",st)}),W(!1)):W(!Y)}}),$&&r.createElement(a.rA,{title:"保存",icon:"save",onClick:ht})),r.createElement("div",{className:"studio-body",ref:Z},r.createElement("div",{className:"studio-nav",style:{width:"".concat(et-1,"em")},onContextMenu:function(t){gt(t,N.name,(0,g.GG)("file",st),!0,lt)}},r.createElement(y,{pre_path:h,list:n,click:ft,handleContextMenu:gt,fatherNowToggleExpansion:lt})),r.createElement("div",{className:"studio__divider",ref:q,onPointerDown:function(){V(!0),Z.current.addEventListener("pointermove",mt)},onPointerUp:vt}),Q&&r.createElement("div",{className:"shell__overlay",onPointerUp:vt}),r.createElement("div",{className:"studio-editor",key:N.path},N.name&&r.createElement(M,{name:N.name,on_change:function(){$||H(!0)}}))))}},1028(t,e,n){"use strict";n.d(e,{A:()=>s});var r=n(1601),i=n.n(r),o=n(6314),a=n.n(o)()(i());a.push([t.id,'.awesomplete [hidden] {\n display: none;\n}\n\n.awesomplete .visually-hidden {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n}\n\n.awesomplete {\n display: inline-block;\n position: relative;\n}\n\n.awesomplete > input {\n display: block;\n}\n\n.awesomplete > ul {\n position: absolute;\n left: 0;\n z-index: 1;\n min-width: 100%;\n box-sizing: border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n background: #fff;\n}\n\n.awesomplete > ul:empty {\n display: none;\n}\n\n.awesomplete > ul {\n\tborder-radius: .3em;\n\tmargin: .2em 0 0;\n\tbackground: hsla(0,0%,100%,.9);\n\tbackground: linear-gradient(to bottom right, white, hsla(0,0%,100%,.8));\n\tborder: 1px solid rgba(0,0,0,.3);\n\tbox-shadow: .05em .2em .6em rgba(0,0,0,.2);\n\ttext-shadow: none;\n}\n\n@supports (transform: scale(0)) {\n\t.awesomplete > ul {\n\t\ttransition: .3s cubic-bezier(.4,.2,.5,1.4);\n\t\ttransform-origin: 1.43em -.43em;\n\t}\n\t\n\t.awesomplete > ul[hidden],\n\t.awesomplete > ul:empty {\n\t\topacity: 0;\n\t\ttransform: scale(0);\n\t\tdisplay: block;\n\t\tvisibility: hidden;\n\t\ttransition-timing-function: ease;\n\t}\n}\n\n\t/* Pointer */\n\t.awesomplete > ul:before {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t\ttop: -.43em;\n\t\tleft: 1em;\n\t\twidth: 0; height: 0;\n\t\tpadding: .4em;\n\t\tbackground: white;\n\t\tborder: inherit;\n\t\tborder-right: 0;\n\t\tborder-bottom: 0;\n\t\t-webkit-transform: rotate(45deg);\n\t\ttransform: rotate(45deg);\n\t}\n\n\t.awesomplete > ul > li {\n\t\tposition: relative;\n\t\tpadding: .2em .5em;\n\t\tcursor: pointer;\n\t}\n\t\n\t.awesomplete > ul > li:hover {\n\t\tbackground: hsl(200, 40%, 80%);\n\t\tcolor: black;\n\t}\n\t\n\t.awesomplete > ul > li[aria-selected="true"] {\n\t\tbackground: hsl(205, 40%, 40%);\n\t\tcolor: white;\n\t}\n\t\n\t\t.awesomplete mark {\n\t\t\tbackground: hsl(65, 100%, 50%);\n\t\t}\n\t\t\n\t\t.awesomplete li:hover mark {\n\t\t\tbackground: hsl(68, 100%, 41%);\n\t\t}\n\t\t\n\t\t.awesomplete li[aria-selected="true"] mark {\n\t\t\tbackground: hsl(86, 100%, 21%);\n\t\t\tcolor: inherit;\n\t\t}\n',""]);const s=a},9145(t,e,n){"use strict";var r=n(5072),i=n.n(r),o=n(7825),a=n.n(o),s=n(7659),l=n.n(s),u=n(5056),c=n.n(u),f=n(540),h=n.n(f),p=n(1113),d=n.n(p),m=n(1028),v={};v.styleTagTransform=d(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=h();i()(m.A,v),m.A&&m.A.locals&&m.A.locals}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 984.b582bf2a28d3f827efd7.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[984],{7374(e,t,n){n.d(t,{e:()=>p});var r=n(6540),o=n(4976),i=n(7767),a=n(4694),l=n(4289),c=n(3033),u=n(5725),f=n(2389);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){var t=(0,i.zy)(),n=s((0,r.useState)([]),2),m=n[0],p=n[1],d=s((0,r.useState)("/"),2),y=d[0],v=d[1],h=s((0,r.useState)(void 0),2),_=h[0],w=h[1],b=(0,f.Bd)(),g=b.t;b.i18n;r.useEffect(function(){var t="",n=(0,l.vX)().split("/");n=n.filter(function(e){return e});var r=n.indexOf(e.baseRoute),o=[];if(-1!=r){t=(0,a.IO)(n.slice(0,r),e.baseRoute);for(var i=n.slice(r+1),c=0;c<i.length;c++){var u=i[c];o.push({value:u,href:0===c?"".concat(t).concat(u,"/"):(0,a.IO)(o[c-1].href,u)})}v(t),p(o)}},[t]);var E=function(t){t.stopPropagation(),e.clickFun(t)};return r.createElement("div",{className:"breadcrumbs",onClick:function(e){w(void 0!==_?void 0:"")}},r.createElement(r.Fragment,null,void 0===_?r.createElement(r.Fragment,null,r.createElement("span",{className:"chevron"},r.createElement(o.N_,{to:y,onClick:E},r.createElement("i",{className:"material-icons"},"home"))),m.map(function(e,t){return r.createElement("span",{className:"chevron",key:t},r.createElement("i",{className:"material-icons"},"keyboard_arrow_right"),r.createElement(o.N_,{to:e.href,onClick:E},decodeURIComponent(e.value)))})):r.createElement(u.QM,{click:function(){w(void 0)},children:r.createElement(c.Sm,{width:"100%",placeholder:g("输入跳转的目录"),handlerEnter:function(t){e.input_path_enter&&e.input_path_enter(t),w(void 0)}})})))}},2984(e,t,n){n.r(t),n.d(t,{default:()=>ue});var r=n(6540),o=n(7374),i=n(7444),a=n(6417),l=n(4284),c=n(7767),u=n(7952),f=n(4289),s=n(3459),m=n(9214),p=n(3033),d=n(2389),y=n(7523),v=n(8247),h=n(8815),_=n(6960),w=n(7071),b=n(4944),g=n(4188),E=n(3430),k=n(2458),A=n(96),S=n(5997),x=n(4505),O=n(4251),j=n(7022),P=n(2042),L=n(3496),C=n(2730),F=n(5725),G=n(447),I=n(7361);function M(e){return M="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},M(e)}function z(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||H(e)||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 D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){K(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function K(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==M(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof l?r:l,u=Object.create(c.prototype);return X(u,"_invoke",function(n,r,o){var i,l,c,u=0,f=o||[],s=!1,m={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,l=0,c=e,m.n=n,a}};function p(n,r){for(l=n,c=r,t=0;!s&&u&&!o&&t<f.length;t++){var o,i=f[t],p=m.p,d=i[2];n>3?(o=d===r)&&(c=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(l=0,m.v=r,m.n=i[1]):p<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,m.n=d,l=0))}if(o||n>1)return a;throw s=!0,r}return function(o,f,d){if(u>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,d),l=f,c=d;(t=l<2?e:c)||!s;){i||(l?l<3?(l>1&&(m.n=-1),p(l,c)):m.n=c:m.v=c);try{if(u=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(s=m.n<0)?c:n.call(r,m))!==a)break}catch(t){i=e,l=1,c=t}finally{u=1}}return{value:t,done:s}}}(n,o,i),!0),u}var a={};function l(){}function c(){}function u(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(X(t={},r,function(){return this}),t),s=u.prototype=l.prototype=Object.create(f);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,X(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,X(s,"constructor",u),X(u,"constructor",c),c.displayName="GeneratorFunction",X(u,o,"GeneratorFunction"),X(s),X(s,o,"Generator"),X(s,r,function(){return this}),X(s,"toString",function(){return"[object Generator]"}),(N=function(){return{w:i,m}})()}function X(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}X=function(e,t,n,r){function i(t,n){X(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},X(e,t,n,r)}function U(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function Y(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){U(i,r,o,a,l,"next",e)}function l(e){U(i,r,o,a,l,"throw",e)}a(void 0)})}}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,t)||H(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var B={};function Z(){var e=(0,d.Bd)().t,t=(0,c.zy)(),n=(0,c.Zp)(),o=(0,v.MH)().check_user_auth,u=$((0,i.L4)(a.A.nowFileList),2),s=u[0],p=(u[1],$((0,i.L4)(a.A.uploadFiles),2)),h=(p[0],p[1]),_=$((0,i.L4)(a.A.showPrompt),2),w=(_[0],_[1]),k=$((0,i.L4)(a.A.selectedFileList),2),A=k[0],L=(k[1],$((0,i.L4)(a.A.copyedFileList),2)),M=L[0],z=L[1],D=$((0,i.L4)(a.A.cutedFileList),2),K=D[0],X=D[1],U=$((0,i.L4)(a.A.selectedFileList),2),R=(U[0],U[1]),Z=$((0,i.L4)(a.A.clickFileList),2),q=(Z[0],Z[1]),V=$((0,i.L4)(a.A.fileShellShow),2),W=V[0],J=V[1],Q=$((0,i.L4)(a.A.file_root_list),2),ee=Q[0],te=(Q[1],$((0,i.L4)(a.A.file_root_index),2)),ne=te[0],re=te[1],oe=$((0,r.useState)(void 0),2),ie=(oe[0],oe[1],$((0,r.useState)(""),2)),ae=(ie[0],ie[1],$((0,i.L4)(a.A.workflow_show),2)),le=ae[0],ce=ae[1],ue=$((0,i.L4)(a.A.workflow_realtime_show),2),fe=(ue[0],ue[1],$((0,i.L4)(a.A.work_flow_show),2)),se=fe[0],me=(fe[1],(0,r.useContext)(y.F).initUserInfo),pe=$((0,i.L4)(a.A.user_base_info),2),de=(pe[0],pe[1],(0,v.kZ)().click_file,$((0,i.L4)(a.A.prompt_card),2)),ye=(de[0],de[1]),ve=(0,r.useMemo)(function(){return s.files.reduce(function(e,t){return e+(t.type!==j.Iw.folder?1:0)},0)},[s]),he=(0,r.useMemo)(function(){var e,t;return s.files.reduce(function(e,t){return e+(t.type===j.Iw.folder?1:0)},0)+(null!==(e=null===(t=s.folders)||void 0===t?void 0:t.length)&&void 0!==e?e:0)},[s]);function _e(e){(0,P.LW)(e)}(0,r.useEffect)(function(){B={}},[t]),(0,r.useEffect)(function(){return function(){J({show:!1,path:""})}},[]);var we=function(){var e=Y(N().m(function e(t){return N().w(function(e){for(;;)switch(e.n){case 0:return re(t),e.n=1,l.$M.post("base_switch",{root_index:t});case 1:return e.n=2,me();case 2:n("/file/"),R([]),q([]);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),be=(0,m.Vs)(),ge=function(t){ye({open:!0,title:e("信息"),context_div:r.createElement("div",{style:{maxWidth:"25rem"}},r.createElement(F.Yh,{left:e("挂载位置磁盘"),right:null==t?void 0:t.total_size}),r.createElement(F.Yh,{left:"".concat(e("磁盘剩余")),right:null==t?void 0:t.left_size}),r.createElement(F.Yh,{left:"".concat(e("文件系统")),right:null==t?void 0:t.fs_type}),r.createElement(F.Yh,{left:"".concat(e("文件夹数")),right:he}),r.createElement(F.Yh,{left:"".concat(e("文件数")),right:ve}),r.createElement(F.Yh,{left:"".concat(e("当前位置")),right:r.createElement(G.xP,{context:null==t?void 0:t.now_absolute_path})})),cancel:function(){b.ws.removeMsg(g.HK.file_info)}})},Ee=function(){var e=Y(N().m(function e(){var t,n;return N().w(function(e){for(;;)switch(e.n){case 0:if(B.now_absolute_path){e.n=2;break}return b.ws.addMsg(g.HK.file_info,function(e){var n=e.context;t&&(B=T(T({},B),n),b.ws.removeMsg(g.HK.file_info),ge(B))}),e.n=1,b.ws.sendData(g.HK.file_info,{type:j.Iw.folder,path:(0,f.GG)("file",(0,f.vX)())});case 1:n=e.v,t=n.context,ge(B=t);case 2:ge(B);case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return r.createElement(r.Fragment,null,A.length>0&&r.createElement(S.rA,{icon:"delete",title:e("删除"),onClick:function(){w({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),A.length>0&&r.createElement(S.rA,{icon:"content_copy",title:e("复制"),onClick:function(){var e=(0,m.ib)(s,A);z(e.map(function(e){return(0,m.Ok)(e.name)})),X([]),_e("已复制")}}),A.length>0&&r.createElement(S.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){var e=(0,m.ib)(s,A);X(e.map(function(e){return(0,m.Ok)(e.name)})),z([]),_e("已剪切")}}),(M.length>0||K.length>0)&&r.createElement(S.rA,{onClick:function(){w({show:!0,type:x.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:M.length+K.length}),A.length>0&&r.createElement(S.rA,{icon:"download",title:e("下载"),onClick:function(){for(var e=(0,m.ib)(s,A),t=0;t<e.length;t++){var n=e[t];e[t]=encodeURIComponent((0,m.Ok)(n.name))}var r=l.$M.getDownloadUrl(e);window.open(r)}}),A.length>0&&r.createElement(S.rA,{icon:"compress",title:e("压缩"),onClick:function(){for(var e=(0,m.ib)(s,A),t=0;t<e.length;t++){var n=e[t];e[t]=(0,m.Ok)(n.name)}e&&0!==e.length?w({show:!0,type:x.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,P.zN)("没有选中")}}),1===A.length&&r.createElement(S.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){w({show:!0,type:x.PromptEnum.FileRename,overlay:!0,data:{}})}}),se&&r.createElement(S.rA,{icon:"api",title:"workflow",onClick:function(){ce(!le)}}),r.createElement(S.rA,{icon:"terminal",title:"shell",onClick:function(){W.show?J({show:!1,path:""}):J({show:!0,path:(0,f.GG)("file",(0,f.vX)())})}}),o(E.oV.share_file)&&r.createElement(S.rA,{icon:"share",title:e("文件分享"),onClick:function(){n("/".concat(I.o.share_list_setting_page))}}),r.createElement(S.rA,{icon:"grid_view",title:e("切换样式"),onClick:be}),r.createElement(S.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){w({show:!0,type:x.PromptEnum.DirNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),r.createElement(S.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){w({show:!0,type:x.PromptEnum.FileNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),r.createElement(S.rA,{icon:"upload_file",title:e("上传"),onClick:function(){w({show:!0,type:x.PromptEnum.UploadFile,overlay:!0,data:{call:function(e){var t,n=null===(t=e.currentTarget)||void 0===t?void 0:t.files;if(n){for(var r=!!n[0].webkitRelativePath,o=[],i=new Set,a=0;a<n.length;a++){var l=n[a],c=r?l.webkitRelativePath:"".concat(l.webkitRelativePath).concat(l.name);l.fullPath=c,r&&i.add((0,C.S)(c)),o.push(l)}var u=[];if(r){var f,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=H(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(i);try{for(s.s();!(f=s.n()).done;){var m=f.value;u.push({isDir:!0,fullPath:m,name:m})}}catch(e){s.e(e)}finally{s.f()}}u.push.apply(u,o),h(u),w({show:!0,type:x.PromptEnum.FilesUpload,overlay:!1,data:{}})}}}})}}),r.createElement(S.rA,{icon:"info",title:e("信息"),onClick:Ee}),r.createElement(S.rA,{icon:"more_vert",title:e("切换目录"),onClick:function(e){var t=new O.ik;t.x=e.clientX,t.y=e.clientY,t.type=j.Iw.directory,t.items=ee,t.item_pre_value=ne,t.textClick=function(){var e=Y(N().m(function e(t){return N().w(function(e){for(;;)switch(e.n){case 0:we(t),w({data:void 0,overlay:!1,type:"",show:!1});case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),w({show:!0,type:x.PromptEnum.FileMenu,overlay:!1,data:t})}}))}var q=n(2543),V=n(1499);function W(e){return function(e){if(Array.isArray(e))return ie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||oe(e)||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 J(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof l?r:l,u=Object.create(c.prototype);return Q(u,"_invoke",function(n,r,o){var i,l,c,u=0,f=o||[],s=!1,m={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,l=0,c=e,m.n=n,a}};function p(n,r){for(l=n,c=r,t=0;!s&&u&&!o&&t<f.length;t++){var o,i=f[t],p=m.p,d=i[2];n>3?(o=d===r)&&(c=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(l=0,m.v=r,m.n=i[1]):p<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,m.n=d,l=0))}if(o||n>1)return a;throw s=!0,r}return function(o,f,d){if(u>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,d),l=f,c=d;(t=l<2?e:c)||!s;){i||(l?l<3?(l>1&&(m.n=-1),p(l,c)):m.n=c:m.v=c);try{if(u=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(s=m.n<0)?c:n.call(r,m))!==a)break}catch(t){i=e,l=1,c=t}finally{u=1}}return{value:t,done:s}}}(n,o,i),!0),u}var a={};function l(){}function c(){}function u(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(Q(t={},r,function(){return this}),t),s=u.prototype=l.prototype=Object.create(f);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Q(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,Q(s,"constructor",u),Q(u,"constructor",c),c.displayName="GeneratorFunction",Q(u,o,"GeneratorFunction"),Q(s),Q(s,o,"Generator"),Q(s,r,function(){return this}),Q(s,"toString",function(){return"[object Generator]"}),(J=function(){return{w:i,m}})()}function Q(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Q=function(e,t,n,r){function i(t,n){Q(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Q(e,t,n,r)}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=oe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function te(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function ne(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){te(i,r,o,a,l,"next",e)}function l(e){te(i,r,o,a,l,"throw",e)}a(void 0)})}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,t)||oe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ae,le=r.lazy(function(){return Promise.all([n.e(856),n.e(659)]).then(n.bind(n,3659))}),ce=r.lazy(function(){return Promise.all([n.e(856),n.e(636)]).then(n.bind(n,1636))});function ue(){var e=re((0,i.L4)(a.A.editorSetting),2),t=(e[0],e[1]),n=re((0,i.L4)(a.A.file_preview),2),S=(n[0],n[1]),P=(0,d.Bd)().t,C=(0,c.zy)(),F=(0,c.Zp)(),G=re((0,i.L4)(a.A.nowFileList),2),I=G[0],D=G[1],K=re((0,i.L4)(a.A.showPrompt),2),X=(K[0],K[1],re((0,i.L4)(a.A.selectedFileList),2)),U=(X[0],X[1]),H=re((0,i.L4)(a.A.clickFileList),2),R=(H[0],H[1]),B=re((0,i.L4)(a.A.fileShellShow),2),Q=(B[0],B[1],re((0,r.useState)(""),2)),te=Q[0],oe=Q[1],ie=re((0,i.L4)(a.A.workflow_show),2),ue=ie[0],fe=(ie[1],re((0,i.L4)(a.A.workflow_realtime_show),2)),se=fe[0],me=(fe[1],re((0,i.L4)(a.A.work_flow_show),2)),pe=(me[0],me[1]),de=((0,r.useContext)(y.F).initUserInfo,re((0,i.L4)(a.A.user_base_info),2)),ye=de[0],ve=(de[1],(0,v.kZ)().click_file,re((0,i.L4)(a.A.to_running_files),2)),he=(ve[0],ve[1]),_e=re((0,i.L4)(a.A.file_page),2),we=_e[0],be=_e[1],ge=function(){var e=$((0,i.L4)(a.A.user_base_info),2),t=e[0],n=(e[1],(0,d.Bd)().t),o=(0,v.MH)().check_user_auth,u=$((0,i.L4)(a.A.router_jump),2),s=(u[0],u[1]),p=(0,c.Zp)(),h=(0,r.useContext)(y.F).initUserInfo,_=$((0,i.L4)(a.A.nowFileList),2),w=(_[0],_[1],$((0,i.L4)(a.A.showPrompt),2)),k=(w[0],w[1]),A=$((0,i.L4)(a.A.fileShellShow),2),S=(A[0],A[1]);return function(e){var i;e.preventDefault(),e.stopPropagation();var a=new O.ik;a.x=e.clientX,a.y=e.clientY,a.type=j.Iw.directory;var c=[{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.time_minx_max?"green":void 0}},n("时间逆序")),v:E.t8.time_minx_max},{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.time_max_min?"green":void 0}},n("时间顺序")),v:E.t8.time_max_min}],u=[{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.size_min_max?"green":void 0}},n("大小顺序")),v:E.t8.size_min_max},{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.size_max_min?"green":void 0}},n("大小逆序")),v:E.t8.size_max_min}],d=[{r:r.createElement("span",{style:{color:t.user_data.file_list_pagination_mode&&t.user_data.file_list_pagination_mode!==E.yM.all?void 0:"green"}},n("全部加载文件")),v:E.yM.all},{r:r.createElement("span",{style:{color:t.user_data.file_list_pagination_mode===E.yM.pagination?"green":void 0}},n("分页滚动加载文件")),v:E.yM.pagination}],y=[{r:r.createElement("span",{style:{color:t.user_data.file_time_show_type&&t.user_data.file_time_show_type!==E.KD.current?void 0:"green"}},n("最近时长")),v:E.KD.current},{r:r.createElement("span",{style:{color:t.user_data.file_time_show_type===E.KD.time?"green":void 0}},n("准确时间")),v:E.KD.time}],v=[{r:n("文件列表展示"),items:[{r:n("文件排序"),v:"",items:[{r:r.createElement("span",{style:{color:t.user_data.dir_show_type?void 0:"green"}},n("系统默认")),v:E.t8.defualt},{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.name?"green":void 0}},n("名字")),v:E.t8.name},{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.time_minx_max||t.user_data.dir_show_type===E.t8.time_max_min?"green":void 0}},n("修改时间")),v:!1,items:c},{r:r.createElement("span",{style:{color:t.user_data.dir_show_type===E.t8.size_min_max||t.user_data.dir_show_type===E.t8.size_max_min?"green":void 0}},n("文件大小")),v:!1,items:u}]},{r:n("文件加载方式"),v:"",items:d},{r:n("时间展示"),v:"",items:y}]}];o(E.oV.code_resource)&&v.push({r:n("添加http资源根目录"),v:"code_resource"}),o(E.oV.http_proxy)&&v.push({r:n("在此目录下载http资源"),v:"http_resource"}),null!=t&&null!==(i=t.user_data)&&void 0!==i&&i.quick_cmd&&(0,m.LL)(z(t.user_data.quick_cmd),v),a.items=v,a.textClick=function(){var e=Y(N().m(function e(t){var n,r,o,i;return N().w(function(e){for(;;)switch(e.n){case 0:if(console.log(t),!1!==t){e.n=1;break}return e.a(2);case 1:if(n={},"code_resource"!==t){e.n=3;break}return e.n=2,b.ws.sendData(g.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});case 2:return r=e.v,s({page_self_router_api_data:["",r.context.now_absolute_path]}),k({data:void 0,overlay:!1,type:"",show:!1}),p("/setting/customer_router/"),e.a(2);case 3:if("http_resource"!==t){e.n=5;break}return e.n=4,b.ws.sendData(g.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});case 4:return o=e.v,s({http_download_map_path:o.context.now_absolute_path}),k({data:void 0,overlay:!1,type:"",show:!1}),p("/proxy/http/"),e.a(2);case 5:if("object"!==M(t)||"quick_cmd"!==t.tag){e.n=6;break}(i=t.cmd)&&(i.endsWith("\r")||(i+="\r",S({show:!0,path:(0,f.GG)("file",(0,f.vX)()),cmd:i}))),e.n=10;break;case 6:if(t!==E.yM.all&&t!==E.yM.pagination){e.n=7;break}n.is_pagination_mode=!0,e.n=10;break;case 7:if(t!==E.KD.current&&t!==E.KD.time){e.n=8;break}n.is_file_show_type=!0,e.n=10;break;case 8:if(t!==E.t8.defualt&&t!==E.t8.name&&t!==E.t8.size_max_min&&t!==E.t8.size_min_max&&t!==E.t8.time_max_min&&t!==E.t8.time_minx_max){e.n=9;break}n.is_dir_list_type=!0,e.n=10;break;case 9:return e.a(2);case 10:return e.n=11,l.wm.post(L.s.user_save_user_file_list_show_type,T({type:t},n));case 11:return e.n=12,h();case 12:k({data:void 0,overlay:!1,type:"",show:!1}),p((0,f.vX)());case 13:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),k({show:!0,type:x.PromptEnum.FileMenu,overlay:!1,data:a})}}(),Ee=function(){var e=ne(J().m(function e(){var t;return J().w(function(e){for(;;)switch(e.n){case 0:return(t=new w.Nd).dir_path="".concat((0,f.GG)("file",(0,f.vX)())),b.ws.addMsg(g.HK.workflow_realtime,function(e){var t=e.context;if(e.context){var n,r=ee(t.sucess_file_list);try{for(r.s();!(n=r.n()).done;){var o=n.value;(0,m.Ys)(o)}}catch(e){r.e(e)}finally{r.f()}var i,a=ee(t.failed_file_list);try{for(a.s();!(i=a.n()).done;){var l=i.value;(0,m.V$)(l)}}catch(e){a.e(e)}finally{a.f()}he(new Set(t.running_file_list))}}),e.n=1,b.ws.sendData(g.HK.workflow_realtime,t);case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=ne(J().m(function e(t){var n,r,o,i,a,l,c,u,f;return J().w(function(e){for(;;)switch(e.n){case 0:o=!1,i=ee(null!==(n=t.files)&&void 0!==n?n:[]);try{for(i.s();!(a=i.n()).done;)(l=a.value).origin_size=l.size,l.size=(0,h.v7)(l.size),ye.user_data.file_time_show_type===E.KD.time?l.show_mtime=l.mtime?(0,V.Yq)(l.mtime):"":l.show_mtime=l.mtime?(0,_.s)(l.mtime):"",o||!l.name.endsWith(".workflow.yml")&&!l.name.endsWith(".act")||(o=!0,Promise.resolve().then(function(){Ee()})),l.name===w.SB&&(o=!0)}catch(e){i.e(e)}finally{i.f()}c=ee(null!==(r=t.folders)&&void 0!==r?r:[]);try{for(c.s();!(u=c.n()).done;)f=u.value,ye.user_data.file_time_show_type===E.KD.time?f.show_mtime=f.mtime?(0,V.Yq)(f.mtime):"":f.show_mtime=f.mtime?(0,_.s)(f.mtime):"",f.name===w.SB&&(o=!0)}catch(e){c.e(e)}finally{c.f()}pe(o);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ae=function(){var e=ne(J().m(function e(){var t,n,r,o,i;return J().w(function(e){for(;;)switch(e.n){case 0:if(t=(0,f.GG)("file",(0,f.vX)()),ye.user_data.file_list_pagination_mode!==E.yM.pagination){e.n=3;break}if(!(we.page_num<0)){e.n=1;break}return e.a(2);case 1:return e.n=2,l.$M.post("file_get_page",{param_path:t,page_num:we.page_num,page_size:we.page_size});case 2:n=e.v,o=n.data,null!==(r=o.files)&&void 0!==r&&r.length||be({page_size:we.page_size,page_num:-1}),o.files=(0,q.cloneDeep)([].concat(W(I.files),W(o.files))),e.n=5;break;case 3:return e.n=4,l.$M.get(t);case 4:n=e.v;case 5:if(n.code===s.m.Success){e.n=6;break}return e.a(2);case 6:i=n.data,(0,m.yC)(i,ye.user_data.dir_show_type),ke(n.data),D(n.data),ae=n.data;case 7:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),Se=function(){be({page_num:1,page_size:200})};(0,r.useEffect)(function(){return Se(),ne(J().m(function e(){return J().w(function(e){for(;;)switch(e.n){case 0:he(new Set);case 1:return e.a(2)}},e)}))},[]);var xe=function(){Ae(),t({open:!1}),S({open:!1}),pe(!1)};(0,r.useEffect)(function(){D({files:[],folders:[]}),Se(),xe()},[C]),(0,r.useEffect)(function(){xe()},[we]);var Oe=function(e){e.target===e.currentTarget&&(U([]),R([]))};return r.createElement(r.Fragment,null,r.createElement(u.A,{left_children:r.createElement(p.$Z,{handleEnterPress:function(){var e,t;if(ae){U([]),R([]);var n,r=[],o=[],i=ee(null!==(e=ae.files)&&void 0!==e?e:[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.name.includes(te)&&r.push(a)}}catch(e){i.e(e)}finally{i.f()}var l,c=ee(null!==(t=ae.folders)&&void 0!==t?t:[]);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.name.includes(te)&&o.push(u)}}catch(e){c.e(e)}finally{c.f()}D({files:r,folders:o})}},placeholder:P("搜索当前目录"),icon:"search",value:"",handleInputChange:function(e){oe(e)},max_width:"25em"})},r.createElement(Z,null)),r.createElement(o.e,{baseRoute:"file",clickFun:function(){U([]),R([])},input_path_enter:function(e){var t;(0,k.Z1)(e)?(e=e.replace(0===(t=ye.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),F(e)):F((0,k.Jn)((0,f.vX)(),e)),U([]),R([]),D({files:[],folders:[]})}}),ye.user_data.file_list_pagination_mode===E.yM.pagination?r.createElement(A.$J,{handleContextMenu:ge,clickBlank:Oe,list:I.files}):r.createElement(A.t$,{handleContextMenu:ge,file_list:I.files,folder_list:I.folders,clickBlank:Oe}),ue&&r.createElement(le,null),se.open&&r.createElement(ce,null))}}}]);
|
package/build/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.3016b615fbde4ee1b25c.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
|