filecat 7.3.0 → 7.3.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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9299],{47374(e,t,i){i.d(t,{e:()=>f});var n=i(96540),s=i(86090),o=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(86149),d=i(85997),_=i(74848);function f(e){let t=(0,s.zy)();const[i,f]=(0,n.useState)([]),[p,h]=(0,n.useState)("/"),[u,m]=(0,n.useState)(void 0),{t:w,i18n:g}=(0,c.B)();n.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const n=i.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(i.slice(0,n),e.baseRoute);const a=i.slice(n+1);for(let e=0;e<a.length;e++){const i=a[e];s.push({value:i,href:0===e?`${t}${i}/`:(0,o.IO)(s[e-1].href,i)})}h(t),f(s)}},[t]);const v=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:p,onClick:v,children:(0,_.jsx)(d.In,{icon:"home"})})}),i.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:v,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,i){i.d(t,{S:()=>l,X:()=>a});var n=i(96540),s=i(61443),o=i(74848);function a(e){const[t,i]=n.useState([]),a=(0,n.useRef)(-1),[l,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?i(Array.isArray(e.children)?e.children:[e.children]):i(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,i)=>{const n=!!e.filter&&(e.filter.column??0)===i;let a=t;if(n){const i=e.filter,n=i.options.find(e=>e.value===i.value);null!=i.value&&n&&(a=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},i)})})}),(0,o.jsx)("tbody",{children:t.map((t,i)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(l===i?"row-dragging":"")+(c===i?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(a.current=i,r(i),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(i))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=a.current,i=c;_(),t<0||i<0||t===i||e.onRowDrag?.(t,i)})())},onDragEnd:_,children:t.map((i,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:i},n)})},i)})})]})}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))})}},19299(e,t,i){i.r(t),i.d(t,{default:()=>q});var n=i(96540),s=i(47374),o=i(34843),a=i(82893),l=i(14284),r=i(86090),c=i(4412),d=i(83529),_=i(34289),f=i(53459),p=i(99214),h=i(61443),u=i(47022),m=i(62042),w=i(86149),g=i(7523),v=i(78247),x=i(88815),y=i(6960),j=i(47071),k=i(14944),G=i(92275),A=i(23430);var b=i(34251),C=i(60096),$=i(87361),z=i(76559),M=i(85997),S=i(77481),D=i(70447),P=i(74848);const I=500;function N(e){const{t}=(0,w.B)(),i=(0,r.Zp)(),[,s]=(0,o.fp)(a.AG.prompt_card),[l,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(!1),[f,p]=(0,n.useState)([]),[u,m]=(0,n.useState)(0),[g,v]=(0,n.useState)(!1),x=(0,n.useMemo)(()=>new z.I(window.location.host,"file_deep_search"),[]),y=(0,n.useRef)(!1),j=decodeURIComponent(e.base_path);(0,n.useEffect)(()=>{let e=[],t=null;const i=()=>{if(t=null,y.current||!e.length)return;const i=e;e=[],m(e=>e+i.length),p(e=>e.length>=I?e:[...e,...i].slice(0,I))},n=()=>{y.current||_(!1)};return x.addMsg(G.HK.file_deep_search_data,n=>{y.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(i,100)))}),x.addMsg(G.HK.file_deep_search_end,()=>{y.current||(i(),_(!1))}),x.on_message("close",n),()=>{y.current=!0,clearTimeout(t),x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",n),x.close()}},[]);const k=()=>{const t=l.trim();if(!t||d)return;p([]),m(0),v(!0),_(!0);const i={param_path:e.base_path,keyword:t};x.sendData(G.HK.file_deep_search,i).catch(()=>{})},A=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),i($.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,P.jsxs)("div",{className:"file-deep-search",children:[(0,P.jsxs)("div",{className:"file-deep-search__bar",children:[(0,P.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,P.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,P.jsxs)("div",{className:"file-deep-search__hint",children:[(0,P.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,P.jsx)("span",{className:"file-deep-search__count",children:u>I?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,P.jsxs)("div",{className:"file-deep-search__body",children:[f.length>0&&(0,P.jsx)(S.X,{headers:[t("名称"),t("路径"),""],rows:f.map(e=>{const i=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,P.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,P.jsx)(D.xP,{context:i}),(0,P.jsx)(M.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,P.jsxs)("div",{className:"file-deep-search__empty",children:[(0,P.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>I&&(0,P.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===f.length&&(0,P.jsx)("div",{className:"file-deep-search__empty",children:t(g?"无匹配":"输入后搜")})]})]})}var F=i(23496),X=i(12730),E=i(75725),K=i(40505);let R={};function H(){const{t:e}=(0,w.B)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:s}=(0,v.MH)(),[c,f]=(0,o.fp)(a.AG.nowFileList),[h,x]=(0,o.fp)(a.AG.uploadFiles),[y,j]=(0,o.fp)(a.AG.showPrompt),[C,z]=(0,o.fp)(a.AG.selectedFileList),[S,I]=(0,o.fp)(a.AG.copyedFileList),[N,F]=(0,o.fp)(a.AG.cutedFileList),[K,H]=(0,o.fp)(a.AG.selectedFileList),[L,U]=(0,o.fp)(a.AG.clickFileList),[Y,O]=(0,o.fp)(a.AG.fileShellShow),[Z]=(0,o.fp)(a.AG.current_mount),[B,W]=(0,o.fp)(a.AG.file_root_list),[T,q]=(0,o.fp)(a.AG.file_root_index),[V,J]=(0,n.useState)(void 0),[Q,ee]=(0,n.useState)(""),[te,ie]=(0,o.fp)(a.AG.workflow_show),[ne,se]=(0,o.fp)(a.AG.workflow_realtime_show),[oe,ae]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,n.useContext)(g.F),[re,ce]=(0,o.fp)(a.AG.user_base_info),{click_file:de}=(0,p.kZ)(),[_e,fe]=(0,o.fp)(a.AG.prompt_card),pe=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),he=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,m.SK)(e)}(0,n.useEffect)(()=>{R={}},[t]),(0,n.useEffect)(()=>()=>{O({show:!1,path:""})},[]);const me=(0,p.Vs)(),we=t=>{fe({open:!0,title:e("信息"),context_div:(0,P.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,P.jsx)(E.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,P.jsx)(E.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,P.jsx)(E.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,P.jsx)(E.Yh,{left:`${e("文件夹数")}`,right:he}),(0,P.jsx)(E.Yh,{left:`${e("文件数")}`,right:pe}),(0,P.jsx)(E.Yh,{left:`${e("当前位置")}`,right:(0,P.jsx)(D.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,P.jsxs)(n.Fragment,{children:[C.length>0&&(0,P.jsx)(M.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,P.jsx)(M.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,C);I(e.map(e=>(0,p.Ok)(e.name))),F([]),ue("已复制")}}),C.length>0&&(0,P.jsx)(M.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,C);F(e.map(e=>(0,p.Ok)(e.name))),I([]),ue("已剪切")}}),(S.length>0||N.length>0)&&(0,P.jsx)(M.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+N.length}),C.length>0&&(0,P.jsx)(M.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,P.jsx)(M.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?j({show:!0,type:d.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,m.zN)("没有选中")}}),1===C.length&&(0,P.jsx)(M.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,P.jsx)(M.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!te)}}),!Z&&(0,P.jsx)(M.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?O({show:!1,path:""}):O({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,P.jsx)(M.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${$.o.share_list_setting_page}`)}}),(0,P.jsx)(M.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,P.jsx)(M.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:d.PromptEnum.DirNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,P.jsx)(M.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:d.PromptEnum.FileNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,P.jsx)(M.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:d.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const n=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=i?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,i&&s.add((0,X.S)(a)),n.push(o)}const o=[];if(i)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...n),x(o),j({show:!0,type:d.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,P.jsx)(M.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!R.now_absolute_path){k.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(R={...R,...i},k.ws.removeMsg(G.HK.file_info),we(R))});const t=await k.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,_.GG)("file",(0,_.vX)())});e=t.context,R=e,we(R)}we(R)}}),(0,P.jsx)(M.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=B,n.item_pre_value=T,n.textClick=async t=>{if(-1===t)return i(`${$.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,m.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await l.$M.post("base_switch",{root_index:e}),await le(),i("/file/"),H([]),U([])})(t),j({data:void 0,overlay:!1,type:"",show:!1})},j({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var L=i(2543),U=i(21499),Y=i(64694),O=i(17903);const Z=n.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(()=>i(63659))),B=n.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(()=>i(81636)));let W,T="";function q(){const[e,t]=(0,o.fp)(a.AG.editorSetting),[,i]=(0,o.fp)(a.AG.md_editor),[,m]=(0,o.fp)(a.AG.log_viewer),[,z]=(0,o.fp)(a.AG.image_editor),[S,D]=(0,o.fp)(a.AG.file_preview),{t:I}=(0,w.B)();let X=(0,r.zy)();const E=(0,r.Zp)(),[R,q]=(0,o.fp)(a.AG.nowFileList),[V]=(0,o.fp)(a.AG.file_list_refresh),[J]=(0,o.fp)(a.AG.mount_enabled),[Q,ee]=(0,o.fp)(a.AG.current_mount),[te,ie]=(0,o.fp)(a.AG.showPrompt),[ne,se]=(0,o.fp)(a.AG.selectedFileList),[oe,ae]=(0,o.fp)(a.AG.clickFileList),[le,re]=(0,o.fp)(a.AG.fileShellShow),[ce,de]=(0,n.useState)(""),[_e,fe]=(0,o.fp)(a.AG.workflow_show),[pe,he]=(0,o.fp)(a.AG.workflow_realtime_show),[ue,me]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:we}=(0,n.useContext)(g.F),[ge,ve]=(0,o.fp)(a.AG.user_base_info),{click_file:xe}=(0,p.kZ)(),[ye]=(0,r.ok)(),je=(0,p._A)(),ke=n.useRef(null),[Ge,Ae]=(0,o.fp)(a.AG.to_running_files),[be,Ce]=(0,o.fp)(a.AG.file_page),[$e]=(0,o.fp)(a.AG.blank_search_mode),[,ze]=(0,o.fp)(a.AG.prompt_card),[Me,Se]=(0,o.fp)(a.AG.blank_search_mode_for_temp),De=function(){const[e,t]=(0,o.fp)(a.AG.user_base_info),{t:i}=(0,w.B)(),{check_user_auth:s}=(0,v.MH)(),[c,f]=(0,o.fp)(a.AG.router_jump),h=(0,r.Zp)(),{initUserInfo:m}=(0,n.useContext)(g.F),[x,y]=(0,o.fp)(a.AG.nowFileList),[j,C]=(0,o.fp)(a.AG.showPrompt),[z,M]=(0,o.fp)(a.AG.fileShellShow),[S,D]=(0,o.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory;const o=[{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:o},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,P.jsx)("span",{style:(0,K.ok)(S),children:i("srchbln")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];x?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),s(A.oV.code_resource)&&w.push({r:i("add_rot"),v:"code_resource"}),s(A.oV.http_proxy)&&w.push({r:i("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),n.items=w,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${$.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${$.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return f({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/setting/customer_router/")}if("http_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return f({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:d.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",M({show:!0,path:(0,_.GG)("file",(0,_.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return D(!S),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(F.s.user_save_private_attr,{type:e,...t}),await m(),C({data:void 0,overlay:!1,type:"",show:!1}),h((0,_.vX)())},C({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}}(),Pe=async()=>{const e=new j.Nd;e.dir_path=`${(0,_.GG)("file",(0,_.vX)())}`,k.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);Ae(new Set(t.running_file_list))}}),await k.ws.sendData(G.HK.workflow_realtime,e)},Ie=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,x.v7)(i.size),ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Pe()})),i.name===j.SB&&(t=!0);for(const i of e.folders??[])ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",i.name===j.SB&&(t=!0);me(t)},Ne=n.useRef(null),Fe=async e=>{if(!0===J){if(Ne.current!==e){Ne.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});ee(t?.data??null)}catch(e){ee(null)}}}else ee(null)},Xe=e=>{const t=ye.get("preview_file_name"),n=ye.get("preview_mode");if(!t||!n)return;const s=(0,_.GG)("file",(0,_.vX)());if(ke.current===s+t)return;const o=(e.files??[]).find(e=>e.name===t);if(!o)return;ke.current=s+t;const a=()=>je(null);"md"!==n?"log"!==n?"image_edit"!==n?xe({name:o.name,size:o.origin_size,opt_shell:!0,mtime:o.mtime,..."text"===n?{model:"text"}:{},close:a}):z({path:(0,Y.IO)((0,_.vX)(),t),name:t,close:a}):m({show:!0,fileName:t,encoding:ye.get("preview_log_enc")??"utf8",wrap:ye.get("preview_log_wrap")??"wrap",close:a}):i({url:l.$M.getDownloadUrl(`${encodeURIComponent(s)}${t}`),path:`${s}${t}`,name:t,close:a})},Ee=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if($e||Me)return;let t;if(Fe(e),ge.user_data.file_list_pagination_mode===A.yM.pagination){if(T!==e){if(T=e,1!==be.page_num)return void Ce({page_size:be.page_size,page_num:1})}else if(be.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:be.page_num,page_size:be.page_size}),t.code!==f.m.Success)return;const i=t.data;return Ie(i),i.files?.length?(q(e=>{const t=(0,L.cloneDeep)(1===be.page_num?i.files:[...e?.files??[],...i.files]),n={...e,files:t};return(0,p.yC)(n,ge.user_data.dir_show_type),n}),W=t.data,void(1===be.page_num&&Xe(i))):void Ce({page_size:be.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==f.m.Success)return;const i=t.data;(0,p.yC)(i,ge.user_data.dir_show_type),Ie(t.data),q(t.data),W=t.data,Xe(t.data)};(0,n.useEffect)(()=>async()=>{Ae(new Set)},[]);(0,n.useEffect)(()=>{Ee(),t({open:!1}),D({open:!1}),me(!1)},[X,be]),(0,n.useEffect)(()=>{V>0&&Ee()},[V]);const Ke=n.useRef(!1);(0,n.useEffect)(()=>{if(null!==J)return Ke.current?void(!0===J?Fe((0,_.GG)("file",(0,_.vX)())):ee(null)):(Ke.current=!0,void(!0===J&&null===Q&&Fe((0,_.GG)("file",(0,_.vX)()))))},[J]);const Re=e=>{e.target===e.currentTarget&&(se([]),ae([]))};return(0,P.jsxs)(n.Fragment,{children:[(0,P.jsx)(c.aZ,{children:(0,P.jsx)(h.$Z,{handleEnterPress:async()=>{if($e||Me){if(se([]),ae([]),!ce||!ce.trim())return void q({files:[],folders:[]});const e=(0,_.GG)("file",(0,_.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ce.trim()});if(t.code!==f.m.Success)return;const i=t.data;return(0,p.yC)(i,ge.user_data.dir_show_type),Ie(i),q(i),void(W=i)}if(!W)return;se([]),ae([]);const e=[],t=[];for(const t of W.files??[])t.name.includes(ce)&&e.push(t);for(const e of W.folders??[])e.name.includes(ce)&&t.push(e);q({files:e,folders:t})},placeholder:I("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,_.GG)("file",(0,_.vX)());ze({open:!0,title:I("深搜"),context_div:(0,P.jsx)(N,{base_path:e})})},handleInputChange:e=>{de(e)},max_width:"25em"})}),(0,P.jsxs)(c.aZ,{position:"right",children:[(0,P.jsx)("div",{className:"mobile-context-btn",children:(0,P.jsx)(M.rA,{icon:"more_horiz",title:I("右键"),onClick:()=>{const e=ne[ne.length-1];if(void 0!==e){const t=[...R.folders??[],...R.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],n=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},o=new b.ik;o.path=(0,Y.IO)((0,_.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===u.Iw.folder?u.Iw.folder:(0,b.uL)(t.name),o.size=t.origin_size,ie({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};De(e)}}})}),(0,P.jsx)(H,{})]}),(0,P.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(se([]),ae([]),ge.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Ce({page_size:be.page_size,page_num:1})}},input_path_enter:e=>{var t;se([]),ae([]),q({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?E(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let n=e.length-1-t;n>=0;n--)if(e[n]===i)return e.substring(0,n+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,_.vX)(),e)):(e=e.replace(0===(t=ge.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),E(e))}}),Q&&(0,P.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:Q.color},children:[(0,P.jsx)("span",{className:"material-icons",style:{color:Q.color},children:"cloud"}),(0,P.jsxs)("span",{children:[I("当前为挂载目录"),":",Q.name]}),(0,P.jsx)("span",{className:"mount-driver-tag",children:O.C1.find(e=>e.value===Q.driver)?.title??Q.driver}),Q.readonly&&(0,P.jsx)("span",{className:"mount-readonly-tag",children:I("只读")})]}),ge.user_data.file_list_pagination_mode===A.yM.pagination?(0,P.jsx)(C.$J,{handleContextMenu:De,clickBlank:Re,list:R.files}):(0,P.jsx)(C.t$,{handleContextMenu:De,file_list:R.files,folder_list:R.folders,clickBlank:Re}),_e&&(0,P.jsx)(Z,{}),pe.open&&(0,P.jsx)(B,{})]})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9299],{47374(e,t,i){i.d(t,{e:()=>f});var n=i(96540),s=i(86090),o=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(86149),d=i(85997),_=i(74848);function f(e){let t=(0,s.zy)();const[i,f]=(0,n.useState)([]),[p,h]=(0,n.useState)("/"),[u,m]=(0,n.useState)(void 0),{t:w,i18n:g}=(0,c.B)();n.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const n=i.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(i.slice(0,n),e.baseRoute);const a=i.slice(n+1);for(let e=0;e<a.length;e++){const i=a[e];s.push({value:i,href:0===e?`${t}${i}/`:(0,o.IO)(s[e-1].href,i)})}h(t),f(s)}},[t]);const v=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:p,onClick:v,children:(0,_.jsx)(d.In,{icon:"home"})})}),i.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:v,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,i){i.d(t,{S:()=>l,X:()=>a});var n=i(96540),s=i(61443),o=i(74848);function a(e){const[t,i]=n.useState([]),a=(0,n.useRef)(-1),[l,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?i(Array.isArray(e.children)?e.children:[e.children]):i(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,i)=>{const n=!!e.filter&&(e.filter.column??0)===i;let a=t;if(n){const i=e.filter,n=i.options.find(e=>e.value===i.value);null!=i.value&&n&&(a=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},i)})})}),(0,o.jsx)("tbody",{children:t.map((t,i)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(l===i?"row-dragging":"")+(c===i?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(a.current=i,r(i),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(i))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=a.current,i=c;_(),t<0||i<0||t===i||e.onRowDrag?.(t,i)})())},onDragEnd:_,children:t.map((i,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:i},n)})},i)})})]})}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))})}},19299(e,t,i){i.r(t),i.d(t,{default:()=>q});var n=i(96540),s=i(47374),o=i(34843),a=i(82893),l=i(14284),r=i(86090),c=i(4412),d=i(83529),_=i(34289),f=i(53459),p=i(99214),h=i(61443),u=i(47022),m=i(62042),w=i(86149),g=i(7523),v=i(78247),x=i(88815),y=i(6960),j=i(47071),k=i(14944),G=i(92275),A=i(23430);var b=i(34251),C=i(60096),$=i(87361),M=i(76559),z=i(85997),S=i(77481),D=i(70447),P=i(74848);const I=500;function N(e){const{t}=(0,w.B)(),i=(0,r.Zp)(),[,s]=(0,o.fp)(a.AG.prompt_card),[l,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(!1),[f,p]=(0,n.useState)([]),[u,m]=(0,n.useState)(0),[g,v]=(0,n.useState)(!1),x=(0,n.useMemo)(()=>new M.I(window.location.host,"file_deep_search"),[]),y=(0,n.useRef)(!1),j=decodeURIComponent(e.base_path);(0,n.useEffect)(()=>{let e=[],t=null;const i=()=>{if(t=null,y.current||!e.length)return;const i=e;e=[],m(e=>e+i.length),p(e=>e.length>=I?e:[...e,...i].slice(0,I))},n=()=>{y.current||_(!1)};return x.addMsg(G.HK.file_deep_search_data,n=>{y.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(i,100)))}),x.addMsg(G.HK.file_deep_search_end,()=>{y.current||(i(),_(!1))}),x.on_message("close",n),()=>{y.current=!0,clearTimeout(t),x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",n),x.close()}},[]);const k=()=>{const t=l.trim();if(!t||d)return;p([]),m(0),v(!0),_(!0);const i={param_path:e.base_path,keyword:t};x.sendData(G.HK.file_deep_search,i).catch(()=>{})},A=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),i($.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,P.jsxs)("div",{className:"file-deep-search",children:[(0,P.jsxs)("div",{className:"file-deep-search__bar",children:[(0,P.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,P.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,P.jsxs)("div",{className:"file-deep-search__hint",children:[(0,P.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,P.jsx)("span",{className:"file-deep-search__count",children:u>I?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,P.jsxs)("div",{className:"file-deep-search__body",children:[f.length>0&&(0,P.jsx)(S.X,{headers:[t("名称"),t("路径"),""],rows:f.map(e=>{const i=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,P.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,P.jsx)(D.xP,{context:i}),(0,P.jsx)(z.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,P.jsxs)("div",{className:"file-deep-search__empty",children:[(0,P.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>I&&(0,P.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===f.length&&(0,P.jsx)("div",{className:"file-deep-search__empty",children:t(g?"无匹配":"输入后搜")})]})]})}var F=i(23496),X=i(12730),E=i(75725),K=i(40505);let R={};function H(){const{t:e}=(0,w.B)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:s}=(0,v.MH)(),[c,f]=(0,o.fp)(a.AG.nowFileList),[h,x]=(0,o.fp)(a.AG.uploadFiles),[y,j]=(0,o.fp)(a.AG.showPrompt),[C,M]=(0,o.fp)(a.AG.selectedFileList),[S,I]=(0,o.fp)(a.AG.copyedFileList),[N,F]=(0,o.fp)(a.AG.cutedFileList),[K,H]=(0,o.fp)(a.AG.selectedFileList),[L,U]=(0,o.fp)(a.AG.clickFileList),[Y,O]=(0,o.fp)(a.AG.fileShellShow),[Z]=(0,o.fp)(a.AG.current_mount),[B,W]=(0,o.fp)(a.AG.file_root_list),[T,q]=(0,o.fp)(a.AG.file_root_index),[V,J]=(0,n.useState)(void 0),[Q,ee]=(0,n.useState)(""),[te,ie]=(0,o.fp)(a.AG.workflow_show),[ne,se]=(0,o.fp)(a.AG.workflow_realtime_show),[oe,ae]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,n.useContext)(g.F),[re,ce]=(0,o.fp)(a.AG.user_base_info),{click_file:de}=(0,p.kZ)(),[_e,fe]=(0,o.fp)(a.AG.prompt_card),pe=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),he=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,m.SK)(e)}(0,n.useEffect)(()=>{R={}},[t]),(0,n.useEffect)(()=>()=>{O({show:!1,path:""})},[]);const me=(0,p.Vs)(),we=t=>{fe({open:!0,title:e("信息"),context_div:(0,P.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,P.jsx)(E.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,P.jsx)(E.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,P.jsx)(E.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,P.jsx)(E.Yh,{left:`${e("文件夹数")}`,right:he}),(0,P.jsx)(E.Yh,{left:`${e("文件数")}`,right:pe}),(0,P.jsx)(E.Yh,{left:`${e("当前位置")}`,right:(0,P.jsx)(D.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,P.jsxs)(n.Fragment,{children:[C.length>0&&(0,P.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,P.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,C);I(e.map(e=>(0,p.Ok)(e.name))),F([]),ue("已复制")}}),C.length>0&&(0,P.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,C);F(e.map(e=>(0,p.Ok)(e.name))),I([]),ue("已剪切")}}),(S.length>0||N.length>0)&&(0,P.jsx)(z.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+N.length}),C.length>0&&(0,P.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,P.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?j({show:!0,type:d.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,m.zN)("没有选中")}}),1===C.length&&(0,P.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,P.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!te)}}),!Z&&(0,P.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?O({show:!1,path:""}):O({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,P.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${$.o.share_list_setting_page}`)}}),(0,P.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,P.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:d.PromptEnum.DirNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,P.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:d.PromptEnum.FileNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,P.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:d.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const n=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=i?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,i&&s.add((0,X.S)(a)),n.push(o)}const o=[];if(i)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...n),x(o),j({show:!0,type:d.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,P.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!R.now_absolute_path){k.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(R={...R,...i},k.ws.removeMsg(G.HK.file_info),we(R))});const t=await k.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,_.GG)("file",(0,_.vX)())});e=t.context,R=e,we(R)}we(R)}}),(0,P.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=B,n.item_pre_value=T,n.textClick=async t=>{if(-1===t)return i(`${$.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,m.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await l.$M.post("base_switch",{root_index:e}),await le(),i("/file/"),H([]),U([])})(t),j({data:void 0,overlay:!1,type:"",show:!1})},j({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var L=i(2543),U=i(21499),Y=i(64694),O=i(17903);const Z=n.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(()=>i(63659))),B=n.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(()=>i(81636)));let W,T="";function q(){const[e,t]=(0,o.fp)(a.AG.editorSetting),[,i]=(0,o.fp)(a.AG.md_editor),[,m]=(0,o.fp)(a.AG.log_viewer),[,M]=(0,o.fp)(a.AG.image_editor),[S,D]=(0,o.fp)(a.AG.file_preview),{t:I}=(0,w.B)();let X=(0,r.zy)();const E=(0,r.Zp)(),[R,q]=(0,o.fp)(a.AG.nowFileList),[V]=(0,o.fp)(a.AG.file_list_refresh),[J]=(0,o.fp)(a.AG.mount_enabled),[Q,ee]=(0,o.fp)(a.AG.current_mount),[te,ie]=(0,o.fp)(a.AG.showPrompt),[ne,se]=(0,o.fp)(a.AG.selectedFileList),[oe,ae]=(0,o.fp)(a.AG.clickFileList),[le,re]=(0,o.fp)(a.AG.fileShellShow),[ce,de]=(0,n.useState)(""),[_e,fe]=(0,o.fp)(a.AG.workflow_show),[pe,he]=(0,o.fp)(a.AG.workflow_realtime_show),[ue,me]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:we}=(0,n.useContext)(g.F),[ge,ve]=(0,o.fp)(a.AG.user_base_info),{click_file:xe}=(0,p.kZ)(),[ye]=(0,r.ok)(),je=(0,p._A)(),ke=n.useRef(null),[Ge,Ae]=(0,o.fp)(a.AG.to_running_files),[be,Ce]=(0,o.fp)(a.AG.file_page),[$e]=(0,o.fp)(a.AG.blank_search_mode),[,Me]=(0,o.fp)(a.AG.prompt_card),[ze,Se]=(0,o.fp)(a.AG.blank_search_mode_for_temp),De=function(){const[e,t]=(0,o.fp)(a.AG.user_base_info),{t:i}=(0,w.B)(),{check_user_auth:s}=(0,v.MH)(),[c,f]=(0,o.fp)(a.AG.router_jump),h=(0,r.Zp)(),{initUserInfo:m}=(0,n.useContext)(g.F),[x,y]=(0,o.fp)(a.AG.nowFileList),[j,C]=(0,o.fp)(a.AG.showPrompt),[M,z]=(0,o.fp)(a.AG.fileShellShow),[S,D]=(0,o.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory;const o=[{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,P.jsx)("span",{style:(0,K.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:o},{r:(0,P.jsx)("span",{style:(0,K.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,P.jsx)("span",{style:(0,K.ok)(S),children:i("srchbln")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];x?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),s(A.oV.code_resource)&&w.push({r:i("add_rot"),v:"code_resource"}),s(A.oV.http_proxy)&&w.push({r:i("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),n.items=w,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${$.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${$.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return f({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/setting/customer_router/")}if("http_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return f({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:d.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",z({show:!0,path:(0,_.GG)("file",(0,_.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return D(!S),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(F.s.user_save_private_attr,{type:e,...t}),await m(),C({data:void 0,overlay:!1,type:"",show:!1}),h((0,_.vX)())},C({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}}(),Pe=async()=>{const e=new j.Nd;e.dir_path=`${(0,_.GG)("file",(0,_.vX)())}`,k.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);Ae(new Set(t.running_file_list))}}),await k.ws.sendData(G.HK.workflow_realtime,e)},Ie=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,x.v7)(i.size),ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Pe()})),i.name===j.SB&&(t=!0);for(const i of e.folders??[])ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",i.name===j.SB&&(t=!0);me(t)},Ne=n.useRef(null),Fe=async e=>{if(!0===J){if(Ne.current!==e){Ne.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});ee(t?.data??null)}catch(e){ee(null)}}}else ee(null)},Xe=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if($e||ze)return;let t;if(Fe(e),ge.user_data.file_list_pagination_mode===A.yM.pagination){if(T!==e){if(T=e,1!==be.page_num)return void Ce({page_size:be.page_size,page_num:1})}else if(be.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:be.page_num,page_size:be.page_size}),t.code!==f.m.Success)return;const i=t.data;return Ie(i),i.files?.length?(q(e=>{const t=(0,L.cloneDeep)(1===be.page_num?i.files:[...e?.files??[],...i.files]),n={...e,files:t};return(0,p.yC)(n,ge.user_data.dir_show_type),n}),void(W=t.data)):void Ce({page_size:be.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==f.m.Success)return;const i=t.data;(0,p.yC)(i,ge.user_data.dir_show_type),Ie(t.data),q(t.data),W=t.data};(0,n.useEffect)(()=>async()=>{Ae(new Set)},[]);const Ee=()=>{t({open:!1}),D({open:!1}),me(!1),(()=>{const e=ye.get("preview_file_name"),t=ye.get("preview_mode");if(!e||!t)return!1;const n=(0,_.GG)("file",(0,_.vX)());if(ke.current===n+e)return!0;ke.current=n+e;const s=()=>je(null);return"md"===t?(i({url:l.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:s}),!0):"log"===t?(m({show:!0,fileName:e,encoding:ye.get("preview_log_enc")??"utf8",wrap:ye.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?(M({path:(0,Y.IO)((0,_.vX)(),e),name:e,close:s}),!0):(xe({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||Xe()};(0,n.useEffect)(()=>{Ee()},[X,be]),(0,n.useEffect)(()=>{V>0&&Xe()},[V]);const Ke=n.useRef(!1);(0,n.useEffect)(()=>{if(null!==J)return Ke.current?void(!0===J?Fe((0,_.GG)("file",(0,_.vX)())):ee(null)):(Ke.current=!0,void(!0===J&&null===Q&&Fe((0,_.GG)("file",(0,_.vX)()))))},[J]);const Re=e=>{e.target===e.currentTarget&&(se([]),ae([]))};return(0,P.jsxs)(n.Fragment,{children:[(0,P.jsx)(c.aZ,{children:(0,P.jsx)(h.$Z,{handleEnterPress:async()=>{if($e||ze){if(se([]),ae([]),!ce||!ce.trim())return void q({files:[],folders:[]});const e=(0,_.GG)("file",(0,_.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ce.trim()});if(t.code!==f.m.Success)return;const i=t.data;return(0,p.yC)(i,ge.user_data.dir_show_type),Ie(i),q(i),void(W=i)}if(!W)return;se([]),ae([]);const e=[],t=[];for(const t of W.files??[])t.name.includes(ce)&&e.push(t);for(const e of W.folders??[])e.name.includes(ce)&&t.push(e);q({files:e,folders:t})},placeholder:I("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,_.GG)("file",(0,_.vX)());Me({open:!0,title:I("深搜"),context_div:(0,P.jsx)(N,{base_path:e})})},handleInputChange:e=>{de(e)},max_width:"25em"})}),(0,P.jsxs)(c.aZ,{position:"right",children:[(0,P.jsx)("div",{className:"mobile-context-btn",children:(0,P.jsx)(z.rA,{icon:"more_horiz",title:I("右键"),onClick:()=>{const e=ne[ne.length-1];if(void 0!==e){const t=[...R.folders??[],...R.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],n=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},o=new b.ik;o.path=(0,Y.IO)((0,_.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===u.Iw.folder?u.Iw.folder:(0,b.uL)(t.name),o.size=t.origin_size,ie({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};De(e)}}})}),(0,P.jsx)(H,{})]}),(0,P.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(se([]),ae([]),ge.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Ce({page_size:be.page_size,page_num:1})}},input_path_enter:e=>{var t;se([]),ae([]),q({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?E(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let n=e.length-1-t;n>=0;n--)if(e[n]===i)return e.substring(0,n+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,_.vX)(),e)):(e=e.replace(0===(t=ge.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),E(e))}}),Q&&(0,P.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:Q.color},children:[(0,P.jsx)("span",{className:"material-icons",style:{color:Q.color},children:"cloud"}),(0,P.jsxs)("span",{children:[I("当前为挂载目录"),":",Q.name]}),(0,P.jsx)("span",{className:"mount-driver-tag",children:O.C1.find(e=>e.value===Q.driver)?.title??Q.driver}),Q.readonly&&(0,P.jsx)("span",{className:"mount-readonly-tag",children:I("只读")})]}),ge.user_data.file_list_pagination_mode===A.yM.pagination?(0,P.jsx)(C.$J,{handleContextMenu:De,clickBlank:Re,list:R.files}):(0,P.jsx)(C.t$,{handleContextMenu:De,file_list:R.files,folder_list:R.folders,clickBlank:Re}),_e&&(0,P.jsx)(Z,{}),pe.open&&(0,P.jsx)(B,{})]})}}}]);
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.fcdf5f00b8cdb69e55a5.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.f76bef665c2f03683b73.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>