filecat 6.60.3 → 6.60.4

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([[1472],{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.auto_upgrade_setting="auto_upgrade_setting",e.ai_long_term_memory_setting="ai_long_term_memory_setting",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))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>E});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(34899),u=s(82893),p=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function g(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 f=s(34843),y=s(78247),w=s(24659);function k(){const{t:e}=(0,h.Bd)(),[t,s]=(0,f.fp)(u.AG.prompt_card),l=(0,w.K)(),g=[e("路由"),e("auth"),e("备注")],[k,S]=(0,f.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:g,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,f.fp)(u.AG.prompt_card),[l,a]=(0,f.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)(g,{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)(g,{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{t:e}=(0,h.Bd)(),{check_user_auth:t}=(0,y.MH)(),[s,i]=(0,n.useState)(!1),[_,p]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[g,w]=(0,n.useState)(180),[k,S]=(0,n.useState)(!1),[C,b]=(0,f.fp)(u.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),p(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),w(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自动升级")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{b({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("保存"),clickFun:async()=>{if(!_)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!g||g<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new I.Mm;t.open=s,t.version_check_url=_,t.exe_download_url=m,t.check_interval_seconds=g;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,v.jsx)("div",{children:e("系统版本检测地址")}),(0,v.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:_,handleInputChange:e=>{p(e)}}),(0,v.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,v.jsxs)(v.Fragment,{children:[!1,(0,v.jsx)("div",{children:e("检测频率(秒)")}),(0,v.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:g,handleInputChange:e=>{w(Number(e)||180)}}),(0,v.jsx)("div",{style:{marginTop:"12px"},children:(0,v.jsx)(o.C3,{text:e(k?"升级检测中...":"立即升级"),clickFun:async()=>{S(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{S(!1)}}})})]})]}):null}function O(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[p,m]=(0,n.useState)(""),[j,g]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[b,O]=(0,n.useState)(!1),[F,K]=(0,n.useState)(""),[P,z]=(0,f.fp)(u.AG.prompt_card),[B,M]=(0,n.useState)(!1),[$,G]=(0,n.useState)(""),[q,E]=(0,n.useState)(""),[T,H]=(0,f.fp)(u.AG.editorSetting),[U,Z]=(0,n.useState)(I.aM.close),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(void 0),{t:J,i18n:R}=(0,h.Bd)(),[Y,ee]=(0,f.fp)(u.AG.user_base_info),{check_user_auth:te}=(0,y.MH)(),{initUserInfo:se}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){g(e.data.self_auth_open),k(e.data.shell_cmd_check_open),O(e.data.recycle_open),K(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info),m(s?.http_proxy||"");const n=e.data.https_setting;n&&(M(n.open),G(n.cert_path||""),E(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&&Q(e.length),e.mode&&Z(e.mode),void 0!==e.persist&&W(e.persist)}})()},[]);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:J("自定义登录auth"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{(await c.XO.post("self_auth_open/save",{open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:J("代码修改"),onClick:async()=>{const e=await c.XO.get("self_auth_open/jscode");H({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(""),H({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:j,onChange:e=>{g(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]})}),(0,v.jsx)(a.Zp,{title:J("自定义shell命令校验"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{(await c.XO.post("shell_cmd_check_open/save",{open:w})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:J("代码修改"),onClick:async()=>{const e=await c.XO.get("shell_cmd_check_open/jscode");H({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(""),H({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:w,onChange:e=>{k(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),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:J("文件回收站")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:J("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),clickFun:async()=>{if(b&&!F)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:F,open:b})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:J("目录"),value:F,handleInputChange:e=>{K(e)}}),(0,v.jsx)(r.l6,{value:b,onChange:e=>{O(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]})]}),(0,v.jsxs)(a.Zp,{title:J("token过期时间"),rightBottomCom:(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(o.C3,{text:J("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=U,e.persist=D,I.aM.length!==e.mode||L||(0,x.zN)("秒数不能为空"),e.length=parseInt(L);(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:J("关闭"),selected:U===I.aM.close,onchange:()=>{Z(I.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:J("指定时间"),selected:U===I.aM.length,onchange:()=>{Z(I.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:J("永不过期"),selected:U===I.aM.forver,onchange:()=>{Z(I.aM.forver)}})]}),U===I.aM.length&&(0,v.jsx)(r.Sm,{placeholder:J("秒"),value:L,handleInputChange:e=>{Q(e)}}),(0,v.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,v.jsx)("input",{type:"checkbox",checked:D,onChange:()=>W(!D)}),J("持久化")]})]})]})}),(0,v.jsx)(i.VP,{widthPer:40,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:J("通用设置")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:J("HTTP 代理说明")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),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,http_proxy:p}})).code===d.m.Success&&((0,x.SK)("修改成功"),se())}}),children:[J("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),(0,v.jsx)("div",{children:J("HTTP 代理地址")}),(0,v.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:p,handleInputChange:e=>{m(e)}}),J("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(a.Zp,{title:J("HTTPS 设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),clickFun:async()=>{if(B){if(!$)return void(0,x.zN)("证书路径不能为空");if(!q)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=B,e.cert_path=$,e.key_path=q;(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:B})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:B,onChange:e=>{M(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]}),B&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:J("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:J("证书文件路径(cert.pem/fullchain.pem)"),value:$,handleInputChange:e=>{G(e)}}),(0,v.jsx)("div",{children:J("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:J("私钥文件路径(privkey.pem)"),value:q,handleInputChange:e=>{E(e)}})]})]}),(0,v.jsx)(N,{})]})}),(0,v.jsx)(C.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[J("系统运行于"),": ",(0,V.s)(Y.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.60.3",null!=Y.latest_version&&"6.60.3"!==Y.latest_version?` -> ${Y.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:J("官网地址"),target:"_blank",children:`filecat ${J("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[J("安装方式")," :",Y.process_env_run_env]})]})})]})}var F=s(64694),K=s(92350);function P(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[k,S]=(0,f.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,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("备注")],T=[e("编号"),e("路径"),e("是否开启"),e("备注")],H=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],U=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],Z=[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&&g(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,K.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,F.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:U,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:T,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([...O,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",O)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,v.jsx)(_.X,{headers:H,rows:O.map((t,s)=>{const n=[(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([...O])},options:G,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...O])},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:()=>(e=>{O.splice(e,1),P([...O])})(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:()=>{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:Z,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 z(e){const{t,i18n:s}=(0,h.Bd)(),[i,a]=(0,f.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},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai 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("端口扫描"),permission:l.oV.port_scan},{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 B=new Map;function M(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[j,g]=(0,f.fp)(u.AG.user_base_info),[y,w]=(0,n.useState)([]),[k,S]=(0,f.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[V,N]=(0,f.fp)(u.AG.confirm),[O,P]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[E,T]=(0,n.useState)([]),[H,U]=(0,n.useState)([]),[Z,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,K.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),B.clear();for(const e of t.data)B.set(e.role_id,e)}},ge=e=>{P(e?.username??""),$(e?.password??""),q(e?.cwd??""),T(e?.access_dirs??[]),U(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?fe(e.bind_role_id,e.auth_list??[]):(_e(""),ue({}))};(0,n.useEffect)(()=>{ve()},[]);const fe=(e,t=[])=>{if(!e)return _e(""),void ue({});const s=B.get(e);if(s){if(s.cwd&&q(s.cwd),s.access_dirs&&s.access_dirs.length>0&&T(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&U(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(!O)return void(0,x.zN)("username not empty");if((0,m.CB)(O))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=O,e.password=M,e.not_access_dirs=H,e.only_read_dirs=Z,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),ge(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),ge(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),ge(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),ge(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:O,handleInputChange:e=>P(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:()=>{T([...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,T([...E])}})}),0===he?.access_dirs?.length||void 0===he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),T([...E])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{U([...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?.not_access_dirs?.length&&void 0!==he?.not_access_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,U([...H])}})}),0===he?.not_access_dirs?.length||void 0===he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{H.splice(s,1),U([...H])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{D([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).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=>{Z[s]=e,D([...Z])}})}),0===he?.only_read_dirs?.length||void 0===he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),D([...Z])},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=>{fe(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)(z,{is_disable:e=>{if(!0===ae)return!0;if(de){const t=B.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,F.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 $(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,g]=(0,f.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),[C,b]=(0,f.fp)(u.AG.confirm),[A,I]=(0,n.useState)(""),[V,N]=(0,n.useState)(""),[O,P]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[q,E]=(0,n.useState)(""),[T,H]=(0,n.useState)(""),[U,Z]=(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,K.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??""),P(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),E(e?.access_cmd??""),H(e?.not_access_cmd??""),Z(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=U,e.theme=D,e.access_dirs=O,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=V,e.access_cmd=q,e.not_access_cmd=T,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:()=>{P([...O,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:V,handleInputChange:e=>N(e)}),(O??[]).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=>{O[t]=e,P([...O])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{O.splice(t,1),P([...O])},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:T,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:U,onChange:e=>{Z(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)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,F.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function G(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[g,y]=(0,f.fp)(u.AG.prompt_card),[k,C]=(0,n.useState)([]),[b,A]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,F]=(0,f.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,K.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[T,H]=(0,n.useState)(""),[U,Z]=(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,K.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(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.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"})})]})]}),(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||!T)return void(0,x.zN)("账号密码不能为空");if(T!==U)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=q,e.password=T,e.confirm_password=U,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=>{H(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(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})]})})]})]})})}var q=s(87361);function E(){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)(G,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,v.jsx)(O,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,v.jsx)(P,{})}),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)(M,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,v.jsx)($,{})}),(0,v.jsx)(i.W1,{optionList:s,father_route:q.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(34899),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.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),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(34899);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([[1472],{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.auto_upgrade_setting="auto_upgrade_setting",e.ai_long_term_memory_setting="ai_long_term_memory_setting",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))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>E});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(34899),u=s(82893),p=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function g(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 f=s(34843),y=s(78247),w=s(24659);function k(){const{t:e}=(0,h.Bd)(),[t,s]=(0,f.fp)(u.AG.prompt_card),l=(0,w.K)(),g=[e("路由"),e("auth"),e("备注")],[k,S]=(0,f.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:g,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,f.fp)(u.AG.prompt_card),[l,a]=(0,f.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)(g,{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)(g,{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{t:e}=(0,h.Bd)(),{check_user_auth:t}=(0,y.MH)(),[s,i]=(0,n.useState)(!1),[_,p]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[g,w]=(0,n.useState)(180),[k,S]=(0,n.useState)(!1),[C,b]=(0,f.fp)(u.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),p(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),w(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自动升级")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{b({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("保存"),clickFun:async()=>{if(!_)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!g||g<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new I.Mm;t.open=s,t.version_check_url=_,t.exe_download_url=m,t.check_interval_seconds=g;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,v.jsx)("div",{children:e("系统版本检测地址")}),(0,v.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:_,handleInputChange:e=>{p(e)}}),(0,v.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,v.jsxs)(v.Fragment,{children:[!1,(0,v.jsx)("div",{children:e("检测频率(秒)")}),(0,v.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:g,handleInputChange:e=>{w(Number(e)||180)}}),(0,v.jsx)("div",{style:{marginTop:"12px"},children:(0,v.jsx)(o.C3,{text:e(k?"升级检测中...":"立即升级"),clickFun:async()=>{S(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{S(!1)}}})})]})]}):null}function O(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[p,m]=(0,n.useState)(""),[j,g]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[b,O]=(0,n.useState)(!1),[F,K]=(0,n.useState)(""),[P,z]=(0,f.fp)(u.AG.prompt_card),[B,M]=(0,n.useState)(!1),[$,G]=(0,n.useState)(""),[q,E]=(0,n.useState)(""),[T,H]=(0,f.fp)(u.AG.editorSetting),[U,Z]=(0,n.useState)(I.aM.close),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(void 0),{t:J,i18n:R}=(0,h.Bd)(),[Y,ee]=(0,f.fp)(u.AG.user_base_info),{check_user_auth:te}=(0,y.MH)(),{initUserInfo:se}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){g(e.data.self_auth_open),k(e.data.shell_cmd_check_open),O(e.data.recycle_open),K(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info),m(s?.http_proxy||"");const n=e.data.https_setting;n&&(M(n.open),G(n.cert_path||""),E(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&&Q(e.length),e.mode&&Z(e.mode),void 0!==e.persist&&W(e.persist)}})()},[]);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:J("自定义登录auth"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{(await c.XO.post("self_auth_open/save",{open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:J("代码修改"),onClick:async()=>{const e=await c.XO.get("self_auth_open/jscode");H({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(""),H({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:j,onChange:e=>{g(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]})}),(0,v.jsx)(a.Zp,{title:J("自定义shell命令校验"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{(await c.XO.post("shell_cmd_check_open/save",{open:w})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:J("代码修改"),onClick:async()=>{const e=await c.XO.get("shell_cmd_check_open/jscode");H({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(""),H({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:w,onChange:e=>{k(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),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:J("文件回收站")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:J("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),clickFun:async()=>{if(b&&!F)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:F,open:b})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:J("目录"),value:F,handleInputChange:e=>{K(e)}}),(0,v.jsx)(r.l6,{value:b,onChange:e=>{O(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]})]}),(0,v.jsxs)(a.Zp,{title:J("token过期时间"),rightBottomCom:(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(o.C3,{text:J("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(o.C3,{text:J("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=U,e.persist=D,I.aM.length!==e.mode||L||(0,x.zN)("秒数不能为空"),e.length=parseInt(L);(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:J("关闭"),selected:U===I.aM.close,onchange:()=>{Z(I.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:J("指定时间"),selected:U===I.aM.length,onchange:()=>{Z(I.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:J("永不过期"),selected:U===I.aM.forver,onchange:()=>{Z(I.aM.forver)}})]}),U===I.aM.length&&(0,v.jsx)(r.Sm,{placeholder:J("秒"),value:L,handleInputChange:e=>{Q(e)}}),(0,v.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,v.jsx)("input",{type:"checkbox",checked:D,onChange:()=>W(!D)}),J("持久化")]})]})]})}),(0,v.jsx)(i.VP,{widthPer:40,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:J("通用设置")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:J("HTTP 代理说明")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),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,http_proxy:p}})).code===d.m.Success&&((0,x.SK)("修改成功"),se())}}),children:[J("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),(0,v.jsx)("div",{children:J("HTTP 代理地址")}),(0,v.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:p,handleInputChange:e=>{m(e)}}),J("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(a.Zp,{title:J("HTTPS 设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:J("确定修改"),clickFun:async()=>{if(B){if(!$)return void(0,x.zN)("证书路径不能为空");if(!q)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=B,e.cert_path=$,e.key_path=q;(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:B})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:B,onChange:e=>{M(e)},options:[{title:J("开启"),value:!0},{title:J("关闭"),value:!1}]}),B&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:J("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:J("证书文件路径(cert.pem/fullchain.pem)"),value:$,handleInputChange:e=>{G(e)}}),(0,v.jsx)("div",{children:J("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:J("私钥文件路径(privkey.pem)"),value:q,handleInputChange:e=>{E(e)}})]})]}),(0,v.jsx)(N,{})]})}),(0,v.jsx)(C.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[J("系统运行于"),": ",(0,V.s)(Y.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.60.4",null!=Y.latest_version&&"6.60.4"!==Y.latest_version?` -> ${Y.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:J("官网地址"),target:"_blank",children:`filecat ${J("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[J("安装方式")," :",Y.process_env_run_env]})]})})]})}var F=s(64694),K=s(92350);function P(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[k,S]=(0,f.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,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("备注")],T=[e("编号"),e("路径"),e("是否开启"),e("备注")],H=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],U=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],Z=[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&&g(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,K.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,F.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:U,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:T,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([...O,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",O)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,v.jsx)(_.X,{headers:H,rows:O.map((t,s)=>{const n=[(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([...O])},options:G,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...O])},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:()=>(e=>{O.splice(e,1),P([...O])})(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:()=>{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:Z,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 z(e){const{t,i18n:s}=(0,h.Bd)(),[i,a]=(0,f.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},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai 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("端口扫描"),permission:l.oV.port_scan},{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 B=new Map;function M(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[j,g]=(0,f.fp)(u.AG.user_base_info),[y,w]=(0,n.useState)([]),[k,S]=(0,f.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[V,N]=(0,f.fp)(u.AG.confirm),[O,P]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[E,T]=(0,n.useState)([]),[H,U]=(0,n.useState)([]),[Z,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,K.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),B.clear();for(const e of t.data)B.set(e.role_id,e)}},ge=e=>{P(e?.username??""),$(e?.password??""),q(e?.cwd??""),T(e?.access_dirs??[]),U(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?fe(e.bind_role_id,e.auth_list??[]):(_e(""),ue({}))};(0,n.useEffect)(()=>{ve()},[]);const fe=(e,t=[])=>{if(!e)return _e(""),void ue({});const s=B.get(e);if(s){if(s.cwd&&q(s.cwd),s.access_dirs&&s.access_dirs.length>0&&T(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&U(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(!O)return void(0,x.zN)("username not empty");if((0,m.CB)(O))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=O,e.password=M,e.not_access_dirs=H,e.only_read_dirs=Z,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),ge(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),ge(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),ge(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),ge(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:O,handleInputChange:e=>P(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:()=>{T([...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,T([...E])}})}),0===he?.access_dirs?.length||void 0===he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),T([...E])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{U([...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?.not_access_dirs?.length&&void 0!==he?.not_access_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,U([...H])}})}),0===he?.not_access_dirs?.length||void 0===he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{H.splice(s,1),U([...H])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{D([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).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=>{Z[s]=e,D([...Z])}})}),0===he?.only_read_dirs?.length||void 0===he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),D([...Z])},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=>{fe(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)(z,{is_disable:e=>{if(!0===ae)return!0;if(de){const t=B.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,F.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 $(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,g]=(0,f.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),[C,b]=(0,f.fp)(u.AG.confirm),[A,I]=(0,n.useState)(""),[V,N]=(0,n.useState)(""),[O,P]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[q,E]=(0,n.useState)(""),[T,H]=(0,n.useState)(""),[U,Z]=(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,K.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??""),P(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),E(e?.access_cmd??""),H(e?.not_access_cmd??""),Z(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=U,e.theme=D,e.access_dirs=O,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=V,e.access_cmd=q,e.not_access_cmd=T,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:()=>{P([...O,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:V,handleInputChange:e=>N(e)}),(O??[]).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=>{O[t]=e,P([...O])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{O.splice(t,1),P([...O])},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:T,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:U,onChange:e=>{Z(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)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,F.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function G(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[g,y]=(0,f.fp)(u.AG.prompt_card),[k,C]=(0,n.useState)([]),[b,A]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,F]=(0,f.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,K.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[T,H]=(0,n.useState)(""),[U,Z]=(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,K.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(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.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"})})]})]}),(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||!T)return void(0,x.zN)("账号密码不能为空");if(T!==U)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=q,e.password=T,e.confirm_password=U,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=>{H(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(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})]})})]})]})})}var q=s(87361);function E(){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)(G,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,v.jsx)(O,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,v.jsx)(P,{})}),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)(M,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,v.jsx)($,{})}),(0,v.jsx)(i.W1,{optionList:s,father_route:q.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(34899),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.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),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(34899);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([[6919],{86919(e,t,l){l.r(t),l.d(t,{default:()=>v});var r=l(96540),i=l(34899),s=l(76213),a=l(34843),n=l(57952),d=l(85997),o=l(75725),h=l(70447),c=l(61443),u=l(82893),p=l(14284),m=l(53459),x=l(62042),j=l(74848);function v(){const{t:e}=(0,i.Bd)(),t=(0,s.Zp)(),[l,v]=(0,a.fp)(u.AG.confirm),[,w]=(0,a.fp)(u.AG.prompt_card),[g,C]=(0,r.useState)(""),[S,_]=(0,r.useState)(""),[b,f]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),[B,I]=(0,r.useState)(""),[N,A]=(0,r.useState)(!1),[D,P]=(0,r.useState)(""),[T,H]=(0,r.useState)(""),[Y,z]=(0,r.useState)(""),[F,G]=(0,r.useState)(!0),[q,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{const e=await p.Yu.get("docker/config");if(e?.code!==m.m.Success)return;const t=e.data??{};C(t.http_proxy??""),_(t.https_proxy??""),f(t.no_proxy??""),k((t.registry_mirrors||[]).join(",")),I((t.insecure_registries||[]).join(",")),A(!!t.debug),P(t.data_root??""),H(t.storage_driver??""),z(t.log_driver??""),G(t.iptables??!0),E(!!t.live_restore)})()},[]);return(0,j.jsxs)("div",{children:[(0,j.jsx)(n.A,{children:(0,j.jsx)(d.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>t(-1)})}),(0,j.jsx)(o.jW,{isFull:!0,more:!0,children:(0,j.jsx)(o.NN,{children:(0,j.jsx)(o.xh,{children:(0,j.jsx)(o.fI,{children:(0,j.jsx)(o.VP,{widthPer:60,children:(0,j.jsx)(h.uF,{self_title:(0,j.jsx)("span",{className:"div-row",children:(0,j.jsx)("h2",{children:e("Docker 代理配置")})}),titleCom:(0,j.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,j.jsx)(d.rA,{icon:"info",title:e("信息"),onClick:()=>{w({open:!0,title:e("信息"),context_div:(0,j.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("代理写入 systemd 服务环境变量,其余写入 daemon.json;修改后需重启 Docker 生效,请谨慎操作(尤其数据存储目录变更)。")})})}}),(0,j.jsx)(d.rA,{icon:"save",title:e("保存"),onClick:()=>(async()=>{const t=e=>e.split(/[\n,,]/).map(e=>e.trim()).filter(Boolean),l=await p.Yu.post("docker/config/save",{http_proxy:g,https_proxy:S,no_proxy:b,registry_mirrors:t(y),insecure_registries:t(B),debug:N,data_root:D,storage_driver:T,log_driver:Y,iptables:F,live_restore:q});l?.code===m.m.Success?v({open:!0,title:e("是否重启 Docker 服务以生效?"),sub_title:e("重启 Docker 会短暂中断容器服务,请确认当前没有关键任务在执行"),handle:async()=>{const t=await p.Yu.post("docker/restart");v({open:!1,handle:null}),t?.code===m.m.Success?(0,x.SK)(e("已重启 Docker,代理配置已生效")):(0,x.zN)(e("重启失败"))}}):(0,x.zN)(e("保存失败"))})()})]}),children:(0,j.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.8rem",padding:"0.2rem 0"},children:[(0,j.jsx)(c.BC,{label:e("HTTP 代理"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"http://127.0.0.1:3067",value:g,handleInputChange:e=>C(e)})}),(0,j.jsx)(c.BC,{label:e("HTTPS 代理"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"https://127.0.0.1:3067",value:S,handleInputChange:e=>_(e)})}),(0,j.jsx)(c.BC,{label:e("No Proxy"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"localhost,127.0.0.1",value:b,handleInputChange:e=>f(e)})}),(0,j.jsx)(c.BC,{label:e("镜像加速"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"https://docker.mirrors.ustc.edu.cn,https://hub-mirror.c.163.com",value:y,handleInputChange:e=>k(e)})}),(0,j.jsx)(c.BC,{label:e("不安全仓库"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"127.0.0.1:5000,registry.example.com",value:B,handleInputChange:e=>I(e)})}),(0,j.jsx)(c.BC,{label:e("开启调试"),width:"8rem",children:(0,j.jsx)(c.l6,{width:"12rem",options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:N,onChange:e=>A(!!e)})}),(0,j.jsx)(c.BC,{label:e("数据存储目录"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"/var/lib/docker",value:D,handleInputChange:e=>P(e)})}),(0,j.jsx)(c.BC,{label:e("存储驱动"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"overlay2",value:T,handleInputChange:e=>H(e)})}),(0,j.jsx)(c.BC,{label:e("日志驱动"),width:"8rem",children:(0,j.jsx)(c.Sm,{width:"24rem",placeholder:"json-file",value:Y,handleInputChange:e=>z(e)})}),(0,j.jsx)(c.BC,{label:e("启用 iptables"),width:"8rem",children:(0,j.jsx)(c.l6,{width:"12rem",options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:F,onChange:e=>G(!!e)})}),(0,j.jsx)(c.BC,{label:e("Live Restore"),width:"8rem",children:(0,j.jsx)(c.l6,{width:"12rem",options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:q,onChange:e=>E(!!e)})})]})})})})})})})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9546],{75007(e,t,s){s.d(t,{h:()=>r});s(96540);var n=s(85997),i=s(74848);function r(e){return(0,i.jsxs)("h2",{className:"message",children:[(0,i.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,i.jsx)("span",{children:e.context})]})}},22081(e,t,s){var n=s(96540),i=s(16349),r=s(74848);const c=({percentage:e})=>{const t=(0,n.useRef)(null),[s,c]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new i.Ay(s,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return c(n),()=>{n.destroy()}},[]),(0,n.useEffect)(()=>{s&&(s.data.datasets[0].data=[e,100-e],s.update())},[e]),(0,r.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,r.jsx)("canvas",{ref:t})})};s.d(t,["A",0,c])},77481(e,t,s){s.d(t,{S:()=>c,X:()=>r});var n=s(96540),i=s(74848);function r(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 c(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))})}},88062(e,t,s){s(96540),s(47022);var n=s(74848);function i(e){return(0,n.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(t,e)},children:e.name})}const r=e=>(0,n.jsxs)("li",{children:[e.click?(0,n.jsx)(i,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,n.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,n.jsx)("ul",{children:e.node.children.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),c=e=>(0,n.jsx)("div",{className:"card-tree-view",children:(0,n.jsx)("ul",{children:e.list&&e.list.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(t,["A",0,c])},59546(e,t,s){s.r(t),s.d(t,{default:()=>le});var n=s(96540),i=s(75725),r=s(70447),c=s(22081),l=s(92275),o=s(14944),a=s(14284),d=s(57952),h=s(85997),u=s(77481),x=s(53459),p=s(34899),m=s(34843),j=s(82893),f=s(74777),_=s(62042),w=s(61443),y=s(74848);function g(e){const{t}=(0,p.Bd)(),[s,c]=(0,m.fp)(j.AG.disk),[l,o]=(0,n.useState)({}),[f,_]=(0,n.useState)([]),w=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===x.m.Success){const e=[];for(const n of s.data.ata_smart_attributes??[]){let s;n[1]>=n[2]?s="var(--icon-green)":n[1]<=n[3]&&(s="var(--icon-red)"),n[0]=(0,y.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}_(s.data.ata_smart_attributes),o(s.data)}})()},[]),(0,y.jsxs)("div",{children:[(0,y.jsx)(d.A,{children:(0,y.jsx)(h.rA,{icon:"close",title:t("关闭"),onClick:()=>{c({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{widthPer:30,children:[(0,y.jsx)(i.xh,{children:(0,y.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("名字"),right:e.name}),(0,y.jsx)(i.Yh,{left:t("厂商名称"),right:e.typeName}),(0,y.jsx)(i.Yh,{left:t("类型"),right:e.type}),(0,y.jsx)(i.Yh,{left:t("容量"),right:e.total})]})}),(0,y.jsx)(i.xh,{children:(0,y.jsxs)(r.Zp,{title:t("物理信息"),children:[(0,y.jsx)(i.Yh,{left:t("是否健康"),right:!0===l.smart_status?"是":"否"}),(0,y.jsx)(i.Yh,{left:t("设备型号"),right:l.model_name}),(0,y.jsx)(i.Yh,{left:t("序列号"),right:l.serial_number}),(0,y.jsx)(i.Yh,{left:t("固件版本"),right:l.firmware_version}),(0,y.jsx)(i.Yh,{left:t("转速(每分钟)"),right:l.rotation_rate}),(0,y.jsx)(i.Yh,{left:t("通电时长(小时)"),right:l.power_on_time_hours}),(0,y.jsx)(i.Yh,{left:t("通电次数"),right:l.power_cycle_count}),(0,y.jsx)(i.Yh,{left:t("温度(°C)"),right:l.temperature}),(0,y.jsx)(i.Yh,{left:t("通信协议"),right:l.device_protocol})]})})]}),(0,y.jsx)(i.VP,{widthPer:50,children:(0,y.jsxs)(i.xh,{children:[f?.length?(0,y.jsx)(r.uF,{title:t("ATA/SATA详细信息"),children:(0,y.jsx)(u.X,{headers:w,rows:f,width:"10rem"})}):(0,y.jsx)(y.Fragment,{}),l.nvme_smart?(0,y.jsxs)(r.Zp,{title:t("NVME详细信息"),children:[(0,y.jsx)(i.Yh,{left:t("NVMe 可用备用块(%)"),right:l.nvme_smart.available_spare}),(0,y.jsx)(i.Yh,{left:t("NVMe 已使用寿命(%)"),right:l.nvme_smart.percentage_used}),(0,y.jsx)(i.Yh,{left:t("NVMe 读取量"),right:l.nvme_smart.data_units_read}),(0,y.jsx)(i.Yh,{left:t("NVMe 写入量"),right:l.nvme_smart.data_units_written}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电次数"),right:l.nvme_smart.power_cycles}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电时长(小时)"),right:l.nvme_smart.power_on_hours}),(0,y.jsx)(i.Yh,{left:t("NVMe 非正常关机"),right:l.nvme_smart.unsafe_shutdowns}),(0,y.jsx)(i.Yh,{left:t("NVMe 媒体错误"),right:l.nvme_smart.media_errors}),(0,y.jsx)(i.Yh,{left:t("NVMe 错误日志数"),right:l.nvme_smart.num_err_log_entries})]}):(0,y.jsx)(y.Fragment,{})]})})]})})})]})}let v=function(e){return e[e.mount=0]="mount",e}({});var k=s(88062),S=s(78247),b=s(23430);const C=e=>(0,y.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,y.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function A(){return(0,y.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}})})}function P(){const{t:e}=(0,p.Bd)(),[t,s]=(0,m.fp)(j.AG.disk),[c,l]=(0,n.useState)({}),[o,f]=(0,n.useState)([]),[w,g]=(0,n.useState)([]),[P,V]=(0,m.fp)(j.AG.showPrompt),{check_user_auth:$}=(0,S.MH)(),[Y,F]=(0,n.useState)([]),{click_file:I}=(0,S.kZ)(),[N,M]=(0,m.fp)(j.AG.prompt_card),E=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],K=async()=>{const e=await a.Yu.get("disk/blk");return e.code===x.m.Success&&f(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{K()})()},[]);const B=[(0,y.jsx)(h.rA,{icon:"info",title:e("提示"),onClick:async()=>{M({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,y.jsxs)("li",{children:["文件系统,有多种格式",(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,y.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,y.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,y.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,y.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,y.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,y.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,y.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,y.jsx)("li",{children:"rw:以读写方式挂载"}),(0,y.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,y.jsx)("li",{children:"...等"})]})]}),(0,y.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,y.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,y.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,y.jsx)(h.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:v.mount})).code===x.m.Success&&(0,_.SK)("挂载文件已生效")}},1)],H=async()=>(await a.Yu.get("get_fstab")).data,G=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.A,{children:(0,y.jsx)(h.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:40,children:(0,y.jsxs)(r.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:(0,y.jsxs)("div",{children:[$(b.oV.sys_disk_mount)&&(0,y.jsx)(h.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{I({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:H,save_file_fun:G,menu_list:B})}}),(0,y.jsx)(h.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await K()===x.m.Success&&(0,_.SK)("刷新成功")}})]}),children:[(0,y.jsx)(u.X,{headers:E,rows:w,width:"10rem"}),(0,y.jsx)(k.A,{list:o,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,y.jsxs)("span",{children:[t,(0,y.jsx)("span",{style:{color:"green"},children:"(已挂载)"})]}):t},onContextMenu:(e,t)=>{e.preventDefault()},click:t=>{let s="";if(t.mountpoint)for(let e=0;e<t.mountpoints.length;e++)s+=t.mountpoints[e]+";";g([[(0,y.jsx)(r.xP,{children:s}),(0,y.jsx)(r.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,y.jsx)(r.xP,{children:t.path}),t.pttype]])}})]})}),(0,y.jsx)(i.VP,{widthPer:60,children:Y.map((t,s)=>{const n=[];for(const e of t.pv_list)n.push({name:`${e.name}---(${e.size})---(${e.free_size})`});const c=[];for(const e of t.lv_list)c.push({name:`${e.name}---(${e.size})`});return(0,y.jsx)(r.Zp,{children:(0,y.jsxs)(i.n5,{children:[(0,y.jsx)(C,{name:e("物理卷"),lvms:n}),(0,y.jsx)(A,{}),(0,y.jsx)(C,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,y.jsx)(A,{}),(0,y.jsx)(C,{name:e("逻辑卷"),lvms:c})]})},s)})})]})})})]})}var V=s(88815);let $=!0;function Y(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],w=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[v,k]=(0,m.fp)(j.AG.user_base_info),[S,C]=(0,n.useState)(0),[A,Y]=(0,n.useState)(0),[F,I]=(0,n.useState)(0),[N,M]=(0,n.useState)(0),[E,K]=(0,n.useState)(0),[B,H]=(0,n.useState)({}),[G,z]=(0,n.useState)(!1),[W,Z]=(0,n.useState)(!1),[D,X]=(0,n.useState)(!1),[T,U]=(0,n.useState)($),[L,q]=(0,n.useState)(null),[R,O]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[ee,te]=(0,m.fp)(j.AG.user_base_info),[se,ne]=(0,m.fp)(j.AG.disk),ie=async()=>{if(!$)return;const e=new l.hf(l.HK.sys_get);await o.ws.send(e),o.ws.addMsg(l.HK.sys_getting,e=>{M(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;Y(t),I(s),C((s-t)/s*100),q(e.context?.node_memory_usage),K(e.context?.node_cpu_usage)})};return(0,n.useEffect)(()=>((async()=>{await ie()})(),()=>{o.ws.sendData(l.HK.sys_cancel,{})}),[]),(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.A,{children:[v.sys===b.XM.linux&&(0,y.jsx)(h.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,y.jsx)(h.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===x.m.Success){const t=e.data;H(t)}})()}}),(0,y.jsx)(h.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{Z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===x.m.Success){const s=e.data,n=[];let i=!0;ee.sysSoftWare&&ee.sysSoftWare[f.jk.smartmontools]&&ee.sysSoftWare[f.jk.smartmontools].installed||(i=!1);for(const e of s??[])n.push([(0,y.jsx)(r.xP,{context:e.name}),e.typeName,e.type,e.total,(0,y.jsx)(h.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{i?ne({type:"check",data:e}):(0,_.zN)("没有安装smartmontools")}})]);O(n)}})()}}),(0,y.jsx)(h.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{X(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===x.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,y.jsx)(r.xP,{context:e.name}),(0,y.jsx)(r.xP,{context:e.device_name}),e.fsType,(0,y.jsx)(r.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,y.jsx)(h.Z$,{defaultStatus:T,text:t("实时信息"),clickFun:e=>{U(e),$=e,ie()}})]}),(0,y.jsxs)(i.xh,{children:[T&&(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(r.Zp,{title:"Sys "+t("内存"),children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(c.A,{percentage:S})}),(0,y.jsx)(i.VP,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)("div",{children:(0,y.jsx)(i.Yh,{left:t("总容量"),center:`${F}G`})})}),(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)(i.Yh,{left:t("剩余"),center:`${A}G`})})]})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(r.Zp,{title:"Sys cpu",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(c.A,{percentage:N})}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.Yh,{left:t("使用率"),center:N})})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(r.Zp,{title:"FileCat",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{children:[(0,y.jsx)(i.qV,{content:t("内存")}),(0,y.jsx)(i.qV,{content:"total: "+(0,V.v7)(L?.rss)}),(0,y.jsx)(i.qV,{content:"object: "+(0,V.v7)(L?.heapTotal)}),(0,y.jsx)(i.qV,{content:"obj-use: "+(0,V.v7)(L?.heapUsed)}),(0,y.jsx)(i.qV,{content:"external: "+(0,V.v7)(L?.external)}),(0,y.jsx)(i.qV,{content:"buffer: "+(0,V.v7)(L?.arrayBuffers)})]}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.qV,{content:"cpu growth rate: "+E})})]})})})]}),(0,y.jsxs)(i.fI,{children:[G&&(0,y.jsx)(i.VP,{children:(0,y.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("总内存"),right:B.mem_total}),(0,y.jsx)(i.Yh,{left:`cpu ${t("制造商")}`,right:B.cpu_manufacturer}),(0,y.jsx)(i.Yh,{left:`cpu ${t("品牌")}`,right:B.cpu_brand}),(0,y.jsx)(i.Yh,{left:`cpu ${t("逻辑核心")}`,right:B.cpu_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("物理核心")}`,right:B.cpu_phy_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("最大")}hz`,right:B.cpu_speed_hz}),(0,y.jsx)(i.Yh,{left:`${t("当前系统")}:pid;ppid`,right:B.pid_ppid}),(0,y.jsx)(i.Yh,{left:t("运行用户"),right:B.user})]})}),W&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.uF,{title:t("物理硬盘"),children:(0,y.jsx)(u.X,{headers:s,rows:R,width:"10rem"})})}),D&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.uF,{title:t("文件硬盘"),children:(0,y.jsx)(u.X,{headers:w,rows:J,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,y.jsx)(g,{...se.data}),se&&"mount"===se.type&&(0,y.jsx)(P,{})]})}var F=s(75007),I=s(97856),N=s(64405);const M=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function E(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(j.AG.dockerShellShow),[c,a]=(0,m.fp)(j.AG.user_base_info),d=c.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{i.show?(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});let t;o.ws.subscribeUnconnect(h);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},o.ws.addMsg("logs"===i.type?l.HK.docker_shell_logs_getting:l.HK.docker_shell_exec_getting,e=>{"error"===e.context&&h(),t(e.context)}),"exec"===i.type&&e.onData(async e=>{const t=new l.hf(l.HK.docker_shell_exec);t.context=e,await o.ws.send(t)}),s(e)})():h()},[i]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,y.jsx)(M,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n=new N.n;let r;n.rows=e,n.cols=s,n.dockerId=i.dockerId,r="logs"===i.type?new l.hf(l.HK.docker_shell_logs):new l.hf(l.HK.docker_shell_exec_open),r.context=n,o.ws.send(r)}})}var K=s(27690),B=s(76213),H=s(87361);let G="",z=[],W=!1;function Z(e){const{t}=(0,p.Bd)(),s=(0,B.Zp)(),[c]=(0,m.fp)(j.AG.user_base_info),[f,g]=(0,n.useState)({}),[v,k]=(0,n.useState)([]),[C,A]=(0,n.useState)([]),{check_user_auth:P}=(0,S.MH)(),[V,$]=(0,m.fp)(j.AG.dockerShellShow),[Y,I]=(0,m.fp)(j.AG.showPrompt),[N,M]=(0,m.fp)(j.AG.confirm),[Z,D]=(0,n.useState)(G),[X,T]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[U,L]=(0,n.useState)([]),[q,R]=(0,n.useState)(void 0),[O,J]=(0,n.useState)(!1),Q=["id",t("name"),t("create时间"),t("大小"),(0,y.jsxs)("span",{children:["选中",(0,y.jsx)(h.rA,{icon:"check_box",title:"全选",onClick:()=>{W=!W;const e={};for(let t=0;t<C.length&&W;t++)e[C[t][0].props.context]=1;g(e)}})]})],ee=async()=>{k([]),L([]);const e=new l.hf(l.HK.docker_get);await o.ws.send(e),o.ws.addMsg(l.HK.docker_getting,e=>{const t=[];if(G){for(const s of e.context)for(const e of s)if(`${e}`.includes(G)){t.push(s);break}}else t.push(...e.context);k(t.map(e=>{const t=e.map(e=>(0,y.jsx)(r.xP,{context:e}));return t.push((0,y.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{L(t)}})),t}))})};(0,n.useEffect)(()=>(D(G),ee(),()=>{(async()=>{$({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{G=Z},[Z]);const te=()=>{const e=new l.hf("logs"===V.type?l.HK.docker_shell_logs_cancel:l.HK.docker_shell_exec_cancel);e.context="",o.ws.send(e)},se=e=>{const t=new l.hf(l.HK.docker_switch);t.context={type:e,dockerId:U[0].props.context},L([]),o.ws.send(t)},ne=async()=>{const e=await a.Yu.get("docker/images");if(e.code===x.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],i=[(0,y.jsx)(r.xP,{context:n[0]}),(0,y.jsx)(r.xP,{context:n[1]}),n[2],n[3],""];s.push(i)}z=s,A(s)}};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.A,{left_children:(0,y.jsx)(h.Z$,{defaultStatus:!1,text:t("docker镜像"),clickFun:e=>{J(e),e?(ne(),L([])):(ee(),A([]),g({}))}}),children:[c.sys===b.XM.linux&&(0,y.jsx)(h.rA,{icon:"settings",title:t("Docker 配置"),onClick:()=>s(H.o.docker_setting_page)}),Object.keys(f).length>0&&(0,y.jsx)(h.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{M({open:!0,title:t("确定删除选中的镜像吗"),handle:async()=>{const e=Object.keys(f),t=await a.Yu.post("docker/check/delete",{ids:e});if(t.code===x.m.Success)if(0===t.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===x.m.Success&&((0,_.SK)("删除完成"),ne(),M({open:!1,handle:null}))}else(0,_.N9)(`有镜像正在运行${JSON.stringify(t.data)}`)}})}}),U.length>0&&(0,y.jsx)("div",{children:U[1].props.context}),U.length>0&&(0,y.jsxs)("div",{children:[P(b.oV.docker_container_update)&&(0,y.jsx)(h.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{I({show:!0,overlay:!0,type:K.PromptEnum.DockerDel,data:{dockerId:U[0].props.context,name:U[1].props.context}})}}),(0,y.jsx)(h.rA,{icon:"print",title:t("打印日志"),onClick:()=>{V.show?($({show:!1,type:"",dockerId:""}),te()):$({show:!0,dockerId:U[0].props.context,type:"logs"})}}),P(b.oV.docker_container_update)&&(0,y.jsx)(h.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{V.show?($({show:!1,type:"",dockerId:""}),te()):$({show:!0,dockerId:U[0].props.context,type:"exec"})}}),P(b.oV.docker_container_update)&&U[4].props.context.includes("Up")&&(0,y.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>se("stop")}),P(b.oV.docker_container_update)&&!U[4].props.context.includes("Up")&&(0,y.jsx)(h.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{se("start")}})]}),(0!==v.length||Z)&&!O&&(0,y.jsx)(h.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new l.hf(l.HK.docker_get);await o.ws.send(e)}})]}),(0,y.jsxs)(i.xh,{children:[O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(r.uF,{title:`${t("镜像")} (${C.length})`,titleCom:(0,y.jsx)(w.Sm,{placeholder:t("过滤镜像"),value:q,handleInputChange:e=>{R(e)},handlerEnter:()=>{const e=[];if(q){for(const t of C)(t[0].props.context.includes(q)||t[1].props.context.includes(q))&&e.push(t);A(e)}else A(z)}}),children:(0,y.jsx)(u.X,{headers:Q,rows:C.map((e,s)=>(e[4]=(0,y.jsx)(w.GL,{context:t(""),selected:f[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,f),t[e]?delete t[e]:t[e]=1,g(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===v.length&&!Z&&!O&&(0,y.jsx)(F.h,{context:t("检测不到docker,主机可能没有安装docker or 容器为空")}),(0!==v.length||Z)&&!O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(r.uF,{title:`${t("容器")} (${v.length})`,titleCom:(0,y.jsx)(w.Sm,{placeholder:t("过滤"),value:Z,handleInputChange:e=>{D(e)}}),children:(0,y.jsx)(u.X,{headers:X,rows:v,width:"10rem"})})})})]}),(0,y.jsx)(E,{})]})}var D=s(64694);let X="",T=!1,U=!1;function L(e){const{t}=(0,p.Bd)(),[s,c]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[m,j]=(0,n.useState)(0),[f,_]=(0,n.useState)(""),[g,v]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,y.jsxs)("span",{children:[t("内存"),(0,y.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{T=!T}})]}),(0,y.jsxs)("span",{children:["cpu%",(0,y.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{U=!U}})]}),t("选择")]),{check_user_auth:k}=(0,S.MH)();(0,n.useEffect)(()=>{_(X),(async()=>{c([]),j(0),x([]);const e=new l.hf(l.HK.process_get);await o.ws.send(e),o.ws.addMsg(l.HK.process_getting,e=>{const s=[];if(X){for(const t of e.context)for(const e of t)if(`${e}`.includes(X)){s.push(t);break}}else s.push(...e.context);T&&(0,D.di)(s,e=>e[3],!1),U&&(0,D.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,y.jsx)(r.xP,{context:3===t?(0,V.v7)(e):e}));return s.push((0,y.jsx)(h.rA,{icon:"place",title:t("选中"),onClick:()=>{x(s)}})),s});j(s.length),c(n)})})()},[]),(0,n.useEffect)(()=>{X=f},[f]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.A,{children:[a.length>0&&(0,y.jsx)("div",{children:a[1].props.context}),a.length>0&&k(b.oV.sys_process_close)&&(0,y.jsx)("div",{children:(0,y.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new l.hf(l.HK.process_close);e.context={pid:a[0].props.context},x([]),o.ws.send(e)}})})]}),(0,y.jsx)(i.xh,{children:0!==s.length||X?(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(r.uF,{title:`${t("进程")} (${m})`,titleCom:(0,y.jsx)(w.Sm,{placeholder:t("过滤"),value:f,handleInputChange:e=>{_(e)}}),children:(0,y.jsx)(u.X,{headers:g,rows:s,width:"10rem"})})})}):(0,y.jsx)(F.h,{context:t("加载中请等待...")})})]})}const q=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function R(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(j.AG.systemd_shell_show),[c,a]=(0,m.fp)(j.AG.user_base_info),d=c.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!i.show)return void h();(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});o.ws.subscribeUnconnect(h),o.ws.addMsg(l.HK.systemd_logs_getting,t=>{"error"===t.context&&h(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[i]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,y.jsx)(q,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n={unit_name:i.unit_name},r=new l.hf(l.HK.systemd_logs_get);r.context=n,o.ws.send(r)}})}const O=[{title:"no(不自动重启)",value:"no"},{title:"always(总是重启)",value:"always"},{title:"on-failure(失败才重启)",value:"on-failure"},{title:"on-abnormal(异常才重启)",value:"on-abnormal"}],J=[{title:"simple",value:"simple"},{title:"forking",value:"forking"},{title:"oneshot",value:"oneshot"},{title:"notify",value:"notify"}],Q=[{title:"multi-user.target",value:"multi-user.target"},{title:"network.target",value:"network.target"}];function ee(e,t){const s=[];return s.push("[Unit]"),t.description.trim()?s.push(`Description=${t.description.trim()}`):s.push(`Description=${e}`),s.push(""),s.push("[Service]"),s.push(`Type=${t.type.trim()||"simple"}`),t.exec_start.trim()&&s.push(`ExecStart=${t.exec_start.trim()}`),t.working_dir.trim()&&s.push(`WorkingDirectory=${t.working_dir.trim()}`),t.user_.trim()&&s.push(`User=${t.user_.trim()}`),t.restart&&"no"!==t.restart&&s.push(`Restart=${t.restart.trim()}`),s.push(""),s.push("[Install]"),s.push(`WantedBy=${t.wanted.trim()||"multi-user.target"}`),s.push(""),s.join("\n")}function te(e){const t={description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"},s=(t,s)=>{const n=e.split(/\r?\n/);let i=!1;for(const e of n){const n=e.trim(),r=n.match(/^\[(.*)\]$/);if(r){i=(r[1]||"").trim()===t;continue}if(!i)continue;const c=n.match(new RegExp(`^${s}\\s*=\\s*(.*)$`,"i"));if(c)return c[1].trim()}return""};return t.description=s("Unit","Description"),t.type=s("Service","Type")||"simple",t.exec_start=s("Service","ExecStart"),t.working_dir=s("Service","WorkingDirectory"),t.user_=s("Service","User"),t.restart=s("Service","Restart")||"no",t.wanted=s("Install","WantedBy")||"multi-user.target",t}function se(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)("form"),[r,c]=(0,n.useState)(()=>(e.unit_name||"").replace(/\.service$/i,"")),[l,o]=(0,n.useState)({description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"}),[d,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[j,f]=(0,n.useState)(!1);(0,n.useEffect)(()=>{"edit"===e.mode&&e.unit_name&&(async()=>{f(!0);try{const t=await a.Yu.post("systemd/get/context",{unit_name:e.unit_name});if(t.code!==x.m.Success)return;const s=t.data.context??"",n=t.data.path??"";m(n),h(s),o(te(s))}finally{f(!1)}})()},[e.mode,e.unit_name]);const g=e=>{e!==s&&("text"===e?h(ee(r,l)):o(te(d)),i(e))},v=e=>t=>{o(s=>({...s,[e]:t}))};return(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem",marginBottom:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat "+("form"===s?"":"button--grey"),onClick:()=>g("form"),children:t("表单")}),(0,y.jsx)("button",{className:"button button--flat "+("text"===s?"":"button--grey"),onClick:()=>g("text"),children:t("文本")})]}),j?(0,y.jsx)("div",{children:t("加载中...")}):"form"===s?(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.6rem"},children:[(0,y.jsx)(w.BC,{label:t("服务名称"),children:(0,y.jsx)(w.Sm,{placeholder:t("服务名称"),value:r,disabled:"edit"===e.mode,handleInputChange:e=>c(e),width:"100%"})}),(0,y.jsx)(w.BC,{label:t("服务描述"),children:(0,y.jsx)(w.Sm,{placeholder:t("服务描述"),value:l.description,handleInputChange:v("description"),width:"100%"})}),(0,y.jsx)(w.BC,{label:t("启动命令"),required:!0,children:(0,y.jsx)(w.Sm,{placeholder:t("ExecStart 启动命令,必填"),value:l.exec_start,handleInputChange:v("exec_start"),width:"100%"})}),(0,y.jsx)(w.BC,{label:t("运行类型"),children:(0,y.jsx)(w.l6,{options:J,value:l.type,onChange:v("type")})}),(0,y.jsx)(w.BC,{label:t("工作目录"),children:(0,y.jsx)(w.Sm,{placeholder:t("工作目录(可选)"),value:l.working_dir,handleInputChange:v("working_dir"),width:"100%"})}),(0,y.jsx)(w.BC,{label:t("运行用户"),children:(0,y.jsx)(w.Sm,{placeholder:t("运行用户(可选)"),value:l.user_,handleInputChange:v("user_"),width:"100%"})}),(0,y.jsx)(w.BC,{label:t("重启策略"),children:(0,y.jsx)(w.l6,{options:O,value:l.restart,onChange:v("restart")})}),(0,y.jsx)(w.BC,{label:t("安装目标"),children:(0,y.jsx)(w.l6,{options:Q,value:l.wanted,onChange:v("wanted")})})]}):(0,y.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",minHeight:"16rem",fontFamily:"monospace",fontSize:"0.85rem",boxSizing:"border-box"},value:d,onChange:e=>h(e.target.value),spellCheck:!1}),(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.4rem",marginTop:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat button--grey",disabled:j,onClick:e.onClose,children:t("取消")}),(0,y.jsx)("button",{className:"button button--flat",disabled:j,onClick:async()=>{if(!r.trim())return void(0,_.zN)(t("请填写服务名称"));const n=(i=r).trim().endsWith(".service")?i.trim():`${i.trim()}.service`;var i;const c="text"===s?d:ee(n,l);if(c.includes("ExecStart=")){f(!0);try{if("create"===e.mode){const e=`/etc/systemd/system/${n}`;await a.Yu.post("systemd/sys/save",{unit_name:n,path:e,context:c}),await a.Yu.post("systemd/sys/enable",{unit_name:n}),await a.Yu.post("systemd/add",{unit_name:n}),(0,_.SK)(t("添加成功"))}else await a.Yu.post("systemd/sys/save",{unit_name:n,path:u,context:c}),(0,_.SK)(t("保存成功"));e.onClose(),e.onDone?.()}catch(e){console.error("systemd 保存失败",e)}finally{f(!1)}}else(0,_.zN)(t("请至少填写 ExecStart 启动命令"))},children:t("保存")})]})]})}let ne,ie="";function re(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[c,f]=(0,m.fp)(j.AG.systemd_shell_show),[g,v]=(0,m.fp)(j.AG.confirm),[k,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[A,P]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[$,Y]=(0,n.useState)([]),[I,N]=(0,n.useState)([]),[M,E]=(0,n.useState)([]),[K,B]=(0,n.useState)(!1),[H,G]=(0,n.useState)([]),[z,W]=(0,n.useState)(""),[Z,D]=(0,n.useState)(""),[X,T]=(0,n.useState)(new Set),[U,L]=(0,m.fp)(j.AG.editorSetting),[q,O]=(0,m.fp)(j.AG.prompt_card);(0,n.useEffect)(()=>{D(ie),(async()=>{Y([]),E([]);const e=new l.hf(l.HK.systemd_inside_get);await o.ws.send(e),o.ws.addMsg(l.HK.systemd_inside_getting,e=>{const t=[];if(ie){for(const s of e.context)for(const e of s)if(`${e}`.includes(ie)){t.push(s);break}}else t.push(...e.context);Y(t.map(e=>{const t=e.map((e,t)=>(0,y.jsx)(r.xP,{context:4===t?(0,V.v7)(e):e}));return t.push((0,y.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{E(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{ie=Z},[Z]);const J=e=>{if(c.show){f({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else f({show:!0,unit_name:e})},Q=async()=>{N([]),G([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==x.m.Success)return;T(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===x.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,y.jsx)(r.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,y.jsx)(r.xP,{context:t.description})];s.push([...e,(0,y.jsx)(h.rA,{icon:"place",title:"添加",onClick:()=>{G([...e])}})])}ne=s,N(s)}},ee=(e,s)=>{O({open:!0,title:t("create"===e?"新建 systemd 服务":"编辑 systemd 服务"),context_div:(0,y.jsx)(se,{mode:e,unit_name:s,onClose:()=>O({open:!1}),onDone:()=>{O({open:!1}),o.ws.send(new l.hf(l.HK.systemd_inside_get)),K&&Q(),E([]),G([])}})})};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.A,{left_children:(0,y.jsx)(h.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{B(e),e?(Q(),E([])):G([])}}),children:[s(b.oV.systemd)&&(0,y.jsx)("div",{children:(0,y.jsx)(h.rA,{icon:"add_circle",title:t("添加 systemd"),onClick:()=>{ee("create")}})}),M.length>0&&(0,y.jsx)("div",{children:M[1].props.context}),H.length>0&&(0,y.jsx)("div",{children:H[0].props.context}),M.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(h.rA,{icon:"delete",title:"从实时监控删除",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(M[1].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(h.rA,{icon:"edit",title:"可视化编辑",onClick:()=>{ee("edit",M[1].props.context)}}),(0,y.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{J(M[1].props.context)}})]}),H.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(h.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(H[0].props.context)}}),(0,y.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{J(H[0].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(h.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===x.m.Success&&(L({model:"text",open:!0,fileName:e.name,save:async e=>{const n={unit_name:t,path:s.data.path,context:e};(await a.Yu.post("systemd/sys/save",n)).code===x.m.Success&&(S.xK.set_value_temp(""),L({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(s.data.context))})(H[0].props.context)}}),s(b.oV.systemd)&&!X.has(H[0].props.context)&&(0,y.jsx)(h.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const t=await a.Yu.post("systemd/add",{unit_name:e});t.code===x.m.Success&&(T(new Set(t.data)),(0,_.SK)("添加成功"))})(H[0].props.context)})]})]}),(0,y.jsxs)(i.xh,{children:[K&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(r.uF,{title:`systemd系统单元(${I.length})`,titleCom:(0,y.jsx)(w.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{W(e)},handlerEnter:()=>{const e=[];if(z){for(const t of ne)(t[0].props.context.includes(z)||t[3].props.context.includes(z))&&e.push(t);N(e)}else N(ne)}}),children:(0,y.jsx)(u.X,{headers:A,rows:I,width:"10rem"})})})}),0===$.length&&!K&&(0,y.jsx)(F.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==$.length&&!K&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(r.uF,{title:`filecat监控单元(${$.length})`,titleCom:(0,y.jsx)(w.Sm,{placeholder:"过滤单元",value:Z,handleInputChange:e=>{D(e)}}),children:(0,y.jsx)(u.X,{headers:k,rows:$,width:"10rem"})})})})]}),(0,y.jsx)(R,{})]})}function ce(){const{t:e}=(0,p.Bd)(),[,t]=(0,m.fp)(j.AG.confirm),[,s]=(0,m.fp)(j.AG.prompt_card),[c,l]=(0,n.useState)([]),[o,f]=(0,n.useState)("ufw"),[g,v]=(0,n.useState)("allow"),[k,S]=(0,n.useState)("in"),[b,C]=(0,n.useState)("tcp"),[A,P]=(0,n.useState)(""),[V,$]=(0,n.useState)(""),[Y,I]=(0,n.useState)(""),[N,M]=(0,n.useState)([]),[E,K]=(0,n.useState)("list"),[B,H]=(0,n.useState)(!1),G=async()=>{const e=await a.V_.get("status");if(e.code===x.m.Success){const t=e.data??[];l(t);const s=t.find(e=>e.installed);s&&!0!==t.find(e=>e.id===o)?.installed&&f(s.id)}},z=async()=>{H(!0);try{if("ufw"===o){const[e,t]=await Promise.all([a.V_.get(`rules?backend=${o}`),a.V_.get("ufw/rules")]);e.code===x.m.Success&&I(e.data??""),t.code===x.m.Success&&M(t.data??[])}else{const e=await a.V_.get(`rules?backend=${o}`);e.code===x.m.Success&&I(e.data??"")}}catch(e){I(""),M([])}finally{H(!1)}};(0,n.useEffect)(()=>{G()},[]),(0,n.useEffect)(()=>{o&&z()},[o]);const W=!0===c.find(e=>e.id===o)?.installed,Z=!0===c.find(e=>e.id===o)?.active;return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.A,{left_children:(0,y.jsx)("span",{className:"header-title",children:e("防火墙")}),children:[(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,y.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[e("后端"),":"]}),(0,y.jsx)("button",{className:"button button--flat "+("ufw"===o?"":"button--grey"),disabled:!0!==c.find(e=>"ufw"===e.id)?.installed,onClick:()=>f("ufw"),children:"ufw"}),(0,y.jsx)("button",{className:"button button--flat "+("nft"===o?"":"button--grey"),disabled:!0!==c.find(e=>"nft"===e.id)?.installed,onClick:()=>f("nft"),children:"nftables"})]}),W&&(0,y.jsx)(h.rA,{icon:"power_settings_new",title:e(Z?"停用":"启用"),onClick:()=>(async t=>{try{const s=await a.V_.post("enable",{backend:o,enabled:t});if(s.code!==x.m.Success)return void(0,_.zN)(s.message||e("操作失败"));(0,_.SK)(s.data||e(t?"已启用":"已停用")),G(),z()}catch(e){}})(!Z)}),(0,y.jsx)(h.rA,{icon:"refresh",title:e("刷新规则"),onClick:z})]}),(0,y.jsxs)(i.xh,{children:[(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)(r.Zp,{title:e("状态"),children:(0,y.jsx)("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:c.map(t=>(0,y.jsxs)("div",{style:{padding:"0.6rem 0.8rem",minWidth:"12rem",border:"1px solid var(--border-color)",borderRadius:"0.4rem"},children:[(0,y.jsx)("div",{style:{fontWeight:"bold"},children:"ufw"===t.id?"ufw":"nftables"}),(0,y.jsxs)("div",{children:[e("已安装"),": ",(0,y.jsx)(r.xP,{context:t.installed?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"red"},children:"✗"})})]}),(0,y.jsxs)("div",{children:[e("已启用"),": ",(0,y.jsx)(r.xP,{context:t.active?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"gray"},children:"✗"})})]}),(0,y.jsx)("div",{style:{color:"gray",fontSize:"0.8rem"},children:t.note})]},t.id))})})})}),(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsxs)(r.uF,{self_title:(0,y.jsxs)("span",{className:"div-row",children:[(0,y.jsx)("h2",{children:e("添加规则")}),(0,y.jsx)(h.rA,{icon:"info",title:e("信息"),onClick:()=>{s({open:!0,title:e("信息"),context_div:(0,y.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("来源地址填写说明")})})}})]}),children:[(0,y.jsx)(w.BC,{label:e("动作"),width:"6rem",children:(0,y.jsx)(w.l6,{width:"10rem",options:[{title:"allow",value:"allow"},{title:"deny",value:"deny"},{title:"reject",value:"reject"},{title:"limit",value:"limit"}],value:g,onChange:e=>v(e)})}),(0,y.jsx)(w.BC,{label:e("方向"),width:"6rem",children:(0,y.jsx)(w.l6,{width:"10rem",options:[{title:"in",value:"in"},{title:"out",value:"out"}],value:k,onChange:e=>S(e)})}),(0,y.jsx)(w.BC,{label:e("协议"),width:"6rem",children:(0,y.jsx)(w.l6,{width:"10rem",options:[{title:"tcp",value:"tcp"},{title:"udp",value:"udp"},{title:"both",value:"both"}],value:b,onChange:e=>C(e)})}),(0,y.jsx)(w.BC,{label:e("端口"),width:"6rem",children:(0,y.jsx)(w.Sm,{width:"16rem",placeholder:e("端口(支持范围 1000:2000)"),value:A,handleInputChange:e=>P(e)})}),(0,y.jsx)(w.BC,{label:e("来源地址"),width:"6rem",children:(0,y.jsx)(w.Sm,{width:"16rem",placeholder:e("来源地址(可选)"),value:V,handleInputChange:e=>$(e)})}),(0,y.jsx)(w.BC,{label:"",width:"6rem",children:(0,y.jsx)(h.C3,{text:e("添加规则"),clickFun:async()=>{if(A.trim())try{const t=await a.V_.post("rule/add",{backend:o,action:g,direction:k,proto:b,port:A.trim(),from:V.trim()||void 0});if(t.code!==x.m.Success)return void(0,_.zN)(t.message||e("操作失败"));(0,_.SK)(t.data||e("已放行")),z()}catch(e){}else(0,_.zN)(e("请填写端口号"))}})})]})})}),(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsxs)(r.uF,{title:`${e("规则列表")} (${o})`,titleCom:"ufw"===o?(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,y.jsx)(h.C3,{text:e("名单视图"),clickFun:()=>K("list")}),(0,y.jsx)(h.C3,{text:e("文本视图"),clickFun:()=>K("text")})]}):void 0,children:[B&&(0,y.jsx)(F.h,{context:e("加载中...")}),!B&&"ufw"===o&&"list"===E&&(0===N.length?(0,y.jsx)(F.h,{context:e("暂无规则")}):(0,y.jsx)(u.X,{headers:[e("编号"),e("目标(To)"),e("动作"),e("来源(From)"),e("备注"),e("操作")],rows:N.map(s=>[s.number,(0,y.jsx)(r.xP,{context:s.to,tip_context:s.to}),s.action,s.from?(0,y.jsx)(r.xP,{context:s.from,tip_context:s.from}):"",s.description||"",(0,y.jsx)(h.rA,{icon:"delete",title:e("删除规则"),onClick:()=>(async s=>{t({open:!0,title:e("确定删除该规则吗?"),sub_title:`${e("规则编号")} ${s}`,handle:async()=>{try{const n=await a.V_.post("ufw/rule/del",{number:s});if(t({open:!1,handle:null}),n.code!==x.m.Success)return void(0,_.zN)(n.message||e("操作失败"));(0,_.SK)(n.data||e("已删除")),z()}catch(e){}}})})(s.number)})]),width:"8rem"})),!B&&("ufw"!==o||"text"===E)&&(Y?(0,y.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontSize:"0.85rem",margin:0},children:Y}):(0,y.jsx)(F.h,{context:e("暂无规则")}))]})})})]})]})}function le(e){const{t}=(0,p.Bd)(),[s,n]=(0,m.fp)(j.AG.user_base_info),r=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,y.jsx)(Y,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,y.jsx)(L,{})},{index:3,name:t("docker容器"),rto:"docker/",component:(0,y.jsx)(Z,{})}];if(s.sys===b.XM.linux){(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.systemd))&&r.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,y.jsx)(re,{})});(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.firewall))&&r.push({index:5,name:t("防火墙"),rto:"firewall/",component:(0,y.jsx)(ce,{})})}return(0,y.jsx)(i.W1,{optionList:r,father_route:H.o.info})}}}]);
@@ -857,6 +857,3 @@ table tr {
857
857
  border-top: 1px solid var(--surfaceSecondary);
858
858
  }
859
859
 
860
- .docker-setting__separator {
861
- border-top: 1px solid var(--surfaceSecondary);
862
- }
@@ -2050,6 +2050,3 @@ table tr {
2050
2050
  border-top: 1px solid var(--surfaceSecondary);
2051
2051
  }
2052
2052
 
2053
- .docker-setting__separator {
2054
- border-top: 1px solid var(--surfaceSecondary);
2055
- }
@@ -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.9a5ea5e915f703c45202.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.e92dc6b4b1a6ec264ea4.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>