filecat 6.13.0 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6413],{75897(e,t,s){s.d(t,{L:()=>i});let n=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_workflow_router_key="customer_workflow_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.sys_software="sys_software",e.protection_directory="sys_protection_directory",e.dir_upload_max_num="dir_upload_max_num",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e.extra_env_path_list_key="extra_env_path_list_key",e.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e}({});const i=n.self_auth_jscode},77481(e,t,s){s.d(t,{S:()=>a,X:()=>l});var n=s(96540),i=s(74848);function l(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,s)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},76413(e,t,s){s.r(t),s.d(t,{default:()=>q});var n=s(96540),i=s(75725),l=s(23430),a=s(70447),o=s(85997),r=s(61443),c=s(14284),d=s(53459),_=s(77481),h=s(22022),u=s(82893),p=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function f(e){const{t}=(0,h.Bd)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.title}),e.info_click&&(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");l([t,...s])}}),(0,v.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,v.jsx)(_.X,{headers:e.headers,rows:s.map((n,i)=>{const a=[];for(let t=0;t<e.headers.length;t++)a.push((0,v.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return a.push((0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,v.jsx)(o.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,p.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,v.jsx)(o.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),a}),width:"10rem"})})})}var g=s(34843),y=s(78247),w=s(24659);function k(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),l=(0,w.K)(),f=[e("路由"),e("auth"),e("备注")],[k,S]=(0,g.fp)(u.AG.editorSetting),[C,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&b(e.data)})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自定义api路由")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([{note:"",needAuth:!1,router:""},...C])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",C)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,v.jsx)(_.X,{headers:f,rows:C.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,b([...C])},no_border:!0}),(0,v.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,b([...C])},options:l,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,b([...C])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)}),(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,x.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);S({model:"ace/mode/javascript",open:!0,fileName:e.router,save:async t=>{const s={context:t,router:e.router};(await c.XO.post("jscode/save",s)).code===d.m.Success&&(y.xK.set_value_temp(""),S({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),y.xK.set_value_temp(t.data)})(t)}),t.router&&(0,v.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,p.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem"})})})}var S=s(23496),C=s(57952);function b(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),[l,a]=(0,g.fp)(u.AG.router_jump),o=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(C.A,{}),(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(f,{title:e("页面资源路由"),headers:o,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_router);if(e.code===d.m.Success){if(l?.page_self_router_api_data){for(const t of e.data)t[1]===l?.page_self_router_api_data[1]&&(0,x.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,l?.page_self_router_api_data),e.data=[t,...e.data],a({})}return e.data}return[]},save:async e=>{(await c.XO.post(S.s.setting_customer_router_save,e)).code===d.m.Success&&(0,x.SK)("success")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})},need_copy:!0}),(0,v.jsx)(f,{title:e("workflow触发路由"),headers:r,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(S.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,x.SK)("保存成功")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})}})]}),(0,v.jsx)(i.VP,{children:(0,v.jsx)(k,{})})]})]})}var A=s(75897),I=s(74777),V=s(6960),X=s(7523);function N(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[j,f]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[b,N]=(0,n.useState)(""),[O,F]=(0,g.fp)(u.AG.prompt_card),[K,P]=(0,n.useState)(!1),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,g.fp)(u.AG.editorSetting),[E,U]=(0,n.useState)(I.aM.close),[T,Z]=(0,n.useState)(void 0),{t:H,i18n:D}=(0,h.Bd)(),[W,L]=(0,g.fp)(u.AG.user_base_info),{check_user_auth:Q}=(0,y.MH)(),{initUserInfo:J}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){m(e.data.self_auth_open),f(e.data.shell_cmd_check_open),k(e.data.recycle_open),N(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info);const n=e.data.https_setting;n&&(P(n.open),B(n.cert_path||""),$(n.key_path||""))}const s=await c.XO.get("token");if(s.code===d.m.Success){const e=s.data;if(!e)return;e.length&&Z(e.length),e.mode&&U(e.mode)}})()},[]);return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.Zp,{title:H("自定义登录auth"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("self_auth_open/save",{open:p})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("self_auth_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e,router:A.L};0===(await c.XO.post("jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:p,onChange:e=>{m(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})}),(0,v.jsx)(a.Zp,{title:H("自定义shell命令校验"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("shell_cmd_check_open/save",{open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("shell_cmd_check_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e};0===(await c.XO.post("shell_cmd_check_open/jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:j,onChange:e=>{f(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})})]})}),(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:H("文件回收站")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{F({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:H("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(w&&!b)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:b,open:w})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:H("目录"),value:b,handleInputChange:e=>{N(e)}}),(0,v.jsx)(r.l6,{value:w,onChange:e=>{k(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})]}),(0,v.jsxs)(a.Zp,{title:H("token过期时间"),rightBottomCom:(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(o.C3,{text:H("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=E,I.aM.length!==e.mode||T||(0,x.zN)("秒数不能为空"),e.length=parseInt(T);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:[(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(r.U6,{value:1,context:H("关闭"),selected:E===I.aM.close,onchange:()=>{U(I.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:H("指定时间"),selected:E===I.aM.length,onchange:()=>{U(I.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:H("永不过期"),selected:E===I.aM.forver,onchange:()=>{U(I.aM.forver)}})]}),E===I.aM.length&&(0,v.jsx)(r.Sm,{placeholder:H("秒"),value:T,handleInputChange:e=>{Z(e)}})]})]})}),(0,v.jsx)(i.VP,{widthPer:40,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{title:H("通用设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:s}})).code===d.m.Success&&((0,x.SK)("修改成功"),J())}}),children:[H("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),H("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(a.Zp,{title:H("HTTPS 设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(K){if(!z)return void(0,x.zN)("证书路径不能为空");if(!M)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=K,e.cert_path=z,e.key_path=M;(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:K})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:K,onChange:e=>{P(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]}),K&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:H("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:H("证书文件路径(cert.pem/fullchain.pem)"),value:z,handleInputChange:e=>{B(e)}}),(0,v.jsx)("div",{children:H("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:H("私钥文件路径(privkey.pem)"),value:M,handleInputChange:e=>{$(e)}})]})]})]})}),(0,v.jsx)(C.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[H("系统运行于"),": ",(0,V.s)(W.runing_time_length)]}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:6.13.0",null!=W.latest_version&&"6.13.0"!==W.latest_version?` -> ${W.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:H("官网地址"),target:"_blank",children:`filecat ${H("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[H("安装方式")," :",W.process_env_run_env]})]})})]})}var O=s(64694),F=s(92350);function K(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[K,P]=(0,n.useState)([]),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)([]),G=(0,w.K)(),q=[e("软件"),e("是否安装"),e("路径")],E=[e("编号"),e("路径"),e("备注")],U=[e("编号"),e("路径"),e("是否开启"),e("备注")],T=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],H=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:D}=(0,y.MH)(),W=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&N(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&f(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&B(t.data),W(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&b(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&I(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&$(i.data??[])})()},[]);const Q=(0,F.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",M)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(i.J,{widthPer:100,children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{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,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of A)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,O.di)(A,e=>e.index);(await c.XO.post("dir_upload_max_num/save",A)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:Z,rows:A.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,I([...A])},options:G,no_border:!0}),(0,v.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,v.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,v.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,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem"})})}),(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PATH")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:V})).code===d.m.Success&&((0,x.SK)("保存成功"),W(),s())}})]}),children:(0,v.jsx)(_.X,{headers:U,rows:V.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,N([...V])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PTY CMD")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:z})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:z,handleInputChange:e=>{B(e)}})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("Workflow Job")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...K,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",K)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,v.jsx)(_.X,{headers:T,rows:K.map((t,s)=>[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>()=>{P([...K.splice(s,1)])}})]),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("插件配置")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...M,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,v.jsx)(_.X,{headers:H,rows:M.map((t,s)=>{const n=[s,(0,v.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,$([...M])},options:G,no_border:!0}),(0,v.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{M.splice(e,1),$([...M])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("系统保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...C,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",C)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:E,rows:C.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{title:e("外部软件"),titleCom:(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,x.SK)("保存成功"),s())}}),children:(0,v.jsx)(_.X,{headers:q,rows:j.map((t,s)=>[(0,v.jsx)("div",{children:t.id}),(0,v.jsx)(a.fq,{ok:t.installed}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("默认使用环境变量")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:"信息"})]),width:"10rem"})})]})})]})]})}function P(e){const{t,i18n:s}=(0,h.Bd)(),[i,a]=(0,g.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("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd删除、添加管理"),permission:l.oV.systemd_update}]},{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 Chat Page"),permission:l.oV.ai_agent_page}]},{title:t("文件权限"),list:[{title:t("文件删除、剪切、重命名"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("文件创建、上传、内容更新、解压缩"),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("htts"),permission:l.oV.https_file},{title:t("token时间修改"),permission:l.oV.token_update},{title:t("自定义auth"),permission:l.oV.code_auth},{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("shell命令检测"),permission:l.oV.shell_cmd_check}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),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("系统保护路径更新"),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("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("网址导航"),permission:l.oV.net_site_tag_update},{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("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("网址导航"),permission:l.oV.nav_net_tag},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,v.jsx)(n.Fragment,{children:o.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.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 z=new Map;function B(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[j,f]=(0,g.fp)(u.AG.user_base_info),[y,w]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[V,N]=(0,g.fp)(u.AG.confirm),[K,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[E,U]=(0,n.useState)([]),[T,Z]=(0,n.useState)([]),[H,D]=(0,n.useState)([]),[W,L]=(0,n.useState)(""),[Q,J]=(0,n.useState)(""),[R,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,ce]=(0,n.useState)(""),[de,_e]=(0,n.useState)(""),[he,ue]=(0,n.useState)({}),pe=(0,F.o)(),[xe,me]=(0,n.useState)([]),je=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ve=async()=>{const e=await c.wm.get("all_users");e.code===d.m.Success&&w(e.data);const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),z.clear();for(const e of t.data)z.set(e.role_id,e)}},fe=e=>{B(e?.username??""),$(e?.password??""),q(e?.cwd??""),U(e?.access_dirs??[]),Z(e?.not_access_dirs??[]),D(e?.only_read_dirs??[]),L(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),ce(e?.id??""),e?.bind_role_id?ge(e.bind_role_id,e.auth_list??[]):(_e(""),ue({}))};(0,n.useEffect)(()=>{ve()},[]);const ge=(e,t=[])=>{if(!e)return _e(""),void ue({});const s=z.get(e);if(s){if(s.cwd&&q(s.cwd),s.access_dirs&&s.access_dirs.length>0&&U(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&Z(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&D(s.only_read_dirs),s.access_cmd&&L(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))}_e(e),ue(s)}},ye=()=>{if(!K)return void(0,x.zN)("username not empty");if((0,m.CB)(K))return void(0,x.zN)("username not empty char");if(!G)return void(0,x.zN)("cwd not empty");const e=new l.E0;return e.language=R,e.theme=ee,e.access_dirs=E,e.username=K,e.password=M,e.not_access_dirs=T,e.only_read_dirs=H,e.cwd=G,e.note=ie,e.access_cmd=W,e.not_access_cmd=Q,e.auth_list=se,e.bind_role_id=de,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("用户")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),I(!1),fe(void 0)}})}),children:(0,v.jsx)(_.X,{headers:je,rows:y.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.id}),(0,v.jsx)(a.xP,{children:t.username}),(0,v.jsx)(a.xP,{children:t.cwd}),(0,v.jsx)(a.xP,{children:t.note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),I(!0),fe(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ve(),N({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(C||A)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(C?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),I(!1),fe(void 0)}}),C&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!M)return void(0,x.zN)("password not empty");if((0,m.CB)(M))return void(0,x.zN)("username not empty char");const e=ye(),t=await c.wm.post("create_user",e);ve(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ve(),b(!1),I(!1),fe(void 0))}}),A&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ye();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ve())}})]}),children:[(0,v.jsx)("label",{children:e("用户名")}),(0,v.jsx)(r.Sm,{value:K,handleInputChange:e=>B(e)}),(0,v.jsx)("label",{children:e("密码")}),(0,v.jsx)(r.Sm,{type:"password",value:M,handleInputChange:e=>$(e)}),(0,v.jsxs)("label",{children:[!he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{U([...E,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{disabled:""!==he.cwd&&void 0!==he.cwd,value:G,handleInputChange:e=>q(e)}),(E??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.access_dirs?.length&&void 0!==he?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,U([...E])}})}),0===he?.access_dirs?.length||void 0===he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),U([...E])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{Z([...T,""])},title:e("添加")}),e("禁止目录范围")]}),(T??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.not_access_dirs?.length&&void 0!==he?.not_access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,Z([...T])}})}),0===he?.not_access_dirs?.length||void 0===he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),Z([...T])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{D([...H,""])},title:e("添加")}),e("只读目录范围")]}),(H??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.only_read_dirs?.length&&void 0!==he?.only_read_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,D([...H])}})}),0===he?.only_read_dirs?.length||void 0===he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{H.splice(s,1),D([...H])},title:e("删除")})]},s)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.access_cmd&&void 0!==he.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>L(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.not_access_cmd&&void 0!==he.not_access_cmd,value:Q,placeholder:"use blank split",handleInputChange:e=>J(e)}),!ae&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("label",{children:e("角色")}),(0,v.jsx)(r.l6,{value:de,onChange:e=>{ge(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of xe)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{disabled:""!==he.language&&void 0!==he.language,value:R,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{disabled:""!==he.theme&&void 0!==he.theme,value:ee,onChange:e=>{te(e)},options:pe}),(0,v.jsx)(P,{is_disable:e=>{if(!0===ae)return!0;if(de){const t=z.get(de);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,O.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,v.jsx)("label",{children:e("备注")}),(0,v.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function M(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,g.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),[C,b]=(0,g.fp)(u.AG.confirm),[A,I]=(0,n.useState)(""),[V,N]=(0,n.useState)(""),[K,z]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)([]),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),z(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),E(e?.access_cmd??""),T(e?.not_access_cmd??""),H(e?.language??""),W(e?.theme??""),Q(e?.auth_list??[]),R(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!A)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=Z,e.theme=D,e.access_dirs=K,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=V,e.access_cmd=q,e.not_access_cmd=U,e.auth_list=L,e.role_note=Y,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("角色")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{w(!0),S(!1),ie(void 0)}})}),children:(0,v.jsx)(_.X,{headers:se,rows:p.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.role_id}),(0,v.jsx)(a.xP,{children:t.role_name}),(0,v.jsx)(a.xP,{children:t.role_note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{w(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{b({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ne(),b({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(y||k)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{w(!1),S(!1),ie(void 0)}}),y&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=le();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ne(),w(!1),S(!1),ie(void 0))}}),k&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=le();if(!e)return;e.role_id=J;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ne())}})]}),children:[(0,v.jsx)("label",{children:e("角色名")}),(0,v.jsx)(r.Sm,{value:A,handleInputChange:e=>I(e)}),(0,v.jsx)("label",{children:e("角色备注")}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{z([...K,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:V,handleInputChange:e=>N(e)}),(K??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{K[t]=e,z([...K])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{K.splice(t,1),z([...K])},title:"删除"})]},t)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{M([...B,""])},title:"添加"}),e("禁止目录范围")]}),(B??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:t,handleInputChange:e=>{B[s]=e,M([...B])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{B.splice(s,1),M([...B])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{G([...$,""])},title:e("添加")}),e("只读目录范围")]}),($??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{$[t]=e,G([...$])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{$.splice(t,1),G([...$])},title:"删除"})]},t)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{value:q,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{value:U,placeholder:"use blank split",handleInputChange:e=>T(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:Z,onChange:e=>{H(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{value:D,onChange:e=>{W(e)},options:te}),(0,v.jsx)(P,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,O.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function $(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[f,y]=(0,g.fp)(u.AG.prompt_card),[k,C]=(0,n.useState)([]),[b,A]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,K]=(0,g.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),A(e.data.quick_cmd),N(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&C(t.data??[])})(),Q(O?.user_data?.language),R(O?.user_data?.theme),ee(O?.user_data?.upload_file_ignore)},[]);const te=(0,F.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件夹路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件夹路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,x.SK)("保存成功"),p(),s())}})]}),children:(0,v.jsx)(_.X,{headers:B,rows:m.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)("div",{children:0!==s&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("个人保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C([...k,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",k)).code===d.m.Success&&((0,x.SK)("保存成功"),p())}})]}),children:(0,v.jsx)(_.X,{headers:M,rows:k.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),C([...k])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("修改密码"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!q||!U)return void(0,x.zN)("账号密码不能为空");if(U!==Z)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=q,e.password=U,e.confirm_password=Z,e.user_id=O.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:e("新账号"),value:q,handleInputChange:e=>{E(e)}}),(0,v.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{T(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{H(e)}})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("个性化设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:Y}})).code===d.m.Success&&((0,x.SK)("修改成功"),s())}}),children:[e("语言"),(0,v.jsx)(r.l6,{value:L,onChange:e=>{Q(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,v.jsx)(r.l6,{value:J,onChange:e=>{R(e)},options:z}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>{ee(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("目录快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("目录快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{cmd:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:b})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:$,rows:b.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:V})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:G,rows:V.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})})]})]})]})})}var G=s(87361);function q(){const{t:e}=(0,h.Bd)(),{check_user_auth:t}=(0,y.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,v.jsx)($,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,v.jsx)(N,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,v.jsx)(K,{})}),t(l.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,v.jsx)(b,{})}),t(l.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,v.jsx)(B,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,v.jsx)(M,{})}),(0,v.jsx)(i.W1,{optionList:s,father_route:G.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>_,o:()=>u});var n=s(34843),i=s(82893),l=s(74777),a=s(96540),o=s(22022),r=s(23430),c=s(14284),d=s(74848);function _(){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,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsx)("ul",{children:(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。"})})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let h=r.Ky;function u(){const[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];h=[...r.Ky,...s],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),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("年前")}`}},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
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6413],{75897(e,t,s){s.d(t,{L:()=>i});let n=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_workflow_router_key="customer_workflow_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.sys_software="sys_software",e.protection_directory="sys_protection_directory",e.dir_upload_max_num="dir_upload_max_num",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e.extra_env_path_list_key="extra_env_path_list_key",e.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e}({});const i=n.self_auth_jscode},77481(e,t,s){s.d(t,{S:()=>a,X:()=>l});var n=s(96540),i=s(74848);function l(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,s)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},76413(e,t,s){s.r(t),s.d(t,{default:()=>q});var n=s(96540),i=s(75725),l=s(23430),a=s(70447),o=s(85997),r=s(61443),c=s(14284),d=s(53459),_=s(77481),h=s(22022),u=s(82893),p=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function f(e){const{t}=(0,h.Bd)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.title}),e.info_click&&(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");l([t,...s])}}),(0,v.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,v.jsx)(_.X,{headers:e.headers,rows:s.map((n,i)=>{const a=[];for(let t=0;t<e.headers.length;t++)a.push((0,v.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return a.push((0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,v.jsx)(o.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,p.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,v.jsx)(o.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),a}),width:"10rem"})})})}var g=s(34843),y=s(78247),w=s(24659);function k(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),l=(0,w.K)(),f=[e("路由"),e("auth"),e("备注")],[k,S]=(0,g.fp)(u.AG.editorSetting),[C,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&b(e.data)})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自定义api路由")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([{note:"",needAuth:!1,router:""},...C])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",C)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,v.jsx)(_.X,{headers:f,rows:C.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,b([...C])},no_border:!0}),(0,v.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,b([...C])},options:l,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,b([...C])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)}),(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,x.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);S({model:"ace/mode/javascript",open:!0,fileName:e.router,save:async t=>{const s={context:t,router:e.router};(await c.XO.post("jscode/save",s)).code===d.m.Success&&(y.xK.set_value_temp(""),S({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),y.xK.set_value_temp(t.data)})(t)}),t.router&&(0,v.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,p.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem"})})})}var S=s(23496),C=s(57952);function b(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),[l,a]=(0,g.fp)(u.AG.router_jump),o=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(C.A,{}),(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(f,{title:e("页面资源路由"),headers:o,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_router);if(e.code===d.m.Success){if(l?.page_self_router_api_data){for(const t of e.data)t[1]===l?.page_self_router_api_data[1]&&(0,x.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,l?.page_self_router_api_data),e.data=[t,...e.data],a({})}return e.data}return[]},save:async e=>{(await c.XO.post(S.s.setting_customer_router_save,e)).code===d.m.Success&&(0,x.SK)("success")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})},need_copy:!0}),(0,v.jsx)(f,{title:e("workflow触发路由"),headers:r,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(S.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,x.SK)("保存成功")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})}})]}),(0,v.jsx)(i.VP,{children:(0,v.jsx)(k,{})})]})]})}var A=s(75897),I=s(74777),V=s(6960),X=s(7523);function N(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[j,f]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[b,N]=(0,n.useState)(""),[O,F]=(0,g.fp)(u.AG.prompt_card),[K,P]=(0,n.useState)(!1),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,g.fp)(u.AG.editorSetting),[E,U]=(0,n.useState)(I.aM.close),[T,Z]=(0,n.useState)(void 0),{t:H,i18n:D}=(0,h.Bd)(),[W,L]=(0,g.fp)(u.AG.user_base_info),{check_user_auth:Q}=(0,y.MH)(),{initUserInfo:J}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){m(e.data.self_auth_open),f(e.data.shell_cmd_check_open),k(e.data.recycle_open),N(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info);const n=e.data.https_setting;n&&(P(n.open),B(n.cert_path||""),$(n.key_path||""))}const s=await c.XO.get("token");if(s.code===d.m.Success){const e=s.data;if(!e)return;e.length&&Z(e.length),e.mode&&U(e.mode)}})()},[]);return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.Zp,{title:H("自定义登录auth"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("self_auth_open/save",{open:p})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("self_auth_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e,router:A.L};0===(await c.XO.post("jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:p,onChange:e=>{m(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})}),(0,v.jsx)(a.Zp,{title:H("自定义shell命令校验"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("shell_cmd_check_open/save",{open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("shell_cmd_check_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e};0===(await c.XO.post("shell_cmd_check_open/jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:j,onChange:e=>{f(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})})]})}),(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:H("文件回收站")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{F({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:H("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(w&&!b)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:b,open:w})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:H("目录"),value:b,handleInputChange:e=>{N(e)}}),(0,v.jsx)(r.l6,{value:w,onChange:e=>{k(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})]}),(0,v.jsxs)(a.Zp,{title:H("token过期时间"),rightBottomCom:(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(o.C3,{text:H("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=E,I.aM.length!==e.mode||T||(0,x.zN)("秒数不能为空"),e.length=parseInt(T);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:[(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(r.U6,{value:1,context:H("关闭"),selected:E===I.aM.close,onchange:()=>{U(I.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:H("指定时间"),selected:E===I.aM.length,onchange:()=>{U(I.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:H("永不过期"),selected:E===I.aM.forver,onchange:()=>{U(I.aM.forver)}})]}),E===I.aM.length&&(0,v.jsx)(r.Sm,{placeholder:H("秒"),value:T,handleInputChange:e=>{Z(e)}})]})]})}),(0,v.jsx)(i.VP,{widthPer:40,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{title:H("通用设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:s}})).code===d.m.Success&&((0,x.SK)("修改成功"),J())}}),children:[H("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),H("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(a.Zp,{title:H("HTTPS 设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(K){if(!z)return void(0,x.zN)("证书路径不能为空");if(!M)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=K,e.cert_path=z,e.key_path=M;(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:K})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:K,onChange:e=>{P(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]}),K&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:H("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:H("证书文件路径(cert.pem/fullchain.pem)"),value:z,handleInputChange:e=>{B(e)}}),(0,v.jsx)("div",{children:H("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:H("私钥文件路径(privkey.pem)"),value:M,handleInputChange:e=>{$(e)}})]})]})]})}),(0,v.jsx)(C.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[H("系统运行于"),": ",(0,V.s)(W.runing_time_length)]}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:6.14.0",null!=W.latest_version&&"6.14.0"!==W.latest_version?` -> ${W.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:H("官网地址"),target:"_blank",children:`filecat ${H("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[H("安装方式")," :",W.process_env_run_env]})]})})]})}var O=s(64694),F=s(92350);function K(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[K,P]=(0,n.useState)([]),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)([]),G=(0,w.K)(),q=[e("软件"),e("是否安装"),e("路径")],E=[e("编号"),e("路径"),e("备注")],U=[e("编号"),e("路径"),e("是否开启"),e("备注")],T=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],H=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:D}=(0,y.MH)(),W=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&N(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&f(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&B(t.data),W(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&b(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&I(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&$(i.data??[])})()},[]);const Q=(0,F.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",M)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(i.J,{widthPer:100,children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{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,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of A)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,O.di)(A,e=>e.index);(await c.XO.post("dir_upload_max_num/save",A)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:Z,rows:A.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,I([...A])},options:G,no_border:!0}),(0,v.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,v.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,v.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,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem"})})}),(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PATH")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:V})).code===d.m.Success&&((0,x.SK)("保存成功"),W(),s())}})]}),children:(0,v.jsx)(_.X,{headers:U,rows:V.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,N([...V])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PTY CMD")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:z})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:z,handleInputChange:e=>{B(e)}})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("Workflow Job")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...K,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",K)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,v.jsx)(_.X,{headers:T,rows:K.map((t,s)=>[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>()=>{P([...K.splice(s,1)])}})]),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("插件配置")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...M,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,v.jsx)(_.X,{headers:H,rows:M.map((t,s)=>{const n=[s,(0,v.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,$([...M])},options:G,no_border:!0}),(0,v.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{M.splice(e,1),$([...M])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("系统保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...C,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",C)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:E,rows:C.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{title:e("外部软件"),titleCom:(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,x.SK)("保存成功"),s())}}),children:(0,v.jsx)(_.X,{headers:q,rows:j.map((t,s)=>[(0,v.jsx)("div",{children:t.id}),(0,v.jsx)(a.fq,{ok:t.installed}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("默认使用环境变量")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:"信息"})]),width:"10rem"})})]})})]})]})}function P(e){const{t,i18n:s}=(0,h.Bd)(),[i,a]=(0,g.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("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd删除、添加管理"),permission:l.oV.systemd_update}]},{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 Chat Page"),permission:l.oV.ai_agent_page}]},{title:t("文件权限"),list:[{title:t("文件删除、剪切、重命名"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("文件创建、上传、内容更新、解压缩"),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("htts"),permission:l.oV.https_file},{title:t("token时间修改"),permission:l.oV.token_update},{title:t("自定义auth"),permission:l.oV.code_auth},{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("shell命令检测"),permission:l.oV.shell_cmd_check}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),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("系统保护路径更新"),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("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("网址导航"),permission:l.oV.net_site_tag_update},{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("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("网址导航"),permission:l.oV.nav_net_tag},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,v.jsx)(n.Fragment,{children:o.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.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 z=new Map;function B(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[j,f]=(0,g.fp)(u.AG.user_base_info),[y,w]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[V,N]=(0,g.fp)(u.AG.confirm),[K,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[E,U]=(0,n.useState)([]),[T,Z]=(0,n.useState)([]),[H,D]=(0,n.useState)([]),[W,L]=(0,n.useState)(""),[Q,J]=(0,n.useState)(""),[R,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,ce]=(0,n.useState)(""),[de,_e]=(0,n.useState)(""),[he,ue]=(0,n.useState)({}),pe=(0,F.o)(),[xe,me]=(0,n.useState)([]),je=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ve=async()=>{const e=await c.wm.get("all_users");e.code===d.m.Success&&w(e.data);const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),z.clear();for(const e of t.data)z.set(e.role_id,e)}},fe=e=>{B(e?.username??""),$(e?.password??""),q(e?.cwd??""),U(e?.access_dirs??[]),Z(e?.not_access_dirs??[]),D(e?.only_read_dirs??[]),L(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),ce(e?.id??""),e?.bind_role_id?ge(e.bind_role_id,e.auth_list??[]):(_e(""),ue({}))};(0,n.useEffect)(()=>{ve()},[]);const ge=(e,t=[])=>{if(!e)return _e(""),void ue({});const s=z.get(e);if(s){if(s.cwd&&q(s.cwd),s.access_dirs&&s.access_dirs.length>0&&U(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&Z(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&D(s.only_read_dirs),s.access_cmd&&L(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))}_e(e),ue(s)}},ye=()=>{if(!K)return void(0,x.zN)("username not empty");if((0,m.CB)(K))return void(0,x.zN)("username not empty char");if(!G)return void(0,x.zN)("cwd not empty");const e=new l.E0;return e.language=R,e.theme=ee,e.access_dirs=E,e.username=K,e.password=M,e.not_access_dirs=T,e.only_read_dirs=H,e.cwd=G,e.note=ie,e.access_cmd=W,e.not_access_cmd=Q,e.auth_list=se,e.bind_role_id=de,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("用户")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),I(!1),fe(void 0)}})}),children:(0,v.jsx)(_.X,{headers:je,rows:y.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.id}),(0,v.jsx)(a.xP,{children:t.username}),(0,v.jsx)(a.xP,{children:t.cwd}),(0,v.jsx)(a.xP,{children:t.note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),I(!0),fe(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ve(),N({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(C||A)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(C?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),I(!1),fe(void 0)}}),C&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!M)return void(0,x.zN)("password not empty");if((0,m.CB)(M))return void(0,x.zN)("username not empty char");const e=ye(),t=await c.wm.post("create_user",e);ve(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ve(),b(!1),I(!1),fe(void 0))}}),A&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ye();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ve())}})]}),children:[(0,v.jsx)("label",{children:e("用户名")}),(0,v.jsx)(r.Sm,{value:K,handleInputChange:e=>B(e)}),(0,v.jsx)("label",{children:e("密码")}),(0,v.jsx)(r.Sm,{type:"password",value:M,handleInputChange:e=>$(e)}),(0,v.jsxs)("label",{children:[!he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{U([...E,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{disabled:""!==he.cwd&&void 0!==he.cwd,value:G,handleInputChange:e=>q(e)}),(E??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.access_dirs?.length&&void 0!==he?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,U([...E])}})}),0===he?.access_dirs?.length||void 0===he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),U([...E])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{Z([...T,""])},title:e("添加")}),e("禁止目录范围")]}),(T??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.not_access_dirs?.length&&void 0!==he?.not_access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,Z([...T])}})}),0===he?.not_access_dirs?.length||void 0===he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),Z([...T])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{D([...H,""])},title:e("添加")}),e("只读目录范围")]}),(H??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.only_read_dirs?.length&&void 0!==he?.only_read_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,D([...H])}})}),0===he?.only_read_dirs?.length||void 0===he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{H.splice(s,1),D([...H])},title:e("删除")})]},s)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.access_cmd&&void 0!==he.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>L(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.not_access_cmd&&void 0!==he.not_access_cmd,value:Q,placeholder:"use blank split",handleInputChange:e=>J(e)}),!ae&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("label",{children:e("角色")}),(0,v.jsx)(r.l6,{value:de,onChange:e=>{ge(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of xe)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{disabled:""!==he.language&&void 0!==he.language,value:R,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{disabled:""!==he.theme&&void 0!==he.theme,value:ee,onChange:e=>{te(e)},options:pe}),(0,v.jsx)(P,{is_disable:e=>{if(!0===ae)return!0;if(de){const t=z.get(de);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,O.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,v.jsx)("label",{children:e("备注")}),(0,v.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function M(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,g.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),[C,b]=(0,g.fp)(u.AG.confirm),[A,I]=(0,n.useState)(""),[V,N]=(0,n.useState)(""),[K,z]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)([]),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),z(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),E(e?.access_cmd??""),T(e?.not_access_cmd??""),H(e?.language??""),W(e?.theme??""),Q(e?.auth_list??[]),R(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!A)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=Z,e.theme=D,e.access_dirs=K,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=V,e.access_cmd=q,e.not_access_cmd=U,e.auth_list=L,e.role_note=Y,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("角色")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{w(!0),S(!1),ie(void 0)}})}),children:(0,v.jsx)(_.X,{headers:se,rows:p.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.role_id}),(0,v.jsx)(a.xP,{children:t.role_name}),(0,v.jsx)(a.xP,{children:t.role_note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{w(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{b({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ne(),b({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(y||k)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{w(!1),S(!1),ie(void 0)}}),y&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=le();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ne(),w(!1),S(!1),ie(void 0))}}),k&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=le();if(!e)return;e.role_id=J;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ne())}})]}),children:[(0,v.jsx)("label",{children:e("角色名")}),(0,v.jsx)(r.Sm,{value:A,handleInputChange:e=>I(e)}),(0,v.jsx)("label",{children:e("角色备注")}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{z([...K,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:V,handleInputChange:e=>N(e)}),(K??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{K[t]=e,z([...K])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{K.splice(t,1),z([...K])},title:"删除"})]},t)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{M([...B,""])},title:"添加"}),e("禁止目录范围")]}),(B??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:t,handleInputChange:e=>{B[s]=e,M([...B])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{B.splice(s,1),M([...B])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{G([...$,""])},title:e("添加")}),e("只读目录范围")]}),($??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{$[t]=e,G([...$])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{$.splice(t,1),G([...$])},title:"删除"})]},t)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{value:q,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{value:U,placeholder:"use blank split",handleInputChange:e=>T(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:Z,onChange:e=>{H(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{value:D,onChange:e=>{W(e)},options:te}),(0,v.jsx)(P,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,O.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function $(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[f,y]=(0,g.fp)(u.AG.prompt_card),[k,C]=(0,n.useState)([]),[b,A]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,K]=(0,g.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),A(e.data.quick_cmd),N(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&C(t.data??[])})(),Q(O?.user_data?.language),R(O?.user_data?.theme),ee(O?.user_data?.upload_file_ignore)},[]);const te=(0,F.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件夹路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件夹路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,x.SK)("保存成功"),p(),s())}})]}),children:(0,v.jsx)(_.X,{headers:B,rows:m.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)("div",{children:0!==s&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("个人保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C([...k,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",k)).code===d.m.Success&&((0,x.SK)("保存成功"),p())}})]}),children:(0,v.jsx)(_.X,{headers:M,rows:k.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),C([...k])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("修改密码"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!q||!U)return void(0,x.zN)("账号密码不能为空");if(U!==Z)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=q,e.password=U,e.confirm_password=Z,e.user_id=O.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:e("新账号"),value:q,handleInputChange:e=>{E(e)}}),(0,v.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{T(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{H(e)}})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("个性化设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:Y}})).code===d.m.Success&&((0,x.SK)("修改成功"),s())}}),children:[e("语言"),(0,v.jsx)(r.l6,{value:L,onChange:e=>{Q(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,v.jsx)(r.l6,{value:J,onChange:e=>{R(e)},options:z}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>{ee(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("目录快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("目录快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{cmd:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:b})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:$,rows:b.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:V})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:G,rows:V.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})})]})]})]})})}var G=s(87361);function q(){const{t:e}=(0,h.Bd)(),{check_user_auth:t}=(0,y.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,v.jsx)($,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,v.jsx)(N,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,v.jsx)(K,{})}),t(l.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,v.jsx)(b,{})}),t(l.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,v.jsx)(B,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,v.jsx)(M,{})}),(0,v.jsx)(i.W1,{optionList:s,father_route:G.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>_,o:()=>u});var n=s(34843),i=s(82893),l=s(74777),a=s(96540),o=s(22022),r=s(23430),c=s(14284),d=s(74848);function _(){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,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsx)("ul",{children:(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。"})})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let h=r.Ky;function u(){const[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];h=[...r.Ky,...s],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),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("年前")}`}},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"}]}])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6505],{26505(e,t,s){s.r(t),s.d(t,{default:()=>k});var a=s(96540),r=(s(82893),s(14284)),n=s(62042),o=s(22022),i=s(85997),l=s(57952),d=s(52671),c=s(34289),p=s(87361),h=s(2543),x=s(74848);const u="var(--surfacePrimary, #ffffff)",f="var(--surfaceSecondary, #f1f3f4)",g="var(--divider, rgba(0,0,0,0.08))",y="var(--textPrimary, #202124)",b="var(--textSecondary, #5f6368)",m="var(--primary, #1a73e8)",j="var(--primary-light, #d2e3fc)",v="var(--secondary, #34a853)",S="var(--accent, #ea4335)",z="#f9ab00";function k(){const{t:e}=(0,o.Bd)(),t=(0,d.Zp)();let s=decodeURIComponent((0,c.GG)(p.o.git_page,(0,c.vX)()));s=s.replace(/\/+$/,"");const[k,C]=(0,a.useState)([]),[N,U]=(0,a.useState)([]),[$,R]=(0,a.useState)({current:"",branches:[]}),[T,W]=(0,a.useState)(""),[B,K]=(0,a.useState)(new Set),[_,P]=(0,a.useState)("status"),[A,D]=(0,a.useState)(!1),[I,F]=(0,a.useState)(16),[L,E]=(0,a.useState)(!1),G=(0,a.useRef)(null),X=(0,a.useRef)(null);(0,a.useEffect)(()=>{s&&(H(),M(),Z())},[s]);const H=async()=>{try{D(!0);const e=await r.TU.post("status",{path:s});0===e.code&&C(e.data||[])}catch(e){}finally{D(!1)}},M=async()=>{try{const e=await r.TU.post("log",{path:s,maxCount:50});0===e.code&&U(e.data||[])}catch(e){}},Z=async()=>{try{const e=await r.TU.post("branches",{path:s});0===e.code&&R(e.data||{current:"",branches:[]})}catch(e){}},q=()=>{B.size===k.length?K(new Set):K(new Set(k.map(e=>e.path)))},J=async(t=!1)=>{try{D(!0);const a=await r.TU.post("push",{path:s,force:t});0===a.code?(0,n.SK)(e("推送成功")):(0,n.zN)(a.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}},O=e=>{switch(e){case"modified":return z;case"added":return v;case"deleted":case"conflict":return S;case"untracked":default:return b;case"renamed":return m}},Q=e=>{switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"untracked":return"?";case"renamed":return"R";case"conflict":return"!";default:return e}},V=(0,a.useCallback)(h.throttle(e=>{const t=parseFloat(getComputedStyle(X.current).fontSize),s=window.innerWidth/t-4,a=e.clientX/t,r=2.25+G.current.offsetWidth/t;a<=s&&a>=r&&F(parseFloat(a.toFixed(2)))},32),[]),Y=()=>{E(!1),X.current.removeEventListener("pointermove",V)};s.split("/").filter(Boolean).pop();return(0,x.jsxs)("div",{className:"studio",children:[(0,x.jsx)(l.A,{ignore_tags:!0,left_children:[(0,x.jsx)(i.rA,{title:e("取消"),icon:"close",onClick:()=>{t(-1)}},1),(0,x.jsx)("span",{children:s})],children:(0,x.jsx)(i.rA,{icon:"refresh",title:e("刷新"),onClick:()=>{H(),M(),Z()}})}),(0,x.jsxs)("div",{className:"studio-body",ref:X,children:[(0,x.jsxs)("div",{className:"studio-nav",style:{width:I-1+"em"},children:[(0,x.jsxs)("div",{style:{display:"flex",borderBottom:`1px solid ${g}`},children:[(0,x.jsxs)("button",{onClick:()=>P("status"),style:{flex:1,padding:"10px 8px",border:"none",background:"status"===_?j:"transparent",color:"status"===_?m:b,cursor:"pointer",fontSize:13,fontWeight:"status"===_?600:400,borderBottom:"status"===_?`2px solid ${m}`:"2px solid transparent"},children:["📝 ",e("变更")," (",k.length,")"]}),(0,x.jsxs)("button",{onClick:()=>P("log"),style:{flex:1,padding:"10px 8px",border:"none",background:"log"===_?j:"transparent",color:"log"===_?m:b,cursor:"pointer",fontSize:13,fontWeight:"log"===_?600:400,borderBottom:"log"===_?`2px solid ${m}`:"2px solid transparent"},children:["📜 ",e("提交记录")," (",N.length,")"]})]}),"status"===_&&(0,x.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[k.length>0&&(0,x.jsxs)("div",{style:{padding:"6px 12px",borderBottom:`1px solid ${g}`,display:"flex",alignItems:"center",gap:8,fontSize:12,color:b,cursor:"pointer"},onClick:q,children:[(0,x.jsx)("input",{type:"checkbox",checked:B.size===k.length&&k.length>0,onChange:q,style:{cursor:"pointer"}}),(0,x.jsxs)("span",{children:[e("全选")," (",B.size,"/",k.length,")"]})]}),k.map(e=>(0,x.jsxs)("div",{onClick:()=>(e=>{const t=new Set(B);t.has(e)?t.delete(e):t.add(e),K(t)})(e.path),style:{padding:"8px 12px",cursor:"pointer",borderBottom:`1px solid ${g}`,display:"flex",alignItems:"center",gap:8,background:B.has(e.path)?j:"transparent",transition:"background 0.2s"},children:[(0,x.jsx)("input",{type:"checkbox",checked:B.has(e.path),onChange:()=>{},style:{cursor:"pointer"}}),(0,x.jsx)("span",{style:{fontSize:11,fontWeight:600,width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#fff",background:O(e.status),flexShrink:0},children:Q(e.status)}),(0,x.jsxs)("span",{style:{fontSize:13,color:y,wordBreak:"break-all"},children:[e.path,e.oldPath&&(0,x.jsxs)("span",{style:{color:b,fontSize:11},children:[" (← ",e.oldPath,")"]})]})]},e.path)),0===k.length&&(0,x.jsx)("p",{style:{color:b,textAlign:"center",padding:20,fontSize:12},children:e("没有变更")})]}),"log"===_&&(0,x.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[N.map((e,t)=>(0,x.jsxs)("div",{style:{padding:"10px 12px",borderBottom:`1px solid ${g}`,display:"flex",flexDirection:"column",gap:4},children:[(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,x.jsx)("span",{style:{fontSize:11,fontFamily:"monospace",color:m,background:j,padding:"2px 6px",borderRadius:4},children:e.hash}),(0,x.jsx)("span",{style:{fontSize:13,color:y,flex:1},children:e.message})]}),(0,x.jsxs)("div",{style:{fontSize:11,color:b,paddingLeft:4},children:[e.author," · ",e.date]})]},t)),0===N.length&&(0,x.jsx)("p",{style:{color:b,textAlign:"center",padding:20,fontSize:12},children:e("暂无提交记录")})]})]}),(0,x.jsx)("div",{className:"studio__divider",ref:G,onPointerDown:()=>{E(!0),X.current.addEventListener("pointermove",V)},onPointerUp:Y}),L&&(0,x.jsx)("div",{className:"shell__overlay",onPointerUp:Y}),(0,x.jsx)("div",{className:"studio-editor",children:(0,x.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"16px",gap:12,overflow:"auto"},children:[(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u},children:[(0,x.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:y,marginBottom:8},children:["🌿 ",e("分支"),": ",(0,x.jsx)("span",{style:{color:v},children:$.current})]}),(0,x.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:$.branches.map(t=>(0,x.jsx)("button",{onClick:()=>(async t=>{try{D(!0);const a=await r.TU.post("checkout",{path:s,branch:t});0===a.code?((0,n.SK)(e("切换分支成功")),H(),M(),Z()):(0,n.zN)(a.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}})(t),disabled:t===$.current||t.startsWith("*"),style:{padding:"4px 10px",borderRadius:12,fontSize:11,border:t===$.current?`1px solid ${v}`:`1px solid ${g}`,background:t===$.current?j:"transparent",color:t===$.current?v:b,cursor:t===$.current?"default":"pointer",opacity:t===$.current?1:.8},children:t.replace("remotes/origin/","")},t))})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u,display:"flex",flexDirection:"column",gap:8},children:[(0,x.jsx)("textarea",{placeholder:e("输入提交信息..."),value:T,onChange:e=>W(e.target.value),rows:2,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${g}`,background:u,color:y,fontSize:13,boxSizing:"border-box",resize:"vertical"}}),(0,x.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,x.jsxs)("button",{onClick:async()=>{if(T.trim())try{D(!0);const t=await r.TU.post("commit",{path:s,message:T.trim(),allChanged:!0});0===t.code?((0,n.SK)(e("提交成功")),W(""),H(),M()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}else(0,n.zN)(e("请输入提交信息"))},disabled:A||!T.trim(),style:w(v),children:["✅ ",e("提交")]}),(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("add_all",{path:s});0===t.code?((0,n.SK)(e("已暂存全部")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(m),children:["➕ ",e("暂存全部")]}),(0,x.jsxs)("button",{onClick:async()=>{if(0!==B.size)try{const t=await r.TU.post("add",{path:s,files:[...B]});0===t.code?((0,n.SK)(e("已暂存")),K(new Set),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(e("请先选择文件"))},style:w(m),children:["📥 ",e("暂存选中")]}),(0,x.jsxs)("button",{onClick:async()=>{if(0!==B.size)try{const t=await r.TU.post("reset",{path:s,files:[...B]});0===t.code?((0,n.SK)(e("已取消暂存")),K(new Set),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(e("请先选择文件"))},style:w(z),children:["↩ ",e("取消暂存")]})]})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:u,display:"flex",flexDirection:"column",gap:8},children:[(0,x.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:y},children:["☁️ ",e("远程操作")]}),(0,x.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,x.jsxs)("button",{onClick:async()=>{try{D(!0);const t=await r.TU.post("pull",{path:s});0===t.code?((0,n.SK)(e("拉取成功")),H(),M()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}finally{D(!1)}},disabled:A,style:w(m),children:["⬇ ",e("拉取")]}),(0,x.jsxs)("button",{onClick:()=>J(!1),disabled:A,style:w(m),children:["⬆ ",e("推送")]}),(0,x.jsxs)("button",{onClick:()=>J(!0),disabled:A,style:w(S),children:["⚠ ",e("强制推送")]})]}),(0,x.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("stash",{path:s});0===t.code?((0,n.SK)(e("暂存工作区成功")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(b),children:["📦 ",e("暂存工作区")]}),(0,x.jsxs)("button",{onClick:async()=>{try{const t=await r.TU.post("stash_pop",{path:s});0===t.code?((0,n.SK)(e("恢复工作区成功")),H()):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:w(b),children:["📤 ",e("恢复工作区")]})]})]}),(0,x.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:`1px solid ${g}`,background:f,fontSize:11,color:b,lineHeight:1.6},children:["💡 ",e("提示:"),(0,x.jsxs)("ul",{style:{margin:"4px 0",paddingLeft:16},children:[(0,x.jsx)("li",{children:e("左侧勾选文件后,使用「暂存选中」将其加入暂存区")}),(0,x.jsx)("li",{children:e("输入提交信息后点击「提交」")}),(0,x.jsx)("li",{children:e("如有冲突,请自行在shell中解决冲突后再提交")}),(0,x.jsx)("li",{children:e("「强制推送」会覆盖远程分支,请谨慎使用")})]})]})]})})]})]})}function w(e){return{padding:"6px 12px",borderRadius:6,border:`1px solid ${e}`,background:"transparent",color:e,cursor:"pointer",fontSize:12}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8714],{47374(e,t,i){i.d(t,{e:()=>f});var o=i(96540),n=i(52671),s=i(64694),a=i(34289),r=i(61443),l=i(75725),c=i(22022),_=i(85997),d=i(74848);function f(e){let t=(0,n.zy)();const[i,f]=(0,o.useState)([]),[p,m]=(0,o.useState)("/"),[h,u]=(0,o.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();o.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const o=i.indexOf(e.baseRoute),n=[];if(-1!=o){t=(0,s.IO)(i.slice(0,o),e.baseRoute);const a=i.slice(o+1);for(let e=0;e<a.length;e++){const i=a[e];n.push({value:i,href:0===e?`${t}${i}/`:(0,s.IO)(n[e-1].href,i)})}m(t),f(n)}},[t]);const y=t=>{t.stopPropagation(),e.clickFun(t)};return(0,d.jsx)("div",{className:"breadcrumbs",onClick:e=>{u(void 0!==h?void 0:"")},children:(0,d.jsx)(o.Fragment,{children:void 0===h?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsx)("span",{className:"chevron",children:(0,d.jsx)(n.N_,{to:p,onClick:y,children:(0,d.jsx)(_.In,{icon:"home"})})}),i.map((e,t)=>(0,d.jsxs)("span",{className:"chevron",children:[(0,d.jsx)(_.In,{icon:"keyboard_arrow_right"}),(0,d.jsx)(n.N_,{to:e.href,onClick:y,children:decodeURIComponent(e.value)})]},t))]}):(0,d.jsx)(l.QM,{click:()=>{u(void 0)},children:(0,d.jsx)(r.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),u(void 0)}})})})})}},78714(e,t,i){i.r(t),i.d(t,{default:()=>N});var o=i(96540),n=i(47374),s=i(34843),a=i(82893),r=i(14284),l=i(52671),c=i(57952),_=i(27690),d=i(34289),f=i(53459),p=i(99214),m=i(61443),h=i(47022),u=i(62042),w=i(22022),v=i(7523),y=i(78247),g=i(88815),x=i(6960),k=i(47071),j=i(14944),G=i(92275),A=i(23430);var C=i(34251),b=i(60096),z=i(85997),P=i(23496),F=i(12730),M=i(75725),$=i(70447),S=i(87361),D=i(74848);let X={};function I(){const{t:e}=(0,w.Bd)();let t=(0,l.zy)();const i=(0,l.Zp)(),{check_user_auth:n}=(0,y.MH)(),[c,f]=(0,s.fp)(a.AG.nowFileList),[m,g]=(0,s.fp)(a.AG.uploadFiles),[x,k]=(0,s.fp)(a.AG.showPrompt),[b,P]=(0,s.fp)(a.AG.selectedFileList),[I,E]=(0,s.fp)(a.AG.copyedFileList),[K,Y]=(0,s.fp)(a.AG.cutedFileList),[L,R]=(0,s.fp)(a.AG.selectedFileList),[H,N]=(0,s.fp)(a.AG.clickFileList),[U,W]=(0,s.fp)(a.AG.fileShellShow),[B,O]=(0,s.fp)(a.AG.file_root_list),[Z,q]=(0,s.fp)(a.AG.file_root_index),[V,T]=(0,o.useState)(void 0),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(v.F),[re,le]=(0,s.fp)(a.AG.user_base_info),{click_file:ce}=(0,y.kZ)(),[_e,de]=(0,s.fp)(a.AG.prompt_card),fe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==h.Iw.folder?1:0),0),[c]),pe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===h.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function me(e){(0,u.SK)(e)}(0,o.useEffect)(()=>{X={}},[t]),(0,o.useEffect)(()=>()=>{W({show:!1,path:""})},[]);const he=(0,p.Vs)(),ue=t=>{de({open:!0,title:e("信息"),context_div:(0,D.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,D.jsx)(M.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,D.jsx)(M.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,D.jsx)(M.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,D.jsx)(M.Yh,{left:`${e("文件夹数")}`,right:pe}),(0,D.jsx)(M.Yh,{left:`${e("文件数")}`,right:fe}),(0,D.jsx)(M.Yh,{left:`${e("当前位置")}`,right:(0,D.jsx)($.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{j.ws.removeMsg(G.HK.file_info)}})};return(0,D.jsxs)(o.Fragment,{children:[b.length>0&&(0,D.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{k({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,b);E(e.map(e=>(0,p.Ok)(e.name))),Y([]),me("已复制")}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,b);Y(e.map(e=>(0,p.Ok)(e.name))),E([]),me("已剪切")}}),(I.length>0||K.length>0)&&(0,D.jsx)(z.rA,{onClick:function(){k({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:I.length+K.length}),b.length>0&&(0,D.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?k({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,u.zN)("没有选中")}}),1===b.length&&(0,D.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){k({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),ne&&(0,D.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{te(!ee)}}),(0,D.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){U.show?W({show:!1,path:""}):W({show:!0,path:(0,d.GG)("file",(0,d.vX)())})}}),n(A.oV.share_file)&&(0,D.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`/${S.o.share_list_setting_page}`)}}),(0,D.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:he}),(0,D.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){k({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){k({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{k({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const o=[],n=new Set;for(let e=0;e<t.length;e++){const s=t[e],a=i?s.webkitRelativePath:`${s.webkitRelativePath}${s.name}`;s.fullPath=a,i&&n.add((0,F.S)(a)),o.push(s)}const s=[];if(i)for(const e of n)s.push({isDir:!0,fullPath:e,name:e});s.push(...o),g(s),k({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,D.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!X.now_absolute_path){j.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(X={...X,...i},j.ws.removeMsg(G.HK.file_info),ue(X))});const t=await j.ws.sendData(G.HK.file_info,{type:h.Iw.folder,path:(0,d.GG)("file",(0,d.vX)())});e=t.context,X=e,ue(X)}ue(X)}}),(0,D.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory,o.items=B,o.item_pre_value=Z,o.textClick=async t=>{if(-1===t)return i(`/${S.o.setting_private_env_setting}`),k({data:void 0,overlay:!1,type:"",show:!1}),void(0,u.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await r.$M.post("base_switch",{root_index:e}),await ae(),i("/file/"),R([]),N([])})(t),k({data:void 0,overlay:!1,type:"",show:!1})},k({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}})]})}var E=i(2543),K=i(21499),Y=i(64694);const L=o.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(i.bind(i,63659))),R=o.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(i.bind(i,81636)));let H;function N(){const[e,t]=(0,s.fp)(a.AG.editorSetting),[i,u]=(0,s.fp)(a.AG.file_preview),{t:F}=(0,w.Bd)();let M=(0,l.zy)();const $=(0,l.Zp)(),[X,N]=(0,s.fp)(a.AG.nowFileList),[U,W]=(0,s.fp)(a.AG.showPrompt),[B,O]=(0,s.fp)(a.AG.selectedFileList),[Z,q]=(0,s.fp)(a.AG.clickFileList),[V,T]=(0,s.fp)(a.AG.fileShellShow),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(v.F),[re,le]=(0,s.fp)(a.AG.user_base_info),{click_file:ce}=(0,y.kZ)(),[_e,de]=(0,s.fp)(a.AG.to_running_files),[fe,pe]=(0,s.fp)(a.AG.file_page),[me]=(0,s.fp)(a.AG.blank_search_mode),[he,ue]=(0,s.fp)(a.AG.blank_search_mode_for_temp),we=function(){const[e,t]=(0,s.fp)(a.AG.user_base_info),{t:i}=(0,w.Bd)(),{check_user_auth:n}=(0,y.MH)(),[c,f]=(0,s.fp)(a.AG.router_jump),m=(0,l.Zp)(),{initUserInfo:u}=(0,o.useContext)(v.F),[g,x]=(0,s.fp)(a.AG.nowFileList),[k,b]=(0,s.fp)(a.AG.showPrompt),[z,F]=(0,s.fp)(a.AG.fileShellShow),[M,$]=(0,s.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory;const s=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max?"green":void 0},children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max?"green":void 0},children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("大小逆序")}),v:A.t8.size_max_min}],l=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode&&e.user_data.file_list_pagination_mode!==A.yM.all?void 0:"green"},children:i("全部加载文件")}),v:A.yM.all},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode===A.yM.pagination?"green":void 0},children:i("分页滚动加载文件")}),v:A.yM.pagination}],c=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type&&e.user_data.file_time_show_type!==A.KD.current?void 0:"green"},children:i("最近时间")}),v:A.KD.current},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type===A.KD.time?"green":void 0},children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type?void 0:"green"},children:i("系统默认")}),v:A.t8.defualt},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.name?"green":void 0},children:i("名字")}),v:A.t8.name},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("修改时间")}),v:!1,items:s},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:l},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,D.jsx)("span",{style:{color:M?"green":void 0},children:i("以空白搜索模式打开目录")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"},{r:i("查看Git提交"),v:"git_page"}];n(A.oV.code_resource)&&w.push({r:i("添加http资源根目录"),v:"code_resource"}),n(A.oV.http_proxy)&&w.push({r:i("在此目录下载http资源"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),o.items=w,o.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,d.GG)("file",(0,d.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`/${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,d.GG)("file",(0,d.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`/${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/setting/customer_router/")}if("http_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({http_download_map_path:e.context.now_absolute_path}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/proxy/http/")}if("zoom_adjust"===e)return b({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{b({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",F({show:!0,path:(0,d.GG)("file",(0,d.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return $(!M),void b({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(P.s.user_save_private_attr,{type:e,...t}),await u(),b({data:void 0,overlay:!1,type:"",show:!1}),m((0,d.vX)())},b({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}}(),ve=async()=>{const e=new k.Nd;e.dir_path=`${(0,d.GG)("file",(0,d.vX)())}`,j.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);de(new Set(t.running_file_list))}}),await j.ws.sendData(G.HK.workflow_realtime,e)},ye=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,g.v7)(i.size),re.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{ve()})),i.name===k.SB&&(t=!0);for(const i of e.folders??[])re.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",i.name===k.SB&&(t=!0);se(t)};(0,o.useEffect)(()=>async()=>{de(new Set)},[]);const ge=()=>{(async()=>{const e=(0,d.GG)("file",(0,d.vX)());if(me||he)return;let t;if(re.user_data.file_list_pagination_mode===A.yM.pagination){if(fe.page_num<0)return;t=await r.$M.post("file_get_page",{param_path:e,page_num:fe.page_num,page_size:fe.page_size});const i=t.data;i.files?.length||pe({page_size:fe.page_size,page_num:-1}),i.files=(0,E.cloneDeep)([...X.files,...i.files])}else t=await r.$M.get(e);if(t.code!==f.m.Success)return;const i=t.data;(0,p.yC)(i,re.user_data.dir_show_type),ye(t.data),N(t.data),H=t.data})(),t({open:!1}),u({open:!1}),se(!1)};(0,o.useEffect)(()=>{ge()},[M,fe]);const xe=e=>{e.target===e.currentTarget&&(O([]),q([]))};return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsxs)(c.A,{left_children:(0,D.jsx)(m.$Z,{handleEnterPress:async()=>{if(me||he){if(O([]),q([]),!J||!J.trim())return void N({files:[],folders:[]});const e=(0,d.GG)("file",(0,d.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:J.trim()});if(t.code!==f.m.Success)return;const i=t.data;return(0,p.yC)(i,re.user_data.dir_show_type),ye(i),N(i),void(H=i)}if(!H)return;O([]),q([]);const e=[],t=[];for(const t of H.files??[])t.name.includes(J)&&e.push(t);for(const e of H.folders??[])e.name.includes(J)&&t.push(e);N({files:e,folders:t})},placeholder:F("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{Q(e)},max_width:"25em"}),children:[(0,D.jsx)("div",{className:"mobile-context-btn",children:(0,D.jsx)(z.rA,{icon:"more_horiz",title:F("右键"),onClick:()=>{const e=B[B.length-1];if(void 0!==e){const t=[...X.folders??[],...X.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],o=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},n={preventDefault:()=>{},stopPropagation:()=>{},clientX:o.left+10,clientY:o.bottom??100},s=new C.ik;s.path=(0,Y.IO)((0,d.vX)(),t.name),s.filename=t.name,s.x=n.clientX,s.y=n.clientY,s.type=t.type===h.Iw.folder?h.Iw.folder:(0,C.uL)(t.name),s.size=t.origin_size,W({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:s})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};we(e)}}})}),(0,D.jsx)(I,{})]}),(0,D.jsx)(n.e,{baseRoute:"file",clickFun:function(){O([]),q([])},input_path_enter:e=>{var t;!function(e){return"string"==typeof e&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\//.test(e))}(e)?$(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let o=e.length-1-t;o>=0;o--)if(e[o]===i)return e.substring(0,o+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,d.vX)(),e)):(e=e.replace(0===(t=re.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),$(e)),O([]),q([]),N({files:[],folders:[]})}}),re.user_data.file_list_pagination_mode===A.yM.pagination?(0,D.jsx)(b.$J,{handleContextMenu:we,clickBlank:xe,list:X.files}):(0,D.jsx)(b.t$,{handleContextMenu:we,file_list:X.files,folder_list:X.folders,clickBlank:xe}),ee&&(0,D.jsx)(L,{}),ie.open&&(0,D.jsx)(R,{})]})}}}]);
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.49a45895e9786d46ad8e.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.0becf41c30bea61f0dd1.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>