filecat 7.21.2 → 7.22.2
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/122.4dcdda2738126091bb48.js +1 -0
- package/build/dist/1317.4d1617ed6eddfd2960b5.js +1 -0
- package/build/dist/2334.9568f51c698d1e261092.js +1 -0
- package/build/dist/{4924.32129da284e5464bf078.js → 2543.c1df37b86fd6b03c3976.js} +2 -2
- package/build/dist/259.5dbfcbe6ecd5e8ce07ca.js +1 -0
- package/build/dist/2674.983f76fc32b01e807e4d.js +1 -0
- package/build/dist/3355.7e565ed6c1feb0f27dee.js +1 -0
- package/build/dist/{3402.30e70a3fe5d2c355bae5.js → 3402.913056b796b3aa4dfd5f.js} +1 -1
- package/build/dist/4091.4ec37d360601d3f388ee.js +1 -0
- package/build/dist/4564.d7a5595346660e89760b.js +2 -0
- package/build/dist/4564.d7a5595346660e89760b.js.LICENSE.txt +39 -0
- package/build/dist/4598.b58b4b0ec393c55bc639.js +1 -0
- package/build/dist/47.8ee00dc79aeb57176214.js +1 -0
- package/build/dist/5272.16c3f9821799656a93a9.js +1 -0
- package/build/dist/6097.bc46f02339159adef0cf.js +1 -0
- package/build/dist/676.ad9fb1447bfc5b04b30a.js +1 -0
- package/build/dist/7181.031a335fc6a96a548882.js +1 -0
- package/build/dist/7678.2bbf9698415064479bce.js +1 -0
- package/build/dist/{8435.5cf0507f0dfbd7576fff.js → 8435.1f63fa3aa621962786b1.js} +1 -1
- package/build/dist/{8765.13b3b3db8cf2edb74526.js → 8765.800f703d3d31566267ab.js} +1 -1
- package/build/dist/9202.ef8b19ff438c0cb38a91.js +1 -0
- package/build/dist/9260.a27089cb2c89280cd27a.js +1 -0
- package/build/dist/{9546.cd3b1747ad87bbd7ccc4.js → 9546.2dc17877ae589e21d6d2.js} +1 -1
- package/build/dist/9765.5882767db41e6316419b.js +1 -0
- package/build/dist/991.2ff5a3ada566cb075df6.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.5a5517ff22ac8f748a14.js +2 -0
- package/build/main.js +1 -1
- package/package.json +5 -1
- package/build/dist/2334.8944eba9ea6bea2c873b.js +0 -1
- package/build/dist/2543.a6ee7f78b6f447ccae9f.js +0 -1
- package/build/dist/259.ed90168189edc15b3ea6.js +0 -1
- package/build/dist/2674.26ef7b92f7a50dde4275.js +0 -1
- package/build/dist/3355.70ffd73778049aa73d5c.js +0 -1
- package/build/dist/3528.f4bf3684610c3ce28c08.js +0 -1
- package/build/dist/4091.bbca4ee92e5d078ee770.js +0 -1
- package/build/dist/4598.6528d76c619352e7e1f3.js +0 -1
- package/build/dist/47.0ad0f7d1c95e6691b317.js +0 -1
- package/build/dist/5272.124204f2cb80d69e8561.js +0 -1
- package/build/dist/5877.afb89fcd6cbae1ab8e39.js +0 -1
- package/build/dist/6097.98ee6ec678fafcc2c2ba.js +0 -1
- package/build/dist/676.4671c5b267b93fd2112d.js +0 -1
- package/build/dist/7181.2403d6d75f9d4ea6917d.js +0 -1
- package/build/dist/7678.5769d70f52981f9434d1.js +0 -1
- package/build/dist/8358.1d1c09cc6b9185e388a2.js +0 -1
- package/build/dist/9260.72cae497ae765cc00d54.js +0 -1
- package/build/dist/9765.2f0daa101ea2bc02379a.js +0 -1
- package/build/dist/main.f512bdab9a0595432be0.js +0 -2
- /package/build/dist/{4924.32129da284e5464bf078.js.LICENSE.txt → 2543.c1df37b86fd6b03c3976.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.f512bdab9a0595432be0.js.LICENSE.txt → main.5a5517ff22ac8f748a14.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.22.2",
|
|
4
4
|
"description": "A self-hosted Web File browser and lightweight server management tool.",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"repository": {
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"docker-cli-js": "^2.10.0",
|
|
83
83
|
"eventsource-parser": "^3.1.0",
|
|
84
84
|
"fast-glob": "^3.3.3",
|
|
85
|
+
"fast-xml-parser": "^5.12.0",
|
|
85
86
|
"flexsearch": "^0.8.212",
|
|
86
87
|
"fluent-ffmpeg": "^2.1.3",
|
|
87
88
|
"flv.js": "^1.6.2",
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"iconv-lite": "^0.6.3",
|
|
97
98
|
"jieba-wasm": "^2.4.0",
|
|
98
99
|
"jotai": "^2.20.1",
|
|
100
|
+
"js-md5": "^0.9.2",
|
|
99
101
|
"js-yaml": "5.4.1",
|
|
100
102
|
"katex": "^0.16.47",
|
|
101
103
|
"listr2": "^8.2.1",
|
|
@@ -131,6 +133,7 @@
|
|
|
131
133
|
"prosemirror-tables": "^1.8.5",
|
|
132
134
|
"prosemirror-view": "^1.42.6",
|
|
133
135
|
"pty-shell": "1.5.4",
|
|
136
|
+
"qrcode": "^1.5.4",
|
|
134
137
|
"react": "^19.2.7",
|
|
135
138
|
"react-dom": "^19.2.7",
|
|
136
139
|
"react-i18next": "^17.0.8",
|
|
@@ -140,6 +143,7 @@
|
|
|
140
143
|
"rimraf": "^5.0.5",
|
|
141
144
|
"routing-controllers": "^0.10.4",
|
|
142
145
|
"simple-mind-map": "^0.14.0-fix.3",
|
|
146
|
+
"smol-toml": "^1.9.1",
|
|
143
147
|
"sshpk": "^1.18.0",
|
|
144
148
|
"style-loader": "^3.3.4",
|
|
145
149
|
"systeminformation": "5.31.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2334],{72458(e,t,n){function i(e,t){let n=function(e){let t="\\";for(const n of e)if("/"===n||"\\"===n){t=n;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===n?1:0;for(let i=e.length-1-t;i>=0;i--)if(e[i]===n)return e.substring(0,i+1)}return e}return e.endsWith(n)&&t.startsWith(n)?e.slice(0,-1)+t:e.endsWith(n)||t.startsWith(n)?e+t:e+n+t}n.d(t,{Jn:()=>i,Z1:()=>s});function s(e){if("string"!=typeof e||0===e.length)return!1;return/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e)}},47374(e,t,n){n.d(t,{e:()=>f});var i=n(96540),s=n(52671),o=n(64694),a=n(34289),l=n(61443),r=n(75725),c=n(22022),d=n(85997),_=n(74848);function f(e){let t=(0,s.zy)();const[n,f]=(0,i.useState)([]),[p,h]=(0,i.useState)("/"),[u,m]=(0,i.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();i.useEffect(()=>{let t="",n=(0,a.vX)().split("/");n=n.filter(e=>e);const i=n.indexOf(e.baseRoute),s=[];if(-1!=i){t=(0,o.IO)(n.slice(0,i),e.baseRoute);const a=n.slice(i+1);for(let e=0;e<a.length;e++){const n=a[e];s.push({value:n,href:0===e?`${t}${n}/`:(0,o.IO)(s[e-1].href,n)})}h(t),f(s)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(i.Fragment,{children:void 0===u?(0,_.jsxs)(i.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:p,onClick:g,children:(0,_.jsx)(d.In,{icon:"home"})})}),n.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,_.jsx)(r.QM,{click:()=>{m(void 0)},children:(0,_.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),m(void 0)}})})})})}},77481(e,t,n){n.d(t,{S:()=>l,X:()=>a});var i=n(96540),s=n(61443),o=n(74848);function a(e){const[t,n]=i.useState([]),a=(0,i.useRef)(-1),[l,r]=(0,i.useState)(-1),[c,d]=(0,i.useState)(-1);(0,i.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const _=()=>{a.current=-1,r(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,n)=>{const i=!!e.filter&&(e.filter.column??0)===n;let a=t;if(i){const n=e.filter,i=n.options.find(e=>e.value===n.value);null!=n.value&&i&&(a=`${t} (${i.label})`)}return(0,o.jsx)("th",{className:i?"table-filter-col":"",children:i?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},n)})})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>{const i=!!e.onRowDrag;return(0,o.jsx)("tr",{className:i?(l===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:i,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{i&&(a.current=n,r(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!i||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{i&&(t.preventDefault(),(()=>{const t=a.current,n=c;_(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:_,children:t.map((n,i)=>{const s=i===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:n},i)})},n)})})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},62334(e,t,n){n.r(t),n.d(t,{default:()=>Q});var i=n(96540),s=n(47374),o=n(34843),a=n(52035),l=n(82893),r=n(14284),c=n(52671),d=n(4412),_=n(89824),f=n(34289),p=n(53459),h=n(99214),u=n(61443),m=n(47022),w=n(62042),v=n(22022),g=n(7523),x=n(78247),y=n(88815),j=n(6960),k=n(47071),G=n(14944),A=n(92275),b=n(23430),C=n(72458),S=n(34251),M=n(60096),z=n(87361),$=n(97952),D=n(85997),N=n(77481),E=n(70447),F=n(74848);const I=500;function P(e){const{t}=(0,v.Bd)(),n=(0,c.Zp)(),[,s]=(0,o.fp)(l.AG.prompt_card),[a,r]=(0,i.useState)(""),[d,_]=(0,i.useState)(!1),[f,p]=(0,i.useState)([]),[h,m]=(0,i.useState)(0),[w,g]=(0,i.useState)(!1),x=(0,i.useMemo)(()=>new $.I(window.location.host,"file_deep_search"),[]),y=(0,i.useRef)(!1),j=decodeURIComponent(e.base_path);(0,i.useEffect)(()=>{let e=[],t=null;const n=()=>{if(t=null,y.current||!e.length)return;const n=e;e=[],m(e=>e+n.length),p(e=>e.length>=I?e:[...e,...n].slice(0,I))},i=()=>{y.current||_(!1)};return x.addMsg(A.HK.file_deep_search_data,i=>{y.current||(e.push(...i.context??[]),null===t&&(t=setTimeout(n,100)))}),x.addMsg(A.HK.file_deep_search_end,()=>{y.current||(n(),_(!1))}),x.on_message("close",i),()=>{y.current=!0,clearTimeout(t),x.sendData(A.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",i),x.close()}},[]);const k=()=>{const t=a.trim();if(!t||d)return;p([]),m(0),g(!0),_(!0);const n={param_path:e.base_path,keyword:t};x.sendData(A.HK.file_deep_search,n).catch(()=>{})},G=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),n(z.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,F.jsxs)("div",{className:"file-deep-search",children:[(0,F.jsxs)("div",{className:"file-deep-search__bar",children:[(0,F.jsx)(u.$Z,{icon:"search",value:a,placeholder:t("搜文件名"),handleInputChange:e=>r(e),handleEnterPress:k}),(0,F.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(A.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,F.jsxs)("div",{className:"file-deep-search__hint",children:[(0,F.jsxs)("span",{children:[t("范围"),":",j]}),h>0&&(0,F.jsx)("span",{className:"file-deep-search__count",children:h>I?`${t("已显示")} 500 / ${h}`:`${h}`})]}),(0,F.jsxs)("div",{className:"file-deep-search__body",children:[f.length>0&&(0,F.jsx)(N.X,{headers:[t("名称"),t("路径"),""],rows:f.map(e=>{const n=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,F.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,F.jsx)(E.xP,{context:n}),(0,F.jsx)(D.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>G(e)})]})}),d&&(0,F.jsxs)("div",{className:"file-deep-search__empty",children:[(0,F.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&h>I&&(0,F.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===f.length&&(0,F.jsx)("div",{className:"file-deep-search__empty",children:t(w?"无匹配":"输入后搜")})]})]})}var X=n(64694),R=n(23496),K=n(12730),L=n(75725),H=n(40505);let U={};function Z(){const{t:e}=(0,v.Bd)();let t=(0,c.zy)();const n=(0,c.Zp)(),{check_user_auth:s}=(0,x.MH)(),[a,d]=(0,o.fp)(l.AG.nowFileList),[p,u]=(0,o.fp)(l.AG.uploadFiles),[y,j]=(0,o.fp)(l.AG.showPrompt),[k,C]=(0,o.fp)(l.AG.selectedFileList),[M,$]=(0,o.fp)(l.AG.copyedFileList),[N,I]=(0,o.fp)(l.AG.cutedFileList),[P,R]=(0,o.fp)(l.AG.selectedFileList),[H,Z]=(0,o.fp)(l.AG.clickFileList),[Y,B]=(0,o.fp)(l.AG.fileShellShow),O=(0,h.Cf)(),[W,T]=(0,o.fp)(l.AG.file_root_list),[V,q]=(0,o.fp)(l.AG.file_root_index),[J,Q]=(0,i.useState)(void 0),[ee,te]=(0,i.useState)(""),[ne,ie]=(0,o.fp)(l.AG.workflow_show),[se,oe]=(0,o.fp)(l.AG.workflow_realtime_show),[ae,le]=(0,o.fp)(l.AG.work_flow_show),{initUserInfo:re}=(0,i.useContext)(g.F),[ce,de]=(0,o.fp)(l.AG.user_base_info),{click_file:_e}=(0,h.kZ)(),[fe,pe]=(0,o.fp)(l.AG.prompt_card),he=(0,i.useMemo)(()=>a.files.reduce((e,t)=>e+(t.type!==m.Iw.folder?1:0),0),[a]),ue=(0,i.useMemo)(()=>a.files.reduce((e,t)=>e+(t.type===m.Iw.folder?1:0),0)+(a.folders?.length??0),[a]);function me(e){(0,w.SK)(e)}(0,i.useEffect)(()=>{U={}},[t]),(0,i.useEffect)(()=>()=>{B({show:!1,path:""})},[]);const we=(0,h.Vs)(),ve=t=>{pe({open:!0,title:e("信息"),context_div:(0,F.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,F.jsx)(L.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,F.jsx)(L.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,F.jsx)(L.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,F.jsx)(L.Yh,{left:`${e("文件夹数")}`,right:ue}),(0,F.jsx)(L.Yh,{left:`${e("文件数")}`,right:he}),(0,F.jsx)(L.Yh,{left:`${e("当前位置")}`,right:(0,F.jsx)(E.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{G.ws.removeMsg(A.HK.file_info)}})};return(0,F.jsxs)(i.Fragment,{children:[k.length>0&&(0,F.jsx)(D.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,F.jsx)(D.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,h.ib)(a,k);$(e.map(e=>(0,h.Ok)(e.name))),I([]),me("已复制")}}),k.length>0&&(0,F.jsx)(D.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,h.ib)(a,k);I(e.map(e=>(0,h.Ok)(e.name))),$([]),me("已剪切")}}),(M.length>0||N.length>0)&&(0,F.jsx)(D.rA,{onClick:function(){j({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:M.length+N.length}),k.length>0&&(0,F.jsx)(D.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,h.ib)(a,k);for(let t=0;t<e.length;t++){const n=e[t];e[t]=encodeURIComponent((0,h.Ok)(n.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,F.jsx)(D.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,h.ib)(a,k);for(let e=0;e<t.length;e++){const n=t[e];t[e]=(0,h.Ok)(n.name)}t&&0!==t.length?j({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,w.zN)(e("没有选中"))}}),1===k.length&&(0,F.jsx)(D.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),ae&&(0,F.jsx)(D.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!ne)}}),O.can_terminal&&(0,F.jsx)(D.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?B({show:!1,path:""}):B({show:!0,path:(0,f.GG)("file",(0,f.vX)())})}}),s(b.oV.share_file)&&(0,F.jsx)(D.rA,{icon:"share",title:e("文件分享"),onClick:()=>{n(`${z.o.share_list_setting_page}`)}}),(0,F.jsx)(D.rA,{icon:"grid_view",title:e("切换样式"),onClick:we}),(0,F.jsx)(D.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,F.jsx)(D.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,F.jsx)(D.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let n=!!t[0].webkitRelativePath;const i=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=n?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,n&&s.add((0,K.S)(a)),i.push(o)}const o=[];if(n)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...i),u(o),j({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,F.jsx)(D.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!U.now_absolute_path){G.ws.addMsg(A.HK.file_info,t=>{const n=t.context;e&&(U={...U,...n},G.ws.removeMsg(A.HK.file_info),ve(U))});const t=await G.ws.sendData(A.HK.file_info,{type:m.Iw.folder,path:(0,f.GG)("file",(0,f.vX)())});e=t.context,U=e,ve(U)}ve(U)}}),(0,F.jsx)(D.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const i=new S.ik;i.x=t.clientX,i.y=t.clientY,i.type=m.Iw.directory,i.items=W,i.item_pre_value=V,i.textClick=async t=>{if(t.type===S.LU.add)return n(`${z.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,w.N9)(e("请配置 文件夹路径"));j({data:void 0,overlay:!1,type:"",show:!1}),t.type!==S.LU.child?(async e=>{q(e),await r.$M.post("base_switch",{root_index:e}),await re(),n("/file/"),R([]),Z([])})(t.index):n((0,X.IO)(z.o.file,t.rel))},j({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:i})}})]})}var Y=n(2543),B=n(21499),O=n(17903);const W=i.lazy(()=>Promise.all([n.e(7856),n.e(6349),n.e(3659)]).then(n.bind(n,63659))),T=i.lazy(()=>Promise.all([n.e(7856),n.e(1636)]).then(n.bind(n,81636))),V=i.lazy(()=>n.e(9857).then(n.bind(n,69857)));let q,J="";function Q(){const[e,t]=(0,o.fp)(l.AG.editorSetting),[,n]=(0,o.fp)(l.AG.md_editor),[,w]=(0,o.fp)(l.AG.log_viewer),[,$]=(0,o.fp)(l.AG.image_editor),[,N]=(0,o.fp)(l.AG.markdown),[,E]=(0,o.fp)(l.AG.excalidraw_editor),[,I]=(0,o.fp)(l.AG.mind_editor),[,K]=(0,o.fp)(l.AG.timeline_editor),[,L]=(0,o.fp)(l.AG.excel_editor),[U,Q]=(0,o.fp)(l.AG.file_preview),{t:ee}=(0,v.Bd)();let te=(0,c.zy)();const ne=(0,c.Zp)(),[ie,se]=(0,o.fp)(l.AG.nowFileList),[oe]=(0,o.fp)(l.AG.file_list_refresh),[ae]=(0,o.fp)(l.AG.mount_enabled),[le,re]=(0,o.fp)(l.AG.current_mount),[ce,de]=(0,o.fp)(l.AG.showPrompt),[_e,fe]=(0,o.fp)(l.AG.selectedFileList),[pe,he]=(0,o.fp)(l.AG.clickFileList),[ue,me]=(0,o.fp)(l.AG.fileShellShow),[we,ve]=(0,i.useState)(""),[ge,xe]=(0,o.fp)(l.AG.workflow_show),[ye,je]=(0,o.fp)(l.AG.workflow_realtime_show),[ke,Ge]=(0,o.fp)(l.AG.work_flow_show),{initUserInfo:Ae}=(0,i.useContext)(g.F),[be,Ce]=(0,o.fp)(l.AG.user_base_info),{check_user_auth:Se}=(0,x.MH)(),{click_file:Me}=(0,h.kZ)(),[ze]=(0,c.ok)(),$e=(0,h._A)(),De=i.useRef(null),[Ne,Ee]=(0,o.fp)(l.AG.to_running_files),[Fe,Ie]=(0,o.fp)(l.AG.file_page),[Pe]=(0,o.fp)(l.AG.blank_search_mode),[,Xe]=(0,o.fp)(l.AG.prompt_card),[Re,Ke]=(0,o.fp)(l.AG.blank_search_mode_for_temp),Le=(0,h.oT)(),He="1"===ze.get("chat_open"),Ue=Se(b.oV.ai_agent_page),Ze=(0,h.Cf)();(0,i.useEffect)(()=>{be?.user_data&&He&&!Ue&&Le("chat_open",null)},[He,Ue,be]);const[Ye,Be]=(0,o.fp)(l.AG.studio_chat_width),Oe=i.useRef(null),[We,Te]=(0,i.useState)(!1),[Ve,qe]=(0,i.useState)(void 0),Je=(0,h.dN)();(0,h.rJ)(Je());const[Qe,et]=(0,o.fp)(l.AG.ai_chat_session_by_cwd),tt=function(){const e=(0,h.Cf)(),[t,n]=(0,o.fp)(l.AG.user_base_info),{t:s}=(0,v.Bd)(),{check_user_auth:a}=(0,x.MH)(),[d,p]=(0,o.fp)(l.AG.router_jump),u=(0,c.Zp)(),{initUserInfo:w}=(0,i.useContext)(g.F),[y,j]=(0,o.fp)(l.AG.nowFileList),[k,C]=(0,o.fp)(l.AG.showPrompt),[M,$]=(0,o.fp)(l.AG.fileShellShow),[D,N]=(0,o.fp)(l.AG.blank_search_mode);return n=>{n.preventDefault(),n.stopPropagation();const i=new S.ik;i.x=n.clientX,i.y=n.clientY,i.type=m.Iw.directory;const o=[{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.time_minx_max),children:s("时间逆序")}),v:b.t8.time_minx_max},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.time_max_min),children:s("时间顺序")}),v:b.t8.time_max_min}],l=[{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.size_min_max),children:s("大小顺序")}),v:b.t8.size_min_max},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.size_max_min),children:s("大小逆序")}),v:b.t8.size_max_min}],c=[{r:(0,F.jsx)("span",{style:(0,H.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===b.yM.all),children:s("全部加载文件")}),v:b.yM.all},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.file_list_pagination_mode===b.yM.pagination),children:s("scrll_l")}),v:b.yM.pagination}],d=[{r:(0,F.jsx)("span",{style:(0,H.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===b.KD.current),children:s("最近时间")}),v:b.KD.current},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.file_time_show_type===b.KD.time),children:s("准确时间")}),v:b.KD.time}],v=[{r:s("文件列表展示"),items:[{r:s("文件排序"),v:"",items:[{r:(0,F.jsx)("span",{style:(0,H.ok)(!t.user_data.dir_show_type),children:s("系统默认")}),v:b.t8.defualt},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.name),children:s("名字")}),v:b.t8.name},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.time_minx_max||t.user_data.dir_show_type===b.t8.time_max_min),children:s("修改时间")}),v:!1,items:o},{r:(0,F.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===b.t8.size_min_max||t.user_data.dir_show_type===b.t8.size_max_min),children:s("文件大小")}),v:!1,items:l}]},{r:s("文件加载方式"),v:"",items:c},{r:s("时间展示"),v:"",items:d},{r:s("缩放调整"),v:"zoom_adjust"},{r:(0,F.jsx)("span",{style:(0,H.ok)(D),children:s("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&y?.folders?.find(e=>".git"===e.name)&&v.push({r:s("查看Git提交"),v:"git_page"}),a(b.oV.code_resource)&&v.push({r:s("add_rot"),v:"code_resource"}),a(b.oV.http_proxy)&&v.push({r:s("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,h.LL)([...t.user_data.quick_cmd],v),i.items=v,i.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,f.GG)("file",(0,f.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void u(`${z.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,f.GG)("file",(0,f.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void u(`${z.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await G.ws.sendData(A.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return p({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void u("/setting/customer_router/")}if("http_resource"===e){const e=await G.ws.sendData(A.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void u("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",$({show:!0,path:(0,f.GG)("file",(0,f.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return N(!D),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===b.yM.all||e===b.yM.pagination)t.is_pagination_mode=!0;else if(e===b.KD.current||e===b.KD.time)t.is_file_show_type=!0;else{if(e!==b.t8.defualt&&e!==b.t8.name&&e!==b.t8.size_max_min&&e!==b.t8.size_min_max&&e!==b.t8.time_max_min&&e!==b.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(R.s.user_save_private_attr,{type:e,...t}),await w(),C({data:void 0,overlay:!1,type:"",show:!1}),u((0,f.vX)())},C({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:i})}}(),nt=async e=>{let t=!1;for(const n of e.files??[])n.origin_size=n.size,n.size=(0,y.v7)(n.size),be.user_data.file_time_show_type===b.KD.time?n.show_mtime=n.mtime?(0,B.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,j.s)(n.mtime):"",t||!n.name.endsWith(".workflow.yml")&&!n.name.endsWith(".act")||(t=!0),n.name===k.SB&&(t=!0);for(const n of e.folders??[])be.user_data.file_time_show_type===b.KD.time?n.show_mtime=n.mtime?(0,B.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,j.s)(n.mtime):"",n.name===k.SB&&(t=!0);Ge(t)},it=i.useRef(null),st=async e=>{if(!0===ae){if(it.current!==e){it.current=e;try{const t=await r.$M.post("file/mount_info",{param_path:e});re(t?.data??null),await G.ws.connect()}catch(e){re(null)}}}else re(null)};(0,i.useEffect)(()=>{ke&&(async()=>{const e=new k.Nd,t=(0,a.zp)().get(l.AG.current_mount);e.dir_path=(0,h.Zl)((0,f.GG)("file",(0,f.vX)()),t),G.ws.addMsg(A.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,h.Ys)(e);for(const e of t.failed_file_list)(0,h.V$)(e);Ee(new Set(t.running_file_list))}}),await G.ws.sendData(A.HK.workflow_realtime,e)})()},[ke,le,te]);const ot=async()=>{const e=(0,f.GG)("file",(0,f.vX)());if(Pe||Re)return;let t;if(st(e),be.user_data.file_list_pagination_mode===b.yM.pagination){if(J!==e){if(J=e,1!==Fe.page_num)return void Ie({page_size:Fe.page_size,page_num:1})}else if(Fe.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:Fe.page_num,page_size:Fe.page_size}),t.code!==p.m.Success)return;const n=t.data;return nt(n),n.files?.length?(se(e=>{const t=(0,Y.cloneDeep)(1===Fe.page_num?n.files:[...e?.files??[],...n.files]),i={...e,files:t};return(0,h.yC)(i,be.user_data.dir_show_type),i}),void(q=t.data)):void Ie({page_size:Fe.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const n=t.data;(0,h.yC)(n,be.user_data.dir_show_type),nt(t.data),se(t.data),q=t.data};(0,i.useEffect)(()=>async()=>{Ee(new Set)},[]);const at=()=>{Ge(!1),(()=>{const e=ze.get("preview_file_name"),t=ze.get("preview_mode");if(!e||!t)return!1;const i=(0,f.GG)("file",(0,f.vX)());if(De.current===i+e)return!0;De.current=i+e;const s=()=>$e(null);return"md"===t?(n({url:r.$M.getDownloadUrl(`${encodeURIComponent(i)}${e}`),path:`${i}${e}`,name:e,close:s}),!0):"log"===t?(w({show:!0,fileName:e,encoding:ze.get("preview_log_enc")??"utf8",wrap:ze.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?($({path:(0,X.IO)((0,f.vX)(),e),name:e,close:s}),!0):(0,S.uL)(e)===m.Iw.url?(Me({name:e,opt_shell:!0,close:s}),!0):(Me({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||(t({open:!1}),Q({open:!1}),n({}),w({show:!1}),$({}),N({}),E({}),I({}),K({}),L({}),ot())};(0,i.useEffect)(()=>{at()},[te,Fe]),(0,i.useEffect)(()=>{oe>0&&ot()},[oe]);const lt=i.useRef(!1);(0,i.useEffect)(()=>{if(null!==ae)return lt.current?void(!0===ae?st((0,f.GG)("file",(0,f.vX)())):re(null)):(lt.current=!0,void(!0===ae&&null===le&&st((0,f.GG)("file",(0,f.vX)()))))},[ae]);const rt=e=>{e.target===e.currentTarget&&(fe([]),he([]))},ct=i.useCallback((0,Y.throttle)(e=>{const t=Oe.current;if(!t||!t.parentElement)return;const n=parseFloat(getComputedStyle(t).fontSize),i=t.parentElement.getBoundingClientRect(),s=i.right-e.clientX,o=Math.min(Math.max(s,320),.7*i.width);Be(parseFloat((o/n).toFixed(2)))},32),[]),dt=()=>{Te(!1),document.removeEventListener("pointermove",ct)},_t=(0,F.jsxs)("div",{className:"file-list-main",children:[(0,F.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(fe([]),he([]),be.user_data.file_list_pagination_mode===b.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Ie({page_size:Fe.page_size,page_num:1})}},input_path_enter:e=>{var t;fe([]),he([]),se({files:[],folders:[]}),(0,C.Z1)(e)?(e=e.replace(0===(t=be.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),ne(e)):ne((0,C.Jn)((0,f.vX)(),e))}}),le&&(0,F.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:le.color},children:[(0,F.jsx)("span",{className:"material-icons",style:{color:le.color},children:"cloud"}),(0,F.jsx)("span",{children:[le.credential_note,le.account_note||(O.C1.find(e=>e.value===le.driver)?.title??le.driver),le.name].filter(Boolean).join(" - ")}),le.readonly&&(0,F.jsx)("span",{className:"mount-readonly-tag",children:ee("只读")})]}),be.user_data.file_list_pagination_mode===b.yM.pagination?(0,F.jsx)(M.$J,{handleContextMenu:tt,clickBlank:rt,list:ie.files}):(0,F.jsx)(M.t$,{handleContextMenu:tt,file_list:ie.files,folder_list:ie.folders,clickBlank:rt})]});return(0,F.jsxs)(i.Fragment,{children:[(0,F.jsx)(d.aZ,{children:(0,F.jsx)(u.$Z,{handleEnterPress:async()=>{if(Pe||Re){if(fe([]),he([]),!we||!we.trim())return void se({files:[],folders:[]});const e=(0,f.GG)("file",(0,f.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:we.trim()});if(t.code!==p.m.Success)return;const n=t.data;return(0,h.yC)(n,be.user_data.dir_show_type),nt(n),se(n),void(q=n)}if(!q)return;fe([]),he([]);const e=[],t=[];for(const t of q.files??[])t.name.includes(we)&&e.push(t);for(const e of q.folders??[])e.name.includes(we)&&t.push(e);se({files:e,folders:t})},placeholder:ee("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,f.GG)("file",(0,f.vX)());Xe({open:!0,title:ee("深搜"),context_div:(0,F.jsx)(P,{base_path:e})})},handleInputChange:e=>{ve(e)},max_width:"25em"})}),(0,F.jsxs)(d.aZ,{position:"right",children:[Se(b.oV.ai_agent_page)&&Ze.ai_chat_available&&(0,F.jsx)(D.rA,{icon:"smart_toy",title:ee("AI 聊天"),selected:He,onClick:()=>Le("chat_open",!He?"1":null)}),(0,F.jsx)("div",{className:"mobile-context-btn",children:(0,F.jsx)(D.rA,{icon:"more_horiz",title:ee("右键"),onClick:()=>{const e=_e[_e.length-1];if(void 0!==e){const t=[...ie.folders??[],...ie.files??[]][e];if(t){const n=document.querySelectorAll(".item")[e],i=n?n.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:i.left+10,clientY:i.bottom??100},o=new S.ik;o.path=(0,X.IO)((0,f.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===m.Iw.folder?m.Iw.folder:(0,S.uL)(t.name),o.size=t.origin_size,de({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};tt(e)}}})}),(0,F.jsx)(Z,{})]}),(0,F.jsxs)("div",{className:"file-list-split"+(He?" file-list-split--chat":""),children:[_t,He&&(0,F.jsxs)(i.Fragment,{children:[(0,F.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Oe,onPointerDown:e=>{e.preventDefault(),Te(!0),document.addEventListener("pointermove",ct),document.addEventListener("pointerup",dt,{once:!0})}}),(0,F.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ye}em`},children:(0,F.jsx)(i.Suspense,{fallback:null,children:(0,F.jsx)(V,{inline_header:!0,sync_url:!1,file_cwd_path:Je(),session_id:Ve??(ft=Je(),l.AG.get_ai_chat_session(Qe,ft)),on_session_change:e=>{qe(e),((e,t)=>{et({...Qe,[e]:t})})(Je(),e)}})})})]})]}),We&&(0,F.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),ge&&(0,F.jsx)(W,{}),ye.open&&(0,F.jsx)(T,{})]});var ft}}}]);
|