filecat 7.27.0 → 7.27.3

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 (25) hide show
  1. package/build/dist/{1317.6fd3354a8ea9df744438.js → 1317.88c4debdc07e0dc950c2.js} +1 -1
  2. package/build/dist/{1636.2be7829caf415f5ac3ef.js → 1636.72a76243c352d7b14b86.js} +1 -1
  3. package/build/dist/{2502.4a025e24ceade6fe41d2.js → 2502.c8f9f2c98369af4a1a3c.js} +1 -1
  4. package/build/dist/{259.c3d200599bc8d98f81bc.js → 259.a205a786acd6321cf443.js} +1 -1
  5. package/build/dist/{3659.068bbdd237be9cbcb260.js → 3659.6d636b2698d3b12a31b9.js} +1 -1
  6. package/build/dist/{3753.7cc36f8a982a052cbdc7.js → 3753.d78d7ec8d40588a28593.js} +1 -1
  7. package/build/dist/3884.9fbc20ef46caa60d805a.js +1 -0
  8. package/build/dist/5574.2f9e5b3f43901da83741.js +1 -0
  9. package/build/dist/{7133.cf2a4a51286b78a653af.js → 7133.867e3e82cd874862ec1f.js} +1 -1
  10. package/build/dist/{8603.f1cbcfd64cde885f9809.js → 8603.8fd3023b066ebaf71bfc.js} +1 -1
  11. package/build/dist/{8765.c91328121327a9359893.js → 8765.44f7008caa0a952f2c65.js} +1 -1
  12. package/build/dist/{9546.9692a1544a1c17aa0467.js → 9546.f1c334f1614f2cdcc91b.js} +1 -1
  13. package/build/dist/index.html +1 -1
  14. package/build/dist/main.f73b97bc561e0c3f5f91.js +2 -0
  15. package/build/main.js +1 -1
  16. package/package.json +7 -7
  17. package/shell/build.js +13 -24
  18. package/shell/config/webpack.exe.config.js +2 -2
  19. package/shell/config/webpack.npm.config.js +2 -2
  20. package/shell/dev.js +1 -1
  21. package/shell/filecat-watch +1 -1
  22. package/build/dist/1629.3d855a7e2ad5567924e4.js +0 -1
  23. package/build/dist/3884.bdde4e88356129e80bd1.js +0 -1
  24. package/build/dist/main.262952a5e81044442376.js +0 -2
  25. /package/build/dist/{main.262952a5e81044442376.js.LICENSE.txt → main.f73b97bc561e0c3f5f91.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5574],{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:()=>a});var n=s(96540),i=s(61443),l=s(74848);function a(e){const[t,s]=n.useState([]),a=(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=()=>{a.current=-1,r(-1),c(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let a=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(a=`${t} (${n.label})`)}return(0,l.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,l.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},s)})})}),(0,l.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,l.jsx)("tr",{className:n?(o===s?"row-dragging":"")+(d===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(a.current=s,r(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",c(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=a.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,l.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function o(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,l.jsx)("div",{children:e},t))})}},95574(e,t,s){s.r(t),s.d(t,{default:()=>je});var n=s(96540),i=s(75725),l=s(23430),a=s(70447),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),b=s(18840),w=s(6960),g=s(7523),C=s(74848);function S(){const{t:e}=(0,_.Bd)(),[,t]=(0,h.fp)(u.AG.prompt_card),[s,i]=(0,n.useState)(""),[l,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,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("网页代理")}),(0,C.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{t({open:!0,title:e("信息"),context_div:(0,C.jsx)("div",{children:(0,C.jsx)("div",{children:e("wbvpn_tip")})})})}})]}),rightBottomCom:(0,C.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(l)||5610,browser_proxy_port_end:Number(j)||5710}})).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,C.jsx)("div",{children:e("wbvpn_allow")}),(0,C.jsx)(r.Z2,{style:{minHeight:"5rem",resize:"vertical"},placeholder:e("wbvpn_allow_ph"),value:s,onChange:e=>{i(e.target.value)}}),(0,C.jsx)("div",{children:e("wbvpn_port_range")}),(0,C.jsx)(p.S,{isFlex:!0,columns:[(0,C.jsx)(r.Sm,{placeholder:"5610",value:l,handleInputChange:e=>x(e)}),(0,C.jsx)("span",{style:{padding:"0 6px"},children:"-"}),(0,C.jsx)(r.Sm,{placeholder:"5710",value:j,handleInputChange:e=>f(e)})]})]})}function k(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(""),[k,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(!1),[B,P]=(0,n.useState)(""),[F,K]=(0,h.fp)(u.AG.prompt_card),[,X]=(0,h.fp)(u.AG.editorSetting),[z,O]=(0,n.useState)(m.aM.close),[T,q]=(0,n.useState)(!1),[M,E]=(0,n.useState)(m.Hb.independent),D=(0,f.T)(),[H,U]=(0,n.useState)(void 0),[W,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)(g.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),l(s?.logo||""),A(s?.show_login_user_info),N(s?.http_proxy||""),Z(s?.control_env_str||b.CU)}const s=await d.XO.get("token");if(s.code===c.m.Success){const e=s.data;if(!e)return;e.length&&U(e.length),e.mode&&O(e.mode),void 0!==e.persist&&q(e.persist),void 0!==e.session_mode&&E(e.session_mode)}};(0,n.useEffect)(()=>{te()},[]);return(0,C.jsxs)("div",{children:[(0,C.jsx)(x.aZ,{children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("span",{className:"credits",children:[G("系统运行于"),": ",(0,w.s)(J.runing_time_length)]}),(0,C.jsx)("span",{className:"credits",children:(0,C.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:7.27.3",null!=J.latest_version&&"7.27.3"!==J.latest_version?` -> ${J.latest_version}`:""]})}),(0,C.jsx)("span",{className:"credits",children:(0,C.jsx)("a",{href:G("官网地址"),target:"_blank",children:`filecat ${G("功能文档")}`})}),(0,C.jsxs)("span",{className:"credits",children:[G("安装方式")," :",J.process_env_run_env]})]})}),(0,C.jsx)(i.xh,{children:(0,C.jsxs)(i.fI,{children:[(0,C.jsxs)(i.VP,{widthPer:33,children:[(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:G("通用设置")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{K({open:!0,title:G("信息"),context_div:(0,C.jsx)("div",{children:(0,C.jsx)("div",{children:G("sys_env_setting_tip")})})})},title:G("信息")})]}),rightBottomCom:(0,C.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:k,http_proxy:I,logo:s}})).code===c.m.Success&&((0,v.SK)(G("修改成功")),ee())}}),rightTopCom:(0,C.jsx)(o.rA,{icon:"tune",title:G("环境控制"),onClick:()=>{j.xK.set_value_temp(W||b.CU),X({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,C.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),G("网站 Logo"),(0,C.jsx)(r.Sm,{placeholder:G("lclorur"),value:s,handleInputChange:e=>{l(e)}}),G("lgn_usr"),(0,C.jsx)("input",{type:"checkbox",checked:k,onChange:()=>{A(!k)}})]}),(0,C.jsx)(S,{})]}),(0,C.jsxs)(i.VP,{widthPer:33,children:[(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:G("文件回收站")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{K({open:!0,title:G("信息"),context_div:(0,C.jsx)("div",{children:G("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:G("信息")})]}),rightBottomCom:(0,C.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,C.jsx)(r.Sm,{placeholder:G("目录"),value:B,handleInputChange:e=>{P(e)}}),(0,C.jsx)(r.l6,{value:$,onChange:e=>{V(e)},options:[{title:G("开启"),value:!0},{title:G("关闭"),value:!1}]})]}),(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:G("会话token设置")}),(0,C.jsx)(o.rA,{icon:"info",title:G("登录会话"),onClick:()=>D(L)})]}),rightBottomCom:(0,C.jsx)(p.S,{isFlex:!0,columns:[(0,C.jsx)(o.C3,{text:G("清空token"),clickFun:async()=>{(await d.XO.get("token/clear")).code===c.m.Success&&(0,v.SK)(G("清理完成,重新登录"))}}),(0,C.jsx)(o.C3,{text:G("保存"),clickFun:async()=>{const e=new m.Gd;e.mode=z,e.persist=T,e.session_mode=M,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,C.jsxs)("div",{className:"form_group",children:[(0,C.jsx)("div",{className:"form_label",children:G("过期策略")}),(0,C.jsx)(p.S,{isFlex:!0,columns:[(0,C.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("默认"),selected:z===m.aM.close,onchange:()=>{O(m.aM.close)}}),(0,C.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("指定时间"),selected:z===m.aM.length,onchange:()=>{O(m.aM.length)}}),(0,C.jsx)(r.U6,{name:"token_time_mode",value:1,context:G("永不过期"),selected:z===m.aM.forver,onchange:()=>{O(m.aM.forver)}})]}),z===m.aM.length&&(0,C.jsx)(r.Sm,{placeholder:G("秒"),value:H,handleInputChange:e=>{U(e)}}),(0,C.jsx)(r.GL,{context:G("持久化"),selected:T,onchange:()=>q(!T)})]}),(0,C.jsxs)("div",{className:"form_group",children:[(0,C.jsx)("div",{className:"form_label",children:G("登录会话")}),(0,C.jsx)(p.S,{isFlex:!0,columns:[(0,C.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.independent,context:G("独立token"),selected:M===m.Hb.independent,onchange:()=>E(m.Hb.independent)}),(0,C.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.reuse,context:G("复用token"),selected:M===m.Hb.reuse,onchange:()=>E(m.Hb.reuse)}),(0,C.jsx)(r.U6,{name:"token_session_mode",value:m.Hb.single,context:G("单会话"),selected:M===m.Hb.single,onchange:()=>E(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(","),l=[];for(const e of i){const n=Number(e.trim());if(!Number.isInteger(n)||n<t||n>s)return null;l.push(n)}return 0===l.length?null:{mode:"list",values:l}}function K(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 X(e){return e<10?`0${e}`:`${e}`}function z(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:l,week:a}=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)=>`${X(e)}:${X(t[s])}`).join("、")):1===e.length&&1===t.length?r.push(`${X(e[0])}:${X(t[0])}`):r.push(`${e.map(X).join("、")} 时 ${t.join("、")} 分`)}else if("list"===n.mode&&"step"===s.mode&&o(t,0))r.push(`${(n.values??[]).map(X).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=z(n,"时"),l=z(s,"分"),a=o(t,0)?null:z(t,"秒");i&&e.push(i),l&&e.push(l),a&&e.push(a),e.length>0&&r.push(e.join(" "))}const d="list"===i.mode&&1===(i.values??[]).length?i.values[0]:null,c="list"===l.mode&&1===(l.values??[]).length?l.values[0]:null,h="list"===a.mode&&1===(a.values??[]).length?a.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"!==l.mode&&e.push(z(l,"月")),"every"!==i.mode&&e.push(z(i,"号")),"every"!==a.mode&&e.push(`星期 ${z(a,"")}`),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 q(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 M=({label:e,field:t,min:s,max:i,pad:l,week_label:a,onChange:o})=>{const d=(0,n.useMemo)(()=>q(s,i,l),[s,i,l]),c=(0,n.useMemo)(()=>{if(!a)return d;const e=["周日","周一","周二","周三","周四","周五","周六","周日"];return d.map(t=>({value:t.value,label:`${t.value} (${e[t.value]})`}))},[d,a]);return(0,C.jsxs)("div",{className:"cron-field",children:[(0,C.jsx)("span",{className:"cron-field__label",children:e}),(0,C.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,C.jsxs)("div",{className:"cron-field__param",children:[(0,C.jsx)("span",{children:"每"}),(0,C.jsx)(r.l6,{value:t.step??1,onChange:e=>o({mode:"step",step:e}),options:q(1,i),no_border:!0,width:"4.5rem"}),(0,C.jsx)("span",{children:e})]}),"range"===t.mode&&(0,C.jsxs)("div",{className:"cron-field__param",children:[(0,C.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,C.jsx)("span",{children:"到"}),(0,C.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,C.jsxs)("div",{className:"cron-field__param cron-field__param--list",children:[(t.values??[]).map((e,s)=>(0,C.jsxs)("span",{className:"cron-tag",children:[(0,C.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,C.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,C.jsx)("i",{className:"material-icons cron-tag__add",onClick:()=>{const e=[...t.values??[]],n=new Set(e);let l=s;for(;n.has(l)&&l<i;)l++;o({mode:"list",values:[...e,l]})},children:"add"})]})]})};const E=[{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]}})}],D=({value:e,onChange:t,no_border:s})=>{const[i,l]=(0,n.useState)(!1),a=(0,n.useRef)(null),o=(0,n.useRef)(null),r=(0,n.useMemo)(()=>K(e??"")??{second:{mode:"every"},minute:{mode:"every"},hour:{mode:"every"},day:{mode:"every"},month:{mode:"every"},week:{mode:"every"}},[e]),d=!!e&&!K(e??""),c=(0,$.r)({active:i,trigger_ref:a,floating_ref:o,width:384,max_height:26});(0,N.$)(i,[a,o],()=>l(!1));const h=e=>{t(P(e))};return(0,C.jsxs)("div",{className:"cron-input "+(i?"cron-input--open":""),children:[(0,C.jsxs)("div",{ref:a,className:"cron-input__display "+(s?"cron-input__display--no-border":""),title:d?"表达式格式不正确":`${e||""} ${O(r)}`.trim(),onClick:()=>l(!i),children:[(0,C.jsx)("span",{className:"cron-input__expr "+(d?"cron-input__expr--invalid":""),children:e||"(未设置)"}),!s&&(0,C.jsx)("span",{className:"cron-input__desc",children:d?"表达式格式不正确":O(r)}),(0,C.jsx)("i",{className:"material-icons cron-input__arrow",children:"arrow_drop_down"})]}),i&&(0,C.jsxs)("div",{ref:o,className:"cron-editor",style:{left:c.left,top:c.top,...c.css_vars,visibility:c.ready?"visible":"hidden"},children:[(0,C.jsxs)("div",{className:"cron-editor__scroll",children:[(0,C.jsxs)("div",{className:"cron-editor__row",children:[(0,C.jsx)("span",{className:"cron-editor__title",children:"常用"}),(0,C.jsx)("div",{className:"cron-editor__presets",children:E.map(e=>(0,C.jsx)("button",{className:"cron-preset",onClick:()=>h(e.make()),children:e.label},e.label))})]}),(0,C.jsx)("div",{className:"cron-editor__fields",children:V.map(e=>(0,C.jsx)(M,{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,C.jsxs)("div",{className:"cron-editor__footer",children:[(0,C.jsx)("span",{className:"cron-editor__preview",children:P(r)}),(0,C.jsx)("button",{className:"cron-editor__done",onClick:()=>l(!1),children:"完成"})]})]})]})};var H=s(24659);function U(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(g.F),[m,x]=(0,n.useState)([]),[f,y]=(0,n.useState)([]),[b,w]=(0,h.fp)(u.AG.prompt_card),[,S]=(0,h.fp)(u.AG.editorSetting),[k,N]=(0,n.useState)([]),[$,V]=(0,n.useState)([]),[B,P]=(0,n.useState)([]),[F,K]=(0,n.useState)([]),[X,z]=(0,n.useState)(""),[O,T]=(0,n.useState)([]),q=(0,H.K)(),M=[e("软件"),e("是否安装"),e("路径")],E=[e("编号"),e("路径"),e("备注")],U=[e("编号"),e("路径"),e("是否开启"),e("备注")],W=[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&&K(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&&z(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,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("up_conc")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.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,C.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("保存成功")),l())}})]}),children:(0,C.jsx)(p.X,{headers:Z,rows:$.map((t,s)=>{const n=[(0,C.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,C.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,V([...$])},options:q,no_border:!0}),(0,C.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,C.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,C.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,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.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,C.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("Workflow Job")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...F,{open:!1}])}}),(0,C.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,C.jsx)(p.X,{headers:W,rows:F.map((t,s)=>{const n=[(0,C.jsx)("div",{children:s}),(0,C.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,C.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,K([...F])},options:q,no_border:!0}),(0,C.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,K([...F])},options:q,no_border:!0}),(0,C.jsx)(D,{value:t.cron_str,onChange:e=>{t.cron_str=e,K([...F])},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{F.splice(e,1),K([...F])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{K((0,A.TI)(F,e,t))}})})}),(0,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,C.jsxs)(i.xh,{children:[(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("PATH")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await d.XO.get("env/process/view");t.code===c.m.Success?w({open:!0,title:e("进程环境变量"),context_div:(0,C.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,C.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,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...B,{path:"",note:""}])}}),(0,C.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,C.jsx)(p.X,{headers:U,rows:B.map((t,s)=>{const n=[(0,C.jsx)("div",{children:s}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...B])},options:q,no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.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,C.jsx)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("PTY CMD")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,C.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await d.XO.post("pty_cmd/save",{str:X})).code===c.m.Success&&((0,v.SK)(e("保存成功")),l())}}),children:(0,C.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:X,handleInputChange:e=>{z(e)}})}),(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("插件配置")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{T([...O,{name:"",path:"",note:"",open:!1}])}}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:Y})]}),children:(0,C.jsx)(p.X,{headers:G,rows:O.map((t,s)=>{const n=[s,(0,C.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,T([...O])},options:q,no_border:!0}),(0,C.jsx)(o.mu,{icon:"edit",value:t.params,save:async e=>{t.params=e,await Y()},title:""}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.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,C.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,C.jsxs)(i.xh,{children:[(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("系统保护路径")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...k,{path:"",note:""}])}}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("protection_dir/sys/save",k)).code===c.m.Success&&((0,v.SK)(e("保存成功")),l())}})]}),children:(0,C.jsx)(p.X,{headers:E,rows:k.map((t,s)=>{const n=[(0,C.jsx)("div",{children:s}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),N([...k])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{N((0,A.TI)(k,e,t))}})}),(0,C.jsx)(a.uF,{title:e("外部软件"),rightTopCom:(0,C.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,C.jsx)(p.X,{headers:M,rows:f.map((t,s)=>[(0,C.jsx)("div",{children:t.id}),(0,C.jsx)(a.fq,{ok:t.installed}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("use_env")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}var W=s(21499);function Z(e){const{t,i18n:s}=(0,_.Bd)(),[i,a]=(0,h.fp)(u.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("dc_ctdl"),permission:l.oV.docker_container_update},{title:t("dc_idl"),permission:l.oV.docker_images_delete},{title:t("systemd管理"),permission:l.oV.systemd},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("ai_page"),permission:l.oV.ai_agent_page},{title:t("sw_mdl"),permission:l.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("log_del"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("log_wr"),permission:l.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:l.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:l.oV.recycle_file_save},{title:t("文件分享"),permission:l.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:l.oV.sys_setting_page},{title:t("tk_time"),permission:l.oV.token_update},{title:t("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key},{title:t("md_set"),permission:l.oV.md_editor_setting},{title:t("目录挂载"),permission:l.oV.file_mount},{title:t("文件服务"),permission:l.oV.file_server}]},{title:t("系统环境设置"),list:[{title:t("sys_env"),permission:l.oV.sys_env_page},{title:t("up_lim"),permission:l.oV.dir_upload_max_num},{title:t("path_md"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("path_up"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("pxy_off"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("浏览器代理编辑"),permission:l.oV.browser_proxy_edit},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("wf_run"),permission:l.oV.workflow_exe},{title:t("wf_user"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("端口扫描"),permission:l.oV.port_scan},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh_sv"),permission:l.oV.crypto_ssh_file},{title:t("cmd_rst"),permission:l.oV.shell_cmd_filecat_restart},{title:t("cmd_upg"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("cmd_dwn"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("cmd_ai"),permission:l.oV.ai_chat_cmd}]}];return(0,C.jsx)(n.Fragment,{children:o.map((t,s)=>(0,C.jsxs)("div",{children:[(0,C.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,C.jsxs)("div",{children:[(0,C.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)(g.F),[x,j]=(0,h.fp)(u.AG.user_base_info),[f,y]=(0,n.useState)([]),[b,w]=(0,h.fp)(u.AG.prompt_card),[S,k]=(0,n.useState)(!1),[N,$]=(0,n.useState)(!1),[V,B]=(0,h.fp)(u.AG.confirm),[P,F]=(0,n.useState)(""),[K,X]=(0,n.useState)(""),[z,O]=(0,n.useState)(""),[T,q]=(0,n.useState)([]),[M,E]=(0,n.useState)([]),[D,H]=(0,n.useState)([]),[U,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,le]=(0,n.useState)(""),[ae,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)}},be=e=>{F(e?.username??""),X(e?.password??""),O(e?.cwd??""),q(e?.access_dirs??[]),E(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??[]),le(e?.note??""),oe(e?.is_root??!1),de(e?.id??""),e?.bind_role_id?we(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ye()},[]);const we=(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&&q(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&E(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)}},ge=()=>{if(!P)return void(0,v.zN)("username not empty");if((0,W.CB)(P))return void(0,v.zN)("username not empty char");if(!z)return void(0,v.zN)("cwd not empty");const e=new l.E0;return e.language=Q,e.theme=ee,e.access_dirs=T,e.username=P,e.password=K,e.not_access_dirs=M,e.only_read_dirs=D,e.cwd=z,e.note=ie,e.access_cmd=U,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=ce,e};return(0,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("用户")})}),rightTopCom:(0,C.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,C.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ye()}}),(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{k(!0),$(!1),be(void 0)}})]}),children:(0,C.jsx)(p.X,{headers:fe,rows:f.map((t,s)=>{const n=[(0,C.jsx)("p",{children:t.id}),(0,C.jsx)(a.xP,{children:t.username}),(0,C.jsx)(a.xP,{children:t.cwd}),(0,C.jsx)(a.xP,{children:t.note}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{k(!1),$(!0),be(e)})(t)}),!t.is_root&&(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{B({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new l.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,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(S||N)&&(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{k(!1),$(!1),be(void 0)}}),S&&(0,C.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!K)return void(0,v.zN)("password not empty");if((0,W.CB)(K))return void(0,v.zN)("username not empty char");const t=ge(),s=await d.wm.post("create_user",t);ye(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ye(),k(!1),$(!1),be(void 0))}}),N&&(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=ge();if(!t)return;t.id=re;(await d.wm.post("save_user",t)).code===c.m.Success&&((0,v.SK)(e("保存完成")),ye())}})]}),children:[(0,C.jsx)("label",{children:e("用户名")}),(0,C.jsx)(r.Sm,{value:P,handleInputChange:e=>F(e)}),(0,C.jsx)("label",{children:e("密码")}),(0,C.jsx)(r.Sm,{type:"password",value:K,handleInputChange:e=>X(e)}),(0,C.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{q([...T,""])},title:"添加"}),e("目录范围")]}),(0,C.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:z,handleInputChange:e=>O(e)}),(T??[]).map((t,s)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,q([...T])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),q([...T])},title:e("删除")})]},s)),(0,C.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{E([...M,""])},title:e("添加")}),e("禁止目录范围")]}),(M??[]).map((t,s)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{M[s]=e,E([...M])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{M.splice(s,1),E([...M])},title:e("删除")})]},s)),(0,C.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{H([...D,""])},title:e("添加")}),e("只读目录范围")]}),(D??[]).map((t,s)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{D[s]=e,H([...D])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{D.splice(s,1),H([...D])},title:e("删除")})]},s)),(0,C.jsx)("label",{children:e("可执行的命令")}),(0,C.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:U,placeholder:"use blank split",handleInputChange:e=>R(e)}),(0,C.jsx)("label",{children:e("禁止执行的命令")}),(0,C.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>J(e)}),!ae&&(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)("label",{children:e("角色")}),(0,C.jsx)(r.l6,{value:ce,onChange:e=>{we(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,C.jsx)("label",{children:e("语言")}),(0,C.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,C.jsx)("label",{children:e("主题")}),(0,C.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:me}),(0,C.jsx)(Z,{is_disable:e=>{if(!0===ae)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===ae||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,C.jsx)("label",{children:e("备注")}),(0,C.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function L(){const{t:e,i18n:t}=(0,_.Bd)(),{initUserInfo:s}=(0,n.useContext)(g.F),[m,x]=(0,n.useState)([]),[j,f]=(0,h.fp)(u.AG.prompt_card),[y,b]=(0,n.useState)(!1),[w,S]=(0,n.useState)(!1),[k,N]=(0,h.fp)(u.AG.confirm),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,K]=(0,n.useState)([]),[X,z]=(0,n.useState)([]),[O,T]=(0,n.useState)([]),[q,M]=(0,n.useState)(""),[E,D]=(0,n.useState)(""),[H,U]=(0,n.useState)(""),[W,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??""),K(e?.access_dirs??[]),z(e?.not_access_dirs??[]),T(e?.only_read_dirs??[]),M(e?.access_cmd??""),D(e?.not_access_cmd??""),U(e?.language??""),G(e?.theme??""),L(e?.auth_list??[]),Q(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!$)return void(0,v.zN)("role_name not empty");const e=new l.E0;return e.language=H,e.theme=W,e.access_dirs=F,e.role_name=$,e.not_access_dirs=X,e.only_read_dirs=O,e.cwd=B,e.access_cmd=q,e.not_access_cmd=E,e.auth_list=R,e.role_note=Y,e};return(0,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("角色")})}),rightTopCom:(0,C.jsx)("div",{children:(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),S(!1),ie(void 0)}})}),children:(0,C.jsx)(p.X,{headers:se,rows:m.map((t,s)=>{const n=[(0,C.jsx)("p",{children:t.role_id}),(0,C.jsx)(a.xP,{children:t.role_name}),(0,C.jsx)(a.xP,{children:t.role_note}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const s=new l.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,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(y||w)&&(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),S(!1),ie(void 0)}}),y&&(0,C.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const t=le();if(!t)return;const s=await d.wm.post("create_role",t);ne(),s.code===c.m.Success&&((0,v.SK)(e("创建完成")),ne(),b(!1),S(!1),ie(void 0))}}),w&&(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=le();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,C.jsx)("label",{children:e("角色名")}),(0,C.jsx)(r.Sm,{value:$,handleInputChange:e=>V(e)}),(0,C.jsx)("label",{children:e("角色备注")}),(0,C.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,C.jsxs)("label",{children:[(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{K([...F,""])},title:"添加"}),e("目录范围")]}),(0,C.jsx)(r.Sm,{value:B,handleInputChange:e=>P(e)}),(F??[]).map((e,t)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{value:e,handleInputChange:e=>{F[t]=e,K([...F])}})}),(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{F.splice(t,1),K([...F])},title:"删除"})]},t)),(0,C.jsxs)("label",{children:[(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{z([...X,""])},title:"添加"}),e("禁止目录范围")]}),(X??[]).map((t,s)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{value:t,handleInputChange:e=>{X[s]=e,z([...X])}})}),(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{X.splice(s,1),z([...X])},title:e("删除")})]},s)),(0,C.jsxs)("label",{children:[(0,C.jsx)(o.rA,{icon:"add",onClick:()=>{T([...O,""])},title:e("添加")}),e("只读目录范围")]}),(O??[]).map((e,t)=>(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("div",{style:{width:"90%"},children:(0,C.jsx)(r.Sm,{value:e,handleInputChange:e=>{O[t]=e,T([...O])}})}),(0,C.jsx)(o.rA,{icon:"delete",onClick:()=>{O.splice(t,1),T([...O])},title:"删除"})]},t)),(0,C.jsx)("label",{children:e("可执行的命令")}),(0,C.jsx)(r.Sm,{value:q,placeholder:"use blank split",handleInputChange:e=>M(e)}),(0,C.jsx)("label",{children:e("禁止执行的命令")}),(0,C.jsx)(r.Sm,{value:E,placeholder:"use blank split",handleInputChange:e=>D(e)}),(0,C.jsx)("label",{children:e("语言")}),(0,C.jsx)(r.l6,{value:H,onChange:e=>{U(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,C.jsx)("label",{children:e("主题")}),(0,C.jsx)(r.l6,{value:W,onChange:e=>{G(e)},options:te}),(0,C.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}))),l=[t("编号"),t("目录"),t("备注")],d=()=>{i([...s,{path:"",note:""}])};(0,n.useEffect)(()=>{s?.length||d()});return(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:t("sub_dir")})}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:d}),(0,C.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:()=>{e.on_confirm(s.filter(e=>e.path))}}),(0,C.jsx)(o.rA,{icon:"close",title:t("取消"),onClick:e.on_cancel})]}),children:(0,C.jsx)(p.X,{headers:l,rows:s.map((e,n)=>[(0,C.jsx)("span",{children:n}),(0,C.jsx)(r.Sm,{value:e.path,handleInputChange:t=>{e.path=t},no_border:!0}),(0,C.jsx)(r.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,C.jsx)("div",{children:(0,C.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)(g.F),[j,f]=(0,n.useState)([]),[b,w]=(0,h.fp)(u.AG.prompt_card),[S,k]=(0,n.useState)([]),[N,$]=(0,n.useState)([]),[V,B]=(0,n.useState)([]),[P,F]=(0,h.fp)(u.AG.user_base_info),K=(0,H.K)(),X=(0,I.o)(),z=[e("编号"),e("路径"),e("是否默认"),e("备注"),e("sub_dir")],O=[e("编号"),e("路径"),e("备注")],T=[e("编号"),e("命令"),e("父编号"),e("备注")],q=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[M,E]=(0,n.useState)(""),[D,U]=(0,n.useState)(""),[W,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,le]=(0,n.useState)(!1),[ae,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&&k(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;le(!!e?.enable),oe(null!=e?.interval?String(e.interval):""),de(e?.editors??[])},[]);const ce=(0,I.Q)();return(0,C.jsx)(n.Fragment,{children:(0,C.jsxs)(i.fI,{children:[(0,C.jsxs)(i.VP,{widthPer:33,children:[(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{title:e("修改密码"),rightBottomCom:(0,C.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!M||!D)return void(0,v.zN)(e("账号密码不能为空"));if(D!==W)return void(0,v.zN)(e("两次密码不一样"));const t=new l.tl;t.username=M,t.password=D,t.confirm_password=W,t.user_id=P.user_data.id;(await d.wm.post("updatePassword",t)).code===c.m.Success&&(0,v.SK)(e("修改成功"))}}),children:[(0,C.jsx)(r.Sm,{placeholder:e("新账号"),value:M,handleInputChange:e=>{E(e)}}),(0,C.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{U(e)}}),(0,C.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(e)}})]})}),(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{title:e("个性化设置"),rightBottomCom:(0,C.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,C.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,C.jsx)(r.l6,{value:ee,onChange:e=>{te(e)},options:X}),(0,C.jsx)(r.Sm,{value:se,handleInputChange:e=>{ne(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{title:e("编辑器自动保存"),rightBottomCom:(0,C.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{const t=parseInt(String(ae),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,C.jsx)(r.BC,{label:e("开启"),children:(0,C.jsx)(r.l6,{value:ie,onChange:e=>{le(e)},options:K,no_border:!0})}),(0,C.jsx)(r.BC,{label:e("自动保存间隔(秒)"),children:(0,C.jsx)(r.Sm,{type:"number",value:ae,handleInputChange:e=>{oe(e)},placeholder:"30",no_border:!0})}),(0,C.jsx)("h3",{children:e("编辑器")}),J.d.map(t=>(0,C.jsxs)("div",{children:[(0,C.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,C.jsxs)(i.VP,{children:[(0,C.jsxs)(i.xh,{children:[(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("文件夹路径")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件夹路径")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{f([...j,{note:"",default:!1,path:""}])}}),(0,C.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,C.jsx)(p.X,{headers:z,rows:j.map((t,s)=>{const n=[(0,C.jsx)("div",{children:s}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.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:K,no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)("span",{children:t.children?.length??0}),0!==s&&(0,C.jsx)(o.rA,{icon:"folder_open",title:e("sub_dir"),onClick:()=>(e=>{w({open:!0,main_context_div:(0,C.jsx)(Q,{children_list:e.children,on_cancel:()=>{w({open:!1})},on_confirm:t=>{e.children=t,f([...j]),w({open:!1})}})})})(t)})]}),(0,C.jsx)("div",{children:0!==s&&(0,C.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,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("个人保护路径")})," ",(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{ce("保护目录")},title:e("信息")})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{k([...S,{path:"",note:""}])}}),(0,C.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,C.jsx)(p.X,{headers:O,rows:S.map((t,s)=>{const n=[(0,C.jsx)("div",{children:s}),(0,C.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{S.splice(e,1),k([...S])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{k((0,A.TI)(S,e,t))}})})]}),(0,C.jsxs)(i.xh,{children:[(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("目录快捷命令")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{ce("目录快捷命令")},title:"info"})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...N,{cmd:"",note:""}])}}),(0,C.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,C.jsx)(p.X,{headers:T,rows:N.map((t,s)=>{const n=[(0,C.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.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,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("文件快捷命令")}),(0,C.jsx)(o.rA,{icon:"info",onClick:()=>{ce("文件快捷命令")},title:"info"})]}),rightTopCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{B([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,C.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,C.jsx)(p.X,{headers:q,rows:V.map((t,s)=>{const n=[(0,C.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,C.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.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(16445),te=s(45907),se=s(17903);function ne(){const{t:e}=(0,_.Bd)(),t=(0,te.y)(),[s,l]=(0,n.useState)([]),[c,h]=(0,n.useState)([]),[u,m]=(0,n.useState)([]),[x,j]=(0,n.useState)(!1),[f,y]=(0,n.useState)(""),[b,w]=(0,n.useState)("webdav"),[g,S]=(0,n.useState)(""),[k,A]=(0,n.useState)(""),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,K]=(0,n.useState)(!1),X=async()=>{try{const[e,t,s]=await Promise.all([d.I2.post("list",{}),d.I2.post("credential/list",{}),d.I2.post("driver/list",{})]);l(Array.isArray(e?.data)?e.data:[]),h(Array.isArray(t?.data)?t.data:[]),m(Array.isArray(s?.data)?s.data:[])}catch(e){}};(0,n.useEffect)(()=>{X()},[]);const z=(0,se.p_)(k,c),O=(0,se.ln)(k,c),T=()=>{j(!1),y(""),w("webdav"),S(""),A(""),N(""),V(""),P(""),K(!1)},q=u.find(e=>e.type===b),M="share"===q?.location,E="local"===q?.location,D=(c.find(e=>e.id===k)?.local_sources??[]).map(e=>({title:`${e.name}(${e.path})`,value:e.name}));return(0,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("网盘挂载")})}),rightTopCom:(0,C.jsx)("div",{className:"div-row",children:(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{T(),j(!0)}})}),children:(0,C.jsx)(p.X,{headers:[e("编号"),e("备注"),e("挂载类型"),e("凭据"),e("账号"),e("操作")],rows:s.map((s,n)=>{const i=c.find(e=>e.id===s.credential_id),l=(i?.accounts??[]).find(e=>e.id===s.account_id);return[(0,C.jsx)("span",{children:n}),(0,C.jsx)(a.xP,{context:s.note||"-"}),(0,C.jsx)("p",{children:(r=s.driver,u.find(e=>e.type===r)?.name??r)}),(0,C.jsx)(a.xP,{context:i?i.note:e("凭据已丢失")}),(0,C.jsx)(a.xP,{context:s.account_id?l?l.note||l.account_name||l.nickname||l.id:e("账号已丢失"):"-"}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{j(!0),y(e.id),w(e.driver),S(e.mount_path??""),A(e.credential_id??""),N(e.account_id??""),V(e.root_dir??""),P(e.note??""),K(Boolean(e.forward_to_remote))})(s)}),(0,C.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 X()}catch(e){}}})})(s)})]})];var r})})})})}),(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:x&&(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e(f?"编辑":"添加")})}),rightBottomCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{if(k)try{const t=await d.I2.post("test",{id:f||void 0,driver:b,credential_id:k,account_id:I,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,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(k)if(!O||I)if(g.trim())try{await d.I2.post(f?"update":"add",{id:f||void 0,driver:b,mount_path:g,credential_id:k,account_id:O?I:void 0,root_dir:$,note:B,color:se.OT,readonly:!1,enabled:!0,forward_to_remote:F}),(0,v.SK)(e("保存成功")),T(),await X()}catch(e){}else(0,v.zN)(e("munt_rq"));else(0,v.zN)(e("请选择账号"));else(0,v.zN)(e("请选择凭据"))}}),(0,C.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:T})]}),children:[(0,C.jsx)(r.BC,{label:e("挂载类型"),label_width:"6rem",children:(0,C.jsx)(r.l6,{value:b,options:u.map(e=>({title:e.name,value:e.type})),onChange:e=>{w(e),A(""),N(""),V("")}})}),(0,C.jsx)(r.BC,{label:e("凭据"),label_width:"6rem",required:!0,children:(0,C.jsx)(r.l6,{value:k,options:(H=b,(0,se.XT)(H,c)),onChange:e=>{A(e),N(""),V("")}})}),O&&(0,C.jsx)(r.BC,{label:e("账号"),label_width:"6rem",required:!0,children:(0,C.jsx)(r.l6,{value:I,options:z,onChange:N})}),(0,C.jsx)(r.BC,{label:e("本地目录"),label_width:"6rem",required:!0,children:(0,C.jsx)(r.Sm,{placeholder:e("被挂载的本地绝对路径"),value:g,handleInputChange:S})}),M&&(0,C.jsx)(r.BC,{label:e("s3_bucket"===q?.location_label?"存储桶":"共享目录"),label_width:"6rem",required:!0,children:(0,C.jsx)(ee.A,{driver:b,credential_id:k,account_id:I,require_account:O,editable:!0,value:$,onChange:V})}),E&&(0,C.jsxs)(r.BC,{label:e("源目录"),label_width:"6rem",required:!0,children:[(0,C.jsx)(r.l6,{value:$,options:D,placeholder:e("选择源目录"),onChange:e=>V(e)}),(0,C.jsx)(r.Sm,{value:String($??""),placeholder:e("src_dir_ph"),handleInputChange:e=>V(String(e??"").trim())})]}),!M&&!E&&(0,C.jsx)(r.BC,{label:e("smb"===b||"s3"===b?"子路径":"baidu"===b?"网盘目录":"tcp_proxy"===b?"对端目录":"目录"),label_width:"6rem",children:(0,C.jsx)(ee.A,{driver:b,credential_id:k,account_id:I,require_account:O,editable:!0,editable_placeholder:"sftp"===b?e("sftp_path_ph"):void 0,value:$,onChange:V})}),(0,C.jsx)(r.BC,{label:e("备注"),label_width:"6rem",children:(0,C.jsx)(r.Sm,{placeholder:e("列表显示的名称"),value:B,handleInputChange:P})}),"tcp_proxy"===b&&(0,C.jsx)(r.BC,{label:e("ftr2rmt"),label_width:"6rem",children:(0,C.jsx)(o.Ay,{checked:F,onChange:K,title:e("ftr2rmt_tip")})})]})})})]});var H}function ie(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)(),s=t(l.oV.file_mount),[r,c]=(0,h.fp)(u.AG.mount_enabled);(0,n.useEffect)(()=>{s&&(async()=>{try{const e=await d.I2.post("enabled/get",{});c(!0===e?.data)}catch(e){c(!1)}})()},[s]);return s?(0,C.jsxs)(n.Fragment,{children:[(0,C.jsxs)(x.aZ,{position:"right",children:[(0,C.jsx)("span",{className:"header-label",children:e("总开关")}),(0,C.jsx)(o.rA,{icon:!0===r?"cloud_done":"cloud_off",title:e(!0===r?"muntont":"muntoff"),selected:!0===r,onClick:async()=>{const t=!r;try{const s=await d.I2.post("enabled/set",{enabled:t}),n=!0===s?.data;c(n),(0,v.SK)(e(n?"挂载已启用":"挂载已停用"))}catch(e){}}})]}),(0,C.jsx)(i.xh,{children:(0,C.jsx)(i.fI,{children:(0,C.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,C.jsx)(ne,{})})})})]}):(0,C.jsx)(i.fI,{children:(0,C.jsx)(i.VP,{children:(0,C.jsx)(a.Zp,{self_title:(0,C.jsx)("h2",{children:e("网盘挂载")}),children:(0,C.jsx)("p",{children:e("nmuntpr")})})})})}var le=s(47996);const ae=[{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"},{key:"ssh_private_key",label:"Private key",type:"password",tip:"Either the key or the account password"}],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"}]},{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}]},{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"}]}];const oe="webdav",re="@authorize",de="@tcp_account",ce={baidu:[{keys:["baidu_app_id","baidu_app_key","baidu_secret_key"],on_next:"save_app"},{keys:[re]}],tcp_proxy:[{keys:["tcp_client_num_id"],on_next:"save_app"},{keys:[de]}]};function he(){const{t:e}=(0,_.Bd)(),t=(0,te.y)(),[,s]=(0,h.fp)(u.AG.prompt_card),[l,c]=(0,n.useState)([]),[m,x]=(0,n.useState)([]),[j,f]=(0,n.useState)(!1),[y,b]=(0,n.useState)(""),[w,g]=(0,n.useState)(oe),[S,k]=(0,n.useState)(""),[A,I]=(0,n.useState)({}),[N,$]=(0,n.useState)({}),[V,B]=(0,n.useState)("oob"),[P,F]=(0,n.useState)(""),[K,X]=(0,n.useState)([]),[z,O]=(0,n.useState)(!0),T=async()=>{try{const e=await d.I2.post("credential/list",{}),t=Array.isArray(e?.data)?e.data:[];return c(t),x(ae),t}catch(e){return[]}},q=async e=>{const t=(await T()).find(t=>t.id===e);t&&X(t.accounts??[])};(0,n.useEffect)(()=>{T()},[]);const M=m.find(e=>e.type===w),E=M?.fields??[],D=!0===M?.sources,H=!0===M?.accounts,U=M?.account_fields??[],W=A.local_sources??[],Z=(e,t)=>{I({...A,local_sources:W.map((s,n)=>n===e?{...s,...t}:s)})},G=()=>{X(e=>[...e,{id:"",account_name:"",password:"",secret_key:""}])},R=(e,t)=>{X(s=>s.map((s,n)=>n===e?{...s,...t}:s))},L=ce[w],J=()=>{f(!1),b(""),g(oe),k(""),I({}),X([]),F(""),O(!0)},Q=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)},Y=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){}},ee=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 T()}catch(e){}else(0,v.zN)(e("请填写授权码"))};return(0,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("网盘凭据")}),(0,C.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{s({open:!0,title:e("信息"),context_div:(0,C.jsxs)("div",{children:[(0,C.jsxs)("ul",{children:[(0,C.jsx)("li",{children:e("crd_tp")}),(0,C.jsx)("li",{children:e("pwdkept")}),(0,C.jsx)("li",{children:e("tstbfrs")})]}),(0,C.jsxs)("ul",{children:[(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:"WebDAV"}),":",e("prtwbdv")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:"SSH / SFTP"}),":",e("prtsftp")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:"S3 兼容对象存储"}),":",e("prt_s3")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:"SMB"}),":",e("prt_smb")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:"百度网盘"}),":",e("prt_bd")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:e("内网穿透 FileCat")}),":",e("prt_tcp")]}),(0,C.jsxs)("li",{children:[(0,C.jsx)("b",{children:e("本地目录")}),":",e("prt_local")]})]})]})})}})]}),rightTopCom:(0,C.jsx)("div",{className:"div-row",children:(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{J(),f(!0)}})}),children:(0,C.jsx)(p.X,{headers:[e("编号"),e("备注"),e("类型"),e("操作")],rows:l.map((s,n)=>{return[(0,C.jsx)("span",{children:n}),(0,C.jsx)(a.xP,{context:s.note||"-"}),(0,C.jsx)(a.xP,{context:(i=s.type,m.find(e=>e.type===i)?.name??i)}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{f(!0),b(e.id),g(e.type),k(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,local_sources:e.local_sources,tcp_client_num_id:e.tcp_client_num_id,tcp_base_url:e.tcp_base_url}),X(e.accounts??[]),F(""),O(!1!==e.enabled);const t=m.find(t=>t.type===e.type)?.fields??[];t.some(e=>e.options_source)&&Q(t).catch(()=>{})})(s)}),(0,C.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 T()}catch(e){}}})})(s)})]})];var i})})})})}),(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:j&&(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("凭据")})}),rightBottomCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t=(t=>{if(!S.trim())return e("请填写备注");for(const s of E){if(!1===t.includes(s.key))continue;const n=String(A[s.key]??"").trim();if(s.required&&!n)return e(s.label)}})(E.map(e=>e.key));if(t)(0,v.zN)(`${e("请填写")}${t}`);else{if(D){const t=new Set;for(const s of W){const n=String(s.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(H)for(const t of K)for(const s of U)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:w,note:S,...A,accounts:H?K:void 0,enabled:z});(0,v.SK)(e("保存成功")),!y&&t.data?.id&&b(t.data.id),await T()}catch(e){}}}}),(0,C.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:J})]}),children:[(0,C.jsx)(r.Sm,{placeholder:e("备注"),value:S,handleInputChange:k}),(0,C.jsx)(r.l6,{value:w,options:m.map(e=>({title:e.name,value:e.type})),onChange:e=>{g(e),I({}),$({}),F("");const t=m.find(t=>t.type===e)?.fields??[];t.some(e=>e.options_source)&&Q(t)}}),D?(0,C.jsxs)(n.Fragment,{children:[(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)("h3",{children:e("目录")}),(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I({...A,local_sources:[...W,{name:"",path:""}]})}})]}),W.map((t,s)=>(0,C.jsxs)(le.d,{title:`${e("目录")} #${s+1}`,toolbar:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{I({...A,local_sources:W.filter((t,s)=>s!==e)})})(s)})}),children:[(0,C.jsx)(r.BC,{label:e("名称"),label_width:"6rem",children:(0,C.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:t.name,handleInputChange:e=>Z(s,{name:e})})}),(0,C.jsx)(r.BC,{label:e("目录"),label_width:"6rem",required:!0,children:(0,C.jsx)(r.Sm,{placeholder:e("本地绝对路径"),value:t.path,handleInputChange:e=>Z(s,{path:e})})})]},s))]}):(0,C.jsxs)(n.Fragment,{children:[E.map(t=>{const s=A[t.key];return t.options_source?(0,C.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,C.jsx)(r.l6,{value:String(s??""),options:N[t.options_source]??[],onChange:e=>I({...A,[t.key]:e})})},t.key):"switch"===t.type?(0,C.jsx)(r.BC,{label:e(t.label),label_width:"6rem",children:(0,C.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,C.jsx)(n.Fragment,{children:(0,C.jsx)(r.Sm,{type:"password"===t.type?"password":"text",placeholder:t.label,value:String(s??""),handleInputChange:e=>I({...A,[t.key]:e})})},t.key)}),H&&(0,C.jsxs)(n.Fragment,{children:[(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)("h3",{children:e("账号")}),(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:G})]}),K.map((t,s)=>(0,C.jsx)(le.d,{title:`${e("账号")} #${s+1}`,toolbar:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{X(t=>t.filter((t,s)=>s!==e))})(s)})}),children:U.map(n=>(0,C.jsx)(r.BC,{label:e(n.label),label_width:"7rem",required:n.required,children:(0,C.jsx)(r.Sm,{type:"password"===n.type?"password":"text",placeholder:n.placeholder?e(n.placeholder):"",value:t[n.key]??"",handleInputChange:e=>R(s,{[n.key]:e})})},n.key))},s))]})]})]})}),L?.[1]?.keys?.includes(re)&&(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.Zp,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("账号")})}),children:(()=>{const s=l.find(e=>e.id===y)?.accounts??[];return(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(r.BC,{label:e("授权方式"),label_width:"6rem",children:(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)(r.U6,{name:"baidu_auth_mode",value:"one_click",context:e("一键授权"),selected:"one_click"===V,onchange:()=>B("one_click")}),(0,C.jsx)(r.U6,{name:"baidu_auth_mode",value:"oob",context:e("outh_ob"),selected:"oob"===V,onchange:()=>B("oob")})]})}),"oob"===V&&(0,C.jsx)(r.BC,{label:e("授权码"),label_width:"6rem",children:(0,C.jsx)(r.Sm,{placeholder:e("粘贴授权码 code"),value:P,handleInputChange:F})}),(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)(o.rA,{icon:"open_in_new",title:e("去授权"),onClick:Y}),"oob"===V&&(0,C.jsx)(o.rA,{icon:"check",title:e("完成授权"),onClick:ee})]}),s.map((s,n)=>(0,C.jsxs)(le.d,{title:`${e("账号")} #${n+1}`,toolbar:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.rA,{icon:"network_check",title:e("授权检测"),onClick:()=>(async(t,s)=>{try{const n=await d.I2.post("baidu/verify",{id:t,account_id:s}),i=n?.data??{};i.valid?(0,v.SK)(e("账号可用")):(0,v.zN)(`${e("账号不可用")}:${i.error??""}`),await T()}catch(e){}})(y,s.id)}),(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>((s,n)=>{t({title:e("确认删除"),sub_title:n.note||n.account_name||n.id,confirm_fun:async()=>{try{await d.I2.post("baidu/deauthorize",{id:s,account_id:n.id}),(0,v.SK)(e("已删除")),await T()}catch(e){}}})})(y,s)})]}),children:[(0,C.jsx)(r.BC,{label:e("备注"),label_width:"6rem",children:(0,C.jsx)(a.xP,{context:s.note||"-"})}),(0,C.jsx)(r.BC,{label:e("百度账号"),label_width:"6rem",children:(0,C.jsx)(a.xP,{context:s.account_name||s.id})}),(0,C.jsx)(r.BC,{label:e("授权状态"),label_width:"6rem",children:(0,C.jsx)("p",{children:s.token?e("已授权"):e("未授权")})}),(0,C.jsx)(r.BC,{label:e("授权时间"),label_width:"6rem",children:(0,C.jsx)("p",{children:s.token?.obtained_at?(0,se.eK)(s.token.obtained_at):"-"})})]},s.id))]},re)})()})}),L?.[1]?.keys?.includes(de)&&(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.Zp,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("账号")})}),children:(0,C.jsxs)(n.Fragment,{children:[(0,C.jsxs)("div",{className:"div-row",children:[(0,C.jsx)("h3",{children:e("账号")}),(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:G})]}),K.map((s,n)=>(0,C.jsxs)(le.d,{title:`${e("账号")} #${n+1}`,toolbar:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async t=>{if(String(t.account_name??"").trim())try{await d.I2.post("credential/account_save",{credential_id:y,account_id:t.id||void 0,note:t.note,account_name:t.account_name,password:t.password}),(0,v.SK)(e("已保存")),await q(y)}catch(e){}else(0,v.zN)(e("请填写对端账号"))})(s)}),(0,C.jsx)(o.rA,{icon:"network_check",title:e("验证登录"),onClick:()=>(async t=>{try{const s=await d.I2.post("credential/account_verify",{credential_id:y,account_id:t.id,account_name:t.account_name,password:t.password}),n=s?.data??{};n.ok?(0,v.SK)(e("账号可用")):(0,v.zN)(`${e("账号不可用")}:${n.error??""}`)}catch(e){}})(s)}),(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(s=>{s.id?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 q(y)}catch(e){}}}):X(e=>e.filter(e=>e!==s))})(s)})]}),children:[(0,C.jsx)(r.BC,{label:e("备注"),label_width:"6rem",children:(0,C.jsx)(r.Sm,{placeholder:e("便于辨认的名字"),value:s.note??"",handleInputChange:e=>R(n,{note:e})})}),(0,C.jsx)(r.BC,{label:e("对端账号"),label_width:"6rem",required:!0,children:(0,C.jsx)(r.Sm,{placeholder:e("对端 FileCat 登录名"),value:s.account_name??"",handleInputChange:e=>R(n,{account_name:e})})}),(0,C.jsx)(r.BC,{label:e("对端密码"),label_width:"6rem",children:(0,C.jsx)(r.Sm,{type:"password",value:s.password??"",handleInputChange:e=>R(n,{password:e})})})]},n))]},de)})})]})})," "]})}function ue(){const{t:e}=(0,_.Bd)(),{check_user_auth:t}=(0,j.MH)();return t(l.oV.file_mount)?(0,C.jsx)(i.xh,{children:(0,C.jsx)(i.fI,{children:(0,C.jsx)(i.VP,{widthPer:100,maxWidth:"90rem",children:(0,C.jsx)(he,{})})})}):(0,C.jsx)(i.fI,{children:(0,C.jsx)(i.VP,{children:(0,C.jsx)(a.Zp,{self_title:(0,C.jsx)("h2",{children:e("网盘凭据")}),children:(0,C.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,te.y)(),s=(0,f.T)(),[l,c]=(0,n.useState)([]),[h,u]=(0,n.useState)("none"),[m,x]=(0,n.useState)(""),[j,y]=(0,n.useState)("sftp"),[b,w]=(0,n.useState)(""),[g,S]=(0,n.useState)(0),[k,A]=(0,n.useState)(!1),[I,N]=(0,n.useState)(""),[$,V]=(0,n.useState)(""),[B,P]=(0,n.useState)(""),[F,K]=(0,n.useState)([{share_name:"",path:"",readonly:!1}]),[X,z]=(0,n.useState)(""),[O,T]=(0,n.useState)(""),[q,M]=(0,n.useState)([{url_path:"",path:"",readonly:!1}]),[E,D]=(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 U=()=>{x(""),y("sftp"),w(""),S(0),A(!1),N(""),V(""),P(""),K([{share_name:"",path:"",readonly:!1}]),z(""),T(""),M([{url_path:"",path:"",readonly:!1}]),D([{username:"",password:"",path:"",readonly:!1}])},W=()=>{u("none"),U()},Z=e=>"smb"===e?F:"webdav"===e?q:E,G=(e,t)=>{"smb"!==e?"webdav"!==e?D(t):M(t):K(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,C.jsxs)(i.fI,{children:[(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,C.jsx)(i.xh,{children:(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:" div-row ",children:(0,C.jsx)("h2",{children:e("文件服务")})}),rightTopCom:(0,C.jsx)("div",{className:"div-row",children:(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{U(),S(2022),u("add")}})}),children:(0,C.jsx)(p.X,{headers:[e("状态"),e("备注"),e("协议"),e("端口"),e("共享"),e("操作")],rows:l.map((s,n)=>{return[(0,C.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,C.jsx)(a.xP,{children:s.note||"-"}),(0,C.jsx)("p",{children:(i=s.type,pe.find(e=>e.value===i)?.label??i)}),(0,C.jsx)("p",{children:s.port}),(0,C.jsx)(a.xP,{children:L(s)||"-"}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{U(),x(e.id),y(e.type),w(e.note),S(e.port),A(e.readonly),N(e.smb?.hostname??""),V(e.smb?.username??""),P(e.smb?.password??""),K(e.smb?.shares?.length?e.smb.shares.map(e=>({...e})):[{share_name:"",path:"",readonly:!1}]),z(e.webdav?.username??""),T(e.webdav?.password??""),M(e.webdav?.shares?.length?e.webdav.shares.map(e=>({...e})):[{url_path:"",path:"",readonly:!1}]),D(e.sftp?.shares?.length?e.sftp.shares.map(e=>({...e})):[{username:"",password:"",path:"",readonly:!1}]),u("edit")})(s)}),(0,C.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&&W(),await H()}})})(s)})]})];var i})})})})}),(0,C.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:"none"!==h&&(0,C.jsx)(i.xh,{children:(0,C.jsxs)(a.Zp,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("add"===h?"添加":"编辑")}),(0,C.jsx)(o.rA,{icon:"info",title:e("说明"),onClick:()=>s(e("smb_known_issue_tip"))})]}),rightBottomCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:W}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const t={type:j,note:b,port:Number(g),readonly:k};"smb"===j&&(t.smb={hostname:I,username:$,password:B,shares:F}),"webdav"===j&&(t.webdav={username:X,password:O,shares:q}),"sftp"===j&&(t.sftp={shares:E}),m?(t.id=m,await d.od.post("update",t)):await d.od.post("add",t),(0,v.SK)(e("保存成功")),W(),await H()}})]}),children:[(0,C.jsx)(r.BC,{label:e("协议"),label_width:"7rem",required:!0,children:(0,C.jsx)(r.l6,{value:j,options:pe,onChange:e=>y(e)})}),(0,C.jsx)(r.BC,{label:e("端口"),label_width:"7rem",required:!0,children:(0,C.jsx)(r.Sm,{placeholder:"1-65535",value:String(g||""),handleInputChange:e=>S(Number(e)||0)})}),(0,C.jsx)(r.BC,{label:e("备注"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{placeholder:e("列表显示的名称"),value:b,handleInputChange:w})}),(0,C.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,C.jsx)(o.Ay,{checked:k,onChange:A})}),"webdav"===j&&(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:X,handleInputChange:z})}),(0,C.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{type:"password",value:O,handleInputChange:T})})]}),"smb"===j&&(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(r.BC,{label:e("主机名"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{value:I,handleInputChange:N})}),(0,C.jsx)(r.BC,{label:e("用户名"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{placeholder:e("留空则不验证身份"),value:$,handleInputChange:V})}),(0,C.jsx)(r.BC,{label:e("密码"),label_width:"7rem",children:(0,C.jsx)(r.Sm,{type:"password",value:B,handleInputChange:P})})]}),Z(j).map((t,s)=>(0,C.jsxs)(le.d,{title:e("sftp"===j?"账号":"共享")+` #${s+1}`,toolbar:(0,C.jsxs)(C.Fragment,{children:["smb"===j&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:e("共享名")}),(0,C.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,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:e("路径")}),(0,C.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,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:e("用户名")}),(0,C.jsx)(r.Sm,{value:t.username,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{username:e})}),(0,C.jsx)("span",{children:e("密码")}),(0,C.jsx)(r.Sm,{type:"password",value:t.password,no_border:!0,width:"8rem",handleInputChange:e=>R(j,s,{password:e})})]}),(0,C.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,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>((e,t)=>{G(e,Z(e).filter((e,s)=>s!==t))})(j,s)})]}),children:[(0,C.jsx)(r.BC,{label:e("目录"),label_width:"7rem",required:!0,children:(0,C.jsx)(r.Sm,{placeholder:e("对外提供的本地绝对路径"),value:t.path,handleInputChange:e=>R(j,s,{path:e})})}),(0,C.jsx)(r.BC,{label:e("只读"),label_width:"7rem",children:(0,C.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(l.oV.file_mount)?(0,C.jsx)(me,{}):(0,C.jsx)(i.fI,{children:(0,C.jsx)(a.Zp,{self_title:(0,C.jsx)("h2",{children:e("文件服务")}),children:(0,C.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,C.jsx)(Y,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,C.jsx)(k,{})}),t(l.oV.sys_env_page)&&s.push({index:3,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,C.jsx)(U,{})}),t(l.oV.file_mount)&&(s.push({index:5,name:e("网盘凭据"),rto:"credential_setting/",component:(0,C.jsx)(ue,{})}),s.push({index:5,name:e("网盘挂载"),rto:"mount_setting/",component:(0,C.jsx)(ie,{})})),t(l.oV.file_server)&&s.push({index:6,name:e("文件服务"),rto:"file_server_setting/",component:(0,C.jsx)(_e,{})}),t(l.oV.user_manage)&&s.push({index:7,name:e("用户管理"),rto:"user_manager/",component:(0,C.jsx)(R,{})}),t(l.oV.role_manage)&&s.push({index:8,name:e("角色管理"),rto:"role_manager/",component:(0,C.jsx)(L,{})}),(0,C.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),l=s(74777),a=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:a}=(0,o.Bd)();return e=>{let n;e===l.jk.ffmpeg?n=(0,c.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.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,a.useState)([]);return(0,a.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:()=>a});var n=s(72635);const i=1440,l=525600;function a(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<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},93245(e,t,s){s.d(t,{a:()=>r});var n=s(96540),i=s(34843),l=s(82893),a=s(23430);const o=[{id:a.nE.ace,label:"文本编辑器(ace)"},{id:a.nE.md,label:"md编辑器"},{id:a.nE.mind,label:"思维导图编辑器"},{id:a.nE.draw,label:"draw编辑器"},{id:a.nE.timeline,label:"时间线编辑器"},{id:a.nE.image,label:"图片编辑器"},{id:a.nE.excel,label:"excel编辑器"}];function r(e,t,s,a=!1){const[o]=(0,i.fp)(l.AG.user_base_info),r=o?.user_data?.editor_auto_save,d=(0,n.useRef)(r);d.current=r;const c=(0,n.useRef)(t);c.current=t;const h=(0,n.useRef)(s);h.current=s,(0,n.useEffect)(()=>{if(a)return;const t=d.current;if(!t?.enable||t.interval<=0||!t.editors?.includes(e))return;const s=setInterval(()=>{c.current()&&h.current(!0)},1e3*t.interval);return()=>clearInterval(s)},[r,e,a])}s.d(t,["d",0,o])},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7133],{77133(e,s,i){i.r(s),i.d(s,{default:()=>d});var a=i(96540),t=i(85997),c=i(57952),l=i(34843),n=i(82893),r=i(47022),o=i(74848);function p(e){const s=(0,a.useRef)(null),i=(0,a.useRef)(null);return(0,o.jsx)("div",{className:"image-ex-container",ref:s,style:{height:"100%"},children:(0,o.jsx)("img",{className:"image-ex-img image-ex-img-center",ref:i,src:e.path,alt:""})})}var u=i(22022);const f=a.lazy(()=>Promise.all([i.e(8772),i.e(6100)]).then(i.bind(i,69160)));function d(e){const{t:s}=(0,u.Bd)(),[i,a]=(0,l.fp)(n.AG.file_preview);if(!i.open)return;let d;switch(i.type){case r.Iw.video:d=(0,o.jsx)(f,{source:i.url,options:{autoplay:!1}});break;case r.Iw.image:d=(0,o.jsx)(p,{path:i.url});break;case r.Iw.pdf:d=(0,o.jsx)("object",{className:"pdf",data:i.url+"&show=1",type:"application/pdf"})}const h=(0,o.jsxs)("div",{id:"previewer",children:[(0,o.jsx)(c.A,{ignore_tags:!0,left_children:[(0,o.jsx)(t.rA,{title:s("取消"),icon:"close",onClick:function(){a({open:!1}),i?.close?.()}},1)]}),(0,o.jsx)("div",{className:"preview",children:d})]});return i.open&&h}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7133],{77133(e,s,i){i.r(s),i.d(s,{default:()=>d});var a=i(96540),t=i(85997),c=i(57952),l=i(34843),n=i(82893),r=i(32768),o=i(74848);function p(e){const s=(0,a.useRef)(null),i=(0,a.useRef)(null);return(0,o.jsx)("div",{className:"image-ex-container",ref:s,style:{height:"100%"},children:(0,o.jsx)("img",{className:"image-ex-img image-ex-img-center",ref:i,src:e.path,alt:""})})}var u=i(22022);const f=a.lazy(()=>Promise.all([i.e(8772),i.e(6100)]).then(i.bind(i,69160)));function d(e){const{t:s}=(0,u.Bd)(),[i,a]=(0,l.fp)(n.AG.file_preview);if(!i.open)return;let d;switch(i.type){case r.Iw.video:d=(0,o.jsx)(f,{source:i.url,options:{autoplay:!1}});break;case r.Iw.image:d=(0,o.jsx)(p,{path:i.url});break;case r.Iw.pdf:d=(0,o.jsx)("object",{className:"pdf",data:i.url+"&show=1",type:"application/pdf"})}const h=(0,o.jsxs)("div",{id:"previewer",children:[(0,o.jsx)(c.A,{ignore_tags:!0,left_children:[(0,o.jsx)(t.rA,{title:s("取消"),icon:"close",onClick:function(){a({open:!1}),i?.close?.()}},1)]}),(0,o.jsx)("div",{className:"preview",children:d})]});return i.open&&h}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>N});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),o=i(82893),l=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(22022),p=i(62042),j=(i(47022),i(4412)),k=i(99214),g=i(6960),w=i(88815),v=i(40505),z=i(23430),F=i(64694),b=i(61973),C=i(74848);function N(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),N=(0,n.useRef)(""),[y,$]=(0,a.fp)(o.AG.prompt_card),[S,M]=(0,a.fp)(o.AG.share_sort_type),{t:A}=(0,f.Bd)(),[G,I]=(0,a.fp)(o.AG.selectedFileList),[U,V]=(0,a.fp)(o.AG.clickFileList),{click_file:W}=(0,k.kZ)(),[D]=(0,b.ok)(),L=(0,k.oT)(),R=(0,k.xp)(),Z=(0,k.Vs)(!0),B=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return S===z.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):S===z.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,S]),H=async()=>{const e=await _.$M.post("share",{id:i.current,token:N.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,g.s)(e.mtime):"",e.size=(0,w.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,N.current);const s=D.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);W({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:N.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:A("未知类型,请下载查看"),readonly:!0,close:()=>{L("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),$({open:!0,title:"share file",confirm:()=>{$({open:!1}),H()},context_div:(0,C.jsx)("div",{className:"card-content",children:(0,C.jsx)(x.Sm,{placeholderOut:A("请输入访问token"),value:"",handleInputChange:e=>{N.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,N.current=localStorage.getItem(`file_share_token_${e}`),H()},[D]),!e)return(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(j.aZ,{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})})}),(0,C.jsxs)(j.aZ,{position:"right",children:[G.length>0&&(0,C.jsx)(c.rA,{icon:"download",title:A("下载"),onClick:function(){const e=[];for(let t=0;t<G.length;t++){const i=B[G[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"grid_view",title:A("切换样式"),onClick:Z}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"schedule",title:S===z.t8.time_minx_max?A("时间逆序"):A("时间顺序"),onClick:()=>{const e=(0,F.jH)([z.t8.time_max_min,z.t8.time_minx_max,z.t8.defualt],S);M(e),I([]),V([])}})]}),(0,C.jsx)(s.xh,{children:(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box ",children:e.is_dir?(0,C.jsx)(l.QW,{share:{share_id:i.current,share_token:N.current},handleContextMenu:()=>{},file_list:B,clickBlank:e=>{e.target===e.currentTarget&&(I([]),V([]))}}):(0,C.jsx)(r.uF,{children:(0,C.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,C.jsx)("div",{className:"file-icons",children:(0,C.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,C.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,C.jsx)("div",{className:"",children:e.name}),(0,C.jsx)("div",{className:"",children:e.size}),(0,C.jsx)("div",{className:"",children:e.show_mtime}),(0,C.jsx)(c.C3,{text:"download",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),(0,C.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current}),n=_.$M.get_full_url(t);(0,v.lW)(n),(0,p.SK)(n)}}),(0,C.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=B[0];R(e.name)}})]})})})})})]})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>N});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),o=i(82893),l=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(22022),p=i(62042),j=(i(32768),i(4412)),k=i(99214),g=i(6960),w=i(88815),v=i(40505),z=i(23430),F=i(64694),b=i(61973),C=i(74848);function N(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),N=(0,n.useRef)(""),[y,$]=(0,a.fp)(o.AG.prompt_card),[S,M]=(0,a.fp)(o.AG.share_sort_type),{t:A}=(0,f.Bd)(),[G,I]=(0,a.fp)(o.AG.selectedFileList),[U,V]=(0,a.fp)(o.AG.clickFileList),{click_file:W}=(0,k.kZ)(),[D]=(0,b.ok)(),L=(0,k.oT)(),R=(0,k.xp)(),Z=(0,k.Vs)(!0),B=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return S===z.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):S===z.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,S]),H=async()=>{const e=await _.$M.post("share",{id:i.current,token:N.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,g.s)(e.mtime):"",e.size=(0,w.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,N.current);const s=D.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);W({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:N.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:A("未知类型,请下载查看"),readonly:!0,close:()=>{L("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),$({open:!0,title:"share file",confirm:()=>{$({open:!1}),H()},context_div:(0,C.jsx)("div",{className:"card-content",children:(0,C.jsx)(x.Sm,{placeholderOut:A("请输入访问token"),value:"",handleInputChange:e=>{N.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,N.current=localStorage.getItem(`file_share_token_${e}`),H()},[D]),!e)return(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,C.jsxs)(n.Fragment,{children:[(0,C.jsx)(j.aZ,{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})})}),(0,C.jsxs)(j.aZ,{position:"right",children:[G.length>0&&(0,C.jsx)(c.rA,{icon:"download",title:A("下载"),onClick:function(){const e=[];for(let t=0;t<G.length;t++){const i=B[G[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"grid_view",title:A("切换样式"),onClick:Z}),e.is_dir&&(0,C.jsx)(c.rA,{icon:"schedule",title:S===z.t8.time_minx_max?A("时间逆序"):A("时间顺序"),onClick:()=>{const e=(0,F.jH)([z.t8.time_max_min,z.t8.time_minx_max,z.t8.defualt],S);M(e),I([]),V([])}})]}),(0,C.jsx)(s.xh,{children:(0,C.jsx)(s.jW,{isFull:!0,children:(0,C.jsx)("div",{className:"common-box ",children:e.is_dir?(0,C.jsx)(l.QW,{share:{share_id:i.current,share_token:N.current},handleContextMenu:()=>{},file_list:B,clickBlank:e=>{e.target===e.currentTarget&&(I([]),V([]))}}):(0,C.jsx)(r.uF,{children:(0,C.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,C.jsx)("div",{className:"file-icons",children:(0,C.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,C.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,C.jsx)("div",{className:"",children:e.name}),(0,C.jsx)("div",{className:"",children:e.size}),(0,C.jsx)("div",{className:"",children:e.show_mtime}),(0,C.jsx)(c.C3,{text:"download",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current});window.open(t)}}),(0,C.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=B[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:N.current}),n=_.$M.get_full_url(t);(0,v.lW)(n),(0,p.SK)(n)}}),(0,C.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=B[0];R(e.name)}})]})})})})})]})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8765],{60096(e,i,t){t.d(i,{QW:()=>z,Ic:()=>b,t$:()=>F,$J:()=>$});var n=t(96540),l=t(47022),s=t(34843),o=t(82893),a=t(61973),r=t(64694),d=t(14284),c=t(34289),m=t(23430),f=t(62042),h=t(99214),p=t(85997),u=t(22022),_=t(74848);function x(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,a]=(0,s.fp)(o.AG.nowFileList),[c,x]=(0,s.fp)(o.AG.confirm),[g,y]=(0,s.fp)(o.AG.user_base_info),{t:w}=(0,u.Bd)();return(0,_.jsxs)("div",{...e.extraAttr,onClick:()=>{!async function(i){e.click&&e.click(i,e.name)}(e.index)},className:e.mount?"item mount-item":"item",role:"button","data-type":e.isLink?"invalid_link":e.type,"data-dir":!e.type||e.type===l.Iw.folder,"data-mount":e.mount?"true":void 0,"aria-selected":null!==(0,r.kW)(i,e.index),"aria-label":e.name,style:{"--filewidth":e.itemWidth??"33%"},onDragStart:n=>{return l=e.index,void(i.find(e=>e===l)||t([...i,l]));var l},onDrop:t=>((t,s)=>{const o=t.dataTransfer;let a,r=!1;for(let e=0;e<o.items.length;e++)if("file"===o.items[e].kind){r=!0;break}if(r)return;if(g?.user_data?.file_list_pagination_mode===m.yM.pagination){if(a=n.files[s],n.files[s]?.type!==l.Iw.folder)return}else if(a=n.folders[s],n.folders.length<=s)return;(0,h.ib)(n,i).some(e=>e?.name===a?.name)?(0,f.zN)(w("mv_self")):x({open:!0,title:`确定将文件移动并覆盖到${a?.name}吗?`,handle:async()=>{await e.draggable_handle(a?.name)}})})(t,e.index),draggable:void 0!==e.draggable_handle,children:[void 0===e.icon&&(0,_.jsx)("div",{children:e.type!==l.Iw.image||null==e.path||g?.user_data?.not_pre_show_image?(0,_.jsx)(p.In,{icon:""}):(0,_.jsx)("img",{loading:"lazy",src:d.$M.getDownloadUrl(e.path,{mtime:e.mtime,cache:1}),alt:e.name})}),void 0!==e.icon&&(0,_.jsx)("div",{className:"rotating-div",children:(0,_.jsx)("span",{className:"material-icons",children:e.icon})}),(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{className:"name",children:[(0,_.jsx)("span",{children:e.name}),e.mount_readonly&&(0,_.jsx)("span",{className:"mount-readonly-tag",children:w("只读")})]}),e.size?(0,_.jsx)("p",{children:e.size}):(0,_.jsx)("p",{children:"—"}),(0,_.jsx)("p",{children:e.show_mtime})]}),e.children]})}var g=t(78150),y=t(34251);function w(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,m]=(0,s.fp)(o.AG.nowFileList),[f,p]=(0,s.fp)(o.AG.confirm),[w,k]=(0,s.fp)(o.AG.file_page),[v,j]=(0,s.fp)(o.AG.enterKey),{click_file:A}=(0,h.kZ)(),G=(0,h._A)(),{t:z}=(0,u.Bd)(),b=(0,a.Zp)();(0,a.zy)();const F=(0,h.A9)(),{clickDouble:$}=(0,h.xI)(),[I,C]=(0,s.fp)(o.AG.showPrompt);return(0,_.jsx)(x,{extraAttr:{onContextMenu:t=>{((t,n,s,o)=>{t.preventDefault(),t.stopPropagation();const a=new y.ik;a.path=(0,r.IO)((0,c.vX)(),n),a.filename=n,a.x=t.clientX,a.y=t.clientY,a.type=s?l.Iw.folder:(0,y.uL)(n),a.size=o,a.useSelectedList=i.includes(e.index),C({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:a})})(t,e.name,e.type===l.Iw.folder,e.origin_size)}},draggable_handle:async e=>{const l=(0,h.ib)(n,i).map(e=>(0,h.Ok)(e.name));await d.$M.post("cut",{files:l,to:`${(0,c.GG)("file",(0,c.vX)())}/${e}`});t([]),p({open:!1,handle:null}),b((0,c.vX)())},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,isLink:e.isLink,path:e.path,icon:e.icon,show_mtime:e.show_mtime,mount:e.mount,mount_driver:e.mount_driver,mount_color:e.mount_color,mount_readonly:e.mount_readonly,click:(n,s)=>{if($(n,async()=>{if(e.type===l.Iw.folder)F(s);else{if(await A({name:s,size:e.origin_size,opt_shell:!0,mtime:e.mtime,close:()=>G(null)})){if(e.type===l.Iw.url)return;G({name:s,mode:(0,h.Pc)(e.type)})}}}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===v)t([...i,n]);else if("shift"===v){const{max:e,min:l}=(0,r.a7)(i),s=[];if(n>=e)for(let i=e;i<=n;i++)s.push(i);else for(let e=l;e>=n;e--)s.push(e);t(s)}else t([n])},itemWidth:e.itemWidth})}var k=t(78247),v=(t(38240),t(64405)),j=t(88815);function A(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,m]=(0,s.fp)(o.AG.editorSetting),[f,p]=(0,s.fp)(o.AG.shellNowDir),[g,y]=(0,s.fp)(o.AG.sshInfo),[w,A]=(0,s.fp)(o.AG.nowFileList),[G,z]=(0,s.fp)(o.AG.enterKey),[b,F]=(0,s.fp)(o.AG.confirm),$=(0,a.Zp)(),{t:I}=(0,u.Bd)(),{clickDouble:C}=(0,h.xI)();return(0,_.jsx)(x,{draggable_handle:async n=>{const l=new v.x;Object.assign(l,g),l.target=(0,r.HS)(...f,n);const s=(0,h.ib)(w,i).map(e=>(0,r.HS)(...f,e.name));for(const e of s)if(l.source=e,!await d.Fg.post("move",l))return!1;t([]),F({open:!1,handle:null}),await e.fileHandler()},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(n,s)=>{if(C(n,()=>{if(e.type===l.Iw.folder){const e=new v.x;return e.key=g.key,e.dir=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${s}`,$((0,r.IO)((0,c.vX)(),s)),t([]),void A({files:[],folders:[]})}const i=async()=>{const i=new v.x;i.key=g.key,i.file=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${s}`;const t=await d.Fg.post("get/file/text",i);let n;s.endsWith(l.Iw.workflow_act)?n="ace/mode/yaml":(s.endsWith(l.Iw.draw)||s.endsWith(l.Iw.excalidraw))&&(n="ace/mode/json"),m({model:n,open:!0,fileName:e.name,save:async e=>{i.context=e;0===(await d.Fg.post("update/file/text",i)).code&&k.xK.set_value_temp("")}}),k.xK.set_value_temp(t.data)};"number"==typeof e.origin_size&&e.origin_size>j.o5?F({open:!0,title:I("提示"),sub_title:"文件超过20MB了确定要打开吗?",handle:async()=>{F({open:!1,handle:null}),await i()}}):i()}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===G)t([...i,n]);else if("shift"===G){const{max:e,min:l}=(0,r.a7)(i),s=[];if(n>=e)for(let i=e;i<=n;i++)s.push(i);else for(let e=l;e>=n;e--)s.push(e);t(s)}else t([n])}})}function G(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,a]=(0,s.fp)(o.AG.enterKey),{click_file:c}=(0,h.kZ)(),[m,f]=(0,s.fp)(o.AG.nowFileList),{t:p}=(0,u.Bd)(),[w,k]=(0,s.fp)(o.AG.showPrompt),v=((0,h.oT)(),(0,h.xp)()),{clickDouble:j}=(0,h.xI)();return(0,_.jsx)(x,{extraAttr:{onContextMenu:i=>{((i,t,n,s)=>{i.preventDefault(),i.stopPropagation();const o=new y.ik,a=e.item_list;for(const e of a)if(e.name===t){o.path=e.path;break}o.is_share=!0,o.filename=t,o.x=i.clientX,o.y=i.clientY,o.type=n?l.Iw.folder:(0,y.uL)(t),o.size=s,o.share_token=e.share.share_token,o.share_id=e.share.share_id,k({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:o})})(i,e.name,e.type===l.Iw.folder,e.origin_size)}},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(s,o)=>{if(j(s,()=>{e.type!==l.Iw.folder&&(v(o)||c({file_path:e.item_list[s].path,file_url:d.$M.getDownloadUrlV2(e.item_list[s].path,"share_download",{share_id:e.share.share_id,share_token:e.share.share_token}),name:o,size:e.origin_size,opt_shell:!0,mtime:e.mtime,not_type_tip:p("未知类型,请下载查看")}))}))return;if(null!==(0,r.kW)(i,s))t((0,r.P1)(i,s));else if("ctrl"===n)t([...i,s]);else if("shift"===n){const{max:e,min:n}=(0,r.a7)(i),l=[];if(s>=e)for(let i=e;i<=s;i++)l.push(i);else for(let e=n;e>=s;e--)l.push(e);t(l)}else t([s])}})}function z({handleContextMenu:e,file_list:i,clickBlank:t,share:l}){const[a,r]=(0,s.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.Bd)(),m=(0,h.OJ)(),{file_is_running:f}=(0,k.hg)();return(0,h.UK)(i,[],d),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:(0,_.jsx)("div",{onClick:t,children:i.map((e,t)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(G,{share:l,item_list:i,icon:f(e.name)?"refresh":void 0,itemWidth:m,index:t+0,...e})},t+0))})})}function b({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:l,fileHandler:a}){const[r,d]=(0,s.fp)(o.AG.user_base_info),c=(0,n.useRef)(null),{t:m}=(0,u.Bd)(),f=(0,h.OJ)(),{file_is_running:p}=(0,k.hg)(),[x,y]=(0,s.fp)(o.AG.fileShellShow),w=(0,n.useMemo)(()=>t?.length??0,[t]);return(0,h.ei)(c,g.PromptEnum.SshUpload),(0,h.UK)(i,t,c),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${r?.user_data?.file_list_show_type??""}`,ref:c,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:m("文件夹")}),t&&(0,_.jsx)("div",{onClick:l,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:l,children:m("文件")}),i&&(0,_.jsx)("div",{onClick:l,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+w,...e})},i+w))})]})}function F({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:l}){const[a,r]=(0,s.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.Bd)(),[m]=(0,s.fp)(o.AG.zoom_style_by_percent),f=(0,h.OJ)(),{file_is_running:p}=(0,k.hg)(),[x,y]=(0,s.fp)(o.AG.fileShellShow),v=(0,n.useMemo)(()=>t?.length??0,[t]),j=(0,h.pi)(m);return(0,h.ei)(d,g.PromptEnum.FilesUpload),(0,h.UK)(i,t,d),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:j.fontSize},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:c("文件夹")}),t&&(0,_.jsx)("div",{onClick:l,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:l,children:c("文件")}),i&&(0,_.jsx)("div",{onClick:l,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+v,...e})},i+v))})]})}function $({handleContextMenu:e,list:i,clickBlank:t}){const[l,a]=(0,s.fp)(o.AG.user_base_info),r=(0,n.useRef)(null),{t:d}=(0,u.Bd)(),[c]=(0,s.fp)(o.AG.zoom_style_by_percent),m=(0,h.OJ)(),{file_is_running:f}=(0,k.hg)(),[p,x]=(0,s.fp)(o.AG.fileShellShow),[y,v]=(0,s.fp)(o.AG.enterKey),[j,A]=(0,s.fp)(o.AG.selectedFileList),[G,z]=(0,s.fp)(o.AG.file_page),b=(0,h.pi)(c);return(0,h.UK)(i,[],r),(0,h.ei)(r,g.PromptEnum.FilesUpload),(0,h.SQ)(r,()=>{z(e=>e.page_num<0?e:{page_size:e.page_size,page_num:e.page_num+1})},()=>{}),(0,n.useEffect)(()=>()=>{p.show&&x({show:!1,path:""})},[]),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:b.fontSize},className:`mosaic file-icons ${l?.user_data?.file_list_show_type??""}`,ref:r,children:i&&(0,_.jsx)("div",{onClick:t,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{icon:f(e.name)?"refresh":void 0,itemWidth:m,index:i,...e})},i))})})}},6960(e,i,t){t.d(i,{s:()=>o});var n=t(72635);const l=1440,s=525600;function o(e){e=e>1e12?e:1e3*e;const i=Date.now(),t=Math.abs(i-e)/6e4;return t<1?n.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${n.Ay.t("分钟前")}`:t<l?`${(t/60).toFixed(0)} ${n.Ay.t("小时前")}`:t<43200?`${(t/l).toFixed(0)} ${n.Ay.t("天前")}`:t<s?`${(t/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(t/s).toFixed(0)} ${n.Ay.t("年前")}`}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8765],{60096(e,i,t){t.d(i,{QW:()=>z,Ic:()=>b,t$:()=>F,$J:()=>$});var n=t(96540),l=t(32768),s=t(34843),o=t(82893),a=t(61973),r=t(64694),d=t(14284),c=t(34289),m=t(23430),f=t(62042),h=t(99214),p=t(85997),u=t(22022),_=t(74848);function x(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,a]=(0,s.fp)(o.AG.nowFileList),[c,x]=(0,s.fp)(o.AG.confirm),[g,y]=(0,s.fp)(o.AG.user_base_info),{t:w}=(0,u.Bd)();return(0,_.jsxs)("div",{...e.extraAttr,onClick:()=>{!async function(i){e.click&&e.click(i,e.name)}(e.index)},className:e.mount?"item mount-item":"item",role:"button","data-type":e.isLink?"invalid_link":e.type,"data-dir":!e.type||e.type===l.Iw.folder,"data-mount":e.mount?"true":void 0,"aria-selected":null!==(0,r.kW)(i,e.index),"aria-label":e.name,style:{"--filewidth":e.itemWidth??"33%"},onDragStart:n=>{return l=e.index,void(i.find(e=>e===l)||t([...i,l]));var l},onDrop:t=>((t,s)=>{const o=t.dataTransfer;let a,r=!1;for(let e=0;e<o.items.length;e++)if("file"===o.items[e].kind){r=!0;break}if(r)return;if(g?.user_data?.file_list_pagination_mode===m.yM.pagination){if(a=n.files[s],n.files[s]?.type!==l.Iw.folder)return}else if(a=n.folders[s],n.folders.length<=s)return;(0,h.ib)(n,i).some(e=>e?.name===a?.name)?(0,f.zN)(w("mv_self")):x({open:!0,title:`确定将文件移动并覆盖到${a?.name}吗?`,handle:async()=>{await e.draggable_handle(a?.name)}})})(t,e.index),draggable:void 0!==e.draggable_handle,children:[void 0===e.icon&&(0,_.jsx)("div",{children:e.type!==l.Iw.image||null==e.path||g?.user_data?.not_pre_show_image?(0,_.jsx)(p.In,{icon:""}):(0,_.jsx)("img",{loading:"lazy",src:d.$M.getDownloadUrl(e.path,{mtime:e.mtime,cache:1}),alt:e.name})}),void 0!==e.icon&&(0,_.jsx)("div",{className:"rotating-div",children:(0,_.jsx)("span",{className:"material-icons",children:e.icon})}),(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{className:"name",children:[(0,_.jsx)("span",{children:e.name}),e.mount_readonly&&(0,_.jsx)("span",{className:"mount-readonly-tag",children:w("只读")})]}),e.size?(0,_.jsx)("p",{children:e.size}):(0,_.jsx)("p",{children:"—"}),(0,_.jsx)("p",{children:e.show_mtime})]}),e.children]})}var g=t(78150),y=t(34251);function w(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,m]=(0,s.fp)(o.AG.nowFileList),[f,p]=(0,s.fp)(o.AG.confirm),[w,k]=(0,s.fp)(o.AG.file_page),[v,j]=(0,s.fp)(o.AG.enterKey),{click_file:A}=(0,h.kZ)(),G=(0,h._A)(),{t:z}=(0,u.Bd)(),b=(0,a.Zp)();(0,a.zy)();const F=(0,h.A9)(),{clickDouble:$}=(0,h.xI)(),[I,C]=(0,s.fp)(o.AG.showPrompt);return(0,_.jsx)(x,{extraAttr:{onContextMenu:t=>{((t,n,s,o)=>{t.preventDefault(),t.stopPropagation();const a=new y.ik;a.path=(0,r.IO)((0,c.vX)(),n),a.filename=n,a.x=t.clientX,a.y=t.clientY,a.type=s?l.Iw.folder:(0,y.uL)(n),a.size=o,a.useSelectedList=i.includes(e.index),C({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:a})})(t,e.name,e.type===l.Iw.folder,e.origin_size)}},draggable_handle:async e=>{const l=(0,h.ib)(n,i).map(e=>(0,h.Ok)(e.name));await d.$M.post("cut",{files:l,to:`${(0,c.GG)("file",(0,c.vX)())}/${e}`});t([]),p({open:!1,handle:null}),b((0,c.vX)())},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,isLink:e.isLink,path:e.path,icon:e.icon,show_mtime:e.show_mtime,mount:e.mount,mount_driver:e.mount_driver,mount_color:e.mount_color,mount_readonly:e.mount_readonly,click:(n,s)=>{if($(n,async()=>{if(e.type===l.Iw.folder)F(s);else{if(await A({name:s,size:e.origin_size,opt_shell:!0,mtime:e.mtime,close:()=>G(null)})){if(e.type===l.Iw.url)return;G({name:s,mode:(0,h.Pc)(e.type)})}}}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===v)t([...i,n]);else if("shift"===v){const{max:e,min:l}=(0,r.a7)(i),s=[];if(n>=e)for(let i=e;i<=n;i++)s.push(i);else for(let e=l;e>=n;e--)s.push(e);t(s)}else t([n])},itemWidth:e.itemWidth})}var k=t(78247),v=(t(38240),t(64405)),j=t(88815);function A(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,m]=(0,s.fp)(o.AG.editorSetting),[f,p]=(0,s.fp)(o.AG.shellNowDir),[g,y]=(0,s.fp)(o.AG.sshInfo),[w,A]=(0,s.fp)(o.AG.nowFileList),[G,z]=(0,s.fp)(o.AG.enterKey),[b,F]=(0,s.fp)(o.AG.confirm),$=(0,a.Zp)(),{t:I}=(0,u.Bd)(),{clickDouble:C}=(0,h.xI)();return(0,_.jsx)(x,{draggable_handle:async n=>{const l=new v.x;Object.assign(l,g),l.target=(0,r.HS)(...f,n);const s=(0,h.ib)(w,i).map(e=>(0,r.HS)(...f,e.name));for(const e of s)if(l.source=e,!await d.Fg.post("move",l))return!1;t([]),F({open:!1,handle:null}),await e.fileHandler()},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(n,s)=>{if(C(n,()=>{if(e.type===l.Iw.folder){const e=new v.x;return e.key=g.key,e.dir=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${s}`,$((0,r.IO)((0,c.vX)(),s)),t([]),void A({files:[],folders:[]})}const i=async()=>{const i=new v.x;i.key=g.key,i.file=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${s}`;const t=await d.Fg.post("get/file/text",i);let n;s.endsWith(l.Iw.workflow_act)?n="ace/mode/yaml":(s.endsWith(l.Iw.draw)||s.endsWith(l.Iw.excalidraw))&&(n="ace/mode/json"),m({model:n,open:!0,fileName:e.name,save:async e=>{i.context=e;0===(await d.Fg.post("update/file/text",i)).code&&k.xK.set_value_temp("")}}),k.xK.set_value_temp(t.data)};"number"==typeof e.origin_size&&e.origin_size>j.o5?F({open:!0,title:I("提示"),sub_title:"文件超过20MB了确定要打开吗?",handle:async()=>{F({open:!1,handle:null}),await i()}}):i()}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===G)t([...i,n]);else if("shift"===G){const{max:e,min:l}=(0,r.a7)(i),s=[];if(n>=e)for(let i=e;i<=n;i++)s.push(i);else for(let e=l;e>=n;e--)s.push(e);t(s)}else t([n])}})}function G(e){const[i,t]=(0,s.fp)(o.AG.selectedFileList),[n,a]=(0,s.fp)(o.AG.enterKey),{click_file:c}=(0,h.kZ)(),[m,f]=(0,s.fp)(o.AG.nowFileList),{t:p}=(0,u.Bd)(),[w,k]=(0,s.fp)(o.AG.showPrompt),v=((0,h.oT)(),(0,h.xp)()),{clickDouble:j}=(0,h.xI)();return(0,_.jsx)(x,{extraAttr:{onContextMenu:i=>{((i,t,n,s)=>{i.preventDefault(),i.stopPropagation();const o=new y.ik,a=e.item_list;for(const e of a)if(e.name===t){o.path=e.path;break}o.is_share=!0,o.filename=t,o.x=i.clientX,o.y=i.clientY,o.type=n?l.Iw.folder:(0,y.uL)(t),o.size=s,o.share_token=e.share.share_token,o.share_id=e.share.share_id,k({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:o})})(i,e.name,e.type===l.Iw.folder,e.origin_size)}},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(s,o)=>{if(j(s,()=>{e.type!==l.Iw.folder&&(v(o)||c({file_path:e.item_list[s].path,file_url:d.$M.getDownloadUrlV2(e.item_list[s].path,"share_download",{share_id:e.share.share_id,share_token:e.share.share_token}),name:o,size:e.origin_size,opt_shell:!0,mtime:e.mtime,not_type_tip:p("未知类型,请下载查看")}))}))return;if(null!==(0,r.kW)(i,s))t((0,r.P1)(i,s));else if("ctrl"===n)t([...i,s]);else if("shift"===n){const{max:e,min:n}=(0,r.a7)(i),l=[];if(s>=e)for(let i=e;i<=s;i++)l.push(i);else for(let e=n;e>=s;e--)l.push(e);t(l)}else t([s])}})}function z({handleContextMenu:e,file_list:i,clickBlank:t,share:l}){const[a,r]=(0,s.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.Bd)(),m=(0,h.OJ)(),{file_is_running:f}=(0,k.hg)();return(0,h.UK)(i,[],d),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:(0,_.jsx)("div",{onClick:t,children:i.map((e,t)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(G,{share:l,item_list:i,icon:f(e.name)?"refresh":void 0,itemWidth:m,index:t+0,...e})},t+0))})})}function b({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:l,fileHandler:a}){const[r,d]=(0,s.fp)(o.AG.user_base_info),c=(0,n.useRef)(null),{t:m}=(0,u.Bd)(),f=(0,h.OJ)(),{file_is_running:p}=(0,k.hg)(),[x,y]=(0,s.fp)(o.AG.fileShellShow),w=(0,n.useMemo)(()=>t?.length??0,[t]);return(0,h.ei)(c,g.PromptEnum.SshUpload),(0,h.UK)(i,t,c),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${r?.user_data?.file_list_show_type??""}`,ref:c,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:m("文件夹")}),t&&(0,_.jsx)("div",{onClick:l,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:l,children:m("文件")}),i&&(0,_.jsx)("div",{onClick:l,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(A,{fileHandler:a,icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+w,...e})},i+w))})]})}function F({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:l}){const[a,r]=(0,s.fp)(o.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.Bd)(),[m]=(0,s.fp)(o.AG.zoom_style_by_percent),f=(0,h.OJ)(),{file_is_running:p}=(0,k.hg)(),[x,y]=(0,s.fp)(o.AG.fileShellShow),v=(0,n.useMemo)(()=>t?.length??0,[t]),j=(0,h.pi)(m);return(0,h.ei)(d,g.PromptEnum.FilesUpload),(0,h.UK)(i,t,d),(0,n.useEffect)(()=>()=>{x.show&&y({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:j.fontSize},className:`mosaic file-icons ${a?.user_data?.file_list_show_type??""}`,ref:d,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:c("文件夹")}),t&&(0,_.jsx)("div",{onClick:l,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{itemWidth:f,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:l,children:c("文件")}),i&&(0,_.jsx)("div",{onClick:l,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{icon:p(e.name)?"refresh":void 0,itemWidth:f,index:i+v,...e})},i+v))})]})}function $({handleContextMenu:e,list:i,clickBlank:t}){const[l,a]=(0,s.fp)(o.AG.user_base_info),r=(0,n.useRef)(null),{t:d}=(0,u.Bd)(),[c]=(0,s.fp)(o.AG.zoom_style_by_percent),m=(0,h.OJ)(),{file_is_running:f}=(0,k.hg)(),[p,x]=(0,s.fp)(o.AG.fileShellShow),[y,v]=(0,s.fp)(o.AG.enterKey),[j,A]=(0,s.fp)(o.AG.selectedFileList),[G,z]=(0,s.fp)(o.AG.file_page),b=(0,h.pi)(c);return(0,h.UK)(i,[],r),(0,h.ei)(r,g.PromptEnum.FilesUpload),(0,h.SQ)(r,()=>{z(e=>e.page_num<0?e:{page_size:e.page_size,page_num:e.page_num+1})},()=>{}),(0,n.useEffect)(()=>()=>{p.show&&x({show:!1,path:""})},[]),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:b.fontSize},className:`mosaic file-icons ${l?.user_data?.file_list_show_type??""}`,ref:r,children:i&&(0,_.jsx)("div",{onClick:t,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(w,{icon:f(e.name)?"refresh":void 0,itemWidth:m,index:i,...e})},i))})})}},6960(e,i,t){t.d(i,{s:()=>o});var n=t(72635);const l=1440,s=525600;function o(e){e=e>1e12?e:1e3*e;const i=Date.now(),t=Math.abs(i-e)/6e4;return t<1?n.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${n.Ay.t("分钟前")}`:t<l?`${(t/60).toFixed(0)} ${n.Ay.t("小时前")}`:t<43200?`${(t/l).toFixed(0)} ${n.Ay.t("天前")}`:t<s?`${(t/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(t/s).toFixed(0)} ${n.Ay.t("年前")}`}}}]);