filecat 5.18.9 → 5.19.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/10.c77bb90ec1aeb2b95137.js +1 -0
- package/build/dist/144.8cd83fa2e2ab8d94ddbe.js +2 -0
- package/build/dist/{209.e7120b01e96f41cdd0af.js → 209.90f204539e2302d8f5cb.js} +2 -2
- package/build/dist/{308.31a2b1b80206ebdbe5df.js → 308.da82818a61875505679b.js} +2 -2
- package/build/dist/330.ab6b41a7c5fbaed1ddab.js +2 -0
- package/build/dist/{441.6b3f5167753ee20cfa70.js → 441.734a2e8d8acf276a9282.js} +2 -2
- package/build/dist/{445.ec2ca2deb2a216cb9eec.js → 445.977ad17aabeda12975e4.js} +2 -2
- package/build/dist/523.c5b2518c86aa02787ba3.js +2 -0
- package/build/dist/{542.58612142cbe464bb12cd.js → 542.840d3d1677755451d6a2.js} +2 -2
- package/build/dist/{674.9daaacb1044ff5c02e21.js → 674.fce5b2418a577c318c9a.js} +2 -2
- package/build/dist/{696.a056a3e48b96ef454eaa.js → 696.9f8f4aa0400b76c63a1d.js} +2 -2
- package/build/dist/{757.ca962bbf7b068d09c8bf.js → 757.3ccf6b7d238530fe65b9.js} +1 -1
- package/build/dist/{759.91dbd0e6cab45b87d2af.js → 759.84e1d3c25f49eee52a17.js} +2 -2
- package/build/dist/{811.f49ff1cdb8e7cd1248ed.js → 811.4247d8d6f44d4b851aa9.js} +2 -2
- package/build/dist/{827.c8279965745ae3aad44b.js → 827.010b3502eeb2e68b081a.js} +2 -2
- package/build/dist/{892.0bc37c517cd066bf8a34.js → 892.c64184db9fe7d1f1b95c.js} +2 -2
- package/build/dist/892.c64184db9fe7d1f1b95c.js.LICENSE.txt +1 -0
- package/build/dist/903.d367a1786af314fe0ca2.js +1 -0
- package/build/dist/{943.3dfa02fd2449b8fd9e4a.js → 943.19340544f5f0acb0f9c5.js} +2 -2
- package/build/dist/index.html +1 -1
- package/build/dist/main.176186ce1264798d01b5.js +2 -0
- package/build/main.js +1 -1
- package/build/{threads.work.js → threads.work.filecat.js} +1 -1
- package/package.json +3 -2
- package/shell/build.js +2 -2
- package/shell/config/base.webpack.config.js +59 -0
- package/shell/config/webpack.exe.config.js +3 -24
- package/shell/config/webpack.npm.config.js +0 -5
- package/shell/config/webpack.worker.get.js +4 -37
- package/build/dist/10.a55af7a1cee5d7b03a31.js +0 -1
- package/build/dist/129.8205cc2ebe117960bc3a.js +0 -1
- package/build/dist/330.9c13b12d9a61020e10e4.js +0 -2
- package/build/dist/523.21246a37436ebfb0fbdd.js +0 -2
- package/build/dist/903.7cc8affd24e5ca8ba0c0.js +0 -1
- package/build/dist/main.57b6fbb6485ba2f2b073.js +0 -2
- /package/build/dist/{209.e7120b01e96f41cdd0af.js.LICENSE.txt → 144.8cd83fa2e2ab8d94ddbe.js.LICENSE.txt} +0 -0
- /package/build/dist/{308.31a2b1b80206ebdbe5df.js.LICENSE.txt → 209.90f204539e2302d8f5cb.js.LICENSE.txt} +0 -0
- /package/build/dist/{330.9c13b12d9a61020e10e4.js.LICENSE.txt → 308.da82818a61875505679b.js.LICENSE.txt} +0 -0
- /package/build/dist/{441.6b3f5167753ee20cfa70.js.LICENSE.txt → 330.ab6b41a7c5fbaed1ddab.js.LICENSE.txt} +0 -0
- /package/build/dist/{445.ec2ca2deb2a216cb9eec.js.LICENSE.txt → 441.734a2e8d8acf276a9282.js.LICENSE.txt} +0 -0
- /package/build/dist/{523.21246a37436ebfb0fbdd.js.LICENSE.txt → 445.977ad17aabeda12975e4.js.LICENSE.txt} +0 -0
- /package/build/dist/{542.58612142cbe464bb12cd.js.LICENSE.txt → 523.c5b2518c86aa02787ba3.js.LICENSE.txt} +0 -0
- /package/build/dist/{674.9daaacb1044ff5c02e21.js.LICENSE.txt → 542.840d3d1677755451d6a2.js.LICENSE.txt} +0 -0
- /package/build/dist/{696.a056a3e48b96ef454eaa.js.LICENSE.txt → 674.fce5b2418a577c318c9a.js.LICENSE.txt} +0 -0
- /package/build/dist/{759.91dbd0e6cab45b87d2af.js.LICENSE.txt → 696.9f8f4aa0400b76c63a1d.js.LICENSE.txt} +0 -0
- /package/build/dist/{811.f49ff1cdb8e7cd1248ed.js.LICENSE.txt → 759.84e1d3c25f49eee52a17.js.LICENSE.txt} +0 -0
- /package/build/dist/{827.c8279965745ae3aad44b.js.LICENSE.txt → 811.4247d8d6f44d4b851aa9.js.LICENSE.txt} +0 -0
- /package/build/dist/{892.0bc37c517cd066bf8a34.js.LICENSE.txt → 827.010b3502eeb2e68b081a.js.LICENSE.txt} +0 -0
- /package/build/dist/{943.3dfa02fd2449b8fd9e4a.js.LICENSE.txt → 943.19340544f5f0acb0f9c5.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.57b6fbb6485ba2f2b073.js.LICENSE.txt → main.176186ce1264798d01b5.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={167(e){e.exports=require("worker_threads")},285(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.file_search_start=function(){(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search,e=>n(this,void 0,void 0,function*(){const{start:t,end:r,file_path:n,query_text_buffer:_,ram_id:l}=e.data;let h=0,f=Buffer.alloc(0);const u=s.openSync(n,"r");let p=0;for(;h<r&&!d[l];){const e=Buffer.alloc(2097152);let t=s.readSync(u,e,0,e.length,h);if(0===t)break;h+=t,f=Buffer.concat([f,e.subarray(0,t)]),(0,o.threads_send)({type:a.threads_msg_type.search_file_progress,data:{progress:(100*h/r).toFixed(0),ram_id:l}});const n=[];if(c(f,_,n),n.length>0){for(let e=0;e<n.length;e++)n[e]+=p;(0,o.threads_send)({type:a.threads_msg_type.search_file_index,data:{find_index:n,ram_id:l}})}p+=f.length-_.length,f=i(f,f.length-_.length,f.length)}return(0,o.threads_send)({type:a.threads_msg_type.search_file_end,data:{ram_id:l}}),s.closeSync(u),"ok"})),(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search_close,e=>n(this,void 0,void 0,function*(){const{ram_id:t}=e.data;return d[t]=!0,"ok"})),(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search_start,e=>n(this,void 0,void 0,function*(){const{ram_id:t}=e.data;return delete d[t],"ok"}))};const o=r(324),a=r(525),s=r(896);function i(e,t,r){const n=r-t,o=Buffer.alloc(n);return e.copy(o,0,t,r),o}function c(e,t,r){const n=function(e){const t={},r=e.length;for(let n=0;n<r;n++)t[e[n]]=n;return t}(t),o=e.length,a=t.length,s=o-a;let i=0;for(;i<=s;){let s=a-1;for(;s>=0&&e[i+s]===t[s];)s--;if(s<0)r.push(i),i+=i+a<o?a-n[e[i+a]]||a:1;else{const t=n[e[i+s]],r=void 0!==t?s-t:s+1;i+=Math.max(r,1)}}}const d={}},324(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.register_threads_worker_handler=
|
|
1
|
+
(()=>{"use strict";var e={167(e){e.exports=require("worker_threads")},285(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.file_search_start=function(){(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search,e=>n(this,void 0,void 0,function*(){const{start:t,end:r,file_path:n,query_text_buffer:_,ram_id:l}=e.data;let h=0,f=Buffer.alloc(0);const u=s.openSync(n,"r");let p=0;for(;h<r&&!d[l];){const e=Buffer.alloc(2097152);let t=s.readSync(u,e,0,e.length,h);if(0===t)break;h+=t,f=Buffer.concat([f,e.subarray(0,t)]),(0,o.threads_send)({type:a.threads_msg_type.search_file_progress,data:{progress:(100*h/r).toFixed(0),ram_id:l}});const n=[];if(c(f,_,n),n.length>0){for(let e=0;e<n.length;e++)n[e]+=p;(0,o.threads_send)({type:a.threads_msg_type.search_file_index,data:{find_index:n,ram_id:l}})}p+=f.length-_.length,f=i(f,f.length-_.length,f.length)}return(0,o.threads_send)({type:a.threads_msg_type.search_file_end,data:{ram_id:l}}),s.closeSync(u),"ok"})),(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search_close,e=>n(this,void 0,void 0,function*(){const{ram_id:t}=e.data;return d[t]=!0,"ok"})),(0,o.register_threads_worker_handler)(a.threads_msg_type.file_search_start,e=>n(this,void 0,void 0,function*(){const{ram_id:t}=e.data;return delete d[t],"ok"}))};const o=r(324),a=r(525),s=r(896);function i(e,t,r){const n=r-t,o=Buffer.alloc(n);return e.copy(o,0,t,r),o}function c(e,t,r){const n=function(e){const t={},r=e.length;for(let n=0;n<r;n++)t[e[n]]=n;return t}(t),o=e.length,a=t.length,s=o-a;let i=0;for(;i<=s;){let s=a-1;for(;s>=0&&e[i+s]===t[s];)s--;if(s<0)r.push(i),i+=i+a<o?a-n[e[i+a]]||a:1;else{const t=n[e[i+s]],r=void 0!==t?s-t:s+1;i+=Math.max(r,1)}}}const d={}},324(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.register_threads_worker_handler=i,t.threads_send=c;const o=r(167),a=r(525);console.log("[worker] 子线程启动, workerData=",o.workerData);const s=new Map;function i(e,t){s.set(e,t)}function c(e){try{null===o.parentPort||void 0===o.parentPort||o.parentPort.postMessage(e)}catch(e){console.error("[worker] send failed:",e)}}null===o.parentPort||void 0===o.parentPort||o.parentPort.on("message",e=>{!function(e){n(this,void 0,void 0,function*(){try{const t=s.get(e.type);if(!t)return void c({id:e.id,type:e.type,data:`unknown type ${e.type}`});const r=yield t(e);c({id:e.id,type:e.type,data:r})}catch(t){c({id:e.id,type:e.type,data:null,error:(null==t?void 0:t.message)||String(t)}),console.error("[worker] task error:",t)}})}(e)}),i(a.threads_msg_type.hello,e=>n(void 0,void 0,void 0,function*(){return new Promise((t,r)=>setTimeout(()=>{if(Math.random()<.05)return r(new Error("模拟错误"));t(`done:${e.data}`)},500))})),console.log("[worker] ready and waiting for messages...")},525(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.threads_msg_type=void 0,function(e){e[e.hello=1]="hello",e[e.file_search_start=2]="file_search_start",e[e.file_search=3]="file_search",e[e.file_search_close=4]="file_search_close",e[e.search_file_index=5]="search_file_index",e[e.search_file_progress=6]="search_file_progress",e[e.search_file_end=7]="search_file_end"}(r||(t.threads_msg_type=r={}))},896(e){e.exports=require("fs")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(0,r(285).file_search_start)()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.19.0",
|
|
4
4
|
"description": "FileCat Server Manager",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"scripts": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@babel/preset-typescript": "^7.24.1",
|
|
53
53
|
"@excalidraw/excalidraw": "^0.17.6",
|
|
54
54
|
"@koa/cors": "^5.0.0",
|
|
55
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
55
56
|
"@xiaobaidadada/prebuild": "^13.0.1-9",
|
|
56
57
|
"@xterm/addon-fit": "^0.10.0",
|
|
57
58
|
"@xterm/xterm": "^5.5.0",
|
|
@@ -77,7 +78,6 @@
|
|
|
77
78
|
"koa-proxies": "^0.12.4",
|
|
78
79
|
"listr2": "^8.2.1",
|
|
79
80
|
"lodash": "^4.17.21",
|
|
80
|
-
"systeminformation": "^5.28.0",
|
|
81
81
|
"markdown-it": "^14.1.0",
|
|
82
82
|
"markdown-it-emoji": "^3.0.0",
|
|
83
83
|
"markdown-it-footnote": "^4.0.0",
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"routing-controllers": "^0.10.4",
|
|
106
106
|
"sshpk": "^1.18.0",
|
|
107
107
|
"style-loader": "^3.3.4",
|
|
108
|
+
"systeminformation": "^5.28.0",
|
|
108
109
|
"tar": "^7.4.3",
|
|
109
110
|
"tldts": "^6.1.20",
|
|
110
111
|
"ts-node": "^10.9.2",
|
package/shell/build.js
CHANGED
|
@@ -46,8 +46,8 @@ const tasksLister = new Listr(
|
|
|
46
46
|
return Promise.all([new Promise((res, rej) => {
|
|
47
47
|
// 第一个
|
|
48
48
|
webpack(get_webpack_work_config({
|
|
49
|
-
entry_path:path.join(__dirname, "..", "build", "server", "main","threads","threads.work.js"),
|
|
50
|
-
output_name:'threads.work.js',
|
|
49
|
+
entry_path:path.join(__dirname, "..", "build", "server", "main","threads","filecat","threads.work.filecat.js"),
|
|
50
|
+
output_name:'threads.work.filecat.js',
|
|
51
51
|
pkg:args[0]==="npm",
|
|
52
52
|
docker:args[0]==="docker",
|
|
53
53
|
}), (err, stats) => {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const nodeExternals = require('webpack-node-externals');
|
|
3
|
+
const webpack = require('webpack');
|
|
4
|
+
const TerserPlugin = require("terser-webpack-plugin");
|
|
5
|
+
const package_data = require("../../package.json")
|
|
6
|
+
const {base_url} = require("./env");
|
|
7
|
+
|
|
8
|
+
// 给js代码注入一些环境变量
|
|
9
|
+
const plugins = [
|
|
10
|
+
new webpack.DefinePlugin({
|
|
11
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
12
|
+
'process.env.version': JSON.stringify(package_data.version),
|
|
13
|
+
'process.env.base_url': JSON.stringify(base_url),
|
|
14
|
+
// 'process.env.run_env': JSON.stringify("exe") // 必须用 JSON.stringify
|
|
15
|
+
}),
|
|
16
|
+
// new webpack.DefinePlugin({
|
|
17
|
+
// 'process.platform': JSON.stringify(process.platform) // 这里将 process.platform 替换为实际的值 在遇到动态打包的时候require 可以判断类型 函数内部的无法判断
|
|
18
|
+
// }),
|
|
19
|
+
// 不要一些Debug的二进制文件
|
|
20
|
+
new webpack.IgnorePlugin({
|
|
21
|
+
resourceRegExp: /Debug/,
|
|
22
|
+
})
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// 处理 node 二进制文件的webpack rules
|
|
26
|
+
const _node_rules = [
|
|
27
|
+
{
|
|
28
|
+
test: /\.node$/,
|
|
29
|
+
loader: 'node-loader',
|
|
30
|
+
options: {
|
|
31
|
+
name: '[path][name].[ext]'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
// 这些不需要打包,会被安装,运行的时候再使用
|
|
37
|
+
const npm_externals =[
|
|
38
|
+
{
|
|
39
|
+
'@aws-sdk/client-s3': 'S3', // 假设全局变量名为 S3 是 @aws-sdk/client-s3带 @符号的话会无法压缩
|
|
40
|
+
// 'routing-controllers':'commonjs routing-controllers', // 有一些动态引入(他需要的动态引入也需要导入),或者含有.node(使用用户自己安装编译的版本) 无法被打包 直接忽略这个包
|
|
41
|
+
'cors':'commonjs cors', // 动态加载无法打包 如果需要可以使用 import "cors"
|
|
42
|
+
'@xiaobaidadada/node-pty-prebuilt':'commonjs @xiaobaidadada/node-pty-prebuilt',
|
|
43
|
+
'@xiaobaidadada/node-tuntap2-wintun':'commonjs @xiaobaidadada/node-tuntap2-wintun',
|
|
44
|
+
'node-process-watcher':'commonjs node-process-watcher',
|
|
45
|
+
'@xiaobaidadada/ssh2-prebuilt':'commonjs @xiaobaidadada/ssh2-prebuilt',
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
const pkg_externals =[
|
|
49
|
+
{
|
|
50
|
+
'@aws-sdk/client-s3': 'S3', // 假设全局变量名为 S3 是 @aws-sdk/client-s3带 @符号的话会无法压缩
|
|
51
|
+
'cors':'commonjs cors' // 动态加载无法打包 如果需要可以使用 import "cors"
|
|
52
|
+
// 'routing-controllers':'commonjs routing-controllers', // 有一些动态引入(他需要的动态引入也需要导入),或者含有.node(使用用户自己安装编译的版本) 无法被打包 直接忽略这个包
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
module.exports.plugins = plugins;
|
|
57
|
+
module.exports._node_rules = _node_rules;
|
|
58
|
+
module.exports.npm_externals = npm_externals;
|
|
59
|
+
module.exports.pkg_externals = pkg_externals;
|
|
@@ -4,20 +4,8 @@ const webpack = require('webpack');
|
|
|
4
4
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
5
5
|
const package_data = require("../../package.json")
|
|
6
6
|
const {base_url} = require("./env");
|
|
7
|
-
const plugins =
|
|
8
|
-
|
|
9
|
-
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
10
|
-
'process.env.version': JSON.stringify(package_data.version),
|
|
11
|
-
'process.env.base_url': JSON.stringify(base_url),
|
|
12
|
-
// 'process.env.run_env': JSON.stringify("exe") // 必须用 JSON.stringify
|
|
13
|
-
}),
|
|
14
|
-
// new webpack.DefinePlugin({
|
|
15
|
-
// 'process.platform': JSON.stringify(process.platform) // 这里将 process.platform 替换为实际的值 在遇到动态打包的时候require 可以判断类型 函数内部的无法判断
|
|
16
|
-
// }),
|
|
17
|
-
new webpack.IgnorePlugin({
|
|
18
|
-
resourceRegExp: /Debug/,
|
|
19
|
-
})
|
|
20
|
-
];
|
|
7
|
+
const {plugins, _node_rules} = require("./base.webpack.config");
|
|
8
|
+
|
|
21
9
|
module.exports = {
|
|
22
10
|
target: 'node', // 指定打包结果运行在node环境下
|
|
23
11
|
mode: 'production', // 或者 'production'
|
|
@@ -30,16 +18,7 @@ module.exports = {
|
|
|
30
18
|
extensions: ['.ts', '.js', '.node'], // 解析文件时自动补全的文件扩展名
|
|
31
19
|
},
|
|
32
20
|
module: {
|
|
33
|
-
rules:
|
|
34
|
-
{
|
|
35
|
-
test: /\.node$/,
|
|
36
|
-
loader: 'node-loader',
|
|
37
|
-
options: {
|
|
38
|
-
name: '[path][name].[ext]'
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
]
|
|
21
|
+
rules: _node_rules
|
|
43
22
|
},
|
|
44
23
|
externalsPresets: { node: true },
|
|
45
24
|
externals: [
|
|
@@ -16,11 +16,6 @@ module.exports = {
|
|
|
16
16
|
},
|
|
17
17
|
module: {
|
|
18
18
|
rules: [
|
|
19
|
-
// {
|
|
20
|
-
// test: /\.js$/, // 处理 JS 文件
|
|
21
|
-
// exclude: /node_modules/, // 排除 node_modules 中的文件
|
|
22
|
-
// use: 'babel-loader', // 如果需要,可以用 Babel 转译 JS 文件
|
|
23
|
-
// }
|
|
24
19
|
]
|
|
25
20
|
},
|
|
26
21
|
externalsPresets: { node: true },
|
|
@@ -3,37 +3,8 @@ const package_data = require("../../package.json")
|
|
|
3
3
|
const webpack = require('webpack');
|
|
4
4
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
5
5
|
const {base_url} = require("./env");
|
|
6
|
+
const {plugins, pkg_externals, npm_externals, _node_rules} = require("./base.webpack.config");
|
|
6
7
|
|
|
7
|
-
const plugins = [
|
|
8
|
-
new webpack.DefinePlugin({
|
|
9
|
-
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
10
|
-
'process.env.version': JSON.stringify(package_data.version),
|
|
11
|
-
// 'process.env.run_env': JSON.stringify("pkg"),
|
|
12
|
-
'process.env.base_url': JSON.stringify(base_url),
|
|
13
|
-
'process.platform': JSON.stringify(process.platform) // 这里将 process.platform 替换为实际的值 在遇到动态打包的时候require 可以判断类型 函数内部的无法判断
|
|
14
|
-
}),
|
|
15
|
-
new webpack.IgnorePlugin({
|
|
16
|
-
resourceRegExp: /Debug/,
|
|
17
|
-
}),
|
|
18
|
-
];
|
|
19
|
-
const npm_externals =[
|
|
20
|
-
{
|
|
21
|
-
'@aws-sdk/client-s3': 'S3', // 假设全局变量名为 S3 是 @aws-sdk/client-s3带 @符号的话会无法压缩
|
|
22
|
-
// 'routing-controllers':'commonjs routing-controllers', // 有一些动态引入(他需要的动态引入也需要导入),或者含有.node(使用用户自己安装编译的版本) 无法被打包 直接忽略这个包
|
|
23
|
-
'cors':'commonjs cors', // 动态加载无法打包 如果需要可以使用 import "cors"
|
|
24
|
-
'@xiaobaidadada/node-pty-prebuilt':'commonjs @xiaobaidadada/node-pty-prebuilt',
|
|
25
|
-
'@xiaobaidadada/node-tuntap2-wintun':'commonjs @xiaobaidadada/node-tuntap2-wintun',
|
|
26
|
-
'node-process-watcher':'commonjs node-process-watcher',
|
|
27
|
-
'@xiaobaidadada/ssh2-prebuilt':'commonjs @xiaobaidadada/ssh2-prebuilt',
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
const pkg_externals =[
|
|
31
|
-
{
|
|
32
|
-
'@aws-sdk/client-s3': 'S3', // 假设全局变量名为 S3 是 @aws-sdk/client-s3带 @符号的话会无法压缩
|
|
33
|
-
'cors':'commonjs cors' // 动态加载无法打包 如果需要可以使用 import "cors"
|
|
34
|
-
// 'routing-controllers':'commonjs routing-controllers', // 有一些动态引入(他需要的动态引入也需要导入),或者含有.node(使用用户自己安装编译的版本) 无法被打包 直接忽略这个包
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
8
|
function get_webpack_work_config({entry_path,output_name,pkg,docker}) {
|
|
38
9
|
const config = {
|
|
39
10
|
target: 'node', // 指定打包结果运行在node环境下
|
|
@@ -55,17 +26,13 @@ function get_webpack_work_config({entry_path,output_name,pkg,docker}) {
|
|
|
55
26
|
}),
|
|
56
27
|
],
|
|
57
28
|
},
|
|
29
|
+
plugins,
|
|
58
30
|
externals: npm_externals
|
|
59
31
|
}
|
|
60
32
|
if(pkg===true || docker===true) {
|
|
61
|
-
|
|
33
|
+
// 整体打包需要二进制也进去
|
|
62
34
|
config['module'] = {
|
|
63
|
-
rules:
|
|
64
|
-
{
|
|
65
|
-
test: /\.node$|Addon$/,
|
|
66
|
-
loader: 'node-loader', // 会拷贝.node 并改变require路径 到build目录下 但是如果 .node 有更新 他是不会不更新的需要先删除?
|
|
67
|
-
}
|
|
68
|
-
]
|
|
35
|
+
rules: _node_rules
|
|
69
36
|
}
|
|
70
37
|
config['externals'] = pkg_externals;
|
|
71
38
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[10],{840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"},4299(e,n,t){t.r(n),t.d(n,{default:()=>p});var r=t(6540),a=t(3557),c=t(3311),l=t(950),s=t(7979),o=t(8263),u=t(9428),i=t.n(u),d=(t(3775),t(1499)),f=new a.A({html:!0,highlight:function(e,n){return'<pre class="custom-code-block"><code>'.concat(f.utils.escapeHtml(e),"</code></pre>")}});function p(e){return r.createElement("div",{dangerouslySetInnerHTML:{__html:f.render(e.context)}})}f.use(c.BB).use(l.A).use(s.A).use(o.A).use(i()).use(function(e){e.renderer.rules.fence;e.renderer.rules.fence=function(n,t,r,a,c){var l=n[t].content.trim();return'\n <div class="code-block-with-copy">\n <button class="copy-btn" data-code="'.concat(e.utils.escapeHtml(l),'">复制</button>\n <pre><code>').concat(e.utils.escapeHtml(l),"</code></pre>\n </div>")}}).use(function(e){var n=e.renderer.rules.link_open||function(e,n,t,r,a){return a.renderToken(e,n,t)};e.renderer.rules.link_open=function(e,t,r,a,c){var l=e[t],s=l.attrIndex("href");if(s>=0){var o=l.attrs[s][1];l.attrs[s][1]=(0,d.bi)(window.location.href,o)}return n(e,t,r,a,c)}})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[129],{5129(e,t,r){r.r(t),r.d(t,{default:()=>c});var n=r(6540);function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(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 o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,l=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}(e,t)||i(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 i(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(){var e=o((0,n.useState)([{id:1,sender:"bot",text:"hello filecat"}]),2),t=e[0],r=e[1],i=o((0,n.useState)(""),2),l=i[0],c=i[1],u=(0,n.useRef)(null);(0,n.useEffect)(function(){var e;null===(e=u.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},[]);var f=function(){var e=l.trim();if(e){var t={id:Date.now(),sender:"user",text:e};r(function(e){return[].concat(a(e),[t])}),c(""),setTimeout(function(){var t={id:Date.now()+1,sender:"bot",text:'你说的是: "'.concat(e,'"')};r(function(e){return[].concat(a(e),[t])})},600)}};return n.createElement("div",{className:"chat-page"},n.createElement("div",{className:"chat-messages"},t.map(function(e){return n.createElement("div",{key:e.id,className:"chat-message ".concat(e.sender)},e.text)}),n.createElement("div",{ref:u})),n.createElement("div",{className:"chat-input-area"},n.createElement("textarea",{value:l,onChange:function(e){var t=e.target;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,200)+"px",c(t.value)},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),f())},placeholder:"输入消息,Shift+Enter换行",className:"chat-input"}),n.createElement("button",{onClick:f},"发送")))}}}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 330.9c13b12d9a61020e10e4.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[330],{7374(e,t,n){n.d(t,{e:()=>m});var r=n(6540),o=n(4976),i=n(7767),a=n(4694),l=n(4289),c=n(1443),u=n(5725);function f(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 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,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 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 m(e){var t=(0,i.zy)(),n=f((0,r.useState)([]),2),s=n[0],m=n[1],p=f((0,r.useState)("/"),2),d=p[0],y=p[1],v=f((0,r.useState)(void 0),2),h=v[0],_=v[1];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)})}y(t),m(o)}},[t]);var b=function(t){t.stopPropagation(),e.clickFun(t)};return r.createElement("div",{className:"breadcrumbs",onClick:function(e){_(void 0!==h?void 0:"")}},r.createElement(r.Fragment,null,void 0===h?r.createElement(r.Fragment,null,r.createElement("span",{className:"chevron"},r.createElement(o.N_,{to:d,onClick:b},r.createElement("i",{className:"material-icons"},"home"))),s.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:b},decodeURIComponent(e.value)))})):r.createElement(u.QM,{click:function(){_(void 0)},children:r.createElement(c.Sm,{width:"100%",placeholder:"输入跳转的目录",handlerEnter:function(t){e.input_path_enter&&e.input_path_enter(t),_(void 0)}})})))}},8844(e,t,n){n.d(t,{B:()=>b});var r=n(6540),o=n(7022),i=n(7444),a=n(4694),l=n(6417),c=n(6007),u=n(3430);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(null,arguments)}function s(e){return function(e){if(Array.isArray(e))return _(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 m(){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 p(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]())):(p(t={},r,function(){return this}),t),s=u.prototype=l.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,p(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,p(s,"constructor",u),p(u,"constructor",c),c.displayName="GeneratorFunction",p(u,o,"GeneratorFunction"),p(s),p(s,o,"Generator"),p(s,r,function(){return this}),p(s,"toString",function(){return"[object Generator]"}),(m=function(){return{w:i,m:d}})()}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 d(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){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)})}}function v(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 _(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)?_(e,t):void 0}}function _(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 b(e){var t,n,p=v((0,i.L4)(l.A.selectedFileList),2),d=p[0],h=p[1],_=v((0,i.L4)(l.A.nowFileList),2),b=_[0],w=(_[1],v((0,i.L4)(l.A.confirm),2)),g=(w[0],w[1]),E=v((0,i.L4)(l.A.user_base_info),2),k=E[0];E[1];function A(){return(A=y(m().m(function t(n){return m().w(function(t){for(;;)switch(t.n){case 0:e.click&&e.click(n,e.name);case 1:return t.a(2)}},t)}))).apply(this,arguments)}return r.createElement("div",f({},e.extraAttr,{onClick:function(){!function(e){A.apply(this,arguments)}(e.index)},className:"item",role:"button","data-type":e.isLink?"invalid_link":e.type,"data-dir":!e.type||e.type===o.Iw.folder,"aria-selected":null!==(0,a.kW)(d,e.index),"aria-label":e.name,style:{"--filewidth":null!==(t=e.itemWidth)&&void 0!==t?t:"33%"},onDragStart:function(t){return n=e.index,void(d.find(function(e){return e===n})||h([].concat(s(d),[n])));var n},onDrop:function(t){return function(t,n){for(var r,i,a=t.dataTransfer,l=!1,c=0;c<a.items.length;c++)if("file"===a.items[c].kind){l=!0;break}if(!l){var f,s,p;if((null==k||null===(r=k.user_data)||void 0===r?void 0:r.file_list_pagination_mode)===u.yM.pagination){if(f=b.files[n],(null===(s=b.files[n])||void 0===s?void 0:s.type)!==o.Iw.folder)return}else if(f=b.folders[n],b.folders.length<=n)return;g({open:!0,title:"确定将文件移动并覆盖到".concat(null===(i=f)||void 0===i?void 0:i.name,"吗?"),handle:(p=y(m().m(function t(){var n;return m().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.draggable_handle(null===(n=f)||void 0===n?void 0:n.name);case 1:return t.a(2)}},t)})),function(){return p.apply(this,arguments)})})}}(t,e.index)},draggable:void 0!==e.draggable_handle}),void 0===e.icon&&r.createElement("div",null,e.type!==o.Iw.image||null==e.path||null!=k&&null!==(n=k.user_data)&&void 0!==n&&n.not_pre_show_image?r.createElement("i",{className:"material-icons"}):r.createElement("img",{loading:"lazy",src:c.$M.getDownloadUrl(e.path,{mtime:e.mtime,cache:1}),alt:e.name})),void 0!==e.icon&&r.createElement("div",{className:"rotating-div"},r.createElement("span",{className:"material-icons"},e.icon)),r.createElement("div",null,r.createElement("p",{className:"name"},e.name),e.size?r.createElement("p",null,e.size):r.createElement("p",null,"—"),r.createElement("p",null,e.show_mtime)),e.children)}},9330(e,t,n){n.r(t),n.d(t,{default:()=>je});var r=n(6540),o=n(7374),i=n(7444),a=n(6417),l=n(6007),c=n(7767),u=n(7952),f=n(6325),s=n(4289),m=n(3459),p=n(9214),d=n(1443),y=n(7022),v=n(2389),h=n(7523),_=n(8247),b=n(8815),w=n(6960),g=n(7071),E=n(4944),k=n(4188),A=n(3430),O=n(2458),S=n(4251),j=n(3496),P=n(4694),x=n(8844);function L(){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 C(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]())):(C(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,C(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,C(s,"constructor",u),C(u,"constructor",c),c.displayName="GeneratorFunction",C(u,o,"GeneratorFunction"),C(s),C(s,o,"Generator"),C(s,r,function(){return this}),C(s,"toString",function(){return"[object Generator]"}),(L=function(){return{w:i,m}})()}function C(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}C=function(e,t,n,r){function i(t,n){C(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))},C(e,t,n,r)}function F(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||T(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 I(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 G(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){I(i,r,o,a,l,"next",e)}function l(e){I(i,r,o,a,l,"throw",e)}a(void 0)})}}function M(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)||T(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 T(e,t){if(e){if("string"==typeof e)return z(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)?z(e,t):void 0}}function z(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 N(e){var t=M((0,i.L4)(a.A.selectedFileList),2),n=t[0],o=t[1],u=M((0,i.L4)(a.A.clickFileList),2),m=u[0],d=u[1],h=M((0,i.L4)(a.A.nowFileList),2),b=h[0],w=h[1],g=M((0,i.L4)(a.A.confirm),2),E=(g[0],g[1]),k=M((0,i.L4)(a.A.enterKey),2),A=k[0],O=(k[1],(0,_.kZ)().click_file),j=((0,v.Bd)().t,(0,c.Zp)()),C=((0,c.zy)(),function(){var t=G(L().m(function t(r,i){var a,l,c,u,f,p;return L().w(function(t){for(;;)switch(t.n){case 0:if(null!==(0,P.kW)(n,r))o((0,P.P1)(n,r));else if("ctrl"===A)o([].concat(F(n),[r]));else if("shift"===A){if(a=(0,P.a7)(n),l=a.max,c=a.min,u=[],r>=l)for(f=l;f<=r;f++)u.push(f);else for(p=c;p>=r;p--)u.push(p);o(u)}else o([r]);if(d([].concat(F(m),[r])),setTimeout(function(){d((0,P.P1)(m,r))},300),e.type!==y.Iw.folder){t.n=2;break}if(void 0===m.find(function(e){return e===r})){t.n=1;break}return j((0,P.IO)((0,s.vX)(),i)),o([]),d([]),w({files:[],folders:[]}),t.a(2);case 1:t.n=3;break;case 2:void 0!==m.find(function(e){return e===r})&&O({name:i,size:e.origin_size,opt_shell:!0,mtime:e.mtime});case 3:return t.a(2)}},t)}));return function(e,n){return t.apply(this,arguments)}}()),I=M((0,i.L4)(a.A.showPrompt),2),T=(I[0],I[1]),z=function(){var e=G(L().m(function e(t){var r,i;return L().w(function(e){for(;;)switch(e.n){case 0:return r=(0,p.ib)(b,n),i=r.map(function(e){return(0,p.Ok)(e.name)}),e.n=1,l.$M.post("cut",{files:i,to:"".concat((0,s.GG)("file",(0,s.vX)()),"/").concat(t)});case 1:e.v,o([]),E({open:!1,handle:null}),j((0,s.vX)());case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();return r.createElement(x.B,{extraAttr:{onContextMenu:function(t){!function(e,t,n,r){e.preventDefault(),e.stopPropagation();var o=new S.ik;o.path=(0,P.IO)((0,s.vX)(),t),o.filename=t,o.x=e.clientX,o.y=e.clientY,o.type=n?y.Iw.folder:(0,S.uL)(t),o.size=r,T({show:!0,type:f.PromptEnum.FileMenu,overlay:!1,data:o})}(t,e.name,e.type===y.Iw.folder,e.origin_size)}},draggable_handle:z,name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,isLink:e.isLink,path:e.path,icon:e.icon,show_mtime:e.show_mtime,click:C,itemWidth:e.itemWidth})}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}function X(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 U(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)?U(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 U(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 $(e){var t,n,o=e.handleContextMenu,l=e.file_list,c=e.folder_list,u=e.clickBlank,f=X((0,i.L4)(a.A.user_base_info),2),s=f[0],m=(f[1],(0,r.useRef)(null)),d=(0,v.Bd)().t,y=(0,p.OJ)(),h=(0,_.hg)().file_is_running,b=X((0,i.L4)(a.A.fileShellShow),2),w=b[0],g=b[1],E=X((0,i.L4)(a.A.enterKey),2),k=(E[0],E[1],X((0,i.L4)(a.A.selectedFileList),2)),A=(k[0],k[1],(0,r.useMemo)(function(){var e;return null!==(e=null==c?void 0:c.length)&&void 0!==e?e:0},[c]));return(0,p.ei)(m),(0,p.UK)(l,c,m),(0,r.useEffect)(function(){return function(){w.show&&g({show:!1,path:""})}},[]),r.createElement("div",{onContextMenu:o,id:"listing",style:{paddingBottom:"10rem"},className:"mosaic file-icons ".concat(null!==(t=null==s||null===(n=s.user_data)||void 0===n?void 0:n.file_list_show_type)&&void 0!==t?t:""),ref:m},c&&c.length>0&&r.createElement("h2",null,d("文件夹")),c&&r.createElement("div",{onClick:u},c.map(function(e,t){return r.createElement(r.Fragment,{key:t},r.createElement(N,D({itemWidth:y,index:t},e)))})),l&&l.length>0&&r.createElement("h2",{onClick:u},d("文件")),l&&r.createElement("div",{onClick:u},l.map(function(e,t){return r.createElement(r.Fragment,{key:t+A},r.createElement(N,D({icon:h(e.name)?"refresh":void 0,itemWidth:y,index:t+A},e)))})))}function B(e){var t,n,o=e.handleContextMenu,l=e.list,c=e.clickBlank,u=X((0,i.L4)(a.A.user_base_info),2),f=u[0],s=(u[1],(0,r.useRef)(null)),m=((0,v.Bd)().t,(0,p.OJ)()),d=(0,_.hg)().file_is_running,y=X((0,i.L4)(a.A.fileShellShow),2),h=y[0],b=y[1],w=X((0,i.L4)(a.A.enterKey),2),g=(w[0],w[1],X((0,i.L4)(a.A.selectedFileList),2)),E=(g[0],g[1],X((0,i.L4)(a.A.file_page),2)),k=(E[0],E[1]);return(0,p.UK)(l,[],s),(0,p.ei)(s),(0,p.SQ)(s,function(){k(function(e){return e.page_num<0?e:{page_size:e.page_size,page_num:e.page_num+1}})},function(){}),(0,r.useEffect)(function(){return function(){h.show&&b({show:!1,path:""})}},[]),r.createElement("div",{onContextMenu:o,id:"listing",style:{paddingBottom:"10rem"},className:"mosaic file-icons ".concat(null!==(t=null==f||null===(n=f.user_data)||void 0===n?void 0:n.file_list_show_type)&&void 0!==t?t:""),ref:s},l&&r.createElement("div",{onClick:c},l.map(function(e,t){return r.createElement(r.Fragment,{key:t},r.createElement(N,D({icon:d(e.name)?"refresh":void 0,itemWidth:m,index:t},e)))})))}var K=n(5997),W=n(2042),H=n(2730),R=n(5725),Y=n(447);function Z(e){return Z="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},Z(e)}function q(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 J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach(function(t){V(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Z(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Z(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(){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 ee(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]())):(ee(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,ee(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,ee(s,"constructor",u),ee(u,"constructor",c),c.displayName="GeneratorFunction",ee(u,o,"GeneratorFunction"),ee(s),ee(s,o,"Generator"),ee(s,r,function(){return this}),ee(s,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:i,m}})()}function ee(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ee=function(e,t,n,r){function i(t,n){ee(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))},ee(e,t,n,r)}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=Object.values(A.UG);function ce(){var e=(0,v.Bd)().t,t=(0,c.zy)(),n=(0,c.Zp)(),o=((0,_.MH)().check_user_auth,re((0,i.L4)(a.A.nowFileList),2)),u=o[0],m=(o[1],re((0,i.L4)(a.A.uploadFiles),2)),d=(m[0],m[1]),b=re((0,i.L4)(a.A.showPrompt),2),w=(b[0],b[1]),g=re((0,i.L4)(a.A.selectedFileList),2),A=g[0],O=(g[1],re((0,i.L4)(a.A.copyedFileList),2)),x=O[0],L=O[1],C=re((0,i.L4)(a.A.cutedFileList),2),F=C[0],I=C[1],G=re((0,i.L4)(a.A.selectedFileList),2),M=(G[0],G[1]),T=re((0,i.L4)(a.A.clickFileList),2),z=(T[0],T[1]),N=re((0,i.L4)(a.A.fileShellShow),2),D=N[0],X=N[1],U=re((0,i.L4)(a.A.file_root_list),2),$=U[0],B=(U[1],re((0,i.L4)(a.A.file_root_index),2)),Z=B[0],q=B[1],V=re((0,r.useState)(void 0),2),ee=(V[0],V[1],re((0,r.useState)(""),2)),te=(ee[0],ee[1],re((0,i.L4)(a.A.workflow_show),2)),ie=te[0],ce=te[1],ue=re((0,i.L4)(a.A.workflow_realtime_show),2),fe=(ue[0],ue[1],re((0,i.L4)(a.A.work_flow_show),2)),se=fe[0],me=(fe[1],(0,r.useContext)(h.F).initUserInfo),pe=re((0,i.L4)(a.A.user_base_info),2),de=pe[0],ye=(pe[1],(0,_.kZ)().click_file,re((0,i.L4)(a.A.prompt_card),2)),ve=(ye[0],ye[1]),he=(0,r.useMemo)(function(){return u.files.reduce(function(e,t){return e+(t.type!==y.Iw.folder?1:0)},0)},[u]),_e=(0,r.useMemo)(function(){var e,t;return u.files.reduce(function(e,t){return e+(t.type===y.Iw.folder?1:0)},0)+(null!==(e=null===(t=u.folders)||void 0===t?void 0:t.length)&&void 0!==e?e:0)},[u]);function be(e){(0,W.LW)(e)}(0,r.useEffect)(function(){ae={}},[t]);var we=function(){var e=ne(Q().m(function e(t){return Q().w(function(e){for(;;)switch(e.n){case 0:return q(t),e.n=1,l.$M.post("base_switch",{root_index:t});case 1:return e.n=2,me();case 2:n("/file/"),M([]),z([]);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();function ge(){return(ge=ne(Q().m(function e(){var t,n,r;return Q().w(function(e){for(;;)switch(e.n){case 0:return r=(0,P.jH)(le,null!==(t=null==de||null===(n=de.user_data)||void 0===n?void 0:n.file_list_show_type)&&void 0!==t?t:""),e.n=1,l.wm.post(j.s.user_save_user_file_list_show_type,{type:r});case 1:me();case 2:return e.a(2)}},e)}))).apply(this,arguments)}var Ee=function(t){ve({open:!0,title:e("信息"),context_div:r.createElement("div",{style:{maxWidth:"25rem"}},r.createElement(R.Yh,{left:e("挂载位置磁盘"),right:null==t?void 0:t.total_size}),r.createElement(R.Yh,{left:"".concat(e("磁盘剩余")),right:null==t?void 0:t.left_size}),r.createElement(R.Yh,{left:"".concat(e("文件系统")),right:null==t?void 0:t.fs_type}),r.createElement(R.Yh,{left:"".concat(e("文件夹数")),right:_e}),r.createElement(R.Yh,{left:"".concat(e("文件数")),right:he}),r.createElement(R.Yh,{left:"".concat(e("当前位置")),right:r.createElement(Y.xP,{context:null==t?void 0:t.now_absolute_path})})),cancel:function(){E.ws.removeMsg(k.HK.file_info)}})},ke=function(){var e=ne(Q().m(function e(){var t,n;return Q().w(function(e){for(;;)switch(e.n){case 0:if(ae.now_absolute_path){e.n=2;break}return E.ws.addMsg(k.HK.file_info,function(e){var n=e.context;t&&(ae=J(J({},ae),n),E.ws.removeMsg(k.HK.file_info),Ee(ae))}),e.n=1,E.ws.sendData(k.HK.file_info,{type:y.Iw.folder,path:(0,s.GG)("file",(0,s.vX)())});case 1:n=e.v,t=n.context,Ee(ae=t);case 2:Ee(ae);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(K.rA,{icon:"delete",title:e("删除"),onClick:function(){w({show:!0,type:f.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),A.length>0&&r.createElement(K.rA,{icon:"content_copy",title:e("复制"),onClick:function(){var e=(0,p.ib)(u,A);L(e.map(function(e){return(0,p.Ok)(e.name)})),I([]),be("已复制")}}),A.length>0&&r.createElement(K.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){var e=(0,p.ib)(u,A);I(e.map(function(e){return(0,p.Ok)(e.name)})),L([]),be("已剪切")}}),(x.length>0||F.length>0)&&r.createElement(K.rA,{onClick:function(){w({show:!0,type:f.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:x.length+F.length}),A.length>0&&r.createElement(K.rA,{icon:"download",title:e("下载"),onClick:function(){for(var e=(0,p.ib)(u,A),t=0;t<e.length;t++){var n=e[t];e[t]=encodeURIComponent((0,p.Ok)(n.name))}var r=l.$M.getDownloadUrl(e);window.open(r)}}),A.length>0&&r.createElement(K.rA,{icon:"compress",title:e("压缩"),onClick:function(){for(var e=(0,p.ib)(u,A),t=0;t<e.length;t++){var n=e[t];e[t]=(0,p.Ok)(n.name)}e&&0!==e.length?w({show:!0,type:f.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,W.zN)("没有选中")}}),1===A.length&&r.createElement(K.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){w({show:!0,type:f.PromptEnum.FileRename,overlay:!0,data:{}})}}),se&&r.createElement(K.rA,{icon:"api",title:"workflow",onClick:function(){ce(!ie)}}),r.createElement(K.rA,{icon:"terminal",title:"shell",onClick:function(){D.show?X({show:!1,path:""}):X({show:!0,path:(0,s.GG)("file",(0,s.vX)())})}}),r.createElement(K.rA,{icon:"grid_view",title:e("切换样式"),onClick:function(){return ge.apply(this,arguments)}}),r.createElement(K.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){w({show:!0,type:f.PromptEnum.DirNew,overlay:!0,data:{dir:(0,s.GG)("file",(0,s.vX)())}})}}),r.createElement(K.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){w({show:!0,type:f.PromptEnum.FileNew,overlay:!0,data:{dir:(0,s.GG)("file",(0,s.vX)())}})}}),r.createElement(K.rA,{icon:"upload_file",title:e("上传"),onClick:function(){w({show:!0,type:f.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,H.S)(c)),o.push(l)}var u=[];if(r){var s,m=function(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}}}}(i);try{for(m.s();!(s=m.n()).done;){var p=s.value;u.push({isDir:!0,fullPath:p,name:p})}}catch(e){m.e(e)}finally{m.f()}}u.push.apply(u,o),d(u),w({show:!0,type:f.PromptEnum.FilesUpload,overlay:!1,data:{}})}}}})}}),r.createElement(K.rA,{icon:"info",title:e("信息"),onClick:ke}),r.createElement(K.rA,{icon:"more_vert",title:e("切换目录"),onClick:function(e){var t=new S.ik;t.x=e.clientX,t.y=e.clientY,t.type=y.Iw.directory,t.items=$,t.item_pre_value=Z,t.textClick=function(){var e=ne(Q().m(function e(t){return Q().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:f.PromptEnum.FileMenu,overlay:!1,data:t})}}))}var ue=n(2543);function fe(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach(function(t){me(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function me(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=pe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pe(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){return pe="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},pe(e)}function de(e){return function(e){if(Array.isArray(e))return Ee(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ge(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 ye(){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 ve(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]())):(ve(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,ve(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return c.prototype=u,ve(s,"constructor",u),ve(u,"constructor",c),c.displayName="GeneratorFunction",ve(u,o,"GeneratorFunction"),ve(s),ve(s,o,"Generator"),ve(s,r,function(){return this}),ve(s,"toString",function(){return"[object Generator]"}),(ye=function(){return{w:i,m}})()}function ve(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ve=function(e,t,n,r){function i(t,n){ve(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))},ve(e,t,n,r)}function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ge(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 _e(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 be(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){_e(i,r,o,a,l,"next",e)}function l(e){_e(i,r,o,a,l,"throw",e)}a(void 0)})}}function we(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)||ge(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 ge(e,t){if(e){if("string"==typeof e)return Ee(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)?Ee(e,t):void 0}}function Ee(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 ke,Ae=r.lazy(function(){return Promise.all([n.e(856),n.e(659)]).then(n.bind(n,3659))}),Oe=r.lazy(function(){return Promise.all([n.e(856),n.e(636)]).then(n.bind(n,1636))}),Se=r.lazy(function(){return Promise.all([n.e(856),n.e(402)]).then(n.bind(n,3402))});function je(){var e=we((0,i.L4)(a.A.editorSetting),2),t=(e[0],e[1]),n=we((0,i.L4)(a.A.file_preview),2),P=(n[0],n[1]),x=(0,v.Bd)().t,L=(0,c.zy)(),C=(0,c.Zp)(),F=(0,_.MH)().check_user_auth,I=we((0,i.L4)(a.A.nowFileList),2),G=I[0],M=I[1],T=we((0,i.L4)(a.A.showPrompt),2),z=(T[0],T[1]),N=we((0,i.L4)(a.A.selectedFileList),2),D=(N[0],N[1]),X=we((0,i.L4)(a.A.clickFileList),2),U=(X[0],X[1]),K=we((0,i.L4)(a.A.fileShellShow),2),W=(K[0],K[1]),H=we((0,r.useState)(""),2),R=H[0],Y=H[1],Z=we((0,i.L4)(a.A.workflow_show),2),q=Z[0],J=(Z[1],we((0,i.L4)(a.A.workflow_realtime_show),2)),V=J[0],Q=(J[1],we((0,i.L4)(a.A.work_flow_show),2)),ee=(Q[0],Q[1]),te=(0,r.useContext)(h.F).initUserInfo,ne=we((0,i.L4)(a.A.user_base_info),2),re=ne[0],oe=(ne[1],(0,_.kZ)().click_file,we((0,i.L4)(a.A.to_running_files),2)),ie=(oe[0],oe[1]),ae=we((0,i.L4)(a.A.router_jump),2),le=(ae[0],ae[1]),fe=we((0,i.L4)(a.A.file_page),2),me=fe[0],ve=fe[1],_e=function(){var e=be(ye().m(function e(){var t;return ye().w(function(e){for(;;)switch(e.n){case 0:return(t=new g.Nd).dir_path="".concat((0,s.GG)("file",(0,s.vX)())),E.ws.addMsg(k.HK.workflow_realtime,function(e){var t=e.context;if(e.context){var n,r=he(t.sucess_file_list);try{for(r.s();!(n=r.n()).done;){var o=n.value;(0,p.Ys)(o)}}catch(e){r.e(e)}finally{r.f()}var i,a=he(t.failed_file_list);try{for(a.s();!(i=a.n()).done;){var l=i.value;(0,p.V$)(l)}}catch(e){a.e(e)}finally{a.f()}ie(new Set(t.running_file_list))}}),e.n=1,E.ws.sendData(k.HK.workflow_realtime,t);case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=be(ye().m(function e(t){var n,r,o,i,a,l,c,u,f;return ye().w(function(e){for(;;)switch(e.n){case 0:o=!1,i=he(null!==(n=t.files)&&void 0!==n?n:[]);try{for(i.s();!(a=i.n()).done;)(l=a.value).show_mtime=l.mtime?(0,w.$)(l.mtime):"",l.origin_size=l.size,l.size=(0,b.v7)(l.size),o||!l.name.endsWith(".workflow.yml")&&!l.name.endsWith(".act")||(o=!0,Promise.resolve().then(function(){_e()})),l.name===g.SB&&(o=!0)}catch(e){i.e(e)}finally{i.f()}c=he(null!==(r=t.folders)&&void 0!==r?r:[]);try{for(c.s();!(u=c.n()).done;)(f=u.value).show_mtime=f.mtime?(0,w.$)(f.mtime):"",f.name===g.SB&&(o=!0)}catch(e){c.e(e)}finally{c.f()}ee(o);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Ee=function(){var e=be(ye().m(function e(){var t,n,r,o,i;return ye().w(function(e){for(;;)switch(e.n){case 0:if(t=(0,s.GG)("file",(0,s.vX)()),re.user_data.file_list_pagination_mode!==A.yM.pagination){e.n=3;break}if(!(me.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:me.page_num,page_size:me.page_size});case 2:n=e.v,o=n.data,null!==(r=o.files)&&void 0!==r&&r.length||ve({page_size:me.page_size,page_num:-1}),o.files=(0,ue.cloneDeep)([].concat(de(G.files),de(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===m.m.Sucess){e.n=6;break}return e.a(2);case 6:i=n.data,(0,p.yC)(i,re.user_data.dir_show_type),ge(n.data),M(n.data),ke=n.data;case 7:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),je=function(){ve({page_num:1,page_size:200})};(0,r.useEffect)(function(){return je(),be(ye().m(function e(){return ye().w(function(e){for(;;)switch(e.n){case 0:ie(new Set);case 1:return e.a(2)}},e)}))},[]);var Pe=function(){Ee(),t({open:!1}),P({open:!1}),ee(!1)};(0,r.useEffect)(function(){M({files:[],folders:[]}),je(),Pe()},[L]),(0,r.useEffect)(function(){Pe()},[me]);var xe=function(e){e.target===e.currentTarget&&D([])},Le=function(e){var t;e.preventDefault(),e.stopPropagation();var n=new S.ik;n.x=e.clientX,n.y=e.clientY,n.type=y.Iw.directory;var o=[{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.time_minx_max?"green":void 0}},x("时间逆序")),v:A.t8.time_minx_max},{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.time_max_min?"green":void 0}},x("时间顺序")),v:A.t8.time_max_min}],i=[{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.size_min_max?"green":void 0}},x("大小逆序")),v:A.t8.size_min_max},{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.size_max_min?"green":void 0}},x("大小顺序")),v:A.t8.size_max_min}],a=[{r:r.createElement("span",{style:{color:re.user_data.file_list_pagination_mode&&re.user_data.file_list_pagination_mode!==A.yM.all?void 0:"green"}},x("全部加载文件")),v:A.yM.all},{r:r.createElement("span",{style:{color:re.user_data.file_list_pagination_mode===A.yM.pagination?"green":void 0}},x("分页滚动加载文件")),v:A.yM.pagination}],c=[{r:x("文件排序"),v:"",items:[{r:r.createElement("span",{style:{color:re.user_data.dir_show_type?void 0:"green"}},x("系统默认")),v:A.t8.defualt},{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.name?"green":void 0}},x("名字")),v:A.t8.name},{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.time_minx_max||re.user_data.dir_show_type===A.t8.time_max_min?"green":void 0}},x("修改时间")),v:!1,items:o},{r:r.createElement("span",{style:{color:re.user_data.dir_show_type===A.t8.size_min_max||re.user_data.dir_show_type===A.t8.size_max_min?"green":void 0}},x("文件大小")),v:!1,items:i}]},{r:x("文件加载方式"),v:"",items:a}];F(A.oV.code_resource)&&c.push({r:x("添加http资源根目录"),v:"code_resource"}),F(A.oV.http_proxy)&&c.push({r:x("在此目录下载http资源"),v:"http_resource"}),null!=re&&null!==(t=re.user_data)&&void 0!==t&&t.quick_cmd&&(0,p.LL)(de(re.user_data.quick_cmd),c),n.items=c,n.textClick=function(){var e=be(ye().m(function e(t){var n,r,o,i;return ye().w(function(e){for(;;)switch(e.n){case 0:if(!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,E.ws.sendData(k.HK.file_info,{path:(0,s.GG)("file",(0,s.vX)())});case 2:return r=e.v,le({page_self_router_api_data:["",r.context.now_absolute_path]}),z({data:void 0,overlay:!1,type:"",show:!1}),C("/setting/customer_router/"),e.a(2);case 3:if("http_resource"!==t){e.n=5;break}return e.n=4,E.ws.sendData(k.HK.file_info,{path:(0,s.GG)("file",(0,s.vX)())});case 4:return o=e.v,le({http_download_map_path:o.context.now_absolute_path}),z({data:void 0,overlay:!1,type:"",show:!1}),C("/proxy/http/"),e.a(2);case 5:"object"===pe(t)&&"quick_cmd"===t.tag?(i=t.cmd)&&(i.endsWith("\r")||(i+="\r",W({show:!0,path:(0,s.GG)("file",(0,s.vX)()),cmd:i}))):t===A.yM.all||t===A.yM.pagination?n.is_pagination_mode=!0:n.is_dir_list_type=!0;case 6:return e.n=7,l.wm.post(j.s.user_save_user_file_list_show_type,se({type:t},n));case 7:return e.n=8,te();case 8:z({data:void 0,overlay:!1,type:"",show:!1}),C((0,s.vX)());case 9:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),z({show:!0,type:f.PromptEnum.FileMenu,overlay:!1,data:n})};return r.createElement(r.Fragment,null,r.createElement(u.A,{left_children:r.createElement(d.$Z,{handleEnterPress:function(){var e,t;if(ke){D([]),U([]);var n,r=[],o=[],i=he(null!==(e=ke.files)&&void 0!==e?e:[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.name.includes(R)&&r.push(a)}}catch(e){i.e(e)}finally{i.f()}var l,c=he(null!==(t=ke.folders)&&void 0!==t?t:[]);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.name.includes(R)&&o.push(u)}}catch(e){c.e(e)}finally{c.f()}M({files:r,folders:o})}},placeholder:x("搜索当前目录"),icon:"search",value:"",handleInputChange:function(e){Y(e)},max_width:"25em"})},r.createElement(ce,null)),r.createElement(o.e,{baseRoute:"file",clickFun:function(){D([]),U([])},input_path_enter:function(e){var t;(0,O.Z1)(e)?(e=e.replace(0===(t=re.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),C(e)):C((0,O.Jn)((0,s.vX)(),e)),D([]),U([]),M({files:[],folders:[]})}}),re.user_data.file_list_pagination_mode===A.yM.pagination?r.createElement(B,{handleContextMenu:Le,clickBlank:xe,list:G.files}):r.createElement($,{handleContextMenu:Le,file_list:G.files,folder_list:G.folders,clickBlank:xe}),r.createElement(Se,null),q&&r.createElement(Ae,null),V.open&&r.createElement(Oe,null))}}}]);
|