filecat 6.61.0 → 6.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/1448.c17092866d8000fc162c.js +1 -0
- package/build/dist/1472.9a15a38ca60311c55865.js +1 -0
- package/build/dist/1636.d564c11eb75c71ba75e5.js +1 -0
- package/build/dist/2502.6a0501313a1fe1b8208a.js +1 -0
- package/build/dist/2542.78f4821c3f796775f225.js +1 -0
- package/build/dist/2674.42bc8edcb369615417fd.js +1 -0
- package/build/dist/2851.dc11a52ef2da1897efaf.js +1 -0
- package/build/dist/3215.aed023089c03fa4b3c40.js +2 -0
- package/build/dist/{8772.f569a899ae1f48eb7b90.js.LICENSE.txt → 3215.aed023089c03fa4b3c40.js.LICENSE.txt} +8 -0
- package/build/dist/3233.7be420d0a208fb097844.js +1 -0
- package/build/dist/3402.cb9eea2cd2080faf57f6.js +1 -0
- package/build/dist/354.1144df502d14a9b9c2c1.js +2 -0
- package/build/dist/{8090.4400dbf0a129ba8b152c.js.LICENSE.txt → 354.1144df502d14a9b9c2c1.js.LICENSE.txt} +0 -2
- package/build/dist/3659.42ebbfa853db66b4c3b3.js +1 -0
- package/build/dist/4273.1bad9a42bb34a1952dc4.js +1 -0
- package/build/dist/{4376.b022a792fb34fbe50398.js → 4376.54d747fb2fd9ed099e68.js} +1 -1
- package/build/dist/4903.5b155e7515c60da8e838.js +1 -0
- package/build/dist/5308.8059b2d04eb5de133d15.js +1 -0
- package/build/dist/5516.f96b5a3874804392788c.js +1 -0
- package/build/dist/{1595.dd1679681930c0894b85.js → 5525.de31026d71adb2710e2d.js} +1 -1
- package/build/dist/5614.7be420d0a208fb097844.js +1 -0
- package/build/dist/5761.aed863dd3ef56e0da7b7.js +1 -0
- package/build/dist/5877.a27f664e496b80e8cf13.js +1 -0
- package/build/dist/5937.8d7e5116bbc7d2b4e478.js +1 -0
- package/build/dist/{6010.34a5093f412c11b86c2f.js → 6010.7a688ca570a944677ad8.js} +1 -1
- package/build/dist/6100.d074c61e823d9b36c293.js +1 -0
- package/build/dist/6247.9bbd3852fd64eadebd20.js +1 -0
- package/build/dist/6505.ac89deebae8c008595a1.js +1 -0
- package/build/dist/676.2854877784f5c96f2f52.js +1 -0
- package/build/dist/678.6b39771efac19466a352.js +1 -0
- package/build/dist/6892.bd3adea0ce83f685bfa5.js +1 -0
- package/build/dist/6919.c7510e6ed23cff35cd52.js +1 -0
- package/build/dist/7133.7cd30c08c154a09693f1.js +1 -0
- package/build/dist/7759.7070cfce4ede684073a2.js +1 -0
- package/build/dist/{5709.81f43e3c021fafdfe36f.js → 8090.a6ad12a3a30434ea59f8.js} +1 -1
- package/build/dist/8319.fc897106bf47394f677c.js +1 -0
- package/build/dist/8435.67db557cac5405fa559d.js +1 -0
- package/build/dist/8603.8819e88398056f0e0562.js +1 -0
- package/build/dist/8714.33b322d07b675e53f5d7.js +1 -0
- package/build/dist/8765.01fa13220d95333e4034.js +1 -0
- package/build/dist/8947.0c83854521d16a092aa8.js +2 -0
- package/build/dist/9546.fa400fbfc3c4ae7850ad.js +1 -0
- package/build/dist/dark.css +2 -22
- package/build/dist/google-dark.css +2 -22
- package/build/dist/google.css +2 -22
- package/build/dist/index.html +1 -1
- package/build/dist/main.28811d3c1bf84795744c.js +2 -0
- package/build/dist/{main.ce650ef690ddefd87f88.js.LICENSE.txt → main.28811d3c1bf84795744c.js.LICENSE.txt} +1 -1
- package/build/main.js +1 -1
- package/build/threads.work.filecat.js +1 -1
- package/package.json +1 -1
- package/build/dist/1448.0cce6a2546d19400aa72.js +0 -1
- package/build/dist/1472.e8897d14d2cc609c9305.js +0 -1
- package/build/dist/1636.723781f88d68ed3657cb.js +0 -1
- package/build/dist/2502.76b0c12a516db7cd7045.js +0 -1
- package/build/dist/2542.107d541161551f162edb.js +0 -1
- package/build/dist/2674.29a3532f8d3839f1c180.js +0 -1
- package/build/dist/2851.e103817a73bd5bc2ad56.js +0 -1
- package/build/dist/3233.cacdc1869069914f4bc8.js +0 -1
- package/build/dist/3402.a72b6d7e2a0f49a66105.js +0 -1
- package/build/dist/3659.55a733505528331021e0.js +0 -1
- package/build/dist/4273.e074f600ee092de848a1.js +0 -1
- package/build/dist/4903.f8714937dbb91b37c119.js +0 -1
- package/build/dist/5308.52192ab9a2d34aafc1f2.js +0 -1
- package/build/dist/5516.867dcf973e3da3f469ed.js +0 -1
- package/build/dist/5614.cacdc1869069914f4bc8.js +0 -1
- package/build/dist/5761.dcbd2f72aefe89ed93bb.js +0 -1
- package/build/dist/5877.4e8f34819a3ae8da88b7.js +0 -1
- package/build/dist/5937.6896e2d5770bc5b1f528.js +0 -1
- package/build/dist/6100.84966ac3e36bcf6702ab.js +0 -1
- package/build/dist/6247.251b22d7770a37a87298.js +0 -1
- package/build/dist/6505.8ce4ae19c126468cdbf9.js +0 -1
- package/build/dist/676.39a5ffb9b489247e47b6.js +0 -1
- package/build/dist/678.d618a4cb674a201b2811.js +0 -1
- package/build/dist/6892.491e86318d079d70ced4.js +0 -1
- package/build/dist/6919.7846986c93eb0199f9a0.js +0 -1
- package/build/dist/7133.ae2c0ab24c0d2a3a5a1c.js +0 -1
- package/build/dist/7759.b58c5676b606e60d7aac.js +0 -1
- package/build/dist/8090.4400dbf0a129ba8b152c.js +0 -2
- package/build/dist/8319.c09052fb42d9c2a29990.js +0 -1
- package/build/dist/8435.1f63fa3aa621962786b1.js +0 -1
- package/build/dist/8603.bed222c279303c511397.js +0 -1
- package/build/dist/8714.353650707a25d38cc90d.js +0 -1
- package/build/dist/8765.032dd636d881d61c16a1.js +0 -1
- package/build/dist/8772.f569a899ae1f48eb7b90.js +0 -2
- package/build/dist/8947.4a6c81c6c271e3ccd642.js +0 -2
- package/build/dist/9546.c9b4ed852636fab1c104.js +0 -1
- package/build/dist/main.ce650ef690ddefd87f88.js +0 -2
- /package/build/dist/{8947.4a6c81c6c271e3ccd642.js.LICENSE.txt → 8947.0c83854521d16a092aa8.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1448],{83277(e,t,l){l.d(t,{$j:()=>r,Lv:()=>i,qq:()=>n});class s{options_agent_url_list;options_agent_key_list;options_agent_model_list;options_local_file_path_prompt_list}class i{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const l of t)if(l.value===e)return l.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const l of t)if(l.value===e)return!0;return!1}}class n extends s{tool_call_max=500;allow_exec_cmd_directly=!1;proxy_url;open_pick_model;max_recent_messages=12;compress_message_count=16;max_tool_content_chars=200}const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function r(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}l.d(t,["CP",0,'\n\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n',"cL",0,a])},11448(e,t,l){l.r(t),l.d(t,{RebotCardContainer:()=>f,default:()=>v});var s=l(86149),i=l(96540),n=l(85997),a=l(57952),r=l(75725),o=l(61443),c=l(70447),d=l(14284),p=l(53459),_=l(62042),h=l(78247),m=l(23430),x=l(3606),u=(l(83277),l(92350)),j=l(74848);const b={qq:{key:"qq",label:"QQ 机器人",icon:"QQ",color:"#12B7F5",fields:[{key:"appId",label:"AppId",type:"text",placeholder:"请输入机器人 AppId",required:!0},{key:"clientSecret",label:"密钥",type:"password",placeholder:"请输入机器人密钥",required:!0}]},dingtalk:{key:"dingtalk",label:"钉钉机器人",icon:"钉钉",color:"#0089FF",fields:[{key:"appId",label:"ClientId (AppKey)",type:"text",placeholder:"请输入应用 ClientId",required:!0},{key:"clientSecret",label:"ClientSecret (AppSecret)",type:"password",placeholder:"请输入应用 ClientSecret",required:!0}]},wecom:{key:"wecom",label:"企业微信机器人",icon:"企业微信",color:"#07C160",fields:[{key:"appId",label:"botId",type:"text",placeholder:"请输入机器人 botId",required:!0},{key:"clientSecret",label:"Secret",type:"password",placeholder:"请输入机器人 Secret",required:!0}]},lark:{key:"lark",label:"飞书机器人",icon:"飞书",color:"#3370FF",fields:[{key:"appId",label:"App ID",type:"text",placeholder:"请输入应用 App ID",required:!0},{key:"clientSecret",label:"App Secret",type:"password",placeholder:"请输入应用 App Secret",required:!0}]}},g=Object.entries(b).map(([e,t])=>({value:e,title:t.label,color:t.color}));function f(e){const{t}=(0,s.B)(),[l,a]=(0,i.useState)(!1),[r,c]=(0,i.useState)(!1),d=(t,l)=>{const s=[...e.items];s[t]={...s[t],...l},e.setItems(s)},p=t=>{const l=[...e.items];l.splice(t,1),e.setItems(l)},_=t=>{e.setItems([...e.items,{...e.items[t],open:!1,name:(e.items[t].name||"")+" (副本)"}])};return(0,j.jsxs)(i.Fragment,{children:[(0,j.jsx)("div",{className:"airebot-setting__toolbar",children:!1!==e.have_auth_edit&&(0,j.jsxs)(j.Fragment,{children:[l?(0,j.jsxs)("div",{className:"airebot-setting__add-select",children:[(0,j.jsx)(o.l6,{options:g,defaultValue:"qq",onChange:t=>{return l=t,e.setItems([...e.items,{platform:l,name:"",open:!1,appId:"",clientSecret:"",note:""}]),void a(!1);var l},width:"180px"}),(0,j.jsx)(n.rA,{icon:"cancel",title:t("取消"),onClick:()=>a(!1)})]}):(0,j.jsx)(n.rA,{icon:"add",title:t("添加机器人"),onClick:()=>a(!0)}),(0,j.jsx)(n.rA,{icon:"save",title:t(r?"保存中...":"保存"),onClick:()=>{r||(async()=>{c(!0),await e.save(),c(!1)})()}})]})}),0===e.items.length?(0,j.jsxs)("div",{className:"airebot-setting__empty",children:[(0,j.jsx)("span",{className:"material-symbols-outlined airebot-setting__empty-icon",children:"smart_toy"}),(0,j.jsx)("p",{children:t("还没有配置任何机器人")}),(0,j.jsx)("p",{className:"airebot-setting__empty-hint",children:t("点击上方「添加机器人」按钮来开始配置")})]}):(0,j.jsx)("div",{className:"airebot-setting__grid",children:e.items.map((e,t)=>(0,j.jsx)(y,{item:e,index:t,onChange:d,onDelete:p,onCopy:_},t))})]})}const y=({item:e,index:t,onChange:l,onDelete:i,onCopy:a})=>{const{t:r}=(0,s.B)(),d=b[e.platform]??b.qq,p=e._status||"disconnected";e.open;return(0,j.jsx)(c.Zp,{self_title:(0,j.jsx)("div",{className:"airebot-setting__card-header",children:(0,j.jsx)("span",{className:"material-symbols-outlined airebot-setting__card-icon",style:{color:d.color},children:d.icon})}),titleCom:(0,j.jsxs)("div",{className:"airebot-setting__card-actions",children:[(0,j.jsx)(n.Ay,{checked:!!e.open,onChange:e=>l(t,{open:e})}),(0,j.jsx)(n.rA,{icon:"content_copy",title:r("复制"),onClick:()=>a(t)}),(0,j.jsx)(n.rA,{icon:"delete",title:r("删除"),onClick:()=>i(t)})]}),children:(0,j.jsxs)("div",{className:"airebot-setting__card-fields",children:[(0,j.jsxs)("div",{className:"airebot-setting__field",children:[(0,j.jsx)("label",{className:"airebot-setting__field-label",children:r("平台")}),(0,j.jsx)(o.l6,{options:g,value:e.platform,onChange:e=>l(t,{platform:e}),width:"100%"})]}),(0,j.jsxs)("div",{className:"airebot-setting__field",children:[(0,j.jsx)("label",{className:"airebot-setting__field-label",children:r("名称")}),(0,j.jsx)(o.Sm,{value:e.name||"",handleInputChange:e=>l(t,{name:e}),placeholder:r("给机器人起个名字")})]}),d.fields.map(s=>{const i=e[s.key]??"";return(0,j.jsxs)("div",{className:"airebot-setting__field",children:[(0,j.jsxs)("label",{className:"airebot-setting__field-label",children:[s.label,s.required&&(0,j.jsx)("span",{className:"airebot-setting__field-required",children:"*"})]}),(0,j.jsx)(o.Sm,{type:s.type,value:i,handleInputChange:e=>l(t,{[s.key]:e}),placeholder:s.placeholder})]},s.key)}),(0,j.jsxs)("div",{className:"airebot-setting__field ",children:[(0,j.jsx)("label",{className:"airebot-setting__field-label",children:r("模型编号")}),(0,j.jsx)(o.Sm,{value:e.model_index,handleInputChange:e=>l(t,{model_index:e}),placeholder:r("使用指定模型(可选)")})]}),(0,j.jsxs)("div",{className:"airebot-setting__field ",children:[(0,j.jsx)("label",{className:"airebot-setting__field-label",children:r("用户id")}),(0,j.jsx)(o.Sm,{value:e.user_id||"",handleInputChange:e=>l(t,{user_id:e}),placeholder:r("默认使用root账户(继承权限,可选)")})]}),(0,j.jsxs)("div",{className:"airebot-setting__field airebot-setting__field-full",children:[(0,j.jsx)("label",{className:"airebot-setting__field-label",children:r("备注")}),(0,j.jsx)(o.Sm,{value:e.note||"",handleInputChange:e=>l(t,{note:e}),placeholder:r("备注信息(可选)")})]})]})})};function v(){const{t:e}=(0,s.B)(),t=(0,x.Zp)(),{check_user_auth:l}=(0,h.MH)(),[o,c]=(0,i.useState)([]),b=(0,u.Q)(),g=async()=>{const e=await d.XO.get("ai_rebot_setting");e.code===p.m.Success&&c(e.data?.list??[])};(0,i.useEffect)(()=>{g()},[]);return(0,j.jsxs)("div",{className:"airebot-setting",children:[(0,j.jsx)(a.A,{children:l(m.oV.ai_agent_setting)&&(0,j.jsx)(n.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>t(-1)})}),(0,j.jsx)(r.fI,{children:(0,j.jsxs)(r.VP,{widthPer:100,children:[(0,j.jsxs)("div",{className:"airebot-setting__page-title",children:[(0,j.jsx)("h2",{children:e("机器人配置")}),(0,j.jsx)(n.rA,{icon:"info",onClick:()=>{b("机器人配置")},title:"信息"})]}),(0,j.jsx)(f,{items:o,setItems:c,save:async()=>{const t={list:o.map((e,t)=>({...e,index:t}))};(await d.XO.post("ai_rebot_setting/save",t)).code===p.m.Success&&((0,_.SK)(e("保存成功")),await g())},have_auth_edit:l(m.oV.ai_agent_setting)})]})})]})}l.d(t,["PLATFORM_META",0,b,"RebotCard",0,y])},92350(e,t,l){l.d(t,{Q:()=>p,o:()=>h});var s=l(34843),i=l(82893),n=l(74777),a=l(96540),r=l(86149),o=l(23430),c=l(14284),d=l(74848);function p(){const[e,t]=(0,s.fp)(i.AG.prompt_card),{t:l,i18n:a}=(0,r.B)();return e=>{let s;e===n.jk.ffmpeg?s=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===n.jk.smartmontools?s=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?s=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?s=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?s=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?s=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?s=(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?s=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?s=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?s=(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?s=(0,d.jsx)("div",{children:l("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(s=(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:s})})}}let _=o.Ky;function h(){const[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const l=e.data||[];_=[...o.Ky,...l],t(_)}else console.warn("获取主题列表失败,使用默认列表"),t(_)}catch(e){t(_)}})()},[]),e}}}]);
|
|
@@ -0,0 +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.process_env_override_key="process_env_override_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(86149),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.B)(),[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.B)(),[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.B)(),[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.B)(),{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),[K,F]=(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.B)(),[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),F(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&&!K)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:K,open:b})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:J("目录"),value:K,handleInputChange:e=>{F(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.62.0",null!=Y.latest_version&&"6.62.0"!==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 K=s(64694),F=s(92350);function P(){const{t:e,i18n:t}=(0,h.B)(),{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]=(0,f.fp)(u.AG.editorSetting),[b,A]=(0,n.useState)([]),[I,V]=(0,n.useState)([]),[N,O]=(0,n.useState)([]),[P,z]=(0,n.useState)([]),[B,M]=(0,n.useState)(""),[$,G]=(0,n.useState)([]),q=(0,w.K)(),E=[e("软件"),e("是否安装"),e("路径")],T=[e("编号"),e("路径"),e("备注")],H=[e("编号"),e("路径"),e("是否开启"),e("备注")],U=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],D=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:W}=(0,y.MH)(),L=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&O(e.data)},Q=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&z(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&&M(t.data),L(),Q();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&A(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&V(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&G(i.data??[])})()},[]);const J=(0,F.Q)(),R=async()=>{(await c.XO.post("plugin/list/save",$)).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:()=>{J("文件上传")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...I,{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 I)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,K.di)(I,e=>e.index);(await c.XO.post("dir_upload_max_num/save",I)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:Z,rows:I.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,V([...I])},options:q,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=>{I.splice(e,1),V([...I])})(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:()=>{J("环境路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?S({open:!0,title:e("进程环境变量"),context_div:(0,v.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(y.xK.set_value_temp(t.data??""),C({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,x.SK)(e("保存成功")):(0,x.zN)(e("保存失败")),y.xK.set_value_temp("")}})):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{O([...N,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:N})).code===d.m.Success&&((0,x.SK)("保存成功"),L(),s())}})]}),children:(0,v.jsx)(_.X,{headers:H,rows:N.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,O([...N])},options:q,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=>{N.splice(e,1),O([...N])})(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:()=>{J("pty")},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:B})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:B,handleInputChange:e=>{M(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:()=>{J("Workflow")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{z([...P,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",P)).code===d.m.Success&&((0,x.SK)("ok"),Q())}})]}),children:(0,v.jsx)(_.X,{headers:U,rows:P.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,z([...P])},options:q,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,z([...P])},options:q,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=>{P.splice(e,1),z([...P])})(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:()=>{J("插件配置")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{G([...$,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:R})]}),children:(0,v.jsx)(_.X,{headers:D,rows:$.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,G([...$])},options:q,no_border:!0}),(0,v.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await R()},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=>{$.splice(e,1),G([...$])})(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:()=>{J("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",b)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:T,rows:b.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=>{b.splice(e,1),A([...b])})(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:E,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:()=>{J(t.id)},title:"信息"})]),width:"10rem"})})]})})]})]})}function z(e){const{t,i18n:s}=(0,h.B)(),[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.B)(),{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,F.o)(),[xe,me]=(0,n.useState)([]),je=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ve=async()=>{const e=await c.wm.get("all_users");e.code===d.m.Success&&w(e.data);const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),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,K.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.B)(),{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,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),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,K.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function G(){const{t:e,i18n:t}=(0,h.B)(),{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,K]=(0,f.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[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,F.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.B)(),{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(86149),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.B)();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(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1636],{88062(e,n,s){s(96540),s(47022);var o=s(74848);function t(e){return(0,o.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,o.jsxs)("li",{children:[e.click?(0,o.jsx)(t,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,o.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,o.jsx)("ul",{children:e.node.children.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),c=e=>(0,o.jsx)("div",{className:"card-tree-view",children:(0,o.jsx)("ul",{children:e.list&&e.list.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(n,["A",0,c])},81636(e,n,s){s.r(n),s.d(n,{default:()=>w});var o=s(86149),t=s(96540),i=s(34843),c=s(82893),r=s(92275),l=s(14944),d=s(70447),a=s(85997),u=s(57952),x=s(75725),f=s(47071),h=s(34289),m=s(88062),j=s(97856),v=(s(62042),s(15629),s(74848));const k=t.lazy(()=>s.e(3233).then(()=>s(85614)));let p,_;function w(e){const{t:n}=(0,o.B)(),[s,w]=(0,i.fp)(c.AG.workflow_realtime_show),[g,C]=(0,t.useState)([]),[y,M]=(0,t.useState)([]),[b,q]=(0,t.useState)(!1),[S,F]=(0,t.useState)(void 0),[A,N]=(0,t.useState)([]),$=e=>{for(const n of e){if(null==n.code&&n?.extra_data?.running_type===f.rl.running)n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{running:!0}),n.name]});else if(0===n.code)n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{success:!0}),n.name]});else{if(!(n.code<1)){delete n.children;continue}n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{success:!1}),n.name]})}n.children&&$(n.children)}};(0,t.useEffect)(()=>(q(!1),p=void 0,_=void 0,(async()=>{const e=new f.v3;e.filename_path=`${(0,h.GG)("file",(0,h.vX)())}${s.filename}`,l.ws.addMsg(r.HK.workflow_realtime_one_rsq,e=>{if(e.context.list&&e.context.list.length>0){const n=e.context.list;$(n),N(n)}e.context.new_log&&B(e.context.new_log)}),l.ws.sendData(r.HK.workflow_realtime_one_req,e)})(),async()=>{l.ws.removeMsg(r.HK.workflow_realtime_one_rsq),_&&(_.dispose(),_=null)}),[]);const B=async e=>{_||await new Promise(e=>{p=e,q(!0),(async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});_=e,F(e)})()}),e&&_.write(e)};return(0,v.jsxs)("div",{children:[(0,v.jsxs)(u.A,{children:[S&&(0,v.jsx)(a.rA,{icon:"print",title:"打印日志",onClick:()=>{q(!b)}}),(0,v.jsx)(a.rA,{icon:"close",title:n("关闭"),onClick:()=>{w({open:!1})}})]}),(0,v.jsx)(x.jW,{isFull:!0,more:!0,children:(0,v.jsx)(x.NN,{children:(0,v.jsx)(m.A,{list:A,click:e=>{}})})}),(0,v.jsx)("div",{style:{display:b?"":"none"},children:(0,v.jsx)(k,{show:!0,terminal:S,init:()=>{p&&(p(1),p=void 0)}})})]})}},15629(e,n,s){s.d(n,{W:()=>r});s(96540);var o=s(70447),t=s(47071),i=s(86149),c=s(74848);function r({item:e}){const{t:n}=(0,i.B)();let s,r;return null!=e.code?s=0===e.code:e.extra_data?.running_type===t.rl.running&&(r=!0),(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:s,running:r}),n(s?"成功":"失败")]})}const l=(e,n,s)=>{if(n)for(const s of n??[]){let n;const t=[];s["use-yml"]?(l(t,void 0,s.use_job_children_list),n=`${s["use-yml"]} ;${s.duration??-1}`):s.runs?n=JSON.stringify(s.runs):s.run?n=s.run:s["run-js"]?n=s["run-js"]:s.sleep&&(n=`sleep ${s.sleep}`),n=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:void 0===s.code?void 0:0===s.code})," ",n+" ;"+(s.duration??"")]}),e.push({name:n,children:t,extra_data:{code:s.code,context:s.message}})}else if(s)for(const n of s??[]){const s=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:s,extra_data:{code:n.code,is_job:!0,job_data:n}})}};s.d(n,["Y",0,l])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2502],{2502(t,e,n){n.r(e),n.d(e,{default:()=>A});var i=n(96540),o=n(92275),s=n(14944),r=n(34843),l=n(82893),c=n(57952),a=n(85997),_=n(47022),h=n(34289),p=n(62042),x=n(61443),d=n(86149),f=n(64694),g=n(70447),u=n(74848);const w=300;let v=!1,m=0,y=!0;var k,b=[],j=-1,C=[];function A(t){const[e,n]=(0,r.fp)(l.AG.log_viewer),A=(0,i.useRef)(null),[H,T]=(0,i.useState)(0),[S,z]=(0,i.useState)(100),[I,K]=(0,i.useState)(!1),[M,$]=(0,i.useState)(""),[E,L]=(0,i.useState)(0),[N,D]=(0,i.useState)(0),[q,G]=(0,i.useState)(0),{t:R}=(0,d.B)(),B=(t,n,i,o=!1,s)=>{const r=document.createElement("div");return-1===j?r.textContent=t:r.innerHTML=t,"wrap"===e.wrap?(r.style.whiteSpace="pre-wrap",r.style.overflowWrap="break-word"):r.style.whiteSpace="nowrap",r.setAttribute("position",`${n}`),r.setAttribute("start_position",`${i}`),o?(A.current.insertBefore(r,s),b.unshift(r)):(A.current.appendChild(r),b.push(r)),r},F=t=>{const e=(0,f.I)(b,e=>e===t);e&&A.current.removeChild(e)},W=(t,e,n,i=!1)=>{if(!t)return;const o=Array.isArray(t)?t:t.split("\n");if(i){let t;for(let i=0;i<o.length;i++)t=B(o[i],e[i],n[i],!0,0===i?A.current.firstChild:t);if(b.length>w){let t=b.length-1;for(;t>=w;)F(b[b.length-1]),t--}}else{for(let t=0;t<o.length;t++)B(o[t],e[t],n[t]);if(b.length>w){let t=b.length-w;for(;t>0;)F(b[0]),t--}}},X=async()=>{k.encoding=e.encoding,k.context="";const t=await s.ws.sendData(o.HK.log_viewer,k);if(t){const e=t.context;if(k=e,e.find_back_enter_index&&e.context_list.length>0)for(let t=0;t<e.context_list.length;t++){const n=new RegExp(e.query_text,"g");e.context_list[t]=e.context_list[t].replace(n,`<span style="color: blue;">${e.query_text}</span>`)}k.find_back_enter_index=!1,W(e.context_list,e.context_position_list,e.context_start_position_list,k.back),k.context_list.length>0&&(k.back&&b.length>0?(k.context_list.length>b.length?T(Math.floor(100*parseInt(b[k.context_list.length-b.length].getAttribute("position"))/k.max_size)):T(Math.floor(100*parseInt(b[b.length-k.context_list.length].getAttribute("position"))/k.max_size)),y=!1):T(Math.floor(100*(k.context_position_list[k.context_position_list.length-1]??0)/k.max_size)))}},Y=t=>{v||(v=!0,T(100),s.ws.addMsg(o.HK.log_viewer_watch,t=>{const e=t.context;e&&(k=e,W(e.context_list,e.context_position_list,e.context_start_position_list,!1),A.current.scrollTop=A.current.scrollHeight)}),k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.position=t,s.ws.sendData(o.HK.log_viewer_watch,k),K(!0))},Z=async()=>{A.current&&A.current.remove(),b=[]};if((0,i.useEffect)(()=>{e.show?(async()=>{A.current.addEventListener("scroll",async()=>{const t=A.current;if(t){if(v)return void(m=t.scrollTop);if(m<t.scrollTop&&b.length>0&&t.scrollTop+t.clientHeight+500>=t.scrollHeight){const t=parseInt(b[b.length-1].getAttribute("position"));if(t>=k.max_size)return void Y(t);k.line=20,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!1,k.position=t,await X()}else if(m>t.scrollTop&&b.length>0&&t.scrollTop-300<=0){const e=parseInt(b[0].getAttribute("start_position"));if(e<=0)return y||(y=!0,(0,p.N9)("到达顶部")),void(m=t.scrollTop);k.line=10,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!0,k.position=e,await X()}m=t.scrollTop}}),A.current.addEventListener("wheel",t=>{const e=A.current;if(e){t.preventDefault();const n=20;t.deltaY>0?e.scrollTop+=n:e.scrollTop-=n}},{passive:!1}),K(!1),L(0),D(0),$(""),v=!1,G(0),m=0,C=[],j=-1,b=[],(k=new _.d2).line=w,k.path=`${(0,h.GG)("file",(0,h.vX)())}${e.fileName}`,k.token=localStorage.getItem("token"),await X(),s.ws.addMsg(o.HK.search_file_progress,t=>{try{L(parseInt(t.context))}catch(t){(0,p.zN)(t.message)}}),s.ws.addMsg(o.HK.search_file_index,t=>{try{C.push(...t.context),G(t.context.length)}catch(t){(0,p.zN)(t.message)}})})():Z()},[e]),(0,i.useEffect)(()=>()=>{Z()},[]),!e.show)return;return(0,u.jsxs)("div",{id:"editor-container",children:[(0,u.jsxs)(c.A,{ignore_tags:!0,left_children:[(0,u.jsx)(a.rA,{title:R("取消"),icon:"close",onClick:()=>{n({show:!1})}},1),(0,u.jsx)("div",{style:{width:"4rem"},children:(0,u.jsx)(g.WA,{context:e.fileName})},2),(0,u.jsxs)(i.Fragment,{children:[" ",(0,u.jsx)(x.$Z,{handleEnterPress:async()=>{M&&(L(.1),D(0),G(0),j=-1,C=[],k.query_text=M,k.encoding=e.encoding,s.ws.sendData(o.HK.search_file,k))},placeholder:R("回车搜索整个文件"),icon:"search",value:M,handleInputChange:t=>{$(t)},max_width:"25em"})]},3),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j+1>=C.length?0:j+1;D(t+1),j=t,k.find_back_enter_index=!0,k.back=!1,k.position=C[j],await X()},children:"↓"},5),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j-1<0?C.length-1:j-1;D(t+1),j=t,k.back=!1,k.find_back_enter_index=!0,k.position=C[j],await X()},children:"↑"},6),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:[N,"/",C.length]},7),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:["搜索进度$",E,"%"]},8),0!==E&&100!==E&&(0,u.jsx)(a.rA,{title:R("取消"),icon:"cancel",onClick:()=>{s.ws.sendData(o.HK.search_file_cancel,{}),$(""),L(0)}},4)],children:[(0,u.jsx)("span",{style:{paddingRight:".5rem"},children:e.encoding}),I&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"},children:"正在实时监听 "}),(0,u.jsx)(a.rA,{icon:"close",title:R("关闭实时"),onClick:()=>{v&&(v=!1,K(!1),s.ws.sendData(o.HK.log_viewer_watch_cancel,k))}})]}),(0,u.jsxs)("span",{children:["当前加载进度",H]}),(0,u.jsx)(x.$Z,{max_width:"10rem",placeholder:R("跳转进度"),icon:"percent",value:S,handleInputChange:t=>{z(t)}}),(0,u.jsx)(a.rA,{icon:"play_arrow",title:R("跳转进度"),onClick:async()=>{k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];let t=0;try{if(t=parseInt(S),t>100||t<0)throw(0,p.zN)("范围在0-100"),"超过最大范围";for(const t of b)A.current.removeChild(t);b=[]}catch(t){return void(0,p.N9)(t)}k.back=t>=100,k.position=Math.floor(k.max_size*(t/100)),await X()}}),(0,u.jsx)(a.rA,{icon:"text_rotate_vertical",title:R("滑动到文件最底部,实时输出"),onClick:async()=>{if(!v){k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[],k.back=!0,k.position=k.max_size,await X(),A.current.scrollTop=A.current.scrollHeight,Y(k.max_size)}}})]}),(0,u.jsx)("div",{style:{height:"100%"},children:(0,u.jsx)("div",{ref:A,style:{overflowY:"auto",overflowX:"auto",height:"100%"}})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(3606),u=n(14284),d=(n(23430),n(82893)),r=n(75725),f=n(86149),h=n(7523),p=n(62042),_=n(21469),m=n(74848);_.m.init();const x=function(){const e=(0,o.Zp)(),[t,n]=(0,c.useState)(""),[x,w]=(0,c.useState)(""),{initUserInfo:k}=(0,c.useContext)(h.F),[g,j]=(0,a.fp)(d.AG.custom_fun_opt),{t:C}=(0,f.B)();async function I(){const n={username:t,password:x},s=await u.wm.post("login",n,!1);0===s.code?(localStorage.setItem("token",s.data),k(),j(""),e("/file")):(0,p.zN)(s.message)}return(0,c.useEffect)(()=>{localStorage.getItem("token")&&e("/file")},[]),(0,m.jsxs)(r.Y5,{children:[(0,m.jsx)("h1",{children:_.m.web_site_title??"FileCat"}),(0,m.jsxs)("div",{className:"self_win_center_content",children:[(0,m.jsx)(l.Sm,{placeholder:C("账号"),handleInputChange:e=>{n(e)}}),(0,m.jsx)(l.cA,{placeholder:C("密码"),handleInputChange:e=>{w(e)},handleEnterPress:I}),(0,m.jsx)(i.$n,{text:C("登录"),clickFun:I}),s.A.has("tcp_client_num_id")&&(0,m.jsx)(i.$n,{text:C("代理退出"),clickFun:()=>{s.A.delete("tcp_client_num_id"),window.location.reload()}})]})]})};n.d(t,["default",0,x])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,a){a.r(t),a.d(t,{default:()=>j});var n=a(96540),i=a(82893),o=a(34843),s=a(85997),l=a(57952),r=a(47022),c=a(34251),d=a(74848);function p(e){{const[t,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)([]),l=e=>{o(e)},h=async()=>{"folder"===e.type?(t||!e.click||i||await e.click(e,l,e.pre_path),a(!t)):e.click&&await e.click(e,l,e.pre_path)},m=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,n.useEffect)(()=>{o(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:h,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,m)},className:"studio-item-title",children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(s.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&i&&(0,d.jsx)("div",{style:{marginLeft:20},children:i.map((t,a)=>(0,d.jsx)(n.Fragment,{children:(0,d.jsx)(p,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:m},a)},a))})]})}}a(61443);function h(e){return(0,d.jsx)("div",{children:e.list.map((t,a)=>(0,d.jsx)(p,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,children:t.children,click:e.click,size:t.size},a))})}var m=a(14284),u=a(34289),f=a(53459),x=a(78247),w=(a(62042),a(2543)),y=a(27690),v=a(86149),_=a(88815),k=a(3606);const g=n.lazy(()=>Promise.all([a.e(5880),a.e(4091)]).then(()=>a(84091)));function j(e){const[t,a]=(0,n.useState)([]),[p,j]=(0,n.useState)(""),[C,E]=(0,n.useState)(""),[N,S]=(0,n.useState)(!1),[M,P]=(0,n.useState)({path:"",name:""}),[$,b]=(0,n.useState)(""),[G,I]=(0,o.fp)(i.AG.confirm),[z,A]=(0,n.useState)(!1),[F,D]=(0,o.fp)(i.AG.fileShellShow),[L,R]=(0,o.fp)(i.AG.file_shell_hidden),T=(0,n.useRef)(null),K=(0,n.useRef)(null),[U,B]=(0,n.useState)(!1),[W,X]=(0,n.useState)(16),[Y,H]=(0,o.fp)(i.AG.showPrompt),{t:Z}=(0,v.B)(),q=(0,k.Zp)();let J=(0,k.zy)().pathname.split("/").filter(Boolean).pop();J=decodeURIComponent(J);const O=async()=>{const e=(0,u.GG)("file",J);j(e),P({path:e,name:(0,u.mH)(e)});const t=await m.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],n=[];for(const a of t.data.list)"folder"===a.type?e.push(a):"file"===a.type&&n.push(a);a([...e,...n])}};(0,n.useEffect)(()=>{E(""),A(!1),O()},[]);const Q=async(e,t)=>{const a=await m.$M.get(`${encodeURIComponent(t)}`);E(a.data),x.xK.set_value_temp(a.data),P({path:t,name:e}),b(t)},V=(e,t)=>{e.size>_.o5?I({open:!0,handle:()=>{Q(e.name,t),I({open:!1,handle:null}),A(!1)},title:"超过20MB了还要打开吗?"}):Q(e.name,t)};async function ee(){if(!z)return;const e={context:x.xK.get_editor_value()};0===(await m.$M.post(`save/${encodeURIComponent($)}`,e)).code&&A(!1)}const te=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),z&&ee())};(0,n.useEffect)(()=>(document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}),[z]);const ae=(0,n.useCallback)(w.throttle(e=>{const t=parseFloat(getComputedStyle(K.current).fontSize),a=window.innerWidth/t-4,n=e.clientX/t,i=2.25+T.current.offsetWidth/t;n<=a&&n>=i&&X(parseFloat(n.toFixed(2)))},32),[]),ne=()=>{B(!1),K.current.removeEventListener("pointermove",ae)},ie=[{r:Z("创建文件"),v:"创建文件"},{r:Z("创建目录"),v:"创建目录"},{r:Z("重命名"),v:"重命名"},{r:Z("删除"),v:"删除"}],oe=[{r:Z("重命名"),v:"重命名"},{r:Z("删除"),v:"删除"}],se=(e,t,a,n,i)=>{e.preventDefault();const o=new c.ik;o.path=a,o.filename=t,o.x=e.clientX,o.y=e.clientY,o.items=n?ie:oe,i===O&&(o.items=o.items.slice(0,2)),o.type=n?r.Iw.studio_folder:r.Iw.studio_file;const s=e=>{i(e)};o.textClick=e=>{switch(e){case"创建文件":H({show:!0,type:y.PromptEnum.FileNew,overlay:!0,data:{dir:a,call:s}});break;case"创建目录":H({show:!0,type:y.PromptEnum.DirNew,overlay:!0,data:{dir:a,call:s}});break;case"删除":if(z&&(M.path===a||M.path.includes(a))){const e=()=>{s(n),A(!1),P({}),E(""),x.xK.set_value_temp("")};H({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:a,call:e,filename:t}});break}H({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:a,filename:t,call:n?()=>{s(!0)}:s}});break;case"重命名":H({show:!0,type:y.PromptEnum.FileRename,overlay:!0,data:{path:a,dir:(0,u.Yp)(a),call:()=>{s(!0)},filename:t}})}},H({show:!0,type:y.PromptEnum.FileMenu,overlay:!1,data:o})};return(0,d.jsxs)("div",{className:"studio",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:"取消",icon:"close",onClick:()=>{D({show:!1,path:""}),R(void 0),q(-1)}},1),(0,d.jsx)("div",{children:M.name},2)],children:[(0,d.jsx)("title",{children:M.name}),(0,c.zr)(M.name)&&(0,d.jsx)(s.rA,{title:"格式化",icon:"data_object",onClick:function(){x.xK.get_editor()?.formatCode()}}),(0,d.jsx)(s.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==L&&!1!==L?F.show?D({show:!1,path:""}):(D({show:!0,path:(0,u.GG)("file",J)}),R(!1)):R(!L)}}),z&&(0,d.jsx)(s.rA,{title:"保存",icon:"save",onClick:ee})]}),(0,d.jsxs)("div",{className:"studio-body",ref:K,children:[(0,d.jsx)("div",{className:"studio-nav",style:{width:W-1+"em"},onContextMenu:e=>{se(e,M.name,(0,u.GG)("file",J),!0,O)},children:(0,d.jsx)(h,{pre_path:p,list:t,click:async(e,t,a)=>{if("folder"===e.type){const e=await m.$M.post("studio/get/item",{path:`${a}`});if(e.code===f.m.Success){const a=[],n=[];for(const t of e.data.list)"folder"===t.type?a.push(t):"file"===t.type&&n.push(t);t([...a,...n])}}else{if(z)return void I({open:!0,handle:()=>{I({open:!1,handle:null}),A(!1),V(e,a)},title:"确定不保存就切换吗?"});V(e,a)}},handleContextMenu:se,fatherNowToggleExpansion:O})}),(0,d.jsx)("div",{className:"studio__divider",ref:T,onPointerDown:()=>{B(!0),K.current.addEventListener("pointermove",ae)},onPointerUp:ne}),U&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:ne}),(0,d.jsx)("div",{className:"studio-editor",children:M.name&&(0,d.jsx)(g,{name:M.name,on_change:()=>{z||A(!0)}})},M.path)]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2851],{75897(e,t,s){s.d(t,{L:()=>a});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.process_env_override_key="process_env_override_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 a=n.self_auth_jscode},8694(e,t,s){s.d(t,{$K:()=>o,RB:()=>i,l5:()=>l,qB:()=>n,vo:()=>r,vr:()=>c});class n{targetProxyUrl;proxyPort;sysProxyPort}let a=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class r{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=a.udp}let i=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class c{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class l{enabled;ip;port;bypass;useForLocal;type}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>o});var n=s(96540),a=s(74848);function o(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,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,t)=>(0,a.jsx)("th",{children:e},t))})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},42851(e,t,s){s.r(t),s.d(t,{default:()=>F});var n=s(96540),a=s(75725),o=s(14284),r=s(62042),i=s(53459),c=s(70447),l=s(61443),d=s(85997),_=s(77481),p=s(8694),h=s(14944),u=s(92275),x=s(86149),m=s(57952),y=s(74848);function v(e){const{t}=(0,x.B)(),[s,v]=(0,n.useState)(void 0),[j,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(""),[S,w]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}信息`,t("在线状态"),t("选择")]),[C,b]=(0,n.useState)([]),[I,A]=(0,n.useState)({}),[U,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new u.hf(u.HK.vir_net_serverIno_get);h.ws.addMsg(u.HK.vir_net_serverIno_get,e=>{(e=>{for(const s of e){const e=s[s.length-1];s[s.length-1]=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(c.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,y.jsx)(c.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,y.jsx)(c.xP,{context:s[2],tip_context:s[2]})}})(e.context),b(e.context)}),await h.ws.send(e)})();return(async()=>{const e=await o._U.get("vir/server/get");if(e.code!==i.m.Success)return;const t=e.data;v(t.port),f(t.key),g(t.open)})(),()=>{}},[]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(m.A,{children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,y.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await o._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.$K;e.open=j,e.key=k,U&&(e.async_ips=Object.keys(I)),s&&(e.port=parseInt(s));(await o._U.post("vir/server/save",e)).code===i.m.Success?((0,r.SK)("保存成功"),P(!1)):(0,r.zN)("网络错误")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"port",value:s,handleInputChange:e=>{v(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:k,handleInputChange:e=>{f(e)}}),(0,y.jsxs)("form",{children:[t("状态"),":",(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:j,onchange:()=>{g(!j)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!j,onchange:()=>{g(!j)}})]})]}),!!Object.keys(I).length&&(0,y.jsx)(l.GL,{context:t("同步信息给选中服务器"),selected:U,onchange:()=>{P(!U)}})]}),(0,y.jsx)(c.Zp,{title:"",children:(0,y.jsx)(_.X,{headers:S,rows:C.map(e=>[...e,(0,y.jsx)(l.GL,{context:t(""),selected:I[e[1]],onchange:()=>{const t={...I};t[e[1]]?delete t[e[1]]:t[e[1]]=e,A(t)}})]),width:"10rem"})})]})})]})}function j(e){const{t}=(0,x.B)(),[s,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(void 0),[g,k]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(void 0),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(""),[P,K]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await o._U.get("vir/client/get");if(e.code!==i.m.Success)return;const t=e.data;if(C(t.serverPort),k(t.serverIp),m(t.ip),j(t.mask),U(t.key),I(t.open),S(t.client_name),t.open){const e=new u.hf(u.HK.vir_net_client_get),t=(await h.ws.send(e)).context.state;K(t),h.ws.addMsg(u.HK.vir_net_client_get,e=>{K(e.context.state)})}})()},[]);return(0,y.jsx)("div",{children:(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.vo;e.ip=s,e.mask=parseInt(v),e.key=A,e.serverIp=g,e.serverPort=parseInt(w),e.open=b,e.client_name=f;(await o._U.post("vir/client/save",e)).code===i.m.Success?(0,r.SK)("保存成功"):(0,r.zN)("网络错误")}}),titleCom:(0,y.jsxs)("div",{children:[t("连接状态"),(0,y.jsx)(c.fq,{ok:P})]}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:"mask",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} ip`,value:g,handleInputChange:e=>{k(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} part`,value:w,handleInputChange:e=>{C(e)}}),(0,y.jsx)(l.Sm,{placeholder:"名称 ",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{U(e)}}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,y.jsxs)(c.Zp,{title:"",children:[(0,y.jsx)("div",{children:"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"}),(0,y.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,y.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var g=s(34843),k=s(82893),f=s(23430),S=(s(75897),s(78247)),w=s(21499),C=s(24659);function b(e){const{t}=(0,x.B)(),[s,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(!1),[P,K]=(0,n.useState)({list:[]}),[F,H]=(0,g.fp)(k.AG.editorSetting),[$,N]=(0,g.fp)(k.AG.user_base_info),B=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[O,Z]=(0,n.useState)([]),z=[t("port"),t("ip"),t("type"),t("开启")],[E,V]=(0,n.useState)([]),M=[t("编辑"),t("开启"),t("备注"),t("删除")],L=(0,C.K)(),X=async()=>{const e=[o._U.post("vir/client/tcp_proxy/get"),o._U.post("http/proxy/server/get")];let t;$.sys===f.XM.mac?t=(async()=>{const e=await o._U.post("http/proxy/get/mac");if(e.code!==i.m.Success)return;const t=[],s=[];for(const n of e.data)"Wi-Fi"===n.name?t.push(n):s.push(n);V([...t,...s])})():$.sys===f.XM.win&&(t=(async()=>{const e=await o._U.post("http/proxy/get/win");if(e.code===i.m.Success){const t=e.data;h(t.ip),m(t.port),I(t.enabled),j(t.bypass),U(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===i.m.Success&&Z(s.data),n.code===i.m.Success&&K(n.data)};(0,n.useEffect)(()=>{X()},[]);return(0,y.jsx)("div",{children:(0,y.jsxs)(a.fI,{children:[$.sys===f.XM.win&&(0,y.jsx)(a.VP,{children:(0,y.jsxs)(c.Zp,{title:"Http Proxy",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.l5;e.port=parseInt(u),e.enabled=b,e.useForLocal=A,e.ip=s,e.bypass=v;(await o._U.post("http/proxy/set/win",e)).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{h(e)}}),(0,y.jsx)(l.Sm,{placeholder:"port ",value:u,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:t("忽略ip"),value:v,handleInputChange:e=>{j(e)}}),(0,y.jsxs)("form",{children:[t("请勿将代理服务器用于本地(Intranet)地址"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:A,onchange:()=>{U(!A)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!A,onchange:()=>{U(!A)}})]})]}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]})}),$.sys===f.XM.mac&&(0,y.jsx)(a.VP,{children:E.map((e,s)=>(0,y.jsxs)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e.name})," "]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=E[e];(await o._U.post("http/proxy/set/mac",[t])).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))})(s)}})}),children:[(0,y.jsx)(_.X,{headers:z,rows:e.proxies.map((e,t)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,y.jsx)("div",{children:1===e.type?"http":"https"}),(0,y.jsx)(l.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...E];n[e].proxies[t].enabled=s,V(n)})(s,t,e)},options:L,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,y.jsx)(l.Sm,{value:e.bypass,handleInputChange:e=>{E[s].bypass=e},no_border:!0})]},s))}),(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{Z([...O,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<O.length;t++)O[t].index=t,e.push(O[t]);(await o._U.post("vir/client/tcp_proxy/save",e)).code===i.m.Success&&((0,r.SK)("保存成功"),X())}})]}),children:(0,y.jsx)(_.X,{headers:B,rows:O.map((e,s)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.l6,{value:e.open,onChange:e=>{O[s].open=e,Z([...O])},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{O.splice(e,1),Z([...O])})(s)})})];return n}),width:"10rem"})}),(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{P.list.push({open:!1,port:0,note:"",list:[]}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await o._U.post("http/proxy/server/save",P)).code===i.m.Success&&(0,r.SK)("保存成功")}})]}),children:P.list.map((e,s)=>(0,y.jsxs)("div",{className:"net-proxy-instance",children:[(0,y.jsxs)("div",{className:"net-proxy-instance__toolbar",children:[(0,y.jsxs)("span",{className:"net-proxy-instance__label",children:[t("端口实例")," #",s+1]}),(0,y.jsx)("span",{children:t("状态")}),(0,y.jsx)(l.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)("span",{children:t("端口")}),(0,y.jsx)(l.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,K({...P})},no_border:!0,width:"80px"}),(0,y.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{P.list.splice(s,1),K({...P})}}),(0,y.jsx)(l.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,K({...P})},no_border:!0})]}),(0,y.jsx)(_.X,{headers:M,rows:e.list.map((n,a)=>{const r=[(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=P.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,w.hU)(),K({...P}));const a=await o._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});H({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{0===(await o._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})).code&&(S.xK.set_value_temp(""),H({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(a.data)})(s,a)}})}),(0,y.jsx)(l.l6,{value:n.open,onChange:t=>{e.list[a].open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(a,1),K({...P})}})})];return r}),width:"10rem"})]},s))})]})]})})}var I=s(87361),A=s(82726),U=s(27690);function P(e){const{t}=(0,x.B)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/dnspod");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.id),S(t.account.token)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("id和token都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={id:v,token:f},e.isOpen=w,e.ddnsType=A.E2.dnspod;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("success")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ID",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"TOKEN",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function K(e){const{t}=(0,x.B)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/tx");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.secretid),S(t.account.secretkey)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("SecretId和SecretKey都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={secretid:v,secretkey:f},e.isOpen=w,e.ddnsType=A.E2.tengxun;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("成功")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"SecretId",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"SecretKey",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function F(){const{t:e}=(0,x.B)(),{check_user_auth:t}=(0,S.MH)(),s=[];return t(f.oV.vir_net)&&s.push({index:1,name:e("系统")+e("代理"),rto:"proxy_sys/",component:(0,y.jsx)(b,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,y.jsx)(j,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,y.jsx)(v,{})}),t(f.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,y.jsx)(P,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,y.jsx)(K,{})}),(0,y.jsx)(a.W1,{optionList:s,father_route:I.o.net})}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|