filecat 7.31.0 → 7.32.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.
Files changed (42) hide show
  1. package/README.md +21 -18
  2. package/build/dist/{1075.ac72fe455fb6105f445c.js → 1075.edeec2fde4f576b4b774.js} +1 -1
  3. package/build/dist/1142.48287fd3666c35215a0c.js +1 -0
  4. package/build/dist/1448.ec0a69fe6ffca6c8df19.js +1 -0
  5. package/build/dist/1922.87a099397741d80df6ad.js +2 -0
  6. package/build/dist/2091.8324e03dcf28985539eb.js +1 -0
  7. package/build/dist/2136.20ea58a65c7fb22d5e43.js +1 -0
  8. package/build/dist/3187.67ad7348b6b7231e657d.js +1 -0
  9. package/build/dist/{3355.fde87101c5a125b8b35f.js → 3355.80b3ed1fdc66b35bd95a.js} +1 -1
  10. package/build/dist/4350.799e1d3b7382a15d295b.js +1 -0
  11. package/build/dist/{4598.0a8c8a04d718951d6692.js → 4598.4d016ea700f650cd1023.js} +1 -1
  12. package/build/dist/{47.1990e4d7ad6e60650aa0.js → 47.8c46e919a7977a77bc14.js} +1 -1
  13. package/build/dist/{6097.9ec647296d88d8025198.js → 6097.da228e297f45f3ec882d.js} +1 -1
  14. package/build/dist/610.9b08d7248340d26dead2.js +1 -0
  15. package/build/dist/6439.f3ddea3c0ef57dcbf23c.js +1 -0
  16. package/build/dist/7212.a825bc171875985e1aab.js +1 -0
  17. package/build/dist/{7678.7ad7da19e968caed935a.js → 7678.926d8c2225731a655537.js} +1 -1
  18. package/build/dist/7759.14e1e0dbbcfc86f3e4f1.js +1 -0
  19. package/build/dist/914.bb6f2b6d8ca806f9366a.js +1 -0
  20. package/build/dist/{9260.da294480ffc3c674bde0.js → 9260.7fbe354ea4e6bee93817.js} +1 -1
  21. package/build/dist/9290.6fd29c7dd03124235217.js +1 -0
  22. package/build/dist/9345.9342b70ddc66397cafce.js +1 -0
  23. package/build/dist/9546.fde8cbe4ebe2dafb6c27.js +1 -0
  24. package/build/dist/{9765.7f8eaa343038f1f21810.js → 9765.7f02ad22213339511811.js} +1 -1
  25. package/build/dist/9861.f266cc5eabb83fc5fa4b.js +1 -0
  26. package/build/dist/index.html +1 -1
  27. package/build/dist/main.b0bcf1b153b849530789.js +2 -0
  28. package/build/main.js +1 -1
  29. package/package.json +6 -1
  30. package/build/dist/1142.7969be5cf5634815b7de.js +0 -1
  31. package/build/dist/1448.2340fca4e068db687c5c.js +0 -1
  32. package/build/dist/1922.c114fe6ee22d708a2a57.js +0 -2
  33. package/build/dist/2136.d12515bfa6c2e0e47520.js +0 -1
  34. package/build/dist/4350.c743128b55202fecc4d7.js +0 -1
  35. package/build/dist/621.965609c72555c936154d.js +0 -1
  36. package/build/dist/6439.472fe94a045edf3755e3.js +0 -1
  37. package/build/dist/7759.0860534bbc24ba31f42c.js +0 -1
  38. package/build/dist/9345.1dbe1ec2d934dc5ca747.js +0 -1
  39. package/build/dist/9546.827d973d735209b0b43e.js +0 -1
  40. package/build/dist/main.20a6043a65debdfa5733.js +0 -2
  41. /package/build/dist/{1922.c114fe6ee22d708a2a57.js.LICENSE.txt → 1922.87a099397741d80df6ad.js.LICENSE.txt} +0 -0
  42. /package/build/dist/{main.20a6043a65debdfa5733.js.LICENSE.txt → main.b0bcf1b153b849530789.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2136],{47374(e,t,s){s.d(t,{e:()=>h});var n=s(96540),i=s(52671),a=s(64694),l=s(34289),o=s(61443),r=s(75725),c=s(22022),d=s(85997),_=s(74848);function h(e){let t=(0,i.zy)();const s=(0,i.Zp)(),[h,p]=(0,n.useState)([]),[m,f]=(0,n.useState)("/"),[u,x]=(0,n.useState)(void 0),{t:g,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",s=(0,l.vX)().split("/");s=s.filter(e=>e);const n=s.indexOf(e.baseRoute),i=[];if(-1!=n){t=(0,a.IO)(s.slice(0,n),e.baseRoute);const l=s.slice(n+1);for(let e=0;e<l.length;e++){const s=l[e];i.push({value:s,href:0===e?`${t}${s}/`:(0,a.IO)(i[e-1].href,s)})}f(t),p(i)}},[t]);const w=t=>{t.stopPropagation(),e.clickFun(t)},[j,y]=(0,n.useState)(0),k=(0,n.useRef)(null),b=(0,n.useRef)(null),A=()=>{const e=k.current,t=b.current;if(!e||!t)return;const s=[];for(const e of Array.from(t.children))s.push(e.getBoundingClientRect().width);const n=e.clientWidth;if(s.reduce((e,t)=>e+t,0)<=n||s.length<=2)return void y(e=>0===e?e:0);let i=s[0]+48,a=0;for(let e=s.length-1;e>=1&&!(i+s[e]>n);e--)i+=s[e],a++;const l=Math.max(s.length-1-a,0);y(e=>e===l?e:l)};(0,n.useEffect)(()=>{A();const e=new ResizeObserver(A);return k.current&&e.observe(k.current),()=>e.disconnect()},[h,m,t]),(0,n.useEffect)(()=>{const e=k.current;e&&0!==j&&e.scrollWidth>e.clientWidth&&j<h.length-1&&y(e=>e+1)});const N=j>0?1+j:1,C=j>0?h.slice(1,N):[],[G,S]=(0,n.useState)(null);return(0,n.useEffect)(()=>{S(null)},[t,j]),(0,_.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{x(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)(i.N_,{to:m,onClick:w,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>j>0&&t>=1&&t<N?1!==t?null:(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();S({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,onClick:w,children:decodeURIComponent(e.value)})]},t)),(0,_.jsxs)("div",{className:"breadcrumbs-measure",ref:b,"aria-hidden":!0,children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,_.jsx)(r.QM,{click:()=>{x(void 0)},children:(0,_.jsx)(o.Sm,{width:"100%",placeholder:g("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),x(void 0)}})})}),G&&(0,_.jsx)(r.rY,{click:()=>S(null),children:(0,_.jsx)(r.sw,{x:G.x,y:G.y,items:C.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{S(null),s(e)}})})]})}},22136(e,t,s){s.r(t),s.d(t,{default:()=>ee});var n=s(96540),i=s(47374),a=s(34843),l=s(52035),o=s(82893),r=s(14284),c=s(52671),d=s(4412),_=s(78150),h=s(34289),p=s(53459),m=s(99214),f=s(61443),u=s(32768),x=s(62042),g=s(22022),v=s(7523),w=s(78247),j=s(88815),y=s(6960),k=s(47071),b=s(14944),A=s(92275),N=s(23430),C=s(72458),G=s(34251),S=s(60096),I=s(87361),M=s(59096),z=s(85997),E=s(23496),$=s(74848);function P(e){const{t}=(0,g.Bd)(),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(""),h=t=>{const s=e.base_path.endsWith("/")?e.base_path:e.base_path+"/",n=t.type===u.Iw.folder?s+t.name:t.path??s+t.name;return n.startsWith("/")?n:"/"+n};(0,n.useEffect)(()=>{(async()=>{if(a)return;l(!0);const t=await r.$M.post("file_get_page",{param_path:e.base_path,page_num:1,page_size:1e4});if(t?.code!==p.m.Success)return;const s=t.data.files??[],n=s.filter(e=>e.type===u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name)),o=s.filter(e=>e.type!==u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name));i([...n,...o])})()},[]);const m=(0,n.useMemo)(()=>{const e=o.trim().toLowerCase();return e?s.filter(t=>t.name.toLowerCase().includes(e)):s},[s,o]),x=()=>{const t=d.trim();t&&!e.ignore_names.includes(t)&&(e.on_change_names([...e.ignore_names,t]),_(""))};return(0,$.jsxs)("div",{className:"search-exclude",children:[(0,$.jsxs)("div",{className:"search-exclude__section",children:[(0,$.jsx)("div",{className:"search-exclude__title",children:t("排除当前目录下的项")}),(0,$.jsx)(f.$Z,{icon:"search",value:o,placeholder:t("过滤列表"),handleInputChange:e=>c(e),handleEnterPress:()=>{}}),(0,$.jsxs)("div",{className:"search-exclude__list",children:[0===m.length&&(0,$.jsx)("div",{className:"search-exclude__empty",children:t(a?"无匹配":"加载中")}),m.map(t=>{const s=h(t),n=e.exclude_paths.includes(s),i=t.type===u.Iw.folder;return(0,$.jsxs)("label",{className:"search-exclude__item",children:[(0,$.jsx)("input",{type:"checkbox",checked:n,onChange:()=>(t=>{const s=h(t),n=e.exclude_paths.includes(s);e.on_change_paths(n?e.exclude_paths.filter(e=>e!==s):[...e.exclude_paths,s])})(t)}),(0,$.jsx)("span",{className:"material-symbols-outlined"+(i?" search-exclude__icon--dir":""),children:i?"folder":"draft"}),(0,$.jsx)("span",{className:"search-exclude__item-name",title:t.name,children:t.name})]},s)})]}),e.exclude_paths.length>0&&(0,$.jsx)("div",{className:"search-exclude__chosen",children:e.exclude_paths.map(t=>(0,$.jsxs)("span",{className:"search-exclude__tag",children:[t.split("/").filter(Boolean).pop(),(0,$.jsx)("span",{className:"material-symbols-outlined",onClick:()=>e.on_change_paths(e.exclude_paths.filter(e=>e!==t)),children:"close"})]},t))})]}),(0,$.jsxs)("div",{className:"search-exclude__section search-exclude__section--ignore",children:[(0,$.jsx)("div",{className:"search-exclude__title",children:t("忽略名字")}),(0,$.jsx)("div",{className:"search-exclude__hint",children:t("按名字忽略")}),(0,$.jsxs)("div",{className:"search-exclude__chosen",children:[0===e.ignore_names.length&&(0,$.jsx)("span",{className:"search-exclude__hint",children:t("暂无")}),e.ignore_names.map(t=>(0,$.jsxs)("span",{className:"search-exclude__tag",children:[t,(0,$.jsx)("span",{className:"material-symbols-outlined",onClick:()=>(t=>{e.on_change_names(e.ignore_names.filter(e=>e!==t))})(t),children:"close"})]},t))]}),(0,$.jsxs)("div",{className:"search-exclude__add",children:[(0,$.jsx)(f.Sm,{value:d,placeholder:t("如 node_modules"),handleInputChange:e=>_(e),handlerEnter:x,width:"12em"}),(0,$.jsx)(z.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,$.jsxs)("div",{className:"div-row",children:[(0,$.jsx)(z.rA,{icon:"save",title:t("保存忽略名字"),onClick:async()=>{await r.wm.post(E.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:e.ignore_names})}}),(0,$.jsx)(z.rA,{icon:"settings",title:t("忽略名字设置"),onClick:e.on_open_setting})]})]})]})}function F(e){const{t}=(0,g.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[i]=(0,a.fp)(o.AG.user_base_info),l=i?.user_data?.search_exclude_names,[c,d]=(0,n.useState)(Array.isArray(l)?[...l]:[]),[_,h]=(0,n.useState)(""),[m,u]=(0,n.useState)(!1),x=()=>{const e=_.trim();e&&!c.includes(e)&&(d([...c,e]),h(""))};return(0,$.jsxs)("div",{className:"search-ignore-setting",children:[(0,$.jsx)("div",{className:"search-ignore-setting__desc",children:t("按名字忽略说明")}),(0,$.jsxs)("div",{className:"search-ignore-setting__add",children:[(0,$.jsx)(f.Sm,{value:_,placeholder:t("如 node_modules"),handleInputChange:e=>h(e),handlerEnter:x,width:"20em"}),(0,$.jsx)(z.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,$.jsxs)("div",{className:"search-ignore-setting__list",children:[0===c.length&&(0,$.jsx)("div",{className:"search-ignore-setting__empty",children:t("暂无")}),c.map(e=>(0,$.jsxs)("div",{className:"search-ignore-setting__item",children:[(0,$.jsx)("span",{className:"material-symbols-outlined",children:"block"}),(0,$.jsx)("span",{className:"search-ignore-setting__item-name",children:e}),(0,$.jsx)(z.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>d(c.filter(t=>t!==e)))(e)})]},e))]}),(0,$.jsxs)("div",{className:"div-row div-row--end search-ignore-setting__footer",children:[(0,$.jsx)(z.rA,{icon:"arrow_back",title:t("返回"),onClick:e.on_back}),(0,$.jsx)(z.rA,{icon:"save",title:t("保存"),onClick:async()=>{if(m)return;u(!0);const t=await r.wm.post(E.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:c});u(!1),t?.code===p.m.Success&&(await s(),e.on_back())}})]})]})}const R=500;function K(e){const{t}=(0,g.Bd)(),s=(0,c.Zp)(),[,i]=(0,a.fp)(o.AG.prompt_card),[l]=(0,a.fp)(o.AG.user_base_info),{click_file:r}=(0,m.kZ)(),[d,_]=(0,n.useState)(""),[h,p]=(0,n.useState)("name"),[u,x]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[j,y]=(0,n.useState)(!0),[k,N]=(0,n.useState)([]),[C,G]=(0,n.useState)([]),[S,E]=(0,n.useState)(!1),[K,L]=(0,n.useState)(!1),[X,D]=(0,n.useState)(!1),[U,H]=(0,n.useState)([]),[B,Z]=(0,n.useState)(0),[Y,O]=(0,n.useState)(!1),W=(0,n.useRef)(!1),T=(0,n.useMemo)(()=>new M.I((0,b.s)(),"file_deep_search"),[]),q=(0,n.useRef)(!1),V=(0,n.useRef)(!1),J=decodeURIComponent(e.base_path),Q=()=>i({open:!1}),ee=()=>{const e=l?.user_data?.search_exclude_names;return Array.isArray(e)?e:[]};(0,n.useEffect)(()=>{G(ee())},[l?.user_data?.search_exclude_names]),(0,n.useEffect)(()=>{let e=[],t=null;const s=()=>{if(t=null,q.current||V.current||!e.length)return;const s=e;e=[],Z(e=>e+s.length),H(e=>e.length>=R?e:[...e,...s].slice(0,R))},n=()=>{q.current||D(!1)};return T.addMsg(A.HK.file_deep_search_data,n=>{q.current||V.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(s,100)))}),T.addMsg(A.HK.file_deep_search_end,()=>{q.current||V.current||(s(),D(!1))}),T.on_message("close",n),()=>{q.current=!0,clearTimeout(t),W.current&&T.sendNotify(A.HK.file_deep_search_cancel,{}).catch(()=>{}).finally(()=>T.close()),T.removeMsg(A.HK.file_deep_search_data),T.removeMsg(A.HK.file_deep_search_end),T.off_message("close",n)}},[]);const te=()=>{const t=d.trim();if(!t||X)return;V.current=!1,H([]),Z(0),O(!0),W.current=!0,D(!0);const s={param_path:e.base_path,keyword:t,search_type:h,is_regex:u,ignore_case:v};"content"===h&&(s.show_match_line=j),k.length&&(s.exclude_paths=k),C.length&&(s.exclude_names=C),T.sendData(A.HK.file_deep_search,s).catch(()=>{})},se=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/"))},ne=async e=>{if(e.is_dir)return se(e);const t=e.path.slice(0,e.path.lastIndexOf("/")+1)||"/";Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/")),await new Promise(e=>setTimeout(e,300)),await r({name:e.name,opt_shell:!0})},ie="content"===h;return K?(0,$.jsx)(F,{on_back:()=>{L(!1),G(ee())}}):(0,$.jsxs)("div",{className:"file-deep-search",children:[(0,$.jsxs)("div",{className:"file-deep-search__bar",children:[(0,$.jsx)(f.$Z,{icon:"search",value:d,placeholder:t(ie?"搜文件内容":"搜文件名"),handleInputChange:e=>_(e),handleEnterPress:te}),(0,$.jsx)("button",{className:"button button--flat",onClick:X?()=>{V.current=!0,T.sendNotify(A.HK.file_deep_search_cancel,{}).catch(()=>{}),D(!1)}:te,children:t(X?"取消":"搜索")}),(0,$.jsx)(z.rA,{icon:"close",title:t("关闭"),onClick:Q})]}),(0,$.jsxs)("div",{className:"file-deep-search__tabs",children:[(0,$.jsx)("button",{className:"file-deep-search__tab"+(ie?"":" file-deep-search__tab--active"),onClick:()=>p("name"),children:t("文件名")}),(0,$.jsx)("button",{className:"file-deep-search__tab"+(ie?" file-deep-search__tab--active":""),onClick:()=>p("content"),children:t("文件内容")})]}),(0,$.jsxs)("div",{className:"file-deep-search__options",children:[(0,$.jsx)(f.GL,{context:t("正则"),selected:u,onchange:()=>x(!u)}),(0,$.jsx)(f.GL,{context:t("忽略大小写"),selected:v,onchange:()=>w(!v)}),ie&&(0,$.jsx)(f.GL,{context:t("显示匹配行"),selected:j,onchange:()=>y(!j)})]}),(0,$.jsxs)("div",{className:"file-deep-search__hint",children:[(0,$.jsxs)("span",{children:[t("范围"),":",J]}),(0,$.jsxs)("span",{className:"file-deep-search__hint-right",children:[(k.length>0||C.length>0)&&(0,$.jsxs)("span",{className:"file-deep-search__excluded",children:[t("已排除")," ",k.length+C.length]}),(0,$.jsxs)("button",{className:"file-deep-search__filter"+(S?" file-deep-search__filter--active":""),onClick:()=>E(!S),children:[(0,$.jsx)("span",{className:"material-symbols-outlined",children:"filter_alt"}),t("过滤")]}),B>0&&(0,$.jsx)("span",{className:"file-deep-search__count",children:B>R?`${t("已显示")} 500 / ${B}`:`${B}`})]})]}),S&&(0,$.jsx)(P,{base_path:e.base_path,exclude_paths:k,ignore_names:C,on_change_paths:N,on_change_names:G,on_open_setting:()=>L(!0)}),(0,$.jsxs)("div",{className:"file-deep-search__body"+(ie&&j?" file-deep-search__body--line":""),children:[U.length>0&&(0,$.jsx)("div",{className:"file-deep-search__results",children:U.map(e=>{const s=e.path.slice(0,e.path.lastIndexOf("/")+1);return(0,$.jsxs)("div",{className:"file-deep-search__row",children:[(0,$.jsxs)("div",{className:"file-deep-search__name",children:[e.is_dir?(0,$.jsx)("span",{className:"file-deep-search__dir",children:e.name}):(0,$.jsx)("span",{className:"file-deep-search__file",title:e.name,children:e.name}),(0,$.jsx)("span",{className:"file-deep-search__path",children:s}),e.lines&&e.lines.length>0&&(0,$.jsx)("div",{className:"file-deep-search__lines",children:e.lines.map(t=>(0,$.jsxs)("div",{className:"file-deep-search__line",onClick:()=>ne(e),children:[(0,$.jsx)("span",{className:"file-deep-search__line-no",children:t.line}),(0,$.jsx)("span",{className:"file-deep-search__line-text",children:t.text})]},t.line))})]}),(0,$.jsxs)("div",{className:"file-deep-search__actions",children:[(0,$.jsx)(z.rA,{icon:"open_in_new",title:e.is_dir?t("打开"):t("打开文件"),onClick:()=>ne(e)}),(0,$.jsx)(z.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>se(e)})]})]},e.path)})}),X&&(0,$.jsxs)("div",{className:"file-deep-search__empty",children:[(0,$.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!X&&B>R&&(0,$.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!X&&0===U.length&&(0,$.jsx)("div",{className:"file-deep-search__empty",children:t(Y?"无匹配":ie?"输入内容后搜":"输入后搜")})]})]})}var L=s(64694),X=s(12730),D=s(75725),U=s(7572),H=s(40505);let B={};function Z(){const{t:e}=(0,g.Bd)();let t=(0,c.zy)();const s=(0,c.Zp)(),{check_user_auth:i}=(0,w.MH)(),[l,d]=(0,a.fp)(o.AG.nowFileList),[p,f]=(0,a.fp)(o.AG.uploadFiles),[j,y]=(0,a.fp)(o.AG.showPrompt),[k,C]=(0,a.fp)(o.AG.selectedFileList),[S,M]=(0,a.fp)(o.AG.copyedFileList),[E,P]=(0,a.fp)(o.AG.cutedFileList),[F,R]=(0,a.fp)(o.AG.selectedFileList),[K,H]=(0,a.fp)(o.AG.clickFileList),[Z,Y]=(0,a.fp)(o.AG.fileShellShow),O=(0,m.Cf)(),[W,T]=(0,a.fp)(o.AG.file_root_list),[q,V]=(0,a.fp)(o.AG.file_root_index),[J,Q]=(0,n.useState)(void 0),[ee,te]=(0,n.useState)(""),[se,ne]=(0,a.fp)(o.AG.workflow_show),[ie,ae]=(0,a.fp)(o.AG.workflow_realtime_show),[le,oe]=(0,a.fp)(o.AG.work_flow_show),{initUserInfo:re}=(0,n.useContext)(v.F),[ce,de]=(0,a.fp)(o.AG.user_base_info),{click_file:_e}=(0,m.kZ)(),[he,pe]=(0,a.fp)(o.AG.prompt_card),me=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[l]),fe=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(l.folders?.length??0),[l]);function ue(e){(0,x.SK)(e)}(0,n.useEffect)(()=>{B={}},[t]),(0,n.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const xe=(0,m.Vs)(),ge=t=>{pe({open:!0,title:e("信息"),context_div:(0,$.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,$.jsx)(D.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,$.jsx)(D.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,$.jsx)(D.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,$.jsx)(D.Yh,{left:`${e("文件夹数")}`,right:fe}),(0,$.jsx)(D.Yh,{left:`${e("文件数")}`,right:me}),(0,$.jsx)(D.Yh,{left:`${e("当前位置")}`,right:(0,$.jsx)(U.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{b.ws.removeMsg(A.HK.file_info)}})};return(0,$.jsxs)(n.Fragment,{children:[k.length>0&&(0,$.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{y({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,m.ib)(l,k);M(e.map(e=>(0,m.Ok)(e.name))),P([]),ue("已复制")}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,m.ib)(l,k);P(e.map(e=>(0,m.Ok)(e.name))),M([]),ue("已剪切")}}),(S.length>0||E.length>0)&&(0,$.jsx)(z.rA,{onClick:function(){y({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+E.length}),k.length>0&&(0,$.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,m.ib)(l,k);for(let t=0;t<e.length;t++){const s=e[t];e[t]=encodeURIComponent((0,m.Ok)(s.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,m.ib)(l,k);for(let e=0;e<t.length;e++){const s=t[e];t[e]=(0,m.Ok)(s.name)}t&&0!==t.length?y({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,x.zN)(e("没有选中"))}}),1===k.length&&(0,$.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){y({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),le&&(0,$.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!se)}}),O.can_terminal&&(0,$.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){Z.show?Y({show:!1,path:""}):Y({show:!0,path:(0,h.GG)("file",(0,h.vX)())})}}),i(N.oV.share_file)&&(0,$.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{s(`${I.o.share_list_setting_page}`)}}),(0,$.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:xe}),(0,$.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){y({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,$.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){y({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,$.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{y({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let s=!!t[0].webkitRelativePath;const n=[],i=new Set;for(let e=0;e<t.length;e++){const a=t[e],l=s?a.webkitRelativePath:`${a.webkitRelativePath}${a.name}`;a.fullPath=l,s&&i.add((0,X.S)(l)),n.push(a)}const a=[];if(s)for(const e of i)a.push({isDir:!0,fullPath:e,name:e});a.push(...n),f(a),y({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,$.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!B.now_absolute_path){b.ws.addMsg(A.HK.file_info,t=>{const s=t.context;e&&(B={...B,...s},b.ws.removeMsg(A.HK.file_info),ge(B))});const t=await b.ws.sendData(A.HK.file_info,{type:u.Iw.folder,path:(0,h.GG)("file",(0,h.vX)())});e=t.context,B=e,ge(B)}ge(B)}}),(0,$.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new G.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=W,n.item_pre_value=q,n.textClick=async t=>{if(t.type===G.LU.add)return s(`${I.o.setting_private_env_setting}`),y({data:void 0,overlay:!1,type:"",show:!1}),void(0,x.N9)(e("请配置 文件夹路径"));y({data:void 0,overlay:!1,type:"",show:!1}),t.type!==G.LU.child?(async e=>{V(e),await r.$M.post("base_switch",{root_index:e}),await re(),s("/file/"),R([]),H([])})(t.index):s((0,L.IO)(I.o.file,t.rel))},y({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var Y=s(32918),O=s(2543),W=s(21499);const T=n.lazy(()=>Promise.all([s.e(7856),s.e(6349),s.e(3659)]).then(s.bind(s,63659))),q=n.lazy(()=>Promise.all([s.e(7856),s.e(1636)]).then(s.bind(s,81636))),V=n.lazy(()=>Promise.all([s.e(3277),s.e(9345)]).then(s.bind(s,49345)));let J,Q="";function ee(){const[e,t]=(0,a.fp)(o.AG.editorSetting),[,s]=(0,a.fp)(o.AG.md_editor),[,x]=(0,a.fp)(o.AG.log_viewer),[,M]=(0,a.fp)(o.AG.image_editor),[,P]=(0,a.fp)(o.AG.markdown),[,F]=(0,a.fp)(o.AG.excalidraw_editor),[,R]=(0,a.fp)(o.AG.mind_editor),[,X]=(0,a.fp)(o.AG.timeline_editor),[,D]=(0,a.fp)(o.AG.excel_editor),[U,B]=(0,a.fp)(o.AG.file_preview),{t:ee}=(0,g.Bd)();let te=(0,c.zy)();const se=(0,c.Zp)(),[ne,ie]=(0,a.fp)(o.AG.nowFileList),[ae]=(0,a.fp)(o.AG.file_list_refresh),[le,oe]=(0,a.fp)(o.AG.current_mount),[re,ce]=(0,a.fp)(o.AG.showPrompt),[de,_e]=(0,a.fp)(o.AG.selectedFileList),[he,pe]=(0,a.fp)(o.AG.clickFileList),[me,fe]=(0,a.fp)(o.AG.fileShellShow),[ue,xe]=(0,n.useState)(""),[ge,ve]=(0,a.fp)(o.AG.workflow_show),[we,je]=(0,a.fp)(o.AG.workflow_realtime_show),[ye,ke]=(0,a.fp)(o.AG.work_flow_show),[be,Ae]=(0,n.useState)(!1),{initUserInfo:Ne}=(0,n.useContext)(v.F),[Ce,Ge]=(0,a.fp)(o.AG.user_base_info),{check_user_auth:Se}=(0,w.MH)(),{click_file:Ie}=(0,m.kZ)(),[Me]=(0,c.ok)(),ze=(0,m._A)(),Ee=n.useRef(null),[$e,Pe]=(0,a.fp)(o.AG.to_running_files),[Fe,Re]=(0,a.fp)(o.AG.file_page),[Ke]=(0,a.fp)(o.AG.blank_search_mode),[,Le]=(0,a.fp)(o.AG.prompt_card),[Xe,De]=(0,a.fp)(o.AG.blank_search_mode_for_temp),Ue=(0,m.oT)(),He="1"===Me.get("chat_open"),Be=Se(N.oV.ai_agent_page),Ze=(0,m.Cf)();(0,n.useEffect)(()=>{Ce?.user_data&&He&&!Be&&Ue("chat_open",null)},[He,Be,Ce]);const[Ye,Oe]=(0,a.fp)(o.AG.studio_chat_width),We=n.useRef(null),[Te,qe]=(0,n.useState)(!1),[Ve,Je]=(0,n.useState)(void 0),Qe=(0,m.dN)();(0,m.rJ)(Qe());const[et,tt]=(0,a.fp)(o.AG.ai_chat_session_by_cwd),st=function(){const e=(0,m.Cf)(),[t,s]=(0,a.fp)(o.AG.user_base_info),{t:i}=(0,g.Bd)(),{check_user_auth:l}=(0,w.MH)(),[d,p]=(0,a.fp)(o.AG.router_jump),f=(0,c.Zp)(),{initUserInfo:x}=(0,n.useContext)(v.F),[j,y]=(0,a.fp)(o.AG.nowFileList),[k,C]=(0,a.fp)(o.AG.showPrompt),[S,M]=(0,a.fp)(o.AG.fileShellShow),[z,P]=(0,a.fp)(o.AG.blank_search_mode);return s=>{s.preventDefault(),s.stopPropagation();const n=new G.ik;n.x=s.clientX,n.y=s.clientY,n.type=u.Iw.directory;const a=[{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_minx_max),children:i("时间逆序")}),v:N.t8.time_minx_max},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_max_min),children:i("时间顺序")}),v:N.t8.time_max_min}],o=[{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_min_max),children:i("大小顺序")}),v:N.t8.size_min_max},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_max_min),children:i("大小逆序")}),v:N.t8.size_max_min}],c=[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===N.yM.all),children:i("全部加载文件")}),v:N.yM.all},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.file_list_pagination_mode===N.yM.pagination),children:i("scrll_l")}),v:N.yM.pagination}],d=[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===N.KD.current),children:i("最近时间")}),v:N.KD.current},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.file_time_show_type===N.KD.time),children:i("准确时间")}),v:N.KD.time}],g=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.dir_show_type),children:i("系统默认")}),v:N.t8.defualt},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.name),children:i("名字")}),v:N.t8.name},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_minx_max||t.user_data.dir_show_type===N.t8.time_max_min),children:i("修改时间")}),v:!1,items:a},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_min_max||t.user_data.dir_show_type===N.t8.size_max_min),children:i("文件大小")}),v:!1,items:o}]},{r:i("文件加载方式"),v:"",items:c},{r:i("时间展示"),v:"",items:d},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,$.jsx)("span",{style:(0,H.ok)(z),children:i("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&j?.folders?.find(e=>".git"===e.name)&&g.push({r:i("查看Git提交"),v:"git_page"}),l(N.oV.http_proxy)&&g.push({r:i("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,m.LL)([...t.user_data.quick_cmd],g),n.items=g,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,h.GG)("file",(0,h.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.git_page}/${encodeURIComponent(e)}`)}if("http_resource"===e){const e=await b.ws.sendData(A.HK.file_info,{path:(0,h.GG)("file",(0,h.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void f("/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",M({show:!0,path:(0,h.GG)("file",(0,h.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return P(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===N.yM.all||e===N.yM.pagination)t.is_pagination_mode=!0;else if(e===N.KD.current||e===N.KD.time)t.is_file_show_type=!0;else{if(e!==N.t8.defualt&&e!==N.t8.name&&e!==N.t8.size_max_min&&e!==N.t8.size_min_max&&e!==N.t8.time_max_min&&e!==N.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(E.s.user_save_private_attr,{type:e,...t}),await x(),C({data:void 0,overlay:!1,type:"",show:!1}),f((0,h.vX)())},C({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}}(),nt=async e=>{let t=!1;for(const s of e.files??[])s.origin_size=s.size,s.size=(0,j.v7)(s.size),Ce.user_data.file_time_show_type===N.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",t||!s.name.endsWith(".workflow.yml")&&!s.name.endsWith(".act")||Ae(!0),s.name===k.SB&&(t=!0);for(const s of e.folders??[])Ce.user_data.file_time_show_type===N.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",s.name===k.SB&&(t=!0);ke(t)},it=async e=>{oe(e??null)};(0,n.useEffect)(()=>{be&&(async()=>{const e=new k.Nd,t=(0,l.zp)().get(o.AG.current_mount);e.dir_path=(0,m.Zl)((0,h.GG)("file",(0,h.vX)()),t),b.ws.removeMsg(A.HK.workflow_realtime),b.ws.addMsg(A.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,m.Ys)(e);for(const e of t.failed_file_list)(0,m.V$)(e);Pe(new Set(t.running_file_list))}}),await b.ws.sendData(A.HK.workflow_realtime,e)})()},[ye,be,le,te]);const at=async()=>{const e=(0,h.GG)("file",(0,h.vX)());if(Ke||Xe)return;let t;if(Ce.user_data.file_list_pagination_mode===N.yM.pagination){if(Q!==e){if(Q=e,1!==Fe.page_num)return void Re({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 s=t.data;return nt(s),it(s.mount_info),s.files?.length?(ie(e=>{const t=(0,O.cloneDeep)(1===Fe.page_num?s.files:[...e?.files??[],...s.files]),n={...e,files:t};return(0,m.yC)(n,Ce.user_data.dir_show_type),n}),void(J=t.data)):void Re({page_size:Fe.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const s=t.data;(0,m.yC)(s,Ce.user_data.dir_show_type),nt(t.data),it(s.mount_info),ie(t.data),J=t.data};(0,n.useEffect)(()=>async()=>{Pe(new Set),le&&await b.ws.close()},[]);const lt=()=>{ke(!1),(()=>{const e=Me.get("preview_file_name"),t=Me.get("preview_mode");if(!e||!t)return!1;const n=(0,h.GG)("file",(0,h.vX)());if(Ee.current===n+e)return!0;Ee.current=n+e;const i=()=>ze(null);return"md"===t?(s({url:r.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:i}),!0):"log"===t?(x({show:!0,fileName:e,encoding:Me.get("preview_log_enc")??"utf8",wrap:Me.get("preview_log_wrap")??"wrap",close:i}),!0):"image_edit"===t?(M({path:(0,L.IO)((0,h.vX)(),e),name:e,close:i}),!0):(Ie({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:i}),!0)})()||(t({open:!1}),B({open:!1}),s({}),x({show:!1}),M({}),P({}),F({}),R({}),X({}),D({}),at())};(0,n.useEffect)(()=>{lt()},[te,Fe]),(0,n.useEffect)(()=>{ae>0&&at()},[ae]);n.useRef(!1);const ot=()=>{const e=(0,h.GG)("file",(0,h.vX)());Le({open:!0,title:ee("深搜"),context_div:(0,$.jsx)(K,{base_path:e})})},rt=e=>{e.target===e.currentTarget&&(_e([]),pe([]))},ct=n.useCallback((0,O.throttle)(e=>{const t=We.current;if(!t||!t.parentElement)return;const s=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),i=n.right-e.clientX,a=Math.min(Math.max(i,0),n.width);Oe(parseFloat((a/s).toFixed(2)))},32),[]),dt=()=>{qe(!1),document.removeEventListener("pointermove",ct)},_t=(0,$.jsxs)("div",{className:"file-list-main",children:[(0,$.jsx)(i.e,{baseRoute:"file",clickFun:function(){if(_e([]),pe([]),Ce.user_data.file_list_pagination_mode===N.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Re({page_size:Fe.page_size,page_num:1})}},input_path_enter:e=>{_e([]),pe([]),ie({files:[],folders:[]}),(0,C.Z1)(e)?(e=e.replace((0,Y.m)(Ce.user_data),""),se(e)):se((0,C.Jn)((0,h.vX)(),e))}}),le&&(0,$.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:le.color},children:[(0,$.jsx)("span",{className:"material-icons",style:{color:le.color},children:"cloud"}),(0,$.jsx)("span",{children:[{v:le.driver,t:ee("驱动")},{v:le.credential_note,t:ee("凭据")},{v:le.account_note,t:ee("账号")}].filter(e=>Boolean(e.v)).map(e=>`${e.v}(${e.t})`).join(" - ")}),le.readonly&&(0,$.jsx)("span",{className:"mount-readonly-tag",children:ee("只读")})]}),Ce.user_data.file_list_pagination_mode===N.yM.pagination?(0,$.jsx)(S.$J,{handleContextMenu:st,clickBlank:rt,list:ne.files}):(0,$.jsx)(S.t$,{handleContextMenu:st,file_list:ne.files,folder_list:ne.folders,clickBlank:rt})]});return(0,$.jsxs)(n.Fragment,{children:[(0,$.jsxs)(d.aZ,{children:[(0,$.jsx)("div",{className:"mobile-deep-search-btn",children:(0,$.jsx)(z.rA,{icon:"search",title:ee("搜索"),onClick:ot})}),(0,$.jsx)(f.$Z,{handleEnterPress:async()=>{if(Ke||Xe){if(_e([]),pe([]),!ue||!ue.trim())return void ie({files:[],folders:[]});const e=(0,h.GG)("file",(0,h.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ue.trim()});if(t.code!==p.m.Success)return;const s=t.data;return(0,m.yC)(s,Ce.user_data.dir_show_type),nt(s),ie(s),void(J=s)}if(!J)return;_e([]),pe([]);const e=[],t=[];for(const t of J.files??[])t.name.includes(ue)&&e.push(t);for(const e of J.folders??[])e.name.includes(ue)&&t.push(e);ie({files:e,folders:t})},placeholder:ee("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:ot,handleInputChange:e=>{xe(e)},max_width:"25em"})]}),(0,$.jsxs)(d.aZ,{position:"right",children:[Se(N.oV.ai_agent_page)&&Ze.ai_chat_available&&(0,$.jsx)(z.rA,{icon:"smart_toy",title:ee("AI 聊天"),selected:He,onClick:()=>Ue("chat_open",!He?"1":null)}),(0,$.jsx)("div",{className:"mobile-context-btn",children:(0,$.jsx)(z.rA,{icon:"more_horiz",title:ee("右键"),onClick:()=>{const e=de[de.length-1];if(void 0!==e){const t=[...ne.folders??[],...ne.files??[]][e];if(t){const s=document.querySelectorAll(".item")[e],n=s?s.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},i={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},a=new G.ik;a.path=(0,L.IO)((0,h.vX)(),t.name),a.filename=t.name,a.x=i.clientX,a.y=i.clientY,a.type=t.type===u.Iw.folder?u.Iw.folder:(0,G.uL)(t.name),a.size=t.origin_size,ce({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:a})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};st(e)}}})}),(0,$.jsx)(Z,{})]}),(0,$.jsxs)("div",{className:"file-list-split"+(He?" file-list-split--chat":""),children:[_t,He&&(0,$.jsxs)(n.Fragment,{children:[(0,$.jsx)("div",{className:"studio__divider studio__divider--chat",ref:We,onPointerDown:e=>{e.preventDefault(),qe(!0),document.addEventListener("pointermove",ct),document.addEventListener("pointerup",dt,{once:!0})}}),(0,$.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ye}em`},children:(0,$.jsx)(n.Suspense,{fallback:null,children:(0,$.jsx)(V,{inline_header:!0,sync_url:!1,file_cwd_path:Qe(),session_id:Ve??(ht=Qe(),o.AG.get_ai_chat_session(et,ht)),on_session_change:e=>{Je(e),((e,t)=>{tt({...et,[e]:t})})(Qe(),e)}})})})]})]}),Te&&(0,$.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),ge&&(0,$.jsx)(T,{}),we.open&&(0,$.jsx)(q,{})]});var ht}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4350],{34350(e,t,n){n.r(t),n.d(t,{default:()=>T});var s=n(96540),o=n(82893),i=n(34843),l=n(85997),a=n(57952),r=n(3198),c=n(14284),d=n(34289),u=n(53459),m=n(32768),p=n(78247),h=n(62042),f=n(2543),_=n(34251),v=n(78150),x=n(22022),w=n(88815),y=n(52671),g=n(23430),j=n(87361),k=n(99214);const S="filecat_studio_view_state";function C(e,t){return`${e}::${t}`}function b(){try{const e=localStorage.getItem(S);if(!e)return{};const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch(e){return{}}}function R(e){try{localStorage.setItem(S,JSON.stringify(e))}catch(e){}}function A(e,t){if(t)return b()[C(e,t)]}function $(e,t,n){if(!t)return;const s=b();s[C(e,t)]=n,R(s)}var I=n(72458),N=n(74848);const E=s.lazy(()=>Promise.all([n.e(122),n.e(4091)]).then(n.bind(n,84091))),M=s.lazy(()=>Promise.all([n.e(1384),n.e(1075),n.e(1142)]).then(n.bind(n,71142))),P=s.lazy(()=>n.e(4877).then(n.bind(n,64877))),U=s.lazy(()=>Promise.all([n.e(3277),n.e(9345)]).then(n.bind(n,49345))),z=s.lazy(()=>Promise.all([n.e(3140),n.e(5744)]).then(n.bind(n,16575))),D=s.lazy(()=>Promise.all([n.e(8725),n.e(2728),n.e(2130),n.e(5602),n.e(8781),n.e(6404)]).then(n.bind(n,35304))),F=s.lazy(()=>Promise.resolve().then(n.bind(n,20892))),L=s.lazy(()=>Promise.all([n.e(1922),n.e(4935)]).then(n.bind(n,24935)));function G(e){return(0,_.uL)(e)===m.Iw.md}function K(e){return(0,_.uL)(e)===m.Iw.excalidraw}function W(e){return(0,_.uL)(e)===m.Iw.mind}function B(e){return(0,_.uL)(e)===m.Iw.timeline}function J(e){return(0,_.uL)(e)===m.Iw.excel}function T(e){const[t,n]=(0,s.useState)([]),[C,b]=(0,s.useState)(""),[R,T]=(0,s.useState)(!1),[X,H]=(0,s.useState)({path:"",name:""}),[O,V]=(0,s.useState)(0),[Y,Z]=(0,s.useState)([]),[q,Q]=(0,s.useState)(""),ee=(0,s.useRef)(""),te=(0,s.useRef)({path:"",name:""}),[ne,se]=(0,i.fp)(o.AG.confirm),[oe,ie]=(0,s.useState)(!1),[le,ae]=(0,i.fp)(o.AG.fileShellShow),[re,ce]=(0,i.fp)(o.AG.file_shell_hidden),de=(0,k.Cf)(),ue=(0,s.useRef)(null),me=(0,s.useRef)(null),[pe,he]=(0,s.useState)(!1),[fe,_e]=(0,s.useState)(16),[ve,xe]=(0,i.fp)(o.AG.showPrompt),{t:we}=(0,x.Bd)(),ye=(0,y.Zp)(),ge=G(X.name),je=K(X.name),ke=W(X.name),Se=B(X.name),Ce=J(X.name),be=(0,s.useRef)(null),Re=(0,s.useRef)(null),Ae=(0,s.useRef)(null),$e=(0,s.useRef)(null),Ie=(0,s.useRef)(null),Ne=(0,s.useRef)(null),Ee=(0,s.useRef)(null),[Me,Pe]=(0,s.useState)([]),[Ue,ze]=(0,s.useState)(-1),De=(0,s.useCallback)(()=>{const e=ee.current,t=te.current.name;if(!e)return;let n="ace";G(t)?n="md":K(t)?n="draw":W(t)?n="mind":B(t)?n="timeline":J(t)&&(n="excel");const s="ace"===n?Re.current:"draw"===n?Ae.current:"mind"===n?$e.current:"timeline"===n?Ie.current:"md"===n?be.current?{get_view_state:()=>({scroll:be.current?.get_scroll()??0})}:null:"excel"===n?Ee.current:null,o=s?.get_view_state?.();o&&$(n,e,o)},[]),[Fe,Le]=(0,s.useState)("folder"),[Ge,Ke]=(0,s.useState)(!0),We=(0,k.oT)(),[Be]=(0,y.ok)(),Je="1"===Be.get("chat_open"),[Te,Xe]=(0,i.fp)(o.AG.studio_chat_width),He=(0,s.useRef)(null),[Oe,Ve]=(0,s.useState)(!1),[Ye,Ze]=(0,s.useState)(void 0),[qe,Qe]=(0,i.fp)(o.AG.ai_chat_session_by_cwd),et=(0,y.zy)(),tt=(()=>{const e=`${j.o.studio_page}/`,t=et.pathname.startsWith(e)?et.pathname.slice(e.length):"",n=(0,d.GG)("file",decodeURIComponent(t));return n.endsWith("/")?n:`${n}/`})(),{check_user_auth:nt}=(0,p.MH)(),[st]=(0,i.fp)(o.AG.user_base_info),ot=nt(g.oV.ai_agent_page);(0,s.useEffect)(()=>{st?.user_data&&Je&&!ot&&We("chat_open",null)},[Je,ot,st]);const it=(0,I.Jn)(g.nM.get_now_dir(st),tt);(0,k.rJ)(it);const lt=async()=>{const e=tt;b(e);const t=await c.$M.post("studio/get/item",{path:e});if(t.code===u.m.Success){const e=[],s=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&s.push(n);n([...e,...s])}},at=(e,t)=>e===t||e.startsWith(t+"/");(0,s.useEffect)(()=>{ie(!1),H({path:"",name:""}),Q(""),p.xK.set_value_temp(""),Z([]),lt()},[et]);const rt=async(e,t)=>{if(De(),p.xK.set_value_temp(""),!J(e)){const e=await c.$M.get(`${encodeURIComponent(t)}`);p.xK.set_value_temp(e.data)}H({path:t,name:e}),Q(t),ee.current=t,te.current={path:t,name:e},Le("folder"),ie(!1)},ct=(e,t)=>{e.size>w.o5?se({open:!0,handle:()=>{rt(e.name,t),se({open:!1,handle:null}),ie(!1)},title:"超过20MB了还要打开吗?"}):rt(e.name,t)};function dt(){Re.current?.save()}const ut=e=>{if(e.ctrlKey&&"s"===e.key){if(e.preventDefault(),ge||je||ke||Se||Ce)return;oe&&dt()}};(0,s.useEffect)(()=>(document.addEventListener("keydown",ut),()=>{document.removeEventListener("keydown",ut)}),[oe,ge,je,ke,Se,Ce]);const mt=(0,s.useCallback)(f.throttle(e=>{const t=parseFloat(getComputedStyle(me.current).fontSize),n=window.innerWidth/t-4,s=e.clientX/t,o=2.25+ue.current.offsetWidth/t;s<=n&&s>=o&&_e(parseFloat(s.toFixed(2)))},32),[]),pt=()=>{he(!1),me.current.removeEventListener("pointermove",mt)},ht=(0,s.useCallback)(f.throttle(e=>{const t=He.current;if(!t)return;const n=parseFloat(getComputedStyle(t).fontSize),s=t.parentElement.getBoundingClientRect().right-e.clientX,o=Math.min(Math.max(s,0),t.parentElement.getBoundingClientRect().width);Xe(parseFloat((o/n).toFixed(2)))},32),[]),ft=()=>{Ve(!1),document.removeEventListener("pointermove",ht)},_t=[{r:we("创建文件"),v:"创建文件"},{r:we("创建目录"),v:"创建目录"},{r:we("重命名"),v:"重命名"},{r:we("删除"),v:"删除"}],vt=[{r:we("重命名"),v:"重命名"},{r:we("删除"),v:"删除"}],xt=(e,t,n,s,o)=>{e.preventDefault();const i=new _.ik;i.path=n,i.filename=t,i.x=e.clientX,i.y=e.clientY,i.items=s?_t:vt,o===lt&&(i.items=i.items.slice(0,2)),i.type=s?m.Iw.studio_folder:m.Iw.studio_file;const l=e=>{o(e)};i.textClick=e=>{switch(e){case"创建文件":xe({show:!0,type:v.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:l}});break;case"创建目录":xe({show:!0,type:v.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:l}});break;case"删除":if(oe&&(X.path===n||X.path.includes(n))){const e=()=>{l(s),ie(!1),H({}),p.xK.set_value_temp("")};xe({show:!0,type:v.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}xe({show:!0,type:v.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:s?()=>{l(!0)}:l}});break;case"重命名":xe({show:!0,type:v.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,d.Yp)(n),call:(e,t)=>{((e,t)=>{if(q&&at(q,e)){const n=t+q.slice(e.length);Q(n),H({path:n,name:(0,d.mH)(n)})}const n=(0,d.oW)(tt);if(at(n,e)){const s=t+n.slice(e.length);return void ye(`${j.o.studio_page}/${encodeURIComponent(`/file/${s}`)}`,{replace:!0})}V(e=>e+1),lt()})(e,t)},filename:t}})}},xe({show:!0,type:v.PromptEnum.FileMenu,overlay:!1,data:i})};const wt=ge&&"outline"===Fe;return(0,N.jsxs)("div",{className:"studio studio--file",children:[(0,N.jsxs)(a.A,{ignore_tags:!0,left_children:[(0,N.jsx)(l.rA,{title:"取消",icon:"close",onClick:()=>{De(),function(){try{localStorage.removeItem(S)}catch(e){}}(),ae({show:!1,path:""}),ce(void 0),ye(-1)}},1),(0,N.jsx)("div",{children:X.name},2)],children:[(0,N.jsx)("title",{children:X.name}),(0,N.jsx)(l.rA,{title:"侧边栏",icon:"list",onClick:()=>Ke(e=>!e),selected:Ge}),ge&&[(0,N.jsx)(l.rA,{icon:"source"===be.current?.mode()?"edit":"code",title:"source"===be.current?.mode()?we("实时编辑模式"):we("源码模式"),onClick:()=>be.current?.toggle_mode()},"mode"),(0,N.jsx)(l.rA,{title:we("导出PDF"),icon:"print",onClick:()=>be.current?.export_pdf()},"pdf")],!ge&&(0,_.zr)(X.name)&&(0,N.jsx)(l.rA,{title:"格式化",icon:"data_object",onClick:function(){p.xK.get_editor()?.formatCode()}}),de.can_terminal&&(0,N.jsx)(l.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==re&&!1!==re?le.show?ae({show:!1,path:""}):(ae({show:!0,path:tt}),ce(!1)):ce(!re)}}),nt(g.oV.ai_agent_page)&&de.ai_chat_available&&(0,N.jsx)(l.rA,{title:we("AI 聊天"),icon:"smart_toy",selected:Je,onClick:()=>We("chat_open",!Je?"1":null)}),oe&&(ge?(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:()=>be.current?.save()}):je?(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:()=>Ae.current?.save()}):ke?(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:()=>$e.current?.save()}):Se?(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:()=>Ie.current?.save()}):Ce?(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:()=>Ne.current?.save()}):(0,N.jsx)(l.rA,{title:we("保存"),icon:"save",onClick:dt}))]}),(0,N.jsxs)("div",{className:"studio-body",ref:me,children:[(0,N.jsxs)("div",{className:"studio-nav",style:{display:Ge?void 0:"none",width:fe-1+"em"},onContextMenu:e=>{xt(e,X.name,tt,!0,lt)},children:[(0,N.jsx)("div",{className:"studio-nav-outline",style:{display:wt?void 0:"none"},children:(0,N.jsx)(P,{items:Me,active_pos:Ue,on_click:e=>be.current?.goto_heading(e)})}),(0,N.jsx)("div",{className:"studio-nav-folder",style:{display:wt?"none":void 0},children:(0,N.jsx)(s.Fragment,{children:(0,N.jsx)(r.z,{pre_path:C,list:t,click:async(e,t,n)=>{if("folder"===e.type){Z(e=>e.includes(n)?e:[...e,n]);const e=await c.$M.post("studio/get/item",{path:`${n}`});if(e.code===u.m.Success){const n=[],s=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&s.push(t);t([...n,...s])}}else{if(oe)return void se({open:!0,handle:()=>{se({open:!1,handle:null}),ie(!1),ct(e,n)},title:"确定不保存就切换吗?"});ct(e,n)}},active_path:q,expand_paths:Y,handleContextMenu:xt,fatherNowToggleExpansion:lt})},O)}),ge&&(0,N.jsx)("div",{className:"studio-nav-switch",children:(0,N.jsx)(l.rA,{icon:wt?"folder":"list",title:we(wt?"文件目录":"大纲"),onClick:()=>Le(wt?"folder":"outline")})})]}),Ge&&(0,N.jsx)("div",{className:"studio__divider",ref:ue,onPointerDown:()=>{he(!0),me.current.addEventListener("pointermove",mt)},onPointerUp:pt}),pe&&(0,N.jsx)("div",{className:"shell__overlay",onPointerUp:pt}),ge?(0,N.jsx)("div",{className:"studio-editor studio-editor--md",children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(M,{pane:{path:q,url:c.$M.getDownloadUrl(encodeURIComponent(q)),name:X.name,on_dirty:ie,on_outline:(e,t)=>{Pe(e),ze(t)},register:e=>{be.current=e;const t=A("md",q);if(!t?.scroll)return;const n=t.scroll;let s=0;const o=()=>{++s>40||(e.set_scroll(n),e.get_scroll()!==n&&window.setTimeout(o,50))};window.setTimeout(o,50)}}})})},q):je?(0,N.jsx)("div",{className:"studio-editor studio-editor--draw",children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(z,{reset_key:q,view_state:A("draw",q),url:c.$M.getDownloadUrl(encodeURIComponent(q)),save_path:q,on_dirty:ie,on_saved:()=>ie(!1),register:e=>{Ae.current=e}})})},q):ke?(0,N.jsx)("div",{className:"studio-editor studio-editor--mind",children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(D,{reset_key:q,view_state:A("mind",q),url:c.$M.getDownloadUrl(encodeURIComponent(q)),on_dirty:ie,on_saved:()=>ie(!1),register:e=>{$e.current=e},on_save:async e=>(await c.$M.post(`save/${encodeURIComponent(q)}`,{context:e})).code===u.m.Success})})},q):Se?(0,N.jsx)("div",{className:"studio-editor studio-editor--timeline",children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(F,{reset_key:q,view_state:A("timeline",q),url:c.$M.getDownloadUrl(encodeURIComponent(q)),on_dirty:ie,register:e=>{Ie.current=e},on_save:async e=>(await c.$M.post(`save/${encodeURIComponent(q)}`,{context:e})).code===u.m.Success})})},q):Ce?(0,N.jsx)("div",{className:"studio-editor studio-editor--excel",children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(L,{url:c.$M.getDownloadUrl(encodeURIComponent(q)),save_path:q,on_dirty:ie,bind_save:e=>{Ne.current={save:e}},bind_view:e=>{const t=A("excel",q);Ee.current={get_view_state:()=>{const t=e.get_state();return{sheet:t.sheet,scroll_x:t.scroll_left,scroll_y:t.scroll_top}}},t&&e.set_state({sheet:t.sheet,scroll_left:t.scroll_x,scroll_top:t.scroll_y})}})})},q):(0,N.jsx)("div",{className:"studio-editor",children:X.name&&(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(E,{name:X.name,on_dirty:ie,view_state:A("ace",q),on_view_state:e=>$("ace",q,e),register:e=>{Re.current=e},save:async e=>{const t={context:p.xK.get_editor_value()},n=await c.$M.post(`save/${encodeURIComponent(q)}`,t);return n.code===u.m.Success||e||(0,h.zN)(we("保存失败")),n.code===u.m.Success}})})},q),Je&&(0,N.jsxs)(s.Fragment,{children:[(0,N.jsx)("div",{className:"studio__divider studio__divider--chat",ref:He,onPointerDown:e=>{e.preventDefault(),Ve(!0),document.addEventListener("pointermove",ht),document.addEventListener("pointerup",ft,{once:!0})}}),(0,N.jsx)("div",{className:"studio-chat-panel",style:{width:`${Te}em`},children:(0,N.jsx)(s.Suspense,{fallback:null,children:(0,N.jsx)(U,{inline_header:!0,sync_url:!1,file_cwd_path:it,session_id:Ye??(yt=it,o.AG.get_ai_chat_session(qe,yt)),on_session_change:e=>{Ze(e),((e,t)=>{Qe({...qe,[e]:t})})(it,e)}})})})]})]})]});var yt}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[621,4935],{53002(e,t,n){n.r(t),n.d(t,{default:()=>m});var r=n(96540),s=n(34843),l=n(82893),o=n(85997),c=n(45907),a=n(74848);function i(e){const{name:t,dirty:n,loading:s,error:l,saving:i,on_save:u,on_close:f,children:d,extra:h}=e,m=(0,c.y)(),g=(0,r.useRef)(f),x=(0,r.useRef)(u),p=(0,r.useRef)(n);g.current=f,x.current=u,p.current=n;const y=()=>{p.current?m({title:"关闭",sub_title:"有未保存的修改,确定关闭吗?",confirm_fun:()=>g.current?.()}):g.current?.()};return(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key.toLowerCase()?(e.preventDefault(),e.stopPropagation(),x.current?.()):"Escape"===e.key&&y()};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[]),(0,a.jsxs)("div",{className:"office-editor",children:[(0,a.jsxs)("div",{className:"office-editor__topbar",children:[(0,a.jsxs)("div",{className:"office-editor__name",children:[t,n&&(0,a.jsx)("span",{className:"office-editor__dirty",title:"有未保存的修改"})]}),(0,a.jsxs)("div",{className:"office-editor__ops",children:[h,i&&(0,a.jsx)("span",{className:"office-editor__saving",children:"保存中…"}),u&&(0,a.jsx)(o.rA,{icon:"save",title:"保存 (Ctrl+S)",onClick:()=>u()}),(0,a.jsx)(o.rA,{icon:"close",title:"关闭 (Esc)",onClick:y})]})]}),(0,a.jsxs)("div",{className:"office-editor__body",children:[s&&(0,a.jsx)("div",{className:"office-editor__tip",children:"加载中…"}),!s&&l&&(0,a.jsx)("div",{className:"office-editor__tip office-editor__tip--error",children:l}),!s&&!l&&d]})]})}var u=n(24935),f=n(99018),d=n(93245),h=n(23430);function m(){const[e,t]=(0,s.fp)(l.AG.excel_editor),[n,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(!1),g=(0,r.useRef)(),x=async()=>{if(!g.current)return!1;m(!0);try{return await g.current()}finally{m(!1)}},p=(0,r.useRef)(n);return p.current=n,(0,d.a)(h.nE.excel,()=>p.current,()=>x()),(0,a.jsx)(i,{name:e.name,dirty:n,loading:!1,error:"",saving:c,on_save:x,on_close:()=>{const n=e.close;t({}),n?.()},children:e.url&&(0,a.jsx)(u.default,{url:e.url,save_path:(0,f.Vi)(e.name??""),on_dirty:o,bind_save:e=>g.current=e})})}},24935(e,t,n){n.r(t),n.d(t,{default:()=>b});var r=n(96540),s=n(47049),l=n(8890);const o=e=>Math.round(7*e+5),c=e=>Math.round(4*e/3);function a(e){return{toBytes:async()=>e}}function i(e,t){if(e){if(e.rgb){const t=String(e.rgb);return"#"+(8===t.length?t.slice(2):t)}return void 0!==e.theme&&t[e.theme]?"#"+function(e,t){if(!t)return e;const n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n].map(e=>{const n=t<0?e*(1+t):e*(1-t)+255*t;return Math.round(n).toString(16).padStart(2,"0")}).join("").toUpperCase()}(t[e.theme],e.tint??0):void 0}}function u(e){const t=Math.round(864e5*(e-25569));return new Date(t)}function f(e,t){const n=e=>String(e).padStart(2,"0"),r=e.getUTCFullYear(),s=r%100,l=e.getUTCMonth()+1,o=e.getUTCDate(),c="日一二三四五六"[e.getUTCDay()];return t.replace(/;.*$/,"").replace(/\[[^\]]*\]/g,"").replace(/"[^"]*"/g,e=>e.slice(1,-1)).replace(/\\/g,"").replace(/yyyy/g,String(r)).replace(/yy/g,n(s)).replace(/(?<!m)m(?!m)/g,String(l)).replace(/mm/g,n(l)).replace(/d(?!d)/g,String(o)).replace(/dd/g,n(o)).replace(/aaaa/g,`星期${c}`)}const d=e=>!!e&&/[ymd]/i.test(e.replace(/"[^"]*"/g,""))&&!/[#0]/.test(e.replace(/"[^"]*"/g,""));function h(e,t,n){const r=e?.value;if(null==r)return{text:null};if("object"==typeof r){if(Array.isArray(r.runs)){const e=r.runs.map(e=>({text:e.text??"",color:i(e.font?.color,t)}));return{text:e.map(e=>e.text).join("")||null,runs:e.some(e=>e.color)?e:void 0}}if("string"==typeof r.text)return{text:r.text};const e=r.cachedValue??r.result;return void 0!==e?"number"==typeof e&&d(n)?{text:f(u(e),n)}:{text:String(e)}:{text:null}}return"number"==typeof r&&d(n)?{text:f(u(r),n)}:{text:String(r)}}function m(e,t,n){const r=e?.styleId;if(void 0===r)return;const s=t.cellXfs?.[r];if(!s)return;const l=t.fills?.[s.fillId],o=t.fonts?.[s.fontId],c={};"solid"===l?.patternType&&(c.bg=i(l.fgColor,n)),c.color=i(o?.color,n),o?.bold&&(c.bold=!0),o?.italic&&(c.italic=!0),o?.size&&(c.fontSize=o.size),o?.name&&(c.fontFamily=o.name),o?.underline&&(c.underline=!0),o?.strike&&(c.strike=!0);const a=s.alignment;return a?.horizontal&&["left","center","right"].includes(a.horizontal)&&(c.align=a.horizontal),a?.vertical&&(c.valign="center"===a.vertical?"middle":a.vertical),a?.wrapText&&(c.wrap=!0),a?.indent&&(c.indent=a.indent),Object.keys(c).length?c:void 0}function g(e,t){const n=e?.styleId;if(void 0===n)return;const r=t.cellXfs?.[n];if(!r)return;const s=r.numFmtId;if(void 0===s||0===s)return;const l={14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",27:'yyyy"年"m"月"',28:'m"月"d"日"',29:'m"月"d"日"',30:"m-d-yy",31:'yyyy"年"m"月"d"日"',32:'h"时"mm"分"',33:'h"时"mm"分"ss"秒"',34:'上午/下午h"时"mm"分"',35:'上午/下午h"时"mm"分"ss"秒"',36:'yyyy"年"m"月"'};if(l[s])return l[s];const o=t.numFmts;return o instanceof Map?o.get(s):void 0}async function x(e){const t=await(0,s.a)(a(e)),n=function(e){const t=["FFFFFF","000000","EEECE1","1F497D","4F81BD","C0504D","9BBB59","8064A2","4BACC6","F79646"];if(!e)return t;const n="string"==typeof e?e:(new TextDecoder).decode(e),r=/<a:clrScheme[\s\S]*?<\/a:clrScheme>/.exec(n)?.[0];if(!r)return t;const s=[],l=/<a:(dk1|lt1|dk2|lt2|accent[1-6]|hlink|folHlink)>([\s\S]*?)<\/a:\1>/g,o=new Map;let c;for(;c=l.exec(r);){const e=/(?:lastClr|val)="([0-9A-Fa-f]{6})"/.exec(c[2])?.[1];e&&o.set(c[1],e.toUpperCase())}return["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"].forEach((e,n)=>s[n]=o.get(e)??t[n]),s}(t.themeXml);return t.sheets.map(e=>{const r=e.sheet,s=t.styles;let l=0,a=0;r.rows.forEach((e,t)=>{e.size&&(l=Math.max(l,t),e.forEach((e,t)=>{a=Math.max(a,t)}))});const i=[],u=new Map;for(let e=1;e<=l;e++){const t=[],l=r.rows.get(e);for(let r=1;r<=a;r++){const o=l?.get(r),c=h(o,n,g(o,s));t.push(c.text);const a=m(o,s,n);c.runs&&(a?a.runs=c.runs:u.set(`${e-1}_${r-1}`,{runs:c.runs})),a&&u.set(`${e-1}_${r-1}`,a)}i.push(t)}const f=o(r.defaultColumnWidth??8.43),d=new Array(a).fill(f);r.columnDimensions?.forEach(e=>{const t=o(e.width??8.43);for(let n=e.min;n<=e.max;n++)n-1<d.length&&(d[n-1]=t)});const x=c(r.defaultRowHeight??15),p=new Array(l).fill(x),y=new Set;r.rowDimensions?.forEach((e,t)=>{t-1<p.length&&e.height&&(p[t-1]=c(e.height)),e.hidden&&t-1<l&&y.add(t-1)});const _=(r.mergedCells??[]).map(e=>[(e.minRow??e.start?.row??1)-1,(e.minCol??e.start?.col??1)-1,(e.maxRow??e.end?.row??1)-1,(e.maxCol??e.end?.col??1)-1]);return{title:r.title,values:i,styles:u,col_widths:d,row_heights:p,hidden_rows:y,merges:_}})}var p=n(74848);function y(e){const{bytes:t,on_change:n,bind_save:o}=e,[c,i]=(0,r.useState)([]),[u,f]=(0,r.useState)(0),[,d]=(0,r.useState)(0),[h,m]=(0,r.useState)(""),g=(0,r.useRef)(!1),y=(0,r.useRef)(null),[w,b]=(0,r.useState)({r0:0,r1:40,c0:0,c1:20});(0,r.useEffect)(()=>{let e=!0;return m(""),x(t).then(t=>e&&i(t)).catch(t=>e&&m(String(t?.message??t))),()=>{e=!1}},[t]);const S=(0,r.useCallback)(()=>{g.current||(g.current=!0,n(!0))},[n]);(0,r.useEffect)(()=>{o(async()=>{const e=await async function(e,t){const n=await(0,s.a)(a(e));return t.forEach((e,t)=>{const r=n.sheets[t];if(!r)return;const s=r.sheet;e.values.forEach((e,t)=>{e.forEach((e,n)=>{const r=t+1,l=n+1;let o=s.rows.get(r);o||(o=new Map,s.rows.set(r,o));const c=o.get(l);null!==e&&""!==e?c?c.value=e:o.set(l,{row:r,col:l,value:e}):c&&(c.value=null)})})}),await(0,l.n)(n)}(t,c);return g.current=!1,n(!1),e})},[c,t,o,n]),(0,r.useEffect)(()=>{e.bind_view?.({get_state:()=>({sheet:u,scroll_left:y.current?.scrollLeft??0,scroll_top:y.current?.scrollTop??0}),set_state:e=>{"number"==typeof e.sheet&&e.sheet>=0&&e.sheet<c.length&&f(e.sheet);const t=y.current;t&&(t.scrollLeft=e.scroll_left??0,t.scrollTop=e.scroll_top??0)}})},[u,c.length,e.bind_view]);const C=c[u],{col_x:j,row_y:E,total_w:k,total_h:M}=r.useMemo(()=>{const e=C?.col_widths??[],t=C?.row_heights??[],n=[0];e.forEach((e,t)=>n.push(n[t]+(C?.hidden_rows.has(t)?0:e)));const r=[0];return t.forEach((e,t)=>r.push(r[t]+e)),{col_x:n,row_y:r,total_w:n[n.length-1]??0,total_h:r[r.length-1]??0}},[C]),N=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){const s=n+r>>1;e[s]<t?n=s+1:r=s}return n},$=(0,r.useCallback)(()=>{const e=y.current;if(!e||!j.length)return;const t=Math.max(0,N(j,e.scrollLeft)-1),n=Math.max(0,N(E,e.scrollTop)-1);b({c0:t,c1:Math.min(j.length-1,N(j,e.scrollLeft+e.clientWidth)+2),r0:n,r1:Math.min(E.length-1,N(E,e.scrollTop+e.clientHeight)+2)})},[j,E]);(0,r.useEffect)(()=>{$()},[C,$]);if(h)return(0,p.jsx)("div",{className:"office-editor__tip office-editor__tip--error",children:h});if(!c.length)return(0,p.jsx)("div",{className:"office-editor__tip",children:"解析中…"});const F=C?.values??[],D=(E.length,j.length,new Set);C.merges.forEach(([e,t,n,r])=>{for(let s=e;s<=n;s++)for(let n=t;n<=r;n++)s===e&&n===t||D.add(`${s}_${n}`)});const A=(e,t)=>{const n=F[e]?.[t];return(null==n||""===n)&&!C.styles.get(`${e}_${t}`)?.bg};return(0,p.jsxs)("div",{className:"xlsx-body",children:[(0,p.jsx)("div",{className:"xlsx-tabs",children:c.map((e,t)=>(0,p.jsx)("div",{className:"xlsx-tab "+(t===u?"xlsx-tab--active":""),onClick:()=>{f(t),y.current&&(y.current.scrollTop=0,y.current.scrollLeft=0)},children:e.title},e.title+t))}),(0,p.jsx)("div",{className:"xlsx-scroll",ref:y,onScroll:$,children:(0,p.jsxs)("div",{className:"xlsx-grid",style:{width:46+k,height:24+M},children:[Array.from({length:Math.max(0,w.c1-w.c0)}).map((e,t)=>{const n=w.c0+t;return(0,p.jsx)("div",{className:"xlsx-head",style:{left:46+j[n],top:0,width:j[n+1]-j[n],height:24},children:v(n)},"ch"+n)}),Array.from({length:Math.max(0,w.r1-w.r0)}).map((e,t)=>{const n=w.r0+t;return(0,p.jsxs)(r.Fragment,{children:[(0,p.jsx)("div",{className:"xlsx-head xlsx-head--row",style:{left:0,top:24+E[n],width:46,height:E[n+1]-E[n]},children:n+1}),Array.from({length:Math.max(0,w.c1-w.c0)}).map((e,t)=>{const r=w.c0+t;if(D.has(`${n}_${r}`))return null;const s=C.merges.find(e=>e[0]===n&&e[1]===r),l=s?j[s[3]+1]-j[s[1]]:j[r+1]-j[r],o=s?E[s[2]+1]-E[s[0]]:E[n+1]-E[n];return(0,p.jsx)(_,{value:F[n]?.[r]??"",cell_style:C.styles.get(`${n}_${r}`),spillable:A(n,r+1),style:{left:46+j[r],top:24+E[n],width:l,height:o,zIndex:s?2:1},on_change:e=>((e,t,n)=>{const r=c[u];r&&(r.values[e][t]=""===n?null:n,S(),d(e=>e+1))})(n,r,e)},r)})]},n)})]})})]})}function _(e){const{value:t,cell_style:n,style:s,spillable:l,on_change:o}=e,[c,a]=(0,r.useState)(!1),[i,u]=(0,r.useState)(""),f=(0,r.useRef)(null);(0,r.useEffect)(()=>{c&&f.current&&(f.current.focus(),f.current.select())},[c]);const d=()=>{a(!1),i!==(t??"")&&o(i)},h={};return n?.bg&&(h.backgroundColor=n.bg),n?.color&&(h.color=n.color),n?.bold&&(h.fontWeight=600),n?.italic&&(h.fontStyle="italic"),n?.fontSize&&(h.fontSize=Math.round(4*n.fontSize/3*10)/10+"px"),n?.fontFamily&&(h.fontFamily=`"${n.fontFamily}", "PingFang SC", sans-serif`),n?.underline&&(h.textDecoration="underline"),n?.strike&&(h.textDecoration=h.textDecoration?`${h.textDecoration} line-through`:"line-through"),n?.align&&(h.textAlign=n.align,h.justifyContent="center"===n.align?"center":"right"===n.align?"flex-end":"flex-start"),n?.valign&&(h.alignItems="middle"===n.valign?"center":"bottom"===n.valign?"flex-end":"flex-start"),n?.wrap&&(h.whiteSpace="pre-wrap"),n?.indent&&(h.paddingLeft=.35+1.4*n.indent+"em"),(0,p.jsx)("div",{className:`xlsx-cell ${n?.wrap?"xlsx-cell--wrap":""} ${l?"xlsx-cell--spill":""}`,style:{...s,...h,"--cell-h":n?.wrap?"1.4":s.height-1+"px"},onDoubleClick:()=>{u(t??""),a(!0)},children:c?(0,p.jsx)("textarea",{ref:f,className:"xlsx-cell__input",value:i,onChange:e=>u(e.target.value),onBlur:d,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey?"Escape"===e.key&&a(!1):(e.preventDefault(),d())}}):n?.runs?(0,p.jsx)("span",{children:n.runs.map((e,t)=>(0,p.jsx)("span",{style:e.color?{color:e.color}:void 0,children:e.text},t))}):t})}function v(e){let t="",n=e+1;for(;n>0;){const e=(n-1)%26;t=String.fromCharCode(65+e)+t,n=Math.floor((n-1)/26)}return t}var w=n(99018);function b(e){const{url:t,save_path:n,on_dirty:s,bind_save:l}=e,[o,c]=(0,r.useState)(),[a,i]=(0,r.useState)(""),[u,f]=(0,r.useState)(!0),[d,h]=(0,r.useState)(!1),m=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!t)return;let e=!0;return f(!0),i(""),h(!1),c(void 0),(0,w.PQ)(t).then(t=>e&&c(t)).catch(t=>e&&i(String(t?.message??t))).finally(()=>e&&f(!1)),()=>{e=!1}},[t]),(0,r.useEffect)(()=>{s?.(d)},[d,s]),(0,r.useEffect)(()=>{l?.(async()=>{if(!m.current)return!1;const e=await m.current(),t=await(0,w.GB)(n,e);return t&&(c(e),h(!1)),t})},[n,l]),a?(0,p.jsx)("div",{className:"office-editor__tip office-editor__tip--error",children:a}):u||!o?(0,p.jsx)("div",{className:"office-editor__tip",children:"读取中…"}):(0,p.jsx)(y,{bytes:o,on_change:h,bind_save:e=>m.current=e,bind_view:e.bind_view})}},99018(e,t,n){n.d(t,{GB:()=>i,PQ:()=>a,Vi:()=>c});var r=n(14284),s=n(57889),l=n(34289),o=n(62042);function c(e){return`${encodeURIComponent((0,l.GG)("file",(0,l.vX)()))}${e}`}async function a(e){return s.l.get_bytes_url(e)}function i(e,t){return async function(e,t){const n=await r.$M.post(`save_bin/${e}`,{base64:u(t)});return 0===n.code||((0,o.zN)(n.message??"保存失败"),!1)}(function(e){const t=e.lastIndexOf("/");return t<0?encodeURIComponent(e):encodeURIComponent(e.slice(0,t))+e.slice(t)}(e),t)}function u(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6439],{47996(e,t,s){s.d(t,{d:()=>i});s(96540);var n=s(74848);function i(e){return(0,n.jsxs)("div",{className:"instance-item",children:[(0,n.jsxs)("div",{className:"instance-item__toolbar",children:[(0,n.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,t,s){s.d(t,{S:()=>o,X:()=>l});var n=s(96540),i=s(61443),a=s(74848);function l(e){const[t,s]=n.useState([]),l=(0,n.useRef)(-1),[o,r]=(0,n.useState)(-1),[d,c]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const h=()=>{l.current=-1,r(-1),c(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let l=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(l=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(o===s?"row-dragging":"")+(d===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(l.current=s,r(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",c(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=l.current,s=d;h(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:h,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function o(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},16439(e,t,s){s.r(t),s.d(t,{default:()=>je});var n=s(96540),i=s(75725),a=s(23430),l=s(7572),o=s(85997),r=s(61443),d=s(14284),c=s(53459),h=s(34843),u=s(82893),p=s(77481),m=s(74777),_=s(22022),x=s(4412),j=s(78247),v=s(62042),f=s(64484),y=s(23496),w=s(18840),g=s(6960),b=s(7523),k=s(74848);function S(){const{t:e}=(0,_.Bd)(),[,t]=(0,h.fp)(u.AG.prompt_card),[s,i]=(0,n.useState)(""),[a,x]=(0,n.useState)(5610),[j,f]=(0,n.useState)(5710);(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("sys_option/status");if(e.code===c.m.Success){const t=e.data?.sys_env;i((t?.browser_proxy_allow||[]).join("\n")),x(t?.browser_proxy_port_start||5610),f(t?.browser_proxy_port_end||5710)}})()},[]);return(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("网页代理")}),(0,k.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{t({open:!0,title:e("信息"),context_div:(0,k.jsx)("div",{children:(0,k.jsx)("div",{children:e("wbvpn_tip")})})})}})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{const t=s.split("\n").map(e=>e.trim()).filter(e=>!!e);(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{browser_proxy_allow:t,browser_proxy_port_start:Number(a)||5610,browser_proxy_port_end:Number(j)||5710}})).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,k.jsx)("div",{children:e("wbvpn_allow")}),(0,k.jsx)(r.Z2,{style:{minHeight:"5rem",resize:"vertical"},placeholder:e("wbvpn_allow_ph"),value:s,onChange:e=>{i(e.target.value)}}),(0,k.jsx)("div",{children:e("wbvpn_port_range")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.Sm,{placeholder:"5610",value:a,handleInputChange:e=>x(e)}),(0,k.jsx)("span",{style:{padding:"0 6px"},children:"-"}),(0,k.jsx)(r.Sm,{placeholder:"5710",value:j,handleInputChange:e=>f(e)})]})]})}function C(){const[e,t]=(0,n.useState)(""),[s,a]=(0,n.useState)(""),[C,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(!1),[B,P]=(0,n.useState)(""),[F,z]=(0,h.fp)(u.AG.prompt_card),[,K]=(0,h.fp)(u.AG.editorSetting),[X,O]=(0,n.useState)(m.aM.close),[T,M]=(0,n.useState)(!1),[q,D]=(0,n.useState)(m.Hb.independent),U=(0,f.T)(),[H,W]=(0,n.useState)(void 0),[E,Z]=(0,n.useState)(""),{t:G,i18n:R}=(0,_.Bd)(),L=[`- ${G("过期策略:默认表示使用系统内置的1小时过期时间;指定时间按填写的秒数过期;永不过期则token一直有效")}`,`- ${G("独立token:每次登录都签发新的token,同一账号可以在多个设备同时登录,互不影响")}`,`- ${G("复用token:该账号已有未过期的token时直接复用它,不会签发新的")}`,`- ${G("单会话:每次登录签发新的token,并让该账号此前的所有token立即失效")}`].join("\n"),[J,Q]=(0,h.fp)(u.AG.user_base_info),{check_user_auth:Y}=(0,j.MH)(),{initUserInfo:ee}=(0,n.useContext)(b.F),te=async()=>{const e=await d.XO.get("sys_option/status");if(e.code===c.m.Success){V(e.data.recycle_open),P(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),a(s?.logo||""),A(s?.show_login_user_info),N(s?.http_proxy||""),Z(s?.control_env_str||w.CU)}const s=await d.XO.get("token");if(s.code===c.m.Success){const e=s.data;if(!e)return;e.length&&W(e.length),e.mode&&O(e.mode),void 0!==e.persist&&M(e.persist),void 0!==e.session_mode&&D(e.session_mode)}};(0,n.useEffect)(()=>{te()},[]);return(0,k.jsxs)("div",{children:[(0,k.jsx)(x.aZ,{children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("span",{className:"credits",children:[G("系统运行于"),": ",(0,g.s)(J.runing_time_length)]}),(0,k.jsx)("span",{className:"credits",children:(0,k.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:7.31.0",null!=J.latest_version&&"7.31.0"!==J.latest_version?` -> ${J.latest_version}`:""]})}),(0,k.jsx)("span",{className:"credits",children:(0,k.jsx)("a",{href:G("官网地址"),target:"_blank",children:`filecat ${G("功能文档")}`})}),(0,k.jsxs)("span",{className:"credits",children:[G("安装方式")," :",J.process_env_run_env]})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(i.fI,{children:[(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("通用设置")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:G("信息"),context_div:(0,k.jsx)("div",{children:(0,k.jsx)("div",{children:G("sys_env_setting_tip")})})})},title:G("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:G("确定修改"),clickFun:async()=>{(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{web_site_title:e,show_login_user_info:C,http_proxy:I,logo:s}})).code===c.m.Success&&((0,v.SK)(G("修改成功")),ee())}}),rightTopCom:(0,k.jsx)(o.rA,{icon:"tune",title:G("环境控制"),onClick:()=>{j.xK.set_value_temp(E||w.CU),K({model:"ace/mode/yaml",open:!0,fileName:"",not_auto_save:!0,save:async e=>{const t=await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.sys_env,value:{control_env_str:e}});t.code===c.m.Success?(Z(e),(0,v.SK)(G("修改成功")),te()):(0,v.zN)(`${t.message??G("保存失败")}`)}})}}),children:[G("网站标题"),(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),G("网站 Logo"),(0,k.jsx)(r.Sm,{placeholder:G("lclorur"),value:s,handleInputChange:e=>{a(e)}}),G("lgn_usr"),(0,k.jsx)("input",{type:"checkbox",checked:C,onChange:()=>{A(!C)}})]}),(0,k.jsx)(S,{})]}),(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("文件回收站")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:G("信息"),context_div:(0,k.jsx)("div",{children:G("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:G("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:G("确定修改"),clickFun:async()=>{if($&&!B)return void(0,v.zN)(G("目录不能为空"));(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.cyc,value:B,open:$})).code===c.m.Success&&(0,v.SK)(G("修改成功"))}}),children:[(0,k.jsx)(r.Sm,{placeholder:G("目录"),value:B,handleInputChange:e=>{P(e)}}),(0,k.jsx)(r.l6,{value:$,onChange:e=>{V(e)},options:[{title:G("开启"),value:!0},{title:G("关闭"),value:!1}]})]}),(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:G("会话token设置")}),(0,k.jsx)(o.rA,{icon:"info",title:G("登录会话"),onClick:()=>U(L)})]}),rightBottomCom:(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(o.C3,{text:G("清空token"),clickFun:async()=>{(await d.XO.get("token/clear")).code===c.m.Success&&(0,v.SK)(G("清理完成,重新登录"))}}),(0,k.jsx)(o.C3,{text:G("保存"),clickFun:async()=>{const e=new m.Gd;e.mode=X,e.persist=T,e.session_mode=q,m.aM.length!==e.mode||H||(0,v.zN)(G("秒数不能为空")),e.length=parseInt(H);(await d.XO.post("token/save",e)).code===c.m.Success&&(0,v.SK)(G("保存成功"))}})]}),children:[(0,k.jsxs)("div",{className:"form_group",children:[(0,k.jsx)("div",{className:"form_label",children:G("过期策略")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("默认"),selected:X===m.aM.close,onchange:()=>{O(m.aM.close)}}),(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("指定时间"),selected:X===m.aM.length,onchange:()=>{O(m.aM.length)}}),(0,k.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("永不过期"),selected:X===m.aM.forver,onchange:()=>{O(m.aM.forver)}})]}),X===m.aM.length&&(0,k.jsx)(r.Sm,{placeholder:G("秒"),value:H,handleInputChange:e=>{W(e)}}),(0,k.jsx)(r.GL,{context:G("持久化"),selected:T,onchange:()=>M(!T)})]}),(0,k.jsxs)("div",{className:"form_group",children:[(0,k.jsx)("div",{className:"form_label",children:G("登录会话")}),(0,k.jsx)(p.S,{isFlex:!0,columns:[(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.independent,context:G("独立token"),selected:q===m.Hb.independent,onchange:()=>D(m.Hb.independent)}),(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.reuse,context:G("复用token"),selected:q===m.Hb.reuse,onchange:()=>D(m.Hb.reuse)}),(0,k.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.single,context:G("单会话"),selected:q===m.Hb.single,onchange:()=>D(m.Hb.single)})]})]})]})]})]})})]})}var A=s(64694),I=s(92350),N=s(69675),$=s(32361);const V=[{key:"second",min:0,max:59,label:"秒"},{key:"minute",min:0,max:59,label:"分"},{key:"hour",min:0,max:23,label:"时"},{key:"day",min:1,max:31,label:"日"},{key:"month",min:1,max:12,label:"月"},{key:"week",min:0,max:7,label:"星期"}];function B(e){switch(e.mode){case"step":return`*/${e.step??1}`;case"range":return`${e.from??0}-${e.to??0}`;case"list":return(e.values??[]).join(",");default:return"*"}}function P(e){return[B(e.second),B(e.minute),B(e.hour),B(e.day),B(e.month),B(e.week)].join(" ")}function F(e,t,s){const n=(e??"").trim();if(!n)return null;if("*"===n)return{mode:"every"};if(n.startsWith("*/")){const e=Number(n.slice(2));return!Number.isInteger(e)||e<=0?null:{mode:"step",step:e}}if(n.includes("-")&&!n.includes(",")){const[e,i]=n.split("-").map(Number);return Number.isInteger(e)&&Number.isInteger(i)?e<t||i>s||e>i?null:{mode:"range",from:e,to:i}:null}const i=n.split(","),a=[];for(const e of i){const n=Number(e.trim());if(!Number.isInteger(n)||n<t||n>s)return null;a.push(n)}return 0===a.length?null:{mode:"list",values:a}}function z(e){const t=(e??"").trim().split(/\s+/);if(6!==t.length)return null;const s={};for(let e=0;e<6;e++){const n=V[e],i=F(t[e],n.min,n.max);if(!i)return null;s[n.key]=i}return s}function K(e){return e<10?`0${e}`:`${e}`}function X(e,t,s){switch(e.mode){case"step":return`每 ${e.step} ${t}`;case"range":return`${e.from} 到 ${e.to} ${t}`;case"list":return`${(e.values??[]).slice().sort((e,t)=>e-t).join("、")} ${t}`;default:return null}}function O(e){const{second:t,minute:s,hour:n,day:i,month:a,week:l}=e,o=(e,t)=>"list"===e.mode&&1===(e.values??[]).length&&e.values[0]===t,r=[];if("list"===n.mode&&"list"===s.mode&&o(t,0)){const e=(n.values??[]).slice().sort((e,t)=>e-t),t=(s.values??[]).slice().sort((e,t)=>e-t);e.length===t.length&&e.length>1&&t.length>1?r.push(e.map((e,s)=>`${K(e)}:${K(t[s])}`).join("、")):1===e.length&&1===t.length?r.push(`${K(e[0])}:${K(t[0])}`):r.push(`${e.map(K).join("、")} 时 ${t.join("、")} 分`)}else if("list"===n.mode&&"step"===s.mode&&o(t,0))r.push(`${(n.values??[]).map(K).join("、")} 时内每 ${s.step} 分钟`);else if("every"===n.mode&&"list"===s.mode&&o(t,0))r.push(`每小时的 ${(s.values??[]).join("、")} 分`);else if("every"===n.mode&&"step"===s.mode&&o(t,0))r.push(`每 ${s.step} 分钟`);else if("every"===n.mode&&"every"===s.mode&&o(t,0))r.push("每分钟");else if("every"===n.mode&&"every"===s.mode&&"step"===t.mode)r.push(`每 ${t.step} 秒`);else if("every"===n.mode&&"every"===s.mode&&"every"===t.mode)r.push("每秒");else if("every"===n.mode&&"every"===s.mode&&"list"===t.mode)r.push(`每分钟的第 ${(t.values??[]).join("、")} 秒`);else{const e=[],i=X(n,"时"),a=X(s,"分"),l=o(t,0)?null:X(t,"秒");i&&e.push(i),a&&e.push(a),l&&e.push(l),e.length>0&&r.push(e.join(" "))}const d="list"===i.mode&&1===(i.values??[]).length?i.values[0]:null,c="list"===a.mode&&1===(a.values??[]).length?a.values[0]:null,h="list"===l.mode&&1===(l.values??[]).length?l.values[0]:null;let u="";if(null!==c&&null!==d)u=`每年 ${c} 月 ${d} 号`;else if(null!==c)u=`每年 ${c} 月`;else if(null!==d)u=`每月 ${d} 号`;else if(null!==h)u=`每${["周日","周一","周二","周三","周四","周五","周六","周日"][h]??`星期 ${h}`}`;else{const e=[];"every"!==a.mode&&e.push(X(a,"月")),"every"!==i.mode&&e.push(X(i,"号")),"every"!==l.mode&&e.push(`星期 ${X(l,"")}`),e.length&&(u=e.join(" "))}u||(u="每天");const p=r.join(",");return/^(每|每天)/.test(p)?`${p}${"每天"===u?"":","+u} 执行`:`${u} ${p} 执行`}const T=[{label:"任意 (*)",value:"every"},{label:"每隔 (*/n)",value:"step"},{label:"区间 (a-b)",value:"range"},{label:"指定 (a,b)",value:"list"}];function M(e,t,s=!1){const n=[];for(let i=e;i<=t;i++)n.push({label:s?String(i).padStart(2,"0"):String(i),value:i});return n}const q=({label:e,field:t,min:s,max:i,pad:a,week_label:l,onChange:o})=>{const d=(0,n.useMemo)(()=>M(s,i,a),[s,i,a]),c=(0,n.useMemo)(()=>{if(!l)return d;const e=["周日","周一","周二","周三","周四","周五","周六","周日"];return d.map(t=>({value:t.value,label:`${t.value} (${e[t.value]})`}))},[d,l]);return(0,k.jsxs)("div",{className:"cron-field",children:[(0,k.jsx)("span",{className:"cron-field__label",children:e}),(0,k.jsx)(r.l6,{value:t.mode,onChange:e=>{o("every"===e?{mode:"every"}:"step"===e?{mode:"step",step:t.step??1}:"range"===e?{mode:"range",from:t.from??s,to:t.to??i}:{mode:"list",values:t.values??[s]})},options:T,no_border:!0,width:"7.5rem"}),"step"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param",children:[(0,k.jsx)("span",{children:"每"}),(0,k.jsx)(r.l6,{value:t.step??1,onChange:e=>o({mode:"step",step:e}),options:M(1,i),no_border:!0,width:"4.5rem"}),(0,k.jsx)("span",{children:e})]}),"range"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param",children:[(0,k.jsx)(r.l6,{value:t.from??s,onChange:e=>o({mode:"range",from:e,to:t.to??i}),options:c,no_border:!0,width:"6.5rem"}),(0,k.jsx)("span",{children:"到"}),(0,k.jsx)(r.l6,{value:t.to??i,onChange:e=>o({mode:"range",from:t.from??s,to:e}),options:c,no_border:!0,width:"6.5rem"})]}),"list"===t.mode&&(0,k.jsxs)("div",{className:"cron-field__param cron-field__param--list",children:[(t.values??[]).map((e,s)=>(0,k.jsxs)("span",{className:"cron-tag",children:[(0,k.jsx)(r.l6,{value:e,onChange:e=>((e,s)=>{const n=[...t.values??[]];n[e]=s,o({mode:"list",values:n})})(s,e),options:c,no_border:!0,width:"6.5rem"}),(0,k.jsx)("i",{className:"material-icons cron-tag__del",onClick:()=>(e=>{const s=(t.values??[]).filter((t,s)=>s!==e);o(s.length?{mode:"list",values:s}:{mode:"every"})})(s),children:"close"})]},s)),(0,k.jsx)("i",{className:"material-icons cron-tag__add",onClick:()=>{const e=[...t.values??[]],n=new Set(e);let a=s;for(;n.has(a)&&a<i;)a++;o({mode:"list",values:[...e,a]})},children:"add"})]})]})};const D=[{label:"每分钟",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},second:{mode:"list",values:[0]}})},{label:"每 5 分钟",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},minute:{mode:"step",step:5},second:{mode:"list",values:[0]}})},{label:"每小时",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每天 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每天 8 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[8]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]}})},{label:"每周一 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]},week:{mode:"list",values:[1]}})},{label:"每月 1 号 0 点",make:()=>({second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"},hour:{mode:"list",values:[0]},minute:{mode:"list",values:[0]},second:{mode:"list",values:[0]},day:{mode:"list",values:[1]}})}],U=({value:e,onChange:t,no_border:s})=>{const[i,a]=(0,n.useState)(!1),l=(0,n.useRef)(null),o=(0,n.useRef)(null),r=(0,n.useMemo)(()=>z(e??"")??{second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"}},[e]),d=!!e&&!z(e??""),c=(0,$.r)({active:i,trigger_ref:l,floating_ref:o,width:384,max_height:26});(0,N.$)(i,[l,o],()=>a(!1));const h=e=>{t(P(e))};return(0,k.jsxs)("div",{className:"cron-input "+(i?"cron-input--open":""),children:[(0,k.jsxs)("div",{ref:l,className:"cron-input__display "+(s?"cron-input__display--no-border":""),title:d?"表达式格式不正确":`${e||""} ${O(r)}`.trim(),onClick:()=>a(!i),children:[(0,k.jsx)("span",{className:"cron-input__expr "+(d?"cron-input__expr--invalid":""),children:e||"(未设置)"}),!s&&(0,k.jsx)("span",{className:"cron-input__desc",children:d?"表达式格式不正确":O(r)}),(0,k.jsx)("i",{className:"material-icons cron-input__arrow",children:"arrow_drop_down"})]}),i&&(0,k.jsxs)("div",{ref:o,className:"cron-editor",style:{left:c.left,top:c.top,...c.css_vars,visibility:c.ready?"visible":"hidden"},children:[(0,k.jsxs)("div",{className:"cron-editor__scroll",children:[(0,k.jsxs)("div",{className:"cron-editor__row",children:[(0,k.jsx)("span",{className:"cron-editor__title",children:"常用"}),(0,k.jsx)("div",{className:"cron-editor__presets",children:D.map(e=>(0,k.jsx)("button",{className:"cron-preset",onClick:()=>h(e.make()),children:e.label},e.label))})]}),(0,k.jsx)("div",{className:"cron-editor__fields",children:V.map(e=>(0,k.jsx)(q,{label:e.label,field:r[e.key],min:e.min,max:e.max,pad:"day"!==e.key&&"month"!==e.key&&"week"!==e.key,week_label:"week"===e.key,onChange:t=>{return s=e.key,n=t,void h({...r,[s]:n});var s,n}},e.key))})]}),(0,k.jsxs)("div",{className:"cron-editor__footer",children:[(0,k.jsx)("span",{className:"cron-editor__preview",children:P(r)}),(0,k.jsx)("button",{className:"cron-editor__done",onClick:()=>a(!1),children:"完成"})]})]})]})};var H=s(24659);function W(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:a}=(0,n.useContext)(b.F),[m,x]=(0,n.useState)([]),[f,y]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[,S]=(0,h.fp)(u.AG.editorSetting),[C,N]=(0,n.useState)([]),[$,V]=(0,n.useState)([]),[B,P]=(0,n.useState)([]),[F,z]=(0,n.useState)([]),[K,X]=(0,n.useState)(""),[O,T]=(0,n.useState)([]),M=(0,H.K)(),q=[e("软件"),e("是否安装"),e("路径")],D=[e("编号"),e("路径"),e("备注")],W=[e("编号"),e("路径"),e("是否开启"),e("备注")],E=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("cron表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("big_res"),e("big_sz"),e("大文件并发数量"),e("big_ck"),e("备注")],G=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:R}=(0,j.MH)(),L=async()=>{const e=await d.XO.get("env/path/get");e.code===c.m.Success&&P(e.data)},J=async()=>{const e=await d.XO.get("workflow_setting_get");e.code===c.m.Success&&z(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("outside/software/get");e.code===c.m.Success&&y(e.data);const t=await d.XO.get("pty_cmd");t.code===c.m.Success&&X(t.data),L(),J();const s=await d.XO.get("protection_dir/sys");s.code===c.m.Success&&N(s.data??[]);const n=await d.XO.get("dir_upload_max_num");n.code===c.m.Success&&V(n.data??[]);const i=await d.XO.get("plugin/list");i.code===c.m.Success&&T(i.data??[])})()},[]);const Q=(0,I.Q)(),Y=async()=>{await d.XO.post("plugin/list/save",O)};return(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("up_conc")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...$,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of $)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,v.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,v.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,v.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,A.di)($,e=>e.index??0);(await d.XO.post("dir_upload_max_num/save",$)).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}})]}),children:(0,k.jsx)(p.X,{headers:Z,rows:$.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,k.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,V([...$])},options:M,no_border:!0}),(0,k.jsx)(r.Sm,{value:"number"==typeof t.ws_file_standard_size?t.ws_file_standard_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_standard_size=1024*parseInt(e)*1024},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,k.jsx)(r.Sm,{value:"number"==typeof t.ws_file_block_mb_size?t.ws_file_block_mb_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_block_mb_size=1024*parseInt(e)*1024},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{$.splice(e,1),V([...$])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,A.TI)($,e,t))}})})}),(0,k.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("Workflow Job")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{z([...F,{open:!1}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("workflow_setting_save",F)).code===c.m.Success&&((0,v.SK)("ok"),J())}})]}),children:(0,k.jsx)(p.X,{headers:E,rows:F.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,z([...F])},options:M,no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,z([...F])},options:M,no_border:!0}),(0,k.jsx)(U,{value:t.cron_str,onChange:e=>{t.cron_str=e,z([...F])},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{F.splice(e,1),z([...F])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{z((0,A.TI)(F,e,t))}})})}),(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("PATH")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await d.XO.get("env/process/view");t.code===c.m.Success?g({open:!0,title:e("进程环境变量"),context_div:(0,k.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,v.zN)(e("获取失败"))}}),(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await d.XO.get("env/process/get");t.code===c.m.Success?(j.xK.set_value_temp(t.data??""),S({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{await d.XO.post("env/process/save",{text:e})}})):(0,v.zN)(e("获取失败"))}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...B,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("env/path/save",{paths:B})).code===c.m.Success&&((0,v.SK)(e("保存成功")),L(),s())}})]}),children:(0,k.jsx)(p.X,{headers:W,rows:B.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...B])},options:M,no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{B.splice(e,1),P([...B])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,A.TI)(B,e,t))}})}),(0,k.jsx)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("PTY CMD")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,k.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await d.XO.post("pty_cmd/save",{str:K})).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}}),children:(0,k.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:K,handleInputChange:e=>{X(e)}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("插件配置")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{T([...O,{name:"",path:"",note:"",open:!1}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:Y})]}),children:(0,k.jsx)(p.X,{headers:G,rows:O.map((t,s)=>{const n=[s,(0,k.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,T([...O])},options:M,no_border:!0}),(0,k.jsx)(o.mu,{icon:"edit",value:t.params,save:async e=>{t.params=e,await Y()},title:""}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),T([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{T((0,A.TI)(O,e,t))}})})]})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("系统保护路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...C,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("protection_dir/sys/save",C)).code===c.m.Success&&((0,v.SK)(e("保存成功")),a())}})]}),children:(0,k.jsx)(p.X,{headers:D,rows:C.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),N([...C])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{N((0,A.TI)(C,e,t))}})}),(0,k.jsx)(l.uF,{title:e("外部软件"),rightTopCom:(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("outside/software/save",f)).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}}),children:(0,k.jsx)(p.X,{headers:q,rows:f.map((t,s)=>[(0,k.jsx)("div",{children:t.id}),(0,k.jsx)(l.fq,{ok:t.installed}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("use_env")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}var E=s(21499);function Z(e){const{t,i18n:s}=(0,_.Bd)(),[i,l]=(0,h.fp)(u.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:a.oV.user_manage},{title:t("角色管理"),permission:a.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:a.oV.all_sys},{title:t("系统进程关闭"),permission:a.oV.sys_process_close},{title:t("dc_ctdl"),permission:a.oV.docker_container_update},{title:t("dc_idl"),permission:a.oV.docker_images_delete},{title:t("systemd管理"),permission:a.oV.systemd},{title:t("防火墙管理"),permission:a.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:a.oV.vir_net},{title:t("内网穿透"),permission:a.oV.tcp_proxy},{title:"ddns",permission:a.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:a.oV.ai_agent_setting},{title:t("ai_page"),permission:a.oV.ai_agent_page},{title:t("sw_mdl"),permission:a.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("log_del"),permission:a.oV.filecat_file_delete_cut_rename},{title:t("log_wr"),permission:a.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:a.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:a.oV.recycle_file_save},{title:t("文件分享"),permission:a.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:a.oV.sys_setting_page},{title:t("tk_time"),permission:a.oV.token_update},{title:t("修改密码"),permission:a.oV.update_password},{title:t("磁盘挂载"),permission:a.oV.sys_disk_mount},{title:t("通用设置"),permission:a.oV.sys_env_setting_key},{title:t("md_set"),permission:a.oV.md_editor_setting},{title:t("目录挂载"),permission:a.oV.file_mount},{title:t("文件服务"),permission:a.oV.file_server}]},{title:t("系统环境设置"),list:[{title:t("sys_env"),permission:a.oV.sys_env_page},{title:t("up_lim"),permission:a.oV.dir_upload_max_num},{title:t("path_md"),permission:a.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:a.oV.pty_cmd_update},{title:"workflow job",permission:a.oV.workflow_job},{title:t("path_up"),permission:a.oV.sys_protection_dir},{title:t("外部软件路径"),permission:a.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:a.oV.private_sys_env}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:a.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:a.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:a.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:a.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy},{title:t("http代理"),permission:a.oV.http_proxy},{title:t("pxy_off"),permission:a.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:a.oV.browser_proxy},{title:t("浏览器代理编辑"),permission:a.oV.browser_proxy_edit},{title:t("rdp代理"),permission:a.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("wf_run"),permission:a.oV.workflow_exe},{title:t("wf_user"),permission:a.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:a.oV.wol_proxy},{title:t("端口扫描"),permission:a.oV.port_scan},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy},{title:t("ssh_sv"),permission:a.oV.crypto_ssh_file},{title:t("cmd_rst"),permission:a.oV.shell_cmd_filecat_restart},{title:t("cmd_upg"),permission:a.oV.shell_cmd_filecat_upgrade},{title:t("cmd_dwn"),permission:a.oV.shell_cmd_filecat_kill_self},{title:t("cmd_ai"),permission:a.oV.ai_chat_cmd}]}];return(0,k.jsx)(n.Fragment,{children:o.map((t,s)=>(0,k.jsxs)("div",{children:[(0,k.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,k.jsxs)("div",{children:[(0,k.jsx)("input",{type:"checkbox",disabled:!t.noDisable&&e.is_disable(t.permission),checked:e.is_selected(t.permission,t.noDisable),onChange:()=>{e.select_auth(t.permission)}}),t.title]},s))]},s))})}const G=new Map;function R(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:m}=(0,n.useContext)(b.F),[x,j]=(0,h.fp)(u.AG.user_base_info),[f,y]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[S,C]=(0,n.useState)(!1),[N,$]=(0,n.useState)(!1),[V,B]=(0,h.fp)(u.AG.confirm),[P,F]=(0,n.useState)(""),[z,K]=(0,n.useState)(""),[X,O]=(0,n.useState)(""),[T,M]=(0,n.useState)([]),[q,D]=(0,n.useState)([]),[U,H]=(0,n.useState)([]),[W,R]=(0,n.useState)(""),[L,J]=(0,n.useState)(""),[Q,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,ae]=(0,n.useState)(""),[le,oe]=(0,n.useState)(!1),[re,de]=(0,n.useState)(""),[ce,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),me=(0,I.o)(),[_e,xe]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ye=async()=>{const e=await d.wm.get("all_users");if(e.code===c.m.Success){const t=e.data??[];if(je){const e=[];for(const s of t)`${s.id}${s.username}${s.cwd}${s.note}`.includes(je)&&e.push(s);y(e)}else y(t)}const t=await d.wm.get("all_roles");if(t.code===c.m.Success){xe(t.data),G.clear();for(const e of t.data)G.set(e.role_id,e)}},we=e=>{F(e?.username??""),K(e?.password??""),O(e?.cwd??""),M(e?.access_dirs??[]),D(e?.not_access_dirs??[]),H(e?.only_read_dirs??[]),R(e?.access_cmd??""),J(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),ae(e?.note??""),oe(e?.is_root??!1),de(e?.id??""),e?.bind_role_id?ge(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ye()},[]);const ge=(e,t=[])=>{if(!e)return he(""),void pe({});const s=G.get(e);if(s){if(s.cwd&&O(s.cwd),s.access_dirs&&s.access_dirs.length>0&&M(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&D(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&H(s.only_read_dirs),s.access_cmd&&R(s.access_cmd),s.not_access_cmd&&J(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}he(e),pe(s)}},be=()=>{if(!P)return void(0,v.zN)("username not empty");if((0,E.CB)(P))return void(0,v.zN)("username not empty char");if(!X)return void(0,v.zN)("cwd not empty");const e=new a.E0;return e.language=Q,e.theme=ee,e.access_dirs=T,e.username=P,e.password=z,e.not_access_dirs=q,e.only_read_dirs=U,e.cwd=X,e.note=ie,e.access_cmd=W,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=ce,e};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("用户")})}),rightTopCom:(0,k.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,k.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ye()}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C(!0),$(!1),we(void 0)}})]}),children:(0,k.jsx)(p.X,{headers:fe,rows:f.map((t,s)=>{const n=[(0,k.jsx)("p",{children:t.id}),(0,k.jsx)(l.xP,{children:t.username}),(0,k.jsx)(l.xP,{children:t.cwd}),(0,k.jsx)(l.xP,{children:t.note}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{C(!1),$(!0),we(e)})(t)}),!t.is_root&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{B({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new a.E0;s.username=t,(await d.wm.post("delete_user",s)).code===c.m.Success&&((0,v.SK)(e("删除完成")),ye(),B({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(S||N)&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{C(!1),$(!1),we(void 0)}}),S&&(0,k.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!z)return void(0,v.zN)("password not empty");if((0,E.CB)(z))return void(0,v.zN)("username not empty char");const t=be(),s=await d.wm.post("create_user",t);ye(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ye(),C(!1),$(!1),we(void 0))}}),N&&(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=be();if(!t)return;t.id=re;(await d.wm.post("save_user",t)).code===c.m.Success&&((0,v.SK)(e("保存完成")),ye())}})]}),children:[(0,k.jsx)("label",{children:e("用户名")}),(0,k.jsx)(r.Sm,{value:P,handleInputChange:e=>F(e)}),(0,k.jsx)("label",{children:e("密码")}),(0,k.jsx)(r.Sm,{type:"password",value:z,handleInputChange:e=>K(e)}),(0,k.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{M([...T,""])},title:"添加"}),e("目录范围")]}),(0,k.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:X,handleInputChange:e=>O(e)}),(T??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,M([...T])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),M([...T])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{D([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,D([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{q.splice(s,1),D([...q])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{H([...U,""])},title:e("添加")}),e("只读目录范围")]}),(U??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{U[s]=e,H([...U])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{U.splice(s,1),H([...U])},title:e("删除")})]},s)),(0,k.jsx)("label",{children:e("可执行的命令")}),(0,k.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>R(e)}),(0,k.jsx)("label",{children:e("禁止执行的命令")}),(0,k.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>J(e)}),!le&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)("label",{children:e("角色")}),(0,k.jsx)(r.l6,{value:ce,onChange:e=>{ge(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of _e)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,k.jsx)("label",{children:e("语言")}),(0,k.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:Q,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,k.jsx)("label",{children:e("主题")}),(0,k.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:me}),(0,k.jsx)(Z,{is_disable:e=>{if(!0===le)return!0;if(ce){const t=G.get(ce);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===le||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,A.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,k.jsx)("label",{children:e("备注")}),(0,k.jsx)(r.Sm,{value:ie,handleInputChange:e=>ae(e)})]})})})]})}function L(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s}=(0,n.useContext)(b.F),[m,x]=(0,n.useState)([]),[j,f]=(0,h.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[g,S]=(0,n.useState)(!1),[C,N]=(0,h.fp)(u.AG.confirm),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,z]=(0,n.useState)([]),[K,X]=(0,n.useState)([]),[O,T]=(0,n.useState)([]),[M,q]=(0,n.useState)(""),[D,U]=(0,n.useState)(""),[H,W]=(0,n.useState)(""),[E,G]=(0,n.useState)(""),[R,L]=(0,n.useState)([]),[J,Q]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,I.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await d.wm.get("all_roles");e.code===c.m.Success&&x(e.data)},ie=e=>{V(e?.role_name??""),P(e?.cwd??""),z(e?.access_dirs??[]),X(e?.not_access_dirs??[]),T(e?.only_read_dirs??[]),q(e?.access_cmd??""),U(e?.not_access_cmd??""),W(e?.language??""),G(e?.theme??""),L(e?.auth_list??[]),Q(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const ae=()=>{if(!$)return void(0,v.zN)("role_name not empty");const e=new a.E0;return e.language=H,e.theme=E,e.access_dirs=F,e.role_name=$,e.not_access_dirs=K,e.only_read_dirs=O,e.cwd=B,e.access_cmd=M,e.not_access_cmd=D,e.auth_list=R,e.role_note=Y,e};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("角色")})}),rightTopCom:(0,k.jsx)("div",{children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{w(!0),S(!1),ie(void 0)}})}),children:(0,k.jsx)(p.X,{headers:se,rows:m.map((t,s)=>{const n=[(0,k.jsx)("p",{children:t.role_id}),(0,k.jsx)(l.xP,{children:t.role_name}),(0,k.jsx)(l.xP,{children:t.role_note}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{w(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new a.E0;s.role_id=t,(await d.wm.post("delete_role",s)).code===c.m.Success&&((0,v.SK)(e("删除完成")),ne(),N({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(y||g)&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{w(!1),S(!1),ie(void 0)}}),y&&(0,k.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const t=ae();if(!t)return;const s=await d.wm.post("create_role",t);ne(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ne(),w(!1),S(!1),ie(void 0))}}),g&&(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=ae();if(!t)return;t.role_id=J;(await d.wm.post("save_role",t)).code===c.m.Success&&((0,v.SK)(e("保存完成")),ne())}})]}),children:[(0,k.jsx)("label",{children:e("角色名")}),(0,k.jsx)(r.Sm,{value:$,handleInputChange:e=>V(e)}),(0,k.jsx)("label",{children:e("角色备注")}),(0,k.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{z([...F,""])},title:"添加"}),e("目录范围")]}),(0,k.jsx)(r.Sm,{value:B,handleInputChange:e=>P(e)}),(F??[]).map((e,t)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{F[t]=e,z([...F])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{F.splice(t,1),z([...F])},title:"删除"})]},t)),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{X([...K,""])},title:"添加"}),e("禁止目录范围")]}),(K??[]).map((t,s)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:t,handleInputChange:e=>{K[s]=e,X([...K])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{K.splice(s,1),X([...K])},title:e("删除")})]},s)),(0,k.jsxs)("label",{children:[(0,k.jsx)(o.rA,{icon:"add",onClick:()=>{T([...O,""])},title:e("添加")}),e("只读目录范围")]}),(O??[]).map((e,t)=>(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{width:"90%"},children:(0,k.jsx)(r.Sm,{value:e,handleInputChange:e=>{O[t]=e,T([...O])}})}),(0,k.jsx)(o.rA,{icon:"delete",onClick:()=>{O.splice(t,1),T([...O])},title:"删除"})]},t)),(0,k.jsx)("label",{children:e("可执行的命令")}),(0,k.jsx)(r.Sm,{value:M,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,k.jsx)("label",{children:e("禁止执行的命令")}),(0,k.jsx)(r.Sm,{value:D,placeholder:"use blank split",handleInputChange:e=>U(e)}),(0,k.jsx)("label",{children:e("语言")}),(0,k.jsx)(r.l6,{value:H,onChange:e=>{W(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,k.jsx)("label",{children:e("主题")}),(0,k.jsx)(r.l6,{value:E,onChange:e=>{G(e)},options:te}),(0,k.jsx)(Z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==R?.find(t=>t===e),select_auth:e=>{R?(R.find(t=>t==e)?(0,A.I)(R,t=>t===e):R.push(e),L([...R])):L([e])}})]})})})]})}var J=s(93245);function Q(e){const{t}=(0,_.Bd)(),[s,i]=(0,n.useState)((e.children_list??[]).map(e=>({path:e.path,note:e.note}))),a=[t("编号"),t("目录"),t("备注")],d=()=>{i([...s,{path:"",note:""}])};(0,n.useEffect)(()=>{s?.length||d()});return(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:t("sub_dir")})}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:d}),(0,k.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:()=>{e.on_confirm(s.filter(e=>e.path))}}),(0,k.jsx)(o.rA,{icon:"close",title:t("取消"),onClick:e.on_cancel})]}),children:(0,k.jsx)(p.X,{headers:a,rows:s.map((e,n)=>[(0,k.jsx)("span",{children:n}),(0,k.jsx)(r.Sm,{value:e.path,handleInputChange:t=>{e.path=t},no_border:!0}),(0,k.jsx)(r.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,k.jsx)("div",{children:(0,k.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>{i(s.filter((e,t)=>t!==n))}})})]),width:"10rem"})})}function Y(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(b.F),[j,f]=(0,n.useState)([]),[w,g]=(0,h.fp)(u.AG.prompt_card),[S,C]=(0,n.useState)([]),[N,$]=(0,n.useState)([]),[V,B]=(0,n.useState)([]),[P,F]=(0,h.fp)(u.AG.user_base_info),z=(0,H.K)(),K=(0,I.o)(),X=[e("编号"),e("路径"),e("是否默认"),e("备注"),e("sub_dir")],O=[e("编号"),e("路径"),e("备注")],T=[e("编号"),e("命令"),e("父编号"),e("备注")],M=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,D]=(0,n.useState)(""),[U,W]=(0,n.useState)(""),[E,Z]=(0,n.useState)(""),[G,R]=(0,n.useState)(!1),[L,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)(""),[ie,ae]=(0,n.useState)(!1),[le,oe]=(0,n.useState)(""),[re,de]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await d.XO.get("filesSetting");e.code===c.m.Success&&(f(e.data.dirs),$(e.data.quick_cmd),B(e.data.file_quick_cmd));const t=await d.XO.get("protection_dir");t.code===c.m.Success&&C(t.data??[])})(),Y(P?.user_data?.language),te(P?.user_data?.theme),ne(P?.user_data?.upload_file_ignore);const e=P?.user_data?.editor_auto_save;ae(!!e?.enable),oe(null!=e?.interval?String(e.interval):""),de(e?.editors??[])},[]);const ce=(0,I.Q)();return(0,k.jsx)(n.Fragment,{children:(0,k.jsxs)(i.fI,{children:[(0,k.jsxs)(i.VP,{widthPer:33,children:[(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("修改密码"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!q||!U)return void(0,v.zN)(e("账号密码不能为空"));if(U!==E)return void(0,v.zN)(e("两次密码不一样"));const t=new a.tl;t.username=q,t.password=U,t.confirm_password=E,t.user_id=P.user_data.id;(await d.wm.post("updatePassword",t)).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,k.jsx)(r.Sm,{placeholder:e("新账号"),value:q,handleInputChange:e=>{D(e)}}),(0,k.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{W(e)}}),(0,k.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(e)}})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("个性化设置"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await d.XO.post(y.s.setting_sys_option_status_save,{type:m.Mu.private_sys_env,value:{language:L,theme:ee,upload_file_ignore:se}})).code===c.m.Success&&((0,v.SK)(e("修改成功")),s())}}),children:[e("语言"),(0,k.jsx)(r.l6,{value:L,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"},{title:"Deutsch",value:"de"},{title:"ドイツ語",value:"ja"},{title:"독일어",value:"ko"},{title:"Немецкий язык",value:"ru"},{title:"Allemand",value:"fr"},{title:"Alemán",value:"es"}]}),e("主题"),(0,k.jsx)(r.l6,{value:ee,onChange:e=>{te(e)},options:K}),(0,k.jsx)(r.Sm,{value:se,handleInputChange:e=>{ne(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{title:e("编辑器自动保存"),rightBottomCom:(0,k.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{const t=parseInt(String(le),10);if(isNaN(t)||t<1)return void(0,v.zN)(e("请输入不小于 1 的整数(秒)"));(await d.wm.post(y.s.user_save_private_attr,{is_editor_auto_save:!0,editor_auto_save:{enable:ie,interval:t,editors:re}})).code===c.m.Success&&((0,v.SK)(e("修改成功")),s())}}),children:[(0,k.jsx)(r.BC,{label:e("开启"),children:(0,k.jsx)(r.l6,{value:ie,onChange:e=>{ae(e)},options:z,no_border:!0})}),(0,k.jsx)(r.BC,{label:e("自动保存间隔(秒)"),children:(0,k.jsx)(r.Sm,{type:"number",value:le,handleInputChange:e=>{oe(e)},placeholder:"30",no_border:!0})}),(0,k.jsx)("h3",{children:e("编辑器")}),J.d.map(t=>(0,k.jsxs)("div",{children:[(0,k.jsx)("input",{type:"checkbox",checked:re.includes(t.id),onChange:e=>{const s=e.target.checked;de(s?[...re,t.id]:re.filter(e=>e!==t.id))}}),e(t.label)]},t.id))]})})]}),(0,k.jsxs)(i.VP,{children:[(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("文件夹路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件夹路径")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{f([...j,{note:"",default:!1,path:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<j.length;e++)j[e].index=e;(await d.XO.post("filesSetting/save",{dirs:j})).code===c.m.Success&&((0,v.SK)(e("保存成功")),x(),s())}})]}),children:(0,k.jsx)(p.X,{headers:X,rows:j.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<j.length;e++)j[e].default=e===s&&t,n.push(j[e]);f(n)})(0,e,s)},options:z,no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)("span",{children:t.children?.length??0}),0!==s&&(0,k.jsx)(o.rA,{icon:"folder_open",title:e("sub_dir"),onClick:()=>(e=>{g({open:!0,main_context_div:(0,k.jsx)(Q,{children_list:e.children,on_cancel:()=>{g({open:!1})},on_confirm:t=>{e.children=t,f([...j]),g({open:!1})}})})})(t)})]}),(0,k.jsx)("div",{children:0!==s&&(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{j.splice(e,1),f([...j])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&f((0,A.TI)(j,e,t))}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("个人保护路径")})," ",(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("保护目录")},title:e("信息")})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C([...S,{path:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("protection_dir/save",S)).code===c.m.Success&&((0,v.SK)(e("保存成功")),x())}})]}),children:(0,k.jsx)(p.X,{headers:O,rows:S.map((t,s)=>{const n=[(0,k.jsx)("div",{children:s}),(0,k.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{S.splice(e,1),C([...S])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{C((0,A.TI)(S,e,t))}})})]}),(0,k.jsxs)(i.xh,{children:[(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("目录快捷命令")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("目录快捷命令")},title:"info"})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...N,{cmd:"",note:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("filesSetting/save",{quick_cmd:N})).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}})]}),children:(0,k.jsx)(p.X,{headers:T,rows:N.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),$([...N])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{$((0,A.TI)(N,e,t))}})}),(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("文件快捷命令")}),(0,k.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件快捷命令")},title:"info"})]}),rightTopCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{B([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("filesSetting/save",{file_quick_cmd:V})).code===c.m.Success&&((0,v.SK)(e("保存成功")),s())}})]}),children:(0,k.jsx)(p.X,{headers:M,rows:V.map((t,s)=>{const n=[(0,k.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,k.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),B([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{B((0,A.TI)(V,e,t))}})})]})]})]})})}var ee=s(45907),te=s(90764),se=s(17903);function ne(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),[s,a]=(0,n.useState)([]),[r,c]=(0,n.useState)([]),[m,x]=(0,h.fp)(u.AG.mount_enabled),[j,f]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[g,b]=(0,n.useState)((0,te.v)()),S=async()=>{try{const[e,t]=await Promise.all([d.I2.post("list",{}),d.I2.post("credential/list",{})]);a(Array.isArray(e?.data)?e.data:[]),c(Array.isArray(t?.data)?t.data:[])}catch(e){}};(0,n.useEffect)(()=>{S(),(async()=>{try{const e=await d.I2.post("enabled/get",{});x(!0===e?.data)}catch(e){x(!1)}})()},[]);const C=(0,se.ln)(g.credential_id,r),A=()=>{f(!1),w(""),b((0,te.v)())};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("网盘挂载")})}),rightTopCom:(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(o.rA,{icon:!0===m?"cloud_done":"cloud_off",title:e(!0===m?"muntont":"muntoff"),selected:!0===m,onClick:async()=>{const t=!m;try{const s=await d.I2.post("enabled/set",{enabled:t}),n=!0===s?.data;x(n),(0,v.SK)(e(n?"挂载已启用":"挂载已停用"))}catch(e){}}}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A(),f(!0)}})]}),children:(0,k.jsx)(p.X,{headers:[e("编号"),e("备注"),e("挂载类型"),e("凭据"),e("账号"),e("操作")],rows:s.map((s,n)=>{const i=r.find(e=>e.id===s.credential_id),a=(i?.accounts??[]).find(e=>e.id===s.account_id);return[(0,k.jsx)("span",{children:n}),(0,k.jsx)(l.xP,{context:s.note||"-"}),(0,k.jsx)("p",{children:(c=s.driver,se.sI.find(e=>e.type===c)?.name??c)}),(0,k.jsx)(l.xP,{context:i?i.note:e("凭据已丢失")}),(0,k.jsx)(l.xP,{context:s.account_id?a?a.note||a.account_name||a.nickname||a.id:e("账号已丢失"):"-"}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{f(!0),w(e.id),b({driver:e.driver,mount_path:e.mount_path??"",credential_id:e.credential_id??"",account_id:e.account_id??"",root_dir:e.root_dir??"",note:e.note??"",color:e.color??se.OT,readonly:Boolean(e.readonly),forward_to_remote:Boolean(e.forward_to_remote)})})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async s=>{t({title:e("确认删除"),sub_title:s.mount_path,confirm_fun:async()=>{try{await d.I2.post("delete",{id:s.id}),(0,v.SK)(e("已删除")),await S()}catch(e){}}})})(s)})]})];var c})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:j&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e(y?"编辑":"添加")})}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{if(g.credential_id)try{const t=await d.I2.post("test",{id:y||void 0,driver:g.driver,credential_id:g.credential_id,account_id:g.account_id,root_dir:g.root_dir}),s=t?.data;s?.ok?(0,v.SK)(`${e("连接成功")}(${s.count??0})`):(0,v.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}else(0,v.zN)(e("请选择凭据"))}}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(g.credential_id)if(!C||g.account_id)if(g.mount_path.trim())try{await d.I2.post(y?"update":"add",{id:y||void 0,driver:g.driver,mount_path:g.mount_path,credential_id:g.credential_id,account_id:C?g.account_id:void 0,root_dir:g.root_dir,note:g.note,color:g.color,readonly:g.readonly,enabled:!0,forward_to_remote:"tcp_proxy"===g.driver&&Boolean(g.forward_to_remote)}),(0,v.SK)(e("保存成功")),await S()}catch(e){}else(0,v.zN)(e("munt_rq"));else(0,v.zN)(e("请选择账号"));else(0,v.zN)(e("请选择凭据"))}}),(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:A})]}),children:(0,k.jsx)(te.A,{value:g,onChange:b,creds:r})})})})]})}function ie(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(i.xh,{children:(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,k.jsx)(ne,{})})})}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("网盘挂载")}),children:(0,k.jsx)("p",{children:e("nmuntpr")})})})})}var ae=s(47996);function le(e){const{src:t,name:s,size:i=1.5,show_name:a=!0,label:l,label_width:o,className:r}=e,[d,c]=(0,n.useState)(!1);(0,n.useEffect)(()=>{c(!1)},[t]);const h={width:`${i}rem`,height:`${i}rem`,borderRadius:"50%",flexShrink:0,verticalAlign:"middle"},u=["avatar",r].filter(Boolean).join(" "),p=t&&!d?(0,k.jsx)("img",{className:u,style:{...h,objectFit:"cover"},src:t,alt:s??"",referrerPolicy:"no-referrer",onError:()=>c(!0)}):(0,k.jsx)("span",{className:`${u} avatar--fallback`,style:{...h,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(s??"").trim().charAt(0).toUpperCase()||"?"}),m=a&&s?(0,k.jsxs)("span",{className:"avatar-with-name",children:[p,(0,k.jsx)("span",{className:"avatar__name",children:s})]}):p;if(void 0===l)return m;const _={whiteSpace:"nowrap",flex:"0 0 auto",textAlign:"right"};return o&&(_.width=o),(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,k.jsx)("label",{style:_,children:l}),(0,k.jsx)("div",{style:{flex:1,minWidth:0},children:m})]})}const oe=[{type:"webdav",name:"WebDAV",fields:[{key:"webdav_url",label:"Service URL",type:"text",required:!0,placeholder:"https://example.com/dav"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text"},{key:"password",label:"Password",type:"password",tip:"Use an app password for services like Nutstore or Synology"}]},{type:"ssh",name:"SSH / SFTP",fields:[{key:"ssh_host",label:"Host",type:"text",required:!0},{key:"ssh_port",label:"Port",type:"text",placeholder:"Default 22"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text",required:!0},{key:"password",label:"Password",type:"password",tip:"Can be left empty when a private key is set"},{key:"private_key",label:"Private key",type:"textarea",tip:"Takes precedence over the password when filled"}]},{type:"smb",name:"SMB / Windows share",fields:[{key:"smb_server",label:"Host",type:"text",required:!0,placeholder:"192.168.1.10 or nas.local"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text"},{key:"password",label:"Password",type:"password"}]},{type:"s3",name:"S3 compatible storage",fields:[{key:"s3_endpoint",label:"Endpoint",type:"text",required:!0,placeholder:"https://s3.amazonaws.com",tip:"Use the endpoint of your provider, e.g. Alibaba OSS, Tencent COS or MinIO"},{key:"s3_region",label:"Region",type:"text",placeholder:"us-east-1"},{key:"s3_force_path_style",label:"Force path style",type:"switch",tip:"Usually required by MinIO"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"AccessKey",type:"text",required:!0},{key:"secret_key",label:"SecretKey",type:"password",required:!0}]},{type:"baidu",name:"Baidu Netdisk",fields:[{key:"baidu_app_id",label:"AppID",type:"text"},{key:"baidu_app_key",label:"AppKey",type:"text",required:!0},{key:"baidu_secret_key",label:"SecretKey",type:"password",required:!0}],accounts:!0,account_key:"account_name",account_fields:[]},{type:"local",name:"Local directory",fields:[],sources:!0},{type:"tcp_proxy",name:"TCP proxy FileCat",fields:[{key:"tcp_client_num_id",label:"Proxy client",type:"text",required:!0,options_source:"tcp_client",tip:"Pick one from the TCP proxy client list"},{key:"tcp_base_url",label:"Remote base_url",type:"text",placeholder:"/pre",tip:"Only needed when the remote FileCat has a base_url configured"}],accounts:!0,account_key:"account_name",account_fields:[{key:"account_name",label:"Username",type:"text",required:!0},{key:"password",label:"Password",type:"password"}]}];const re="webdav",de="@authorize",ce={baidu:[{keys:["baidu_app_id","baidu_app_key","baidu_secret_key"],on_next:"save_app"},{keys:[de]}],tcp_proxy:[{keys:["tcp_client_num_id"],on_next:"save_app"},{keys:["@tcp_account"]}]};function he(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),[,s]=(0,h.fp)(u.AG.prompt_card),[a,c]=(0,n.useState)([]),[m,x]=(0,n.useState)([]),[j,f]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[g,b]=(0,n.useState)(re),[S,C]=(0,n.useState)(""),[A,I]=(0,n.useState)({}),[N,$]=(0,n.useState)({}),[V,B]=(0,n.useState)("oob"),[P,F]=(0,n.useState)(""),[z,K]=(0,n.useState)(""),[X,O]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[q,D]=(0,n.useState)([]),[U,H]=(0,n.useState)(!0),W=async()=>{try{const e=await d.I2.post("credential/list",{}),t=Array.isArray(e?.data)?e.data:[];return c(t),x(oe),t}catch(e){return[]}},E=async e=>{const t=(await W()).find(t=>t.id===e);t&&D(t.accounts??[])};(0,n.useEffect)(()=>{W()},[]);const Z=m.find(e=>e.type===g),G=Z?.fields??[],R=!0===Z?.sources,L=!0===Z?.accounts,J=Z?.account_fields??[],Q=q,Y=(e,t)=>{D(s=>s.map((s,n)=>n===e?{...s,...t}:s))},te=()=>{D(e=>[...e,{id:"",account_name:"",password:"",secret_key:""}])},ne=(e,t)=>{D(s=>s.map((s,n)=>n===e?{...s,...t}:s))},ie=ce[g],he=()=>{f(!1),w(""),b(re),C(""),I({}),D([]),F(""),H(!0)},ue=async e=>{const t=Array.from(new Set(e.map(e=>e.options_source).filter(e=>Boolean(e)))),s={};for(const e of t){const t=await d.I2.post("credential/options",{source:e});s[e]=(t?.data??[]).map(e=>({label:e.label,value:e.value}))}$(s)},pe=async()=>{try{const e=await d.I2.post("baidu/authorize_url",{id:y,mode:V});e?.data&&window.open(e.data,"_blank","noopener,noreferrer")}catch(e){}},me=async()=>{if(P.trim())try{const t=await d.I2.post("baidu/exchange",{id:y,code:P.trim(),mode:V});(0,v.SK)(`${e("授权成功")}:${t?.data?.baidu_name??""}`),F(""),await E(y)}catch(e){}else(0,v.zN)(e("请填写授权码"))},_e=async()=>{if(z.trim())if(X.trim())try{const t=await d.I2.post("baidu/import",{id:y,uk:z.trim(),access_token:X.trim(),refresh_token:T.trim()});(0,v.SK)(`${e("添加成功")}:${t?.data?.baidu_name??""}`),K(""),O(""),M(""),await E(y)}catch(e){}else(0,v.zN)(e("请填写 access_token"));else(0,v.zN)(e("请填写账号 id"))},xe=async t=>{try{const s={credential_id:y};t.id&&(s.account_id=t.id),void 0!==t.note&&(s.note=t.note);for(const e of J){const n=t[e.key];null!=n&&(s[e.key]=String(n))}const n=await d.I2.post("credential/account_save",s);(0,v.SK)(e("保存成功"));const i=n?.data;D(e=>e.map(e=>e===t?{...e,...i}:e))}catch(e){}},je=async t=>{try{const s={credential_id:y};t.id&&(s.account_id=t.id);for(const e of J){const n=t[e.key];null!=n&&(s[e.key]=String(n))}const n=await d.I2.post("credential/account_verify",s),i=n?.data??{};i.ok?(0,v.SK)(e("账号可用")):(0,v.zN)(`${e("账号不可用")}:${i.error??""}`)}catch(e){}},ve=s=>{if(!s.id)return n=q.indexOf(s),void D(e=>e.filter((e,t)=>t!==n));var n;t({title:e("确认删除"),sub_title:s.note||s.account_name||s.id,confirm_fun:async()=>{try{await d.I2.post("credential/account_remove",{credential_id:y,account_id:s.id}),(0,v.SK)(e("已删除")),await E(y)}catch(e){}}})};return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("网盘凭据")}),(0,k.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{s({open:!0,title:e("信息"),context_div:(0,k.jsxs)("div",{children:[(0,k.jsxs)("ul",{children:[(0,k.jsx)("li",{children:e("crd_tp")}),(0,k.jsx)("li",{children:e("pwdkept")}),(0,k.jsx)("li",{children:e("tstbfrs")})]}),(0,k.jsxs)("ul",{children:[(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"WebDAV"}),":",e("prtwbdv")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"SSH / SFTP"}),":",e("prtsftp")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"S3 兼容对象存储"}),":",e("prt_s3")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"SMB"}),":",e("prt_smb")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:"百度网盘"}),":",e("prt_bd")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:e("内网穿透 FileCat")}),":",e("prt_tcp")]}),(0,k.jsxs)("li",{children:[(0,k.jsx)("b",{children:e("本地目录")}),":",e("prt_local")]})]})]})})}})]}),rightTopCom:(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{he(),f(!0)}})}),children:(0,k.jsx)(p.X,{headers:[e("编号"),e("备注"),e("类型"),e("操作")],rows:a.map((s,n)=>{return[(0,k.jsx)("span",{children:n}),(0,k.jsx)(l.xP,{context:s.note||"-"}),(0,k.jsx)(l.xP,{context:(i=s.type,m.find(e=>e.type===i)?.name??i)}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{f(!0),w(e.id),b(e.type),C(e.note??""),I({webdav_url:e.webdav_url,ssh_host:e.ssh_host,ssh_port:e.ssh_port,ssh_private_key:e.ssh_private_key,smb_server:e.smb_server,s3_endpoint:e.s3_endpoint,s3_region:e.s3_region,s3_force_path_style:e.s3_force_path_style,baidu_app_id:e.baidu_app_id,baidu_app_key:e.baidu_app_key,baidu_secret_key:e.baidu_secret_key,tcp_client_num_id:e.tcp_client_num_id,tcp_base_url:e.tcp_base_url}),D(e.accounts??[]),F(""),K(""),O(""),M(""),H(!1!==e.enabled);const t=m.find(t=>t.type===e.type)?.fields??[];t.some(e=>e.options_source)&&ue(t).catch(()=>{})})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async s=>{t({title:e("确认删除"),sub_title:s.note,confirm_fun:async()=>{try{await d.I2.post("credential/delete",{id:s.id}),(0,v.SK)(e("已删除")),await W()}catch(e){}}})})(s)})]})];var i})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("凭据")})}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=(t=>{if(!S.trim())return e("请填写备注");for(const s of G){if(!1===t.includes(s.key))continue;const n=String(A[s.key]??"").trim();if(s.required&&!n)return e(s.label)}})(G.map(e=>e.key));if(t)(0,v.zN)(`${e("请填写")}${t}`);else{if(R){const t=new Set;for(const s of Q){const n=String(s.account_name??"").trim(),i=String(s.path??"").trim();if(!n||!i)return void(0,v.zN)(e("源目录的名称和路径都不能为空"));if(t.has(n))return void(0,v.zN)(`${e("源目录名称重复")}:${n}`);t.add(n)}}if(L)for(const t of q)for(const s of J)if(s.required&&!String(t[s.key]??"").trim())return void(0,v.zN)(`${e("请填写")}${e(s.label)}`);try{const t=await d.I2.post(y?"credential/update":"credential/add",{id:y||void 0,type:g,note:S,...A,enabled:U});(0,v.SK)(e("保存成功"));const s=y||t.data?.id;if(!y&&t.data?.id&&w(t.data.id),(L||R)&&s)for(const e of q){if(e.id)continue;const t={credential_id:s};void 0!==e.note&&(t.note=e.note);const n=R?["account_name","path"]:J.map(e=>e.key);for(const s of n){const n=e[s];null!=n&&(t[s]=String(n))}const i=await d.I2.post("credential/account_save",t);Object.assign(e,i?.data??{})}await W()}catch(e){}}}}),(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:he})]}),children:[(0,k.jsx)(r.Sm,{placeholder:e("备注"),value:S,handleInputChange:C}),(0,k.jsx)(r.l6,{value:g,options:m.map(e=>({title:e.name,value:e.type})),onChange:e=>{b(e),I({}),$({}),F("");const t=m.find(t=>t.type===e)?.fields??[];t.some(e=>e.options_source)&&ue(t)}}),!R&&G.map(t=>{const s=A[t.key];return t.options_source?(0,k.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,k.jsx)(r.l6,{value:String(s??""),options:N[t.options_source]??[],onChange:e=>I({...A,[t.key]:e})})},t.key):"switch"===t.type?(0,k.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,k.jsx)(r.l6,{value:!0===s?"on":"off",options:[{title:e("开启"),value:"on"},{title:e("关闭"),value:"off"}],onChange:e=>I({...A,[t.key]:"on"===e})})},t.key):(0,k.jsx)(n.Fragment,{children:(0,k.jsx)(r.Sm,{type:"password"===t.type?"password":"text",placeholder:t.label,value:String(s??""),handleInputChange:e=>I({...A,[t.key]:e})})},t.key)})]})}),ie?.[1]?.keys?.includes(de)&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("授权")})}),children:(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("授权方式"),label_width:"6rem",children:(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(r.U6,{name:"baidu_auth_mode",value:"one_click",context:e("一键授权"),selected:"one_click"===V,onchange:()=>B("one_click")}),(0,k.jsx)(r.U6,{name:"baidu_auth_mode",value:"oob",context:e("outh_ob"),selected:"oob"===V,onchange:()=>B("oob")})]})}),"oob"===V&&(0,k.jsx)(r.BC,{label:e("授权码"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴授权码 code"),value:P,handleInputChange:F})}),(0,k.jsxs)("div",{className:"div-row",children:[(0,k.jsx)(o.rA,{icon:"open_in_new",title:e("去授权"),onClick:pe}),"oob"===V&&(0,k.jsx)(o.rA,{icon:"check",title:e("完成授权"),onClick:me})]}),(0,k.jsx)(r.BC,{label:e("手动添加"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("账号 id(uk)"),value:z,handleInputChange:K})}),(0,k.jsx)(r.BC,{label:e("access_token"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴 access_token"),value:X,handleInputChange:O})}),(0,k.jsx)(r.BC,{label:e("refresh_token"),label_width:"6rem",children:(0,k.jsx)(r.Sm,{placeholder:e("粘贴 refresh_token"),value:T,handleInputChange:M})}),(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加账号"),onClick:_e})})]},de)})}),R&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("目录")})}),children:[(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{D(e=>[...e,{id:"",account_name:"",path:""}])}})}),Q.map((t,s)=>(0,k.jsxs)(ae.d,{title:`#${s+1}`,toolbar:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async t=>{const s=q[t];if(y)try{const n={credential_id:y};s.id&&(n.account_id=s.id),void 0!==s.note&&(n.note=s.note),void 0!==s.account_name&&(n.account_name=String(s.account_name)),void 0!==s.path&&(n.path=String(s.path));const i=await d.I2.post("credential/account_save",n);(0,v.SK)(e("保存成功"));const a=i?.data;D(e=>e.map((e,s)=>s===t?{...e,...a}:e))}catch(e){}else(0,v.zN)(e("请先保存凭据"))})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{ve(q[e])})(s)})]}),children:[(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:t.note??"",handleInputChange:e=>Y(s,{note:e})})}),(0,k.jsx)(r.BC,{label:e("名称"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("目录"),value:t.account_name??"",handleInputChange:e=>Y(s,{account_name:e})})}),(0,k.jsx)(r.BC,{label:e("目录"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:e("本地绝对路径"),value:t.path,handleInputChange:e=>Y(s,{path:e})})})]},s))]})}),L&&(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("账号")})}),children:(0,k.jsxs)(n.Fragment,{children:[J.length>0&&(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:te})}),q.map((t,s)=>(0,k.jsxs)(ae.d,{title:(0,k.jsx)(k.Fragment,{children:(0,k.jsx)("span",{children:`${e("账号")} #${s+1}`})}),toolbar:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>xe(t)}),(0,k.jsx)(o.rA,{icon:"network_check",title:e("验证"),onClick:()=>je(t)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)})]}),children:[(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:t.note??"",handleInputChange:e=>ne(s,{note:e})})}),J.map(n=>(0,k.jsx)(r.BC,{label:e(n.label),label_width:"7rem",required:n.required,children:"textarea"===n.type?(0,k.jsx)(r.Z2,{style:{width:"100%",height:"6rem"},placeholder:n.placeholder?e(n.placeholder):"",value:String(t[n.key]??""),handleInputChange:e=>ne(s,{[n.key]:e})}):(0,k.jsx)(r.Sm,{type:"password"===n.type?"password":"text",placeholder:n.placeholder?e(n.placeholder):"",value:String(t[n.key]??""),handleInputChange:e=>ne(s,{[n.key]:e})})},n.key)),t.id&&void 0!==t.token&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(le,{src:t.avatar_url,name:t.nickname||t.account_name,label:e("头像"),label_width:"7rem"}),(0,k.jsx)(r.BC,{label:e("百度账号"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.account_name||t.id})}),(0,k.jsx)(r.BC,{label:e("授权状态"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.token?e("已授权"):e("未授权")})}),(0,k.jsx)(r.BC,{label:e("授权时间"),label_width:"7rem",children:(0,k.jsx)("p",{children:t.token?.obtained_at?(0,se.eK)(t.token.obtained_at):"-"})})]})]},t.id??s))]})})})]})})," "]})}function ue(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(i.xh,{children:(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,k.jsx)(he,{})})})}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(i.VP,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("网盘凭据")}),children:(0,k.jsx)("p",{children:e("nmuntpr")})})})})}const pe=[{value:"sftp",label:"SFTP"},{value:"webdav",label:"WebDAV"},{value:"smb",label:"SMB"}];function me(){const{t:e}=(0,_.Bd)(),t=(0,ee.y)(),s=(0,f.T)(),[a,c]=(0,n.useState)([]),[h,u]=(0,n.useState)("none"),[m,x]=(0,n.useState)(""),[j,y]=(0,n.useState)("sftp"),[w,g]=(0,n.useState)(""),[b,S]=(0,n.useState)(0),[C,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,z]=(0,n.useState)([{share_name:"",path:"",readonly:!1}]),[K,X]=(0,n.useState)(""),[O,T]=(0,n.useState)(""),[M,q]=(0,n.useState)([{url_path:"",path:"",readonly:!1}]),[D,U]=(0,n.useState)([{username:"",password:"",path:"",readonly:!1}]),H=async()=>{const e=await d.od.post("list",{});c(e?.data??[])};(0,n.useEffect)(()=>{H()},[]);const W=()=>{x(""),y("sftp"),g(""),S(0),A(!1),N(""),V(""),P(""),z([{share_name:"",path:"",readonly:!1}]),X(""),T(""),q([{url_path:"",path:"",readonly:!1}]),U([{username:"",password:"",path:"",readonly:!1}])},E=()=>{u("none"),W()},Z=e=>"smb"===e?F:"webdav"===e?M:D,G=(e,t)=>{"smb"!==e?"webdav"!==e?U(t):q(t):z(t)},R=(e,t,s)=>{G(e,Z(e).map((e,n)=>n===t?{...e,...s}:e))},L=e=>"smb"===e.type?(e.smb?.shares??[]).map(e=>e.share_name).join(", "):"webdav"===e.type?(e.webdav?.shares??[]).map(e=>e.url_path).join(", "):(e.sftp?.shares??[]).map(e=>e.username).join(", ");return(0,k.jsxs)(i.fI,{children:[(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,k.jsx)(i.xh,{children:(0,k.jsx)(l.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:e("文件服务")})}),rightTopCom:(0,k.jsx)("div",{className:"div-row",children:(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{W(),S(2022),u("add")}})}),children:(0,k.jsx)(p.X,{headers:[e("状态"),e("备注"),e("协议"),e("端口"),e("共享"),e("操作")],rows:a.map((s,n)=>{return[(0,k.jsx)(o.Ay,{checked:s.running,title:e("启用"),onChange:t=>(async(t,s)=>{await d.od.post(s?"start":"stop",{id:t.id}),(0,v.SK)(e(s?"已启用":"已禁用")),await H()})(s,t)}),(0,k.jsx)(l.xP,{children:s.note||"-"}),(0,k.jsx)("p",{children:(i=s.type,pe.find(e=>e.value===i)?.label??i)}),(0,k.jsx)("p",{children:s.port}),(0,k.jsx)(l.xP,{children:L(s)||"-"}),(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{W(),x(e.id),y(e.type),g(e.note),S(e.port),A(e.readonly),N(e.smb?.hostname??""),V(e.smb?.username??""),P(e.smb?.password??""),z(e.smb?.shares?.length?e.smb.shares.map(e=>({...e})):[{share_name:"",path:"",readonly:!1}]),X(e.webdav?.username??""),T(e.webdav?.password??""),q(e.webdav?.shares?.length?e.webdav.shares.map(e=>({...e})):[{url_path:"",path:"",readonly:!1}]),U(e.sftp?.shares?.length?e.sftp.shares.map(e=>({...e})):[{username:"",password:"",path:"",readonly:!1}]),u("edit")})(s)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(s=>{t({title:e("确认删除"),confirm_fun:async()=>{await d.od.post("delete",{id:s.id}),(0,v.SK)(e("删除成功")),m===s.id&&E(),await H()}})})(s)})]})];var i})})})})}),(0,k.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:"none"!==h&&(0,k.jsx)(i.xh,{children:(0,k.jsxs)(l.Zp,{self_title:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsx)("h2",{children:e("add"===h?"添加":"编辑")}),(0,k.jsx)(o.rA,{icon:"info",title:e("说明"),onClick:()=>s(e("smb_known_issue_tip"))})]}),rightBottomCom:(0,k.jsxs)("div",{children:[(0,k.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:E}),(0,k.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t={type:j,note:w,port:Number(b),readonly:C};"smb"===j&&(t.smb={hostname:I,username:$,password:B,shares:F}),"webdav"===j&&(t.webdav={username:K,password:O,shares:M}),"sftp"===j&&(t.sftp={shares:D}),m?(t.id=m,await d.od.post("update",t)):await d.od.post("add",t),(0,v.SK)(e("保存成功")),E(),await H()}})]}),children:[(0,k.jsx)(r.BC,{label:e("协议"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.l6,{value:j,options:pe,onChange:e=>y(e)})}),(0,k.jsx)(r.BC,{label:e("端口"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:"1-65535",value:String(b||""),handleInputChange:e=>S(Number(e)||0)})}),(0,k.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{value:w,handleInputChange:g})}),(0,k.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,k.jsx)(o.Ay,{checked:C,onChange:A})}),"webdav"===j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:K,handleInputChange:X})}),(0,k.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{type:"password",value:O,handleInputChange:T})})]}),"smb"===j&&(0,k.jsxs)(n.Fragment,{children:[(0,k.jsx)(r.BC,{label:e("主机名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{value:I,handleInputChange:N})}),(0,k.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:$,handleInputChange:V})}),(0,k.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,k.jsx)(r.Sm,{type:"password",value:B,handleInputChange:P})})]}),Z(j).map((t,s)=>(0,k.jsxs)(ae.d,{title:e("sftp"===j?"账号":"共享")+` #${s+1}`,toolbar:(0,k.jsxs)(k.Fragment,{children:["smb"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("共享名")}),(0,k.jsx)(r.Sm,{value:t.share_name,no_border:!0,width:"8rem",placeholder:"share",handleInputChange:e=>R(j,s,{share_name:e})})]}),"webdav"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("路径")}),(0,k.jsx)(r.Sm,{value:t.url_path,no_border:!0,width:"8rem",placeholder:"docs",handleInputChange:e=>R(j,s,{url_path:e})})]}),"sftp"===j&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{children:e("用户名")}),(0,k.jsx)(r.Sm,{value:t.username,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{username:e})}),(0,k.jsx)("span",{children:e("密码")}),(0,k.jsx)(r.Sm,{type:"password",value:t.password,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{password:e})})]}),(0,k.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>(e=>{const t="smb"===e?{share_name:"",path:"",readonly:!1}:"webdav"===e?{url_path:"",path:"",readonly:!1}:{username:"",password:"",path:"",readonly:!1};G(e,[...Z(e),t])})(j)}),(0,k.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>((e,t)=>{G(e,Z(e).filter((e,s)=>s!==t))})(j,s)})]}),children:[(0,k.jsx)(r.BC,{label:e("目录"),label_width:"7rem",required:!0,children:(0,k.jsx)(r.Sm,{placeholder:e("对外提供的本地绝对路径"),value:t.path,handleInputChange:e=>R(j,s,{path:e})})}),(0,k.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,k.jsx)(o.Ay,{checked:t.readonly,onChange:e=>R(j,s,{readonly:e})})})]},s))]})})})]})}function _e(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(a.oV.file_mount)?(0,k.jsx)(me,{}):(0,k.jsx)(i.fI,{children:(0,k.jsx)(l.Zp,{self_title:(0,k.jsx)("h2",{children:e("文件服务")}),children:(0,k.jsx)("p",{children:e("没有权限")})})})}var xe=s(87361);function je(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)(),s=[{index:2,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,k.jsx)(Y,{})}];return t(a.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,k.jsx)(C,{})}),t(a.oV.sys_env_page)&&s.push({index:3,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,k.jsx)(W,{})}),t(a.oV.file_mount)&&(s.push({index:5,name:e("网盘凭据"),rto:"credential_setting/",component:(0,k.jsx)(ue,{})}),s.push({index:5,name:e("网盘挂载"),rto:"mount_setting/",component:(0,k.jsx)(ie,{})})),t(a.oV.file_server)&&s.push({index:6,name:e("文件服务"),rto:"file_server_setting/",component:(0,k.jsx)(_e,{})}),t(a.oV.user_manage)&&s.push({index:7,name:e("用户管理"),rto:"user_manager/",component:(0,k.jsx)(R,{})}),t(a.oV.role_manage)&&s.push({index:8,name:e("角色管理"),rto:"role_manager/",component:(0,k.jsx)(L,{})}),(0,k.jsx)(i.W1,{optionList:s,father_route:xe.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),a=s(74777),l=s(96540),o=s(22022),r=s(23430),d=s(14284),c=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:l}=(0,o.Bd)();return e=>{let n;e===a.jk.ffmpeg?n=(0,c.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===a.jk.smartmontools?n=(0,c.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,c.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,c.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,c.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,c.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,c.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,c.jsx)("div",{children:(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,c.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,c.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,c.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,c.jsx)("div",{children:(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,c.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,c.jsxs)("li",{children:[(0,c.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,c.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,c.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,c.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,c.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,c.jsxs)("div",{children:[(0,c.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,c.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,c.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,c.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,c.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,l.useState)([]);return(0,l.useEffect)(()=>{(async()=>{try{const e=await d.XO.get("themes");if(0===e.code){const s=e.data||[];u=[...r.Ky,...s],t(u)}else console.warn("获取主题列表失败,使用默认列表"),t(u)}catch(e){t(u)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>l});var n=s(72635);const i=1440,a=525600;function l(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<a?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/a).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){s.d(t,{K:()=>i});var n=s(22022);const i=()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7759],{45601(A,e,s){"use strict";s.r(e),s.d(e,{default:()=>G});var a=s(96540),t=s(22022),c=s(34843),d=s(82893),l=s(14944),o=s(92275),r=s(14284),Y=s(53459),i=s(61443),n=s(85997),p=s(83029),B=s(4412),j=(s(82341),s(91568)),h=s(18257),S=s.n(h),u=s(59096),f=s(62042),x=s(74777),y=s(78247),m=s(23430),z=s(74848);let N;function G(){const{t:A}=(0,t.Bd)(),[e,s]=(0,a.useState)(void 0),[h,G]=(0,a.useState)(!1),[P,k]=(0,c.fp)(d.AG.user_base_info),{check_user_auth:H}=(0,y.MH)(),g=(0,a.useRef)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{N&&(N.pause(),N.unload(),N.detachMediaElement(),N.destroy(),N=null),w.current&&w.current.dispose()},[]);const L=s=>{G(!0),(async e=>{P.sysSoftWare&&P.sysSoftWare[x.jk.ffmpeg]&&P.sysSoftWare[x.jk.ffmpeg].installed?(w.current=(0,j.default)(g.current,{controls:!0,width:640,height:360}),S().isSupported()?(N=S().createPlayer({type:"flv",url:u.I.getOtherWebSocketUrl(o.HK.rtsp_get,{url:e}),isLive:!0}),N.attachMediaElement(g.current),N.load(),N.load()):(0,f.zN)("FLV.js is not supported in this browser.")):(0,f.zN)(A("ff_none"))})(s.address?s.address:e)};return(0,z.jsxs)("div",{children:[(0,z.jsxs)(B.aZ,{position:"right",children:[(0,z.jsx)(i.$Z,{max_width:"40rem",placeholder:A(" rtsp://username:password@ip:port/path"),icon:"link",value:e,handleInputChange:A=>s(A)}),!h&&(0,z.jsx)(n.rA,{icon:"play_arrow",title:A("连接"),onClick:L}),h&&(0,z.jsx)(n.rA,{icon:"close",title:A("关闭"),onClick:async()=>{await l.ws.sendData(o.HK.rdp_disconnect,""),G(!1)}})]}),!h&&(0,z.jsx)(p.N,{have_auth_edit:H(m.oV.rtsp_proxy_tag_update),getItems:async()=>{const A=await r.K4.get("tag");return A.code===Y.m.Success?A.data:[]},save:async e=>{(await r.K4.post("tag/save",e)).code!==Y.m.Success&&(0,f.zN)(A("网络错误"))},clickItem:async A=>{s(A.address),L(A)},items:[{key:"name",preName:A("名字")},{key:"address",preName:A("地址")},{key:"color",preName:"color"}]}),(0,z.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}}),(0,z.jsx)("div",{style:{display:h?"block":"none"},children:(0,z.jsx)("video",{ref:g,className:"video-js vjs-default-skin"})})]})}},17422(A){"use strict";A.exports="data:application/font-woff;charset=utf-8;base64,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"},80542(){}}]);