filecat 6.18.0 → 6.20.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.a04f4e4820cf310af59b.js +1 -0
- package/build/dist/1472.3ec00b3ff3c8a37045f3.js +1 -0
- package/build/dist/2851.f0c25ac0ab329092b258.js +1 -0
- package/build/dist/5761.1123531bdddf9ac35376.js +1 -0
- package/build/dist/9258.af81dfbd7c2bd191c90a.js +1 -0
- package/build/dist/dark.css +1 -4
- package/build/dist/google-dark.css +1 -4
- package/build/dist/index.html +1 -1
- package/build/dist/main.4e3dcb6bafc56360eb2b.js +2 -0
- package/build/main.js +1 -1
- package/package.json +3 -2
- package/build/dist/1448.cb0b816ecce11857fbc4.js +0 -1
- package/build/dist/2851.0961ff82dbbafc9180ae.js +0 -1
- package/build/dist/6413.21ab088c4485bbaf5c00.js +0 -1
- package/build/dist/8302.19a72820071ef3c3e981.js +0 -1
- package/build/dist/8635.14f6899e51bc338025b2.js +0 -1
- package/build/dist/main.f4425239534ec5a35a30.js +0 -2
- /package/build/dist/{main.f4425239534ec5a35a30.js.LICENSE.txt → main.4e3dcb6bafc56360eb2b.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.20.0",
|
|
4
4
|
"description": "FileCat File Browser Server Manager",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"repository": {
|
|
@@ -133,7 +133,8 @@
|
|
|
133
133
|
"webpack-node-externals": "^3.0.0",
|
|
134
134
|
"windows-shortcuts": "^0.1.6",
|
|
135
135
|
"ws": "^8.16.0",
|
|
136
|
-
"xxhashjs": "^0.2.2"
|
|
136
|
+
"xxhashjs": "^0.2.2",
|
|
137
|
+
"dingtalk-stream": "^2.1.6-beta.1"
|
|
137
138
|
},
|
|
138
139
|
"keywords": [
|
|
139
140
|
"文件服务器",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1448],{83277(e,t,s){s.d(t,{$j:()=>r,Lv:()=>i,qq:()=>n});class l{options_agent_url_list;options_agent_key_list;options_agent_model_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 s of t)if(s.value===e)return s.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const s of t)if(s.value===e)return!0;return!1}}class n extends l{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url}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"):""}s.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\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',"cL",0,a])},11448(e,t,s){s.r(t),s.d(t,{RebotCardContainer:()=>f,default:()=>y});var l=s(22022),i=s(96540),n=s(85997),a=s(57952),r=s(75725),o=s(61443),c=s(70447),d=s(14284),_=s(53459),h=s(62042),x=s(78247),p=s(23430),m=s(61973),j=(s(83277),s(92350)),u=s(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}]}},g=Object.entries(b).map(([e,t])=>({value:e,title:t.label,color:t.color}));function f(e){const{t}=(0,l.Bd)(),[s,a]=(0,i.useState)(!1),[r,c]=(0,i.useState)(!1),d=(t,s)=>{const l=[...e.items];l[t]={...l[t],...s},e.setItems(l)},_=t=>{const s=[...e.items];s.splice(t,1),e.setItems(s)},h=t=>{e.setItems([...e.items,{...e.items[t],open:!1,name:(e.items[t].name||"")+" (副本)"}])};return(0,u.jsxs)(i.Fragment,{children:[(0,u.jsx)("div",{className:"airebot-setting__toolbar",children:!1!==e.have_auth_edit&&(0,u.jsxs)(u.Fragment,{children:[s?(0,u.jsxs)("div",{className:"airebot-setting__add-select",children:[(0,u.jsx)(o.l6,{options:g,defaultValue:"qq",onChange:t=>{return s=t,e.setItems([...e.items,{platform:s,name:"",open:!1,appId:"",clientSecret:"",note:""}]),void a(!1);var s},width:"180px"}),(0,u.jsx)(n.rA,{icon:"cancel",title:t("取消"),onClick:()=>a(!1)})]}):(0,u.jsx)(n.rA,{icon:"add",title:t("添加机器人"),onClick:()=>a(!0)}),(0,u.jsx)(n.rA,{icon:"save",title:t(r?"保存中...":"保存"),onClick:()=>{r||(async()=>{c(!0),await e.save(),c(!1)})()}})]})}),0===e.items.length?(0,u.jsxs)("div",{className:"airebot-setting__empty",children:[(0,u.jsx)("span",{className:"material-symbols-outlined airebot-setting__empty-icon",children:"smart_toy"}),(0,u.jsx)("p",{children:t("还没有配置任何机器人")}),(0,u.jsx)("p",{className:"airebot-setting__empty-hint",children:t("点击上方「添加机器人」按钮来开始配置")})]}):(0,u.jsx)("div",{className:"airebot-setting__grid",children:e.items.map((e,t)=>(0,u.jsx)(v,{item:e,index:t,onChange:d,onDelete:_,onCopy:h},t))})]})}const v=({item:e,index:t,onChange:s,onDelete:i,onCopy:a})=>{const{t:r}=(0,l.Bd)(),d=b[e.platform]??b.qq,_=e._status||"disconnected";e.open;return(0,u.jsx)(c.Zp,{self_title:(0,u.jsx)("div",{className:"airebot-setting__card-header",children:(0,u.jsx)("span",{className:"material-symbols-outlined airebot-setting__card-icon",style:{color:d.color},children:d.icon})}),titleCom:(0,u.jsxs)("div",{className:"airebot-setting__card-actions",children:[(0,u.jsx)(n.Ay,{checked:!!e.open,onChange:e=>s(t,{open:e})}),(0,u.jsx)(n.rA,{icon:"content_copy",title:r("复制"),onClick:()=>a(t)}),(0,u.jsx)(n.rA,{icon:"delete",title:r("删除"),onClick:()=>i(t)})]}),children:(0,u.jsxs)("div",{className:"airebot-setting__card-fields",children:[(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("平台")}),(0,u.jsx)(o.l6,{options:g,value:e.platform,onChange:e=>s(t,{platform:e}),width:"100%"})]}),(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("名称")}),(0,u.jsx)(o.Sm,{value:e.name||"",handleInputChange:e=>s(t,{name:e}),placeholder:r("给机器人起个名字")})]}),d.fields.map(l=>{const i=e[l.key]??"";return(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsxs)("label",{className:"airebot-setting__field-label",children:[l.label,l.required&&(0,u.jsx)("span",{className:"airebot-setting__field-required",children:"*"})]}),(0,u.jsx)(o.Sm,{type:l.type,value:i,handleInputChange:e=>s(t,{[l.key]:e}),placeholder:l.placeholder})]},l.key)}),(0,u.jsxs)("div",{className:"airebot-setting__field ",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("模型编号")}),(0,u.jsx)(o.Sm,{value:e.model_index,handleInputChange:e=>s(t,{model_index:e}),placeholder:r("使用指定模型(可选)")})]}),(0,u.jsxs)("div",{className:"airebot-setting__field ",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("用户id")}),(0,u.jsx)(o.Sm,{value:e.user_id||"",handleInputChange:e=>s(t,{user_id:e}),placeholder:r("默认使用root账户(继承权限,可选)")})]}),(0,u.jsxs)("div",{className:"airebot-setting__field airebot-setting__field-full",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("备注")}),(0,u.jsx)(o.Sm,{value:e.note||"",handleInputChange:e=>s(t,{note:e}),placeholder:r("备注信息(可选)")})]})]})})};function y(){const{t:e}=(0,l.Bd)(),t=(0,m.Zp)(),{check_user_auth:s}=(0,x.MH)(),[o,c]=(0,i.useState)([]),b=(0,j.Q)(),g=async()=>{const e=await d.XO.get("ai_rebot_setting");e.code===_.m.Success&&c(e.data?.list??[])};(0,i.useEffect)(()=>{g()},[]);return(0,u.jsxs)("div",{className:"airebot-setting",children:[(0,u.jsx)(a.A,{children:s(p.oV.ai_agent_setting)&&(0,u.jsx)(n.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>t(-1)})}),(0,u.jsx)(r.fI,{children:(0,u.jsxs)(r.VP,{widthPer:100,children:[(0,u.jsxs)("div",{className:"airebot-setting__page-title",children:[(0,u.jsx)("h2",{children:e("机器人配置")}),(0,u.jsx)(n.rA,{icon:"info",onClick:()=>{b("机器人配置")},title:"信息"})]}),(0,u.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===_.m.Success&&((0,h.SK)(e("保存成功")),await g())},have_auth_edit:s(p.oV.ai_agent_setting)})]})})]})}s.d(t,["PLATFORM_META",0,b,"RebotCard",0,v])},92350(e,t,s){s.d(t,{Q:()=>_,o:()=>x});var l=s(34843),i=s(82893),n=s(74777),a=s(96540),r=s(22022),o=s(23430),c=s(14284),d=s(74848);function _(){const[e,t]=(0,l.fp)(i.AG.prompt_card),{t:s,i18n:a}=(0,r.Bd)();return e=>{let l;e===n.jk.ffmpeg?l=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===n.jk.smartmontools?l=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?l=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?l=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?l=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?l=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?l=(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?l=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?l=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?l=(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?l=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(l=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsx)("ul",{children:(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。"})})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:l})})}}let h=o.Ky;function x(){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=[...o.Ky,...s],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),e}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
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.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e}({});const a=n.self_auth_jscode},8694(e,t,s){s.d(t,{$K:()=>o,RB:()=>r,l5:()=>l,qB:()=>n,vo:()=>c,vr:()=>i});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 c{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=a.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class i{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:()=>c,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 c(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:()=>K});var n=s(96540),a=s(75725),o=s(14284),c=s(62042),r=s(53459),i=s(70447),l=s(61443),d=s(85997),_=s(77481),p=s(8694),h=s(14944),u=s(92275),x=s(22022),y=s(57952),m=s(74848);function v(e){const{t}=(0,x.Bd)(),[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,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,m.jsx)(i.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,m.jsx)(i.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!==r.m.Success)return;const t=e.data;v(t.port),f(t.key),g(t.open)})(),()=>{}},[]);return(0,m.jsxs)("div",{children:[(0,m.jsxs)(y.A,{children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,m.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await o._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,m.jsx)(a.fI,{children:(0,m.jsxs)(a.VP,{children:[(0,m.jsxs)(i.Zp,{title:"",rightBottomCom:(0,m.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===r.m.Success?((0,c.SK)("保存成功"),P(!1)):(0,c.zN)("网络错误")}}),children:[(0,m.jsx)(l.Sm,{placeholder:"port",value:s,handleInputChange:e=>{v(e)}}),(0,m.jsx)(l.Sm,{type:"password",placeholder:"key ",value:k,handleInputChange:e=>{f(e)}}),(0,m.jsxs)("form",{children:[t("状态"),":",(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:j,onchange:()=>{g(!j)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!j,onchange:()=>{g(!j)}})]})]}),!!Object.keys(I).length&&(0,m.jsx)(l.GL,{context:t("同步信息给选中服务器"),selected:U,onchange:()=>{P(!U)}})]}),(0,m.jsx)(i.Zp,{title:"",children:(0,m.jsx)(_.X,{headers:S,rows:C.map(e=>[...e,(0,m.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.Bd)(),[s,y]=(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,F]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await o._U.get("vir/client/get");if(e.code!==r.m.Success)return;const t=e.data;if(C(t.serverPort),k(t.serverIp),y(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;F(t),h.ws.addMsg(u.HK.vir_net_client_get,e=>{F(e.context.state)})}})()},[]);return(0,m.jsx)("div",{children:(0,m.jsx)(a.fI,{children:(0,m.jsxs)(a.VP,{children:[(0,m.jsxs)(i.Zp,{title:"",rightBottomCom:(0,m.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===r.m.Success?(0,c.SK)("保存成功"):(0,c.zN)("网络错误")}}),titleCom:(0,m.jsxs)("div",{children:[t("连接状态"),(0,m.jsx)(i.fq,{ok:P})]}),children:[(0,m.jsx)(l.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{y(e)}}),(0,m.jsx)(l.Sm,{placeholder:"mask",value:v,handleInputChange:e=>{j(e)}}),(0,m.jsx)(l.Sm,{placeholder:`${t("服务器")} ip`,value:g,handleInputChange:e=>{k(e)}}),(0,m.jsx)(l.Sm,{placeholder:`${t("服务器")} part`,value:w,handleInputChange:e=>{C(e)}}),(0,m.jsx)(l.Sm,{placeholder:"名称 ",value:f,handleInputChange:e=>{S(e)}}),(0,m.jsx)(l.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{U(e)}}),(0,m.jsxs)("form",{children:[t("状态"),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,m.jsxs)(i.Zp,{title:"",children:[(0,m.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,m.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,m.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.Bd)(),[s,h]=(0,n.useState)(""),[u,y]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(!1),[P,F]=(0,n.useState)({port:0,open:!1,list:[]}),[K,H]=(0,g.fp)(k.AG.editorSetting),[$,B]=(0,g.fp)(k.AG.user_base_info),O=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[N,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!==r.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===r.m.Success){const t=e.data;h(t.ip),y(t.port),I(t.enabled),j(t.bypass),U(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===r.m.Success&&Z(s.data),n.code===r.m.Success&&F(n.data)};(0,n.useEffect)(()=>{X()},[]);const G=async()=>{(await o._U.post("http/proxy/server/save",P)).code===r.m.Success&&(X(),(0,c.SK)("保存成功"))};return(0,m.jsx)("div",{children:(0,m.jsxs)(a.fI,{children:[$.sys===f.XM.win&&(0,m.jsx)(a.VP,{children:(0,m.jsxs)(i.Zp,{title:"Http Proxy",rightBottomCom:(0,m.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===r.m.Success&&(X(),(0,c.SK)("保存成功"))}}),children:[(0,m.jsx)(l.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{h(e)}}),(0,m.jsx)(l.Sm,{placeholder:"port ",value:u,handleInputChange:e=>{y(e)}}),(0,m.jsx)(l.Sm,{placeholder:t("忽略ip"),value:v,handleInputChange:e=>{j(e)}}),(0,m.jsxs)("form",{children:[t("请勿将代理服务器用于本地(Intranet)地址"),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:A,onchange:()=>{U(!A)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!A,onchange:()=>{U(!A)}})]})]}),(0,m.jsxs)("form",{children:[t("状态"),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]})}),$.sys===f.XM.mac&&(0,m.jsx)(a.VP,{children:E.map((e,s)=>(0,m.jsxs)(i.uF,{self_title:(0,m.jsxs)("span",{className:" div-row ",children:[(0,m.jsx)("h2",{children:e.name})," "]}),titleCom:(0,m.jsx)("div",{children:(0,m.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=E[e];(await o._U.post("http/proxy/set/mac",[t])).code===r.m.Success&&(X(),(0,c.SK)("保存成功"))})(s)}})}),children:[(0,m.jsx)(_.X,{headers:z,rows:e.proxies.map((e,t)=>{const n=[(0,m.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,m.jsx)(l.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,m.jsx)("div",{children:1===e.type?"http":"https"}),(0,m.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,m.jsx)(l.Sm,{value:e.bypass,handleInputChange:e=>{E[s].bypass=e},no_border:!0})]},s))}),(0,m.jsxs)(a.VP,{children:[(0,m.jsx)(i.uF,{self_title:(0,m.jsxs)("span",{className:" div-row ",children:[(0,m.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,m.jsxs)("div",{children:[(0,m.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{Z([...N,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,m.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<N.length;t++)N[t].index=t,e.push(N[t]);(await o._U.post("vir/client/tcp_proxy/save",e)).code===r.m.Success&&((0,c.SK)("保存成功"),X())}})]}),children:(0,m.jsx)(_.X,{headers:O,rows:N.map((e,s)=>{const n=[(0,m.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,m.jsx)(l.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,m.jsx)(l.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,m.jsx)(l.l6,{value:e.open,onChange:e=>{N[s].open=e,Z([...N])},options:L,no_border:!0}),(0,m.jsx)(l.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,m.jsx)("div",{children:(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{N.splice(e,1),Z([...N])})(s)})})];return n}),width:"10rem"})}),(0,m.jsxs)(i.uF,{self_title:(0,m.jsxs)("span",{className:" div-row ",children:[(0,m.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,m.jsxs)("div",{children:[(0,m.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{P.list.push({note:"",open:!1}),F({...P})}}),(0,m.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:G})]}),children:[(0,m.jsx)(_.X,{headers:M,rows:P.list.map((e,s)=>[(0,m.jsx)("div",{children:(0,m.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async e=>{P.list[e].random_key||(P.list[e].random_key=(0,w.hU)(),F({...P}),await G());const t=await o._U.post("http/proxy/server/code/get",{key:P.list[e].random_key});H({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async t=>{0===(await o._U.post("http/proxy/server/code/save",{context:t,key:P.list[e].random_key})).code&&(S.xK.set_value_temp(""),H({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(t.data)})(s)}})}),(0,m.jsx)(l.l6,{value:e.open,onChange:e=>{P.list[s].open=e,F({...P})},options:L,no_border:!0}),(0,m.jsx)(l.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,m.jsx)("div",{children:(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{P.list.splice(s,1),F({...P})}})})]),width:"10rem"}),(0,m.jsxs)("form",{children:[t("状态"),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:P.open,onchange:()=>{F({...P,open:!P.open})}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!P.open,onchange:()=>{F({...P,open:!P.open})}})]})]}),"port",(0,m.jsx)(l.Sm,{value:P.port,handleInputChange:e=>{P.port=e?parseInt(e):"",F({...P})},no_border:!0})]})]})]})})}var I=s(87361),A=s(82726),U=s(27690);function P(e){const{t}=(0,x.Bd)(),[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,F]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/dnspod");if(e.code!==r.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 K=async e=>{F({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),F({open:!1,handle:null})},title:t("确定删除吗")})};return(0,m.jsxs)("div",{children:[(0,m.jsx)(y.A,{children:(0,m.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,m.jsxs)(a.fI,{children:[(0,m.jsxs)(a.VP,{children:[(0,m.jsx)(i.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,m.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,m.jsx)(l.Sm,{right_placeholder:(0,m.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,m.jsx)(i.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,m.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,m.jsx)(l.Sm,{right_placeholder:(0,m.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,m.jsxs)(a.VP,{children:[(0,m.jsxs)(i.Zp,{title:t("账号设置"),rightBottomCom:(0,m.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,c.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===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("success")}}),children:[(0,m.jsx)(l.Sm,{placeholder:"ID",value:v,handleInputChange:e=>{j(e)}}),(0,m.jsx)(l.cA,{placeholder:"TOKEN",value:f,handleInputChange:e=>{S(e)}}),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,m.jsx)(i.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function F(e){const{t}=(0,x.Bd)(),[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,F]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/tx");if(e.code!==r.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 K=async e=>{F({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),F({open:!1,handle:null})},title:t("确定删除吗")})};return(0,m.jsxs)("div",{children:[(0,m.jsx)(y.A,{children:(0,m.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,m.jsxs)(a.fI,{children:[(0,m.jsxs)(a.VP,{children:[(0,m.jsx)(i.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,m.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,m.jsx)(l.Sm,{right_placeholder:(0,m.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,m.jsx)(i.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,m.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,m.jsx)(l.Sm,{right_placeholder:(0,m.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,m.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,m.jsxs)(a.VP,{children:[(0,m.jsxs)(i.Zp,{title:t("账号设置"),rightBottomCom:(0,m.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,c.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===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("成功")}}),children:[(0,m.jsx)(l.Sm,{placeholder:"SecretId",value:v,handleInputChange:e=>{j(e)}}),(0,m.jsx)(l.cA,{placeholder:"SecretKey",value:f,handleInputChange:e=>{S(e)}}),(0,m.jsx)(_.S,{isFlex:!0,columns:[(0,m.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,m.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,m.jsx)(i.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function K(){const{t:e}=(0,x.Bd)(),{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,m.jsx)(b,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,m.jsx)(j,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,m.jsx)(v,{})}),t(f.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,m.jsx)(P,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,m.jsx)(F,{})}),(0,m.jsx)(a.W1,{optionList:s,father_route:I.o.net})}},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6413],{75897(e,t,s){s.d(t,{L:()=>i});let n=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_workflow_router_key="customer_workflow_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.sys_software="sys_software",e.protection_directory="sys_protection_directory",e.dir_upload_max_num="dir_upload_max_num",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e.extra_env_path_list_key="extra_env_path_list_key",e.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e}({});const i=n.self_auth_jscode},77481(e,t,s){s.d(t,{S:()=>a,X:()=>l});var n=s(96540),i=s(74848);function l(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,s)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},76413(e,t,s){s.r(t),s.d(t,{default:()=>q});var n=s(96540),i=s(75725),l=s(23430),a=s(70447),o=s(85997),r=s(61443),c=s(14284),d=s(53459),_=s(77481),h=s(22022),u=s(82893),p=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function f(e){const{t}=(0,h.Bd)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.title}),e.info_click&&(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");l([t,...s])}}),(0,v.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,v.jsx)(_.X,{headers:e.headers,rows:s.map((n,i)=>{const a=[];for(let t=0;t<e.headers.length;t++)a.push((0,v.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return a.push((0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,v.jsx)(o.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,p.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,v.jsx)(o.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),a}),width:"10rem"})})})}var g=s(34843),y=s(78247),w=s(24659);function k(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),l=(0,w.K)(),f=[e("路由"),e("auth"),e("备注")],[k,S]=(0,g.fp)(u.AG.editorSetting),[C,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&b(e.data)})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自定义api路由")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([{note:"",needAuth:!1,router:""},...C])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",C)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,v.jsx)(_.X,{headers:f,rows:C.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,b([...C])},no_border:!0}),(0,v.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,b([...C])},options:l,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,b([...C])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)}),(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,x.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);S({model:"ace/mode/javascript",open:!0,fileName:e.router,save:async t=>{const s={context:t,router:e.router};(await c.XO.post("jscode/save",s)).code===d.m.Success&&(y.xK.set_value_temp(""),S({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),y.xK.set_value_temp(t.data)})(t)}),t.router&&(0,v.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,p.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem"})})})}var S=s(23496),C=s(57952);function b(){const{t:e}=(0,h.Bd)(),[t,s]=(0,g.fp)(u.AG.prompt_card),[l,a]=(0,g.fp)(u.AG.router_jump),o=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(C.A,{}),(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(f,{title:e("页面资源路由"),headers:o,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_router);if(e.code===d.m.Success){if(l?.page_self_router_api_data){for(const t of e.data)t[1]===l?.page_self_router_api_data[1]&&(0,x.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,l?.page_self_router_api_data),e.data=[t,...e.data],a({})}return e.data}return[]},save:async e=>{(await c.XO.post(S.s.setting_customer_router_save,e)).code===d.m.Success&&(0,x.SK)("success")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})},need_copy:!0}),(0,v.jsx)(f,{title:e("workflow触发路由"),headers:r,getItems:async()=>{const e=await c.XO.get(S.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(S.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,x.SK)("保存成功")},info_click:()=>{let e=(0,v.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:e})})}})]}),(0,v.jsx)(i.VP,{children:(0,v.jsx)(k,{})})]})]})}var A=s(75897),I=s(74777),V=s(6960),X=s(7523);function N(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[j,f]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[b,N]=(0,n.useState)(""),[O,F]=(0,g.fp)(u.AG.prompt_card),[K,P]=(0,n.useState)(!1),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,g.fp)(u.AG.editorSetting),[E,U]=(0,n.useState)(I.aM.close),[T,Z]=(0,n.useState)(void 0),{t:H,i18n:D}=(0,h.Bd)(),[W,L]=(0,g.fp)(u.AG.user_base_info),{check_user_auth:Q}=(0,y.MH)(),{initUserInfo:J}=(0,n.useContext)(X.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){m(e.data.self_auth_open),f(e.data.shell_cmd_check_open),k(e.data.recycle_open),N(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info);const n=e.data.https_setting;n&&(P(n.open),B(n.cert_path||""),$(n.key_path||""))}const s=await c.XO.get("token");if(s.code===d.m.Success){const e=s.data;if(!e)return;e.length&&Z(e.length),e.mode&&U(e.mode)}})()},[]);return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.Zp,{title:H("自定义登录auth"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("self_auth_open/save",{open:p})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("self_auth_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e,router:A.L};0===(await c.XO.post("jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:p,onChange:e=>{m(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})}),(0,v.jsx)(a.Zp,{title:H("自定义shell命令校验"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{(await c.XO.post("shell_cmd_check_open/save",{open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),titleCom:(0,v.jsx)(o.rA,{icon:"edit",title:H("代码修改"),onClick:async()=>{const e=await c.XO.get("shell_cmd_check_open/jscode");q({model:"ace/mode/javascript",open:!0,fileName:"",save:async e=>{const t={context:e};0===(await c.XO.post("shell_cmd_check_open/jscode/save",t)).code&&(y.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),y.xK.set_value_temp(e.data)}}),children:(0,v.jsx)(r.l6,{value:j,onChange:e=>{f(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})})]})}),(0,v.jsx)(i.VP,{widthPer:30,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:H("文件回收站")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{F({open:!0,title:"信息",context_div:(0,v.jsx)("div",{children:H("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(w&&!b)return void(0,x.zN)("目录不能为空");(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:b,open:w})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:H("目录"),value:b,handleInputChange:e=>{N(e)}}),(0,v.jsx)(r.l6,{value:w,onChange:e=>{k(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]})]}),(0,v.jsxs)(a.Zp,{title:H("token过期时间"),rightBottomCom:(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(o.C3,{text:H("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(o.C3,{text:H("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=E,I.aM.length!==e.mode||T||(0,x.zN)("秒数不能为空"),e.length=parseInt(T);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:[(0,v.jsx)(_.S,{isFlex:!0,columns:[(0,v.jsx)(r.U6,{value:1,context:H("关闭"),selected:E===I.aM.close,onchange:()=>{U(I.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:H("指定时间"),selected:E===I.aM.length,onchange:()=>{U(I.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:H("永不过期"),selected:E===I.aM.forver,onchange:()=>{U(I.aM.forver)}})]}),E===I.aM.length&&(0,v.jsx)(r.Sm,{placeholder:H("秒"),value:T,handleInputChange:e=>{Z(e)}})]})]})}),(0,v.jsx)(i.VP,{widthPer:40,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsxs)(a.Zp,{title:H("通用设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:s}})).code===d.m.Success&&((0,x.SK)("修改成功"),J())}}),children:[H("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),H("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(a.Zp,{title:H("HTTPS 设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:H("确定修改"),clickFun:async()=>{if(K){if(!z)return void(0,x.zN)("证书路径不能为空");if(!M)return void(0,x.zN)("私钥路径不能为空")}const e=new I.CH;e.open=K,e.cert_path=z,e.key_path=M;(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:K})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:K,onChange:e=>{P(e)},options:[{title:H("开启"),value:!0},{title:H("关闭"),value:!1}]}),K&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:H("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:H("证书文件路径(cert.pem/fullchain.pem)"),value:z,handleInputChange:e=>{B(e)}}),(0,v.jsx)("div",{children:H("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:H("私钥文件路径(privkey.pem)"),value:M,handleInputChange:e=>{$(e)}})]})]})]})}),(0,v.jsx)(C.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[H("系统运行于"),": ",(0,V.s)(W.runing_time_length)]}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:6.18.0",null!=W.latest_version&&"6.18.0"!==W.latest_version?` -> ${W.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:H("官网地址"),target:"_blank",children:`filecat ${H("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[H("安装方式")," :",W.process_env_run_env]})]})})]})}var O=s(64694),F=s(92350);function K(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,I]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[K,P]=(0,n.useState)([]),[z,B]=(0,n.useState)(""),[M,$]=(0,n.useState)([]),G=(0,w.K)(),q=[e("软件"),e("是否安装"),e("路径")],E=[e("编号"),e("路径"),e("备注")],U=[e("编号"),e("路径"),e("是否开启"),e("备注")],T=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],H=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:D}=(0,y.MH)(),W=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&N(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&f(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&B(t.data),W(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&b(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&I(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&$(i.data??[])})()},[]);const Q=(0,F.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",M)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(i.J,{widthPer:100,children:(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of A)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,O.di)(A,e=>e.index);(await c.XO.post("dir_upload_max_num/save",A)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:Z,rows:A.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,I([...A])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:"number"==typeof t.ws_file_standard_size?t.ws_file_standard_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_standard_size=1024*parseInt(e)*1024},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:"number"==typeof t.ws_file_block_mb_size?t.ws_file_block_mb_size/1024/1024:void 0,handleInputChange:e=>{t.ws_file_block_mb_size=1024*parseInt(e)*1024},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem"})})}),(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PATH")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:V})).code===d.m.Success&&((0,x.SK)("保存成功"),W(),s())}})]}),children:(0,v.jsx)(_.X,{headers:U,rows:V.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,N([...V])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PTY CMD")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:"信息"})]}),rightBottomCom:(0,v.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:z})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:z,handleInputChange:e=>{B(e)}})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("Workflow Job")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...K,{open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",K)).code===d.m.Success&&((0,x.SK)("ok"),L())}})]}),children:(0,v.jsx)(_.X,{headers:T,rows:K.map((t,s)=>[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...K])},options:G,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>()=>{P([...K.splice(s,1)])}})]),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("插件配置")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{$([...M,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,v.jsx)(_.X,{headers:H,rows:M.map((t,s)=>{const n=[s,(0,v.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,$([...M])},options:G,no_border:!0}),(0,v.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{M.splice(e,1),$([...M])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("系统保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...C,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",C)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(_.X,{headers:E,rows:C.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{title:e("外部软件"),titleCom:(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,x.SK)("保存成功"),s())}}),children:(0,v.jsx)(_.X,{headers:q,rows:j.map((t,s)=>[(0,v.jsx)("div",{children:t.id}),(0,v.jsx)(a.fq,{ok:t.installed}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("默认使用环境变量")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:"信息"})]),width:"10rem"})})]})})]})]})}function P(e){const{t,i18n:s}=(0,h.Bd)(),[i,a]=(0,g.fp)(u.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd删除、添加管理"),permission:l.oV.systemd_update}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai Chat Page"),permission:l.oV.ai_agent_page}]},{title:t("文件权限"),list:[{title:t("文件删除、剪切、重命名"),permission:l.oV.filecat_file_delete_cut_rename},{title:t("文件创建、上传、内容更新、解压缩"),permission:l.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:l.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:l.oV.recycle_file_save},{title:t("文件分享"),permission:l.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:l.oV.sys_setting_page},{title:t("htts"),permission:l.oV.https_file},{title:t("token时间修改"),permission:l.oV.token_update},{title:t("自定义auth"),permission:l.oV.code_auth},{title:t("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key},{title:t("shell命令检测"),permission:l.oV.shell_cmd_check}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("系统保护路径更新"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("网址导航"),permission:l.oV.net_site_tag_update},{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("网址导航"),permission:l.oV.nav_net_tag},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,v.jsx)(n.Fragment,{children:o.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,v.jsxs)("div",{children:[(0,v.jsx)("input",{type:"checkbox",disabled:!t.noDisable&&e.is_disable(t.permission),checked:e.is_selected(t.permission,t.noDisable),onChange:()=>{e.select_auth(t.permission)}}),t.title]},s))]},s))})}const z=new Map;function B(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[j,f]=(0,g.fp)(u.AG.user_base_info),[y,w]=(0,n.useState)([]),[k,S]=(0,g.fp)(u.AG.prompt_card),[C,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[V,N]=(0,g.fp)(u.AG.confirm),[K,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[E,U]=(0,n.useState)([]),[T,Z]=(0,n.useState)([]),[H,D]=(0,n.useState)([]),[W,L]=(0,n.useState)(""),[Q,J]=(0,n.useState)(""),[R,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,le]=(0,n.useState)(""),[ae,oe]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,_e]=(0,n.useState)(""),[he,ue]=(0,n.useState)({}),pe=(0,F.o)(),[xe,me]=(0,n.useState)([]),je=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ve=async()=>{const e=await c.wm.get("all_users");e.code===d.m.Success&&w(e.data);const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),z.clear();for(const e of t.data)z.set(e.role_id,e)}},fe=e=>{B(e?.username??""),$(e?.password??""),q(e?.cwd??""),U(e?.access_dirs??[]),Z(e?.not_access_dirs??[]),D(e?.only_read_dirs??[]),L(e?.access_cmd??""),J(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),le(e?.note??""),oe(e?.is_root??!1),ce(e?.id??""),e?.bind_role_id?ge(e.bind_role_id,e.auth_list??[]):(_e(""),ue({}))};(0,n.useEffect)(()=>{ve()},[]);const ge=(e,t=[])=>{if(!e)return _e(""),void ue({});const s=z.get(e);if(s){if(s.cwd&&q(s.cwd),s.access_dirs&&s.access_dirs.length>0&&U(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&Z(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&D(s.only_read_dirs),s.access_cmd&&L(s.access_cmd),s.not_access_cmd&&J(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}_e(e),ue(s)}},ye=()=>{if(!K)return void(0,x.zN)("username not empty");if((0,m.CB)(K))return void(0,x.zN)("username not empty char");if(!G)return void(0,x.zN)("cwd not empty");const e=new l.E0;return e.language=R,e.theme=ee,e.access_dirs=E,e.username=K,e.password=M,e.not_access_dirs=T,e.only_read_dirs=H,e.cwd=G,e.note=ie,e.access_cmd=W,e.not_access_cmd=Q,e.auth_list=se,e.bind_role_id=de,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("用户")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),I(!1),fe(void 0)}})}),children:(0,v.jsx)(_.X,{headers:je,rows:y.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.id}),(0,v.jsx)(a.xP,{children:t.username}),(0,v.jsx)(a.xP,{children:t.cwd}),(0,v.jsx)(a.xP,{children:t.note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),I(!0),fe(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{N({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ve(),N({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(C||A)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(C?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),I(!1),fe(void 0)}}),C&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!M)return void(0,x.zN)("password not empty");if((0,m.CB)(M))return void(0,x.zN)("username not empty char");const e=ye(),t=await c.wm.post("create_user",e);ve(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ve(),b(!1),I(!1),fe(void 0))}}),A&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ye();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ve())}})]}),children:[(0,v.jsx)("label",{children:e("用户名")}),(0,v.jsx)(r.Sm,{value:K,handleInputChange:e=>B(e)}),(0,v.jsx)("label",{children:e("密码")}),(0,v.jsx)(r.Sm,{type:"password",value:M,handleInputChange:e=>$(e)}),(0,v.jsxs)("label",{children:[!he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{U([...E,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{disabled:""!==he.cwd&&void 0!==he.cwd,value:G,handleInputChange:e=>q(e)}),(E??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.access_dirs?.length&&void 0!==he?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,U([...E])}})}),0===he?.access_dirs?.length||void 0===he?.access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),U([...E])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{Z([...T,""])},title:e("添加")}),e("禁止目录范围")]}),(T??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.not_access_dirs?.length&&void 0!==he?.not_access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,Z([...T])}})}),0===he?.not_access_dirs?.length||void 0===he?.not_access_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{T.splice(s,1),Z([...T])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{D([...H,""])},title:e("添加")}),e("只读目录范围")]}),(H??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==he?.only_read_dirs?.length&&void 0!==he?.only_read_dirs?.length,value:t,handleInputChange:e=>{H[s]=e,D([...H])}})}),0===he?.only_read_dirs?.length||void 0===he?.only_read_dirs?.length&&(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{H.splice(s,1),D([...H])},title:e("删除")})]},s)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.access_cmd&&void 0!==he.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>L(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==he.not_access_cmd&&void 0!==he.not_access_cmd,value:Q,placeholder:"use blank split",handleInputChange:e=>J(e)}),!ae&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("label",{children:e("角色")}),(0,v.jsx)(r.l6,{value:de,onChange:e=>{ge(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of xe)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{disabled:""!==he.language&&void 0!==he.language,value:R,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{disabled:""!==he.theme&&void 0!==he.theme,value:ee,onChange:e=>{te(e)},options:pe}),(0,v.jsx)(P,{is_disable:e=>{if(!0===ae)return!0;if(de){const t=z.get(de);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===ae||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,O.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,v.jsx)("label",{children:e("备注")}),(0,v.jsx)(r.Sm,{value:ie,handleInputChange:e=>le(e)})]})})})]})}function M(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s}=(0,n.useContext)(X.F),[p,m]=(0,n.useState)([]),[j,f]=(0,g.fp)(u.AG.prompt_card),[y,w]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),[C,b]=(0,g.fp)(u.AG.confirm),[A,I]=(0,n.useState)(""),[V,N]=(0,n.useState)(""),[K,z]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)([]),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),z(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),E(e?.access_cmd??""),T(e?.not_access_cmd??""),H(e?.language??""),W(e?.theme??""),Q(e?.auth_list??[]),R(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!A)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=Z,e.theme=D,e.access_dirs=K,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=V,e.access_cmd=q,e.not_access_cmd=U,e.auth_list=L,e.role_note=Y,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(a.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("角色")})}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{w(!0),S(!1),ie(void 0)}})}),children:(0,v.jsx)(_.X,{headers:se,rows:p.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.role_id}),(0,v.jsx)(a.xP,{children:t.role_name}),(0,v.jsx)(a.xP,{children:t.role_note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{w(!1),S(!0),ie(e)})(t)}),!t.is_root&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{b({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new l.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,x.SK)("删除完成"),ne(),b({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(y||k)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(y?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{w(!1),S(!1),ie(void 0)}}),y&&(0,v.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=le();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ne(),w(!1),S(!1),ie(void 0))}}),k&&(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=le();if(!e)return;e.role_id=J;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ne())}})]}),children:[(0,v.jsx)("label",{children:e("角色名")}),(0,v.jsx)(r.Sm,{value:A,handleInputChange:e=>I(e)}),(0,v.jsx)("label",{children:e("角色备注")}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{z([...K,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:V,handleInputChange:e=>N(e)}),(K??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{K[t]=e,z([...K])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{K.splice(t,1),z([...K])},title:"删除"})]},t)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{M([...B,""])},title:"添加"}),e("禁止目录范围")]}),(B??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:t,handleInputChange:e=>{B[s]=e,M([...B])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{B.splice(s,1),M([...B])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[(0,v.jsx)(o.rA,{icon:"add",onClick:()=>{G([...$,""])},title:e("添加")}),e("只读目录范围")]}),($??[]).map((e,t)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{$[t]=e,G([...$])}})}),(0,v.jsx)(o.rA,{icon:"delete",onClick:()=>{$.splice(t,1),G([...$])},title:"删除"})]},t)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{value:q,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{value:U,placeholder:"use blank split",handleInputChange:e=>T(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:Z,onChange:e=>{H(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{value:D,onChange:e=>{W(e)},options:te}),(0,v.jsx)(P,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,O.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function $(){const{t:e,i18n:t}=(0,h.Bd)(),{initUserInfo:s,reloadUserInfo:p}=(0,n.useContext)(X.F),[m,j]=(0,n.useState)([]),[f,y]=(0,g.fp)(u.AG.prompt_card),[k,C]=(0,n.useState)([]),[b,A]=(0,n.useState)([]),[V,N]=(0,n.useState)([]),[O,K]=(0,g.fp)(u.AG.user_base_info),P=(0,w.K)(),z=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[q,E]=(0,n.useState)(""),[U,T]=(0,n.useState)(""),[Z,H]=(0,n.useState)(""),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),A(e.data.quick_cmd),N(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&C(t.data??[])})(),Q(O?.user_data?.language),R(O?.user_data?.theme),ee(O?.user_data?.upload_file_ignore)},[]);const te=(0,F.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件夹路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件夹路径")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,x.SK)("保存成功"),p(),s())}})]}),children:(0,v.jsx)(_.X,{headers:B,rows:m.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)("div",{children:0!==s&&(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("个人保护路径")})," ",(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("保护目录")},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{C([...k,{path:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",k)).code===d.m.Success&&((0,x.SK)("保存成功"),p())}})]}),children:(0,v.jsx)(_.X,{headers:M,rows:k.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),C([...k])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("修改密码"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!q||!U)return void(0,x.zN)("账号密码不能为空");if(U!==Z)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=q,e.password=U,e.confirm_password=Z,e.user_id=O.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:e("新账号"),value:q,handleInputChange:e=>{E(e)}}),(0,v.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{T(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{H(e)}})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(a.Zp,{title:e("个性化设置"),rightBottomCom:(0,v.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(S.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:Y}})).code===d.m.Success&&((0,x.SK)("修改成功"),s())}}),children:[e("语言"),(0,v.jsx)(r.l6,{value:L,onChange:e=>{Q(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"},{title:"Deutsch",value:"de"},{title:"ドイツ語",value:"ja"},{title:"독일어",value:"ko"},{title:"Немецкий язык",value:"ru"},{title:"Allemand",value:"fr"},{title:"Alemán",value:"es"}]}),e("主题"),(0,v.jsx)(r.l6,{value:J,onChange:e=>{R(e)},options:z}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>{ee(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})}),(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("目录快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("目录快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{cmd:"",note:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:b})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:$,rows:b.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(a.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件快捷命令")}),(0,v.jsx)(o.rA,{icon:"info",onClick:()=>{te("文件快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...V,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,v.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:V})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(_.X,{headers:G,rows:V.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),N([...V])})(s)})];return n}),width:"10rem"})})]})]})]})})}var G=s(87361);function q(){const{t:e}=(0,h.Bd)(),{check_user_auth:t}=(0,y.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,v.jsx)($,{})}];return t(l.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,v.jsx)(N,{})}),t(l.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,v.jsx)(K,{})}),t(l.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,v.jsx)(b,{})}),t(l.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,v.jsx)(B,{})}),t(l.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,v.jsx)(M,{})}),(0,v.jsx)(i.W1,{optionList:s,father_route:G.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>_,o:()=>u});var n=s(34843),i=s(82893),l=s(74777),a=s(96540),o=s(22022),r=s(23430),c=s(14284),d=s(74848);function _(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:a}=(0,o.Bd)();return e=>{let n;e===l.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsx)("ul",{children:(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。"})})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let h=r.Ky;function u(){const[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];h=[...r.Ky,...s],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>a});var n=s(72635);const i=1440,l=525600;function a(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010,8302],{83277(e,t,n){n.d(t,{$j:()=>a,Lv:()=>o,qq:()=>i});class s{options_agent_url_list;options_agent_key_list;options_agent_model_list}class o{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 n of t)if(n.value===e)return n.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const n of t)if(n.value===e)return!0;return!1}}class i extends s{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url}const l=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function a(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}n.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\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',"cL",0,l])},77481(e,t,n){n.d(t,{S:()=>l,X:()=>i});var s=n(96540),o=n(74848);function i(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((e,t)=>(0,o.jsx)("th",{children:e},t))})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>(0,o.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,o.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},29591(e,t,n){n.r(t),n.d(t,{default:()=>K});var s=n(22022),o=n(96540),i=n(85997),l=n(57952),a=n(34843),r=n(82893),c=n(75725),d=n(77481),p=n(61443),u=n(70447),h=n(34299),_=n(74848);var m=n(14284),x=n(53459),j=n(62042),v=n(7523),g=n(78247),f=n(23430),w=n(61973),y=n(14944),C=n(92275),k=n(88815),b=n(45907),A=n(12721),S=n(24659),I=n(83277),$=n(96494);function K(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(v.F),n=[e("编号"),e("url"),e("model类型"),e("是否开启"),e("key"),"model",e("成为tool"),e("更多属性"),e("备注")],K=(0,$.r)(),N=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[P,M]=(0,o.useState)([]),[O,X]=(0,o.useState)([]),[V,L]=(0,o.useState)([]),[H,F]=(0,o.useState)(null),Y=(0,o.useRef)(),q=(0,o.useRef)(!1),G=(0,o.useRef)(!1),[z,B]=(0,o.useState)([]),[R,T]=(0,o.useState)(!1),[D,E]=(0,a.fp)(r.AG.prompt_card),[J,Z]=(0,a.fp)(r.AG.user_base_info),[U,W]=(0,o.useState)(!1),Q=V.filter(e=>"http"!==(e.transport??"stdio")),ee=V.filter(e=>"http"===e.transport),te=[e("编号"),e("名称"),e("是否开启"),"command","args","cwd",e("tools|env"),e("备注")],ne=[e("编号"),e("名称"),e("是否开启"),e("endpoint"),e("tools|headers"),e("备注")],se=[e("编号"),e("提示词"),e("备注")],[oe,ie]=(0,o.useState)([]),le=function(){const[e,t]=(0,a.fp)(r.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,_.jsx)("div",{children:(0,_.jsx)(h.default,{context:e})})})}}(),{check_user_auth:ae}=(0,g.MH)(),[re,ce]=(0,a.fp)(r.AG.editorSetting),de=(0,w.Zp)(),pe=(0,b.y)(),ue=(0,S.K)(),he=async()=>{const e=await m.jV.get("docs_on_get");e.code===x.m.Success&&W(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await m.XO.get("ai_agent_setting");e.code===x.m.Success&&M(e.data.models),await y.ws.addMsg(C.HK.ai_load_info,e=>{F(e.context)});const t=await y.ws.sendData(C.HK.ai_load_info,{});t?.context&&F(t.context);const n=await m.XO.get("ai_docs_setting");n.code===x.m.Success&&(Y.current=n.data.param,n.data.list?.length&&X(n.data.list));const s=await m.XO.get("ai_mcp_setting");s.code===x.m.Success&&L(s.data.list??[]),await ge(),he();const o=await m.XO.get("ai_system_prompts");o.code===x.m.Success&&ie(o.data??[])})()},[]);const _e=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};L([...V,t]),q.current=!0},me=e=>{const t=V.indexOf(e);t<0||(V.splice(t,1),L([...V]),q.current=!0)},xe=e=>{L([...V,{...e,open:!1}]),q.current=!0},je=async e=>{for(let e=0;e<P.length;e++)P[e].index=e;(await m.XO.post("ai_agent_setting/save",{models:e??P})).code===x.m.Success&&(0,j.SK)("保存成功")},ve=async e=>{for(let e=0;e<V.length;e++)V[e].index=e;(await m.XO.post("ai_mcp_setting/save",{list:e??V})).code===x.m.Success&&((0,j.SK)("保存成功"),q.current=!1,await ge())},ge=async()=>{const e=await m.XO.get("ai_mcp_tools");return e.code===x.m.Success?(B(e.data??[]),e.data??[]):[]},fe=async e=>{T(!0);try{const t=await m.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await ge(),(0,j.SK)("MCP工具加载成功"),t.data??null}finally{T(!1)}return null},we=async(t,n,s,o)=>{const i=o??z.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},l=(i.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));E({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,_.jsx)(A.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${i.transport??"stdio"} | ${i.open?e("是"):e("否")} | ${i.loaded?"loaded":"idle"} | ${i.tool_count} tools`,pages:l,initialPageId:s,onRefresh:async()=>{const e=await fe(n);e&&await we(t,n,s,e)},renderPage:t=>{if(!t)return(0,_.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=i.tools?.find(e=>e.runtime_name===t.id);return n?(0,_.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,_.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,_.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,_.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,_.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("strong",{children:"schema:"}),(0,_.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,_.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>E({open:!1})})},ye=async e=>{for(let e=0;e<P.length;e++)P[e].index=e;let t={list:O,docs_update_tag:G.current};null!=e&&(t={param:e}),G.current=!1;(await m.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,j.SK)("保存成功")},Ce=async()=>{for(let e=0;e<oe.length;e++)oe[e].index=e;(await m.XO.post("ai_system_prompts/save",{list:oe})).code===x.m.Success&&(0,j.SK)("保存成功")};return(0,_.jsxs)("div",{children:[(0,_.jsx)(l.A,{children:ae(f.oV.ai_agent_setting)&&(0,_.jsx)(i.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{de(-1)}})}),(0,_.jsx)(c.jW,{isFull:!0,more:!0,children:(0,_.jsx)(c.NN,{children:(0,_.jsxs)(c.xh,{children:[(0,_.jsx)(c.fI,{children:(0,_.jsx)(c.VP,{widthPer:100,children:(0,_.jsx)(u.uF,{self_title:(0,_.jsxs)("span",{className:" div-row ",children:[(0,_.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,_.jsx)(i.rA,{icon:"info",onClick:()=>{le('\n1. 只能使用符合openai风格的ai接口,接口不能只填域名,而是类似 https://ark.cn-beijing.volces.com/api/v3/chat/completions 这样的全路径链接聊天url\n2. 对话的历史越长,消耗的大模型token费用越贵,目前不具备长期记忆简化能力,可以在系统prompt中设置一下让AI回答的简洁一点,节省tokens\n3. model请求参数json编写,里面只能编写json,来用于编写openai风格ai支持的属性,比如 temperature thinking(豆包的深度思考开关)等\n4. 可以在model请求参数中开启 "stream":true 提高响应速度\n5. 深度思考现在会影响输出速度,建议设置`{\n "thinking" : { \n "type":"disabled"\n }\n}`关闭(豆包例子)\n6. 使用AI功能来查询服务器信息,那么AI就需要能够之一些命令,需要先在用户设置中,给用户设置命令权限,建议设置 `*` 允许全部命令,在设置禁止不能执行的危险命令。\n7. 成为tool 后,该模型将会作为一个工具被加载,可以实现不同模型作为不能角色的能力。\n8. model 类型是必须要设置的,因为不同类型的 model 接口格式不同。\n')},title:"信息"})]}),titleCom:(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...P,{note:"",open:!1,path:"",dotenv:I.CP,json_params:I.cL}])}}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:async()=>{await je()}})]}),children:(0,_.jsx)(d.X,{headers:n,rows:P.map((t,n)=>{const s=[(0,_.jsx)("div",{children:n}),(0,_.jsx)(p.Sm,{value:I.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,_.jsx)(p.l6,{value:t.request_type??"completions",onChange:e=>{t.request_type=e,M([...P])},options:K,no_border:!0}),(0,_.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<P.length;e++)P[e].open=e===n&&t,s.push(P[e]);M(s)})(0,e,n)},options:ue,no_border:!0}),(0,_.jsx)(p.Sm,{type:I.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:I.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,_.jsx)(p.Sm,{value:I.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,_.jsx)(p.l6,{value:t.tool_mode,onChange:n=>{t.open&&!0===n?(0,j.zN)(e("开启状态不能成为tool")):(t.tool_mode=n,M([...P]))},options:ue,no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"short_text",title:"prompt",onClick:()=>{g.xK.set_value_temp(P[n].sys_prompt??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{P[n].sys_prompt=e,M(P),g.xK.set_value_temp(""),je(P)}})}}),(0,_.jsx)(i.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{g.xK.set_value_temp(P[n].json_params),ce({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{P[n].json_params=e,M(P),g.xK.set_value_temp(""),je(P)},can_format:!0})}}),(0,_.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(P[n].dotenv),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{P[n].dotenv=e,M(P),g.xK.set_value_temp(""),je(P)}})}})]}),(0,_.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{P.splice(e,1),M([...P])})(n)}),(0,_.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{M([...P,{...P[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,_.jsx)(c.fI,{children:(0,_.jsx)(c.VP,{widthPer:70,children:(0,_.jsx)(u.uF,{self_title:(0,_.jsxs)("span",{className:" div-row ",children:[(0,_.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,_.jsx)(i.rA,{icon:"info",onClick:()=>{le("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),titleCom:(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>_e("stdio")}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ve()}})]}),children:(0,_.jsx)(d.X,{headers:te,rows:Q.map((t,n)=>{const s=V.indexOf(t);return[(0,_.jsx)("div",{children:n}),(0,_.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,q.current=!0},no_border:!0}),(0,_.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,L([...V]),q.current=!0},options:ue,no_border:!0}),(0,_.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,q.current=!0},no_border:!0}),(0,_.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,q.current=!0},no_border:!0}),(0,_.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,q.current=!0},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,_.jsx)(i.rA,{icon:"settings",title:"env",onClick:()=>{g.xK.set_value_temp(t.env??""),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,L([...V]),g.xK.set_value_temp(""),q.current=!0,ve()}})}})]}),(0,_.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,q.current=!0},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>me(t)}),(0,_.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>xe(t)})]})]}),width:"10rem"})})})}),(0,_.jsx)(c.fI,{children:(0,_.jsxs)(c.VP,{widthPer:70,children:[(0,_.jsx)(u.uF,{self_title:(0,_.jsxs)("span",{className:" div-row ",children:[(0,_.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>_e("http")}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ve()}})]}),children:(0,_.jsx)(d.X,{headers:ne,rows:ee.map((t,n)=>{const s=V.indexOf(t);return[(0,_.jsx)("div",{children:n}),(0,_.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,q.current=!0},no_border:!0}),(0,_.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,L([...V]),q.current=!0},options:ue,no_border:!0}),(0,_.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,q.current=!0},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,_.jsx)(i.rA,{icon:"settings",title:"headers",onClick:()=>{g.xK.set_value_temp(t.headers??""),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,L([...V]),g.xK.set_value_temp(""),q.current=!0,ve()}})}})]}),(0,_.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,q.current=!0},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>me(t)}),(0,_.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>xe(t)})]})]}),width:"10rem"})}),(0,_.jsx)(u.uF,{self_title:(0,_.jsxs)("span",{className:" div-row ",children:[(0,_.jsx)("h2",{children:e("系统会话提示词")})," ",(0,_.jsx)(i.rA,{icon:"info",onClick:()=>{le('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n')},title:"信息"})]}),titleCom:(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{ie([...oe,{prompt:"",note:""}])}}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{Ce()}})]}),children:(0,_.jsx)(d.X,{headers:se,rows:oe.map((t,n)=>{const s=[(0,_.jsx)("div",{children:n}),(0,_.jsx)("div",{children:(0,_.jsx)(i.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{g.xK.set_value_temp(t.prompt??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,ie([...oe]),g.xK.set_value_temp(""),Ce()}})}})}),(0,_.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,_.jsx)("div",{children:(0,_.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{oe.splice(e,1),ie([...oe])})(n)})})];return s}),width:"10rem"})})]})}),(0,_.jsxs)(c.fI,{children:[(0,_.jsx)(c.VP,{widthPer:50,children:(0,_.jsx)(u.uF,{self_title:(0,_.jsxs)("span",{className:" div-row ",children:[(0,_.jsx)("h2",{children:e("本地知识库")})," ",(0,_.jsx)(i.rA,{icon:"info",onClick:()=>{le("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,_.jsxs)("div",{children:[(0,_.jsx)(i.Ay,{checked:U,onChange:async e=>{await m.jV.post("docs_on_set",{status:e}),he(),t()},title:e("知识库开关")}),(0,_.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(Y.current),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{Y.current=e,g.xK.set_value_temp(""),ye(Y.current)}})}}),(0,_.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...O,{note:"",auto_load:!1,dir:""}]),G.current=!0}}),(0,_.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ye()}})]}),children:(0,_.jsx)(d.X,{headers:N,rows:O.map((t,n)=>{const s=[(0,_.jsx)("div",{children:n}),(0,_.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,G.current=!0},no_border:!0}),(0,_.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,X([...O]),G.current=!0},options:ue,no_border:!0}),(0,_.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,_.jsxs)("div",{children:[(0,_.jsx)(i.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{O.splice(e,1),X([...O]),G.current=!0})(n)}),(0,_.jsx)(i.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{pe({sub_title:"手动加载",confirm_fun:()=>{m.jV.post("ai_load_one_file",{param_path:t.dir}),(0,j.SK)("ok")}})}}),(0,_.jsx)(i.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{pe({sub_title:"从索引删除",confirm_fun:()=>{m.jV.post("ai_del",{param_path:t.dir}),(0,j.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),H&&(0,_.jsx)(c.VP,{widthPer:50,children:(0,_.jsxs)(u.Zp,{title:e("知识库加载信息"),children:[(0,_.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:H?.progress}),(0,_.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:H?.num}),(0,_.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:H?.char_num}),(0,_.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,k.v7)(H?.size)}),(0,_.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,k.a3)(H?.consume_time_ms_len)}),(0,_.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:H?.total_num})]})})]})]})})})]})}},96494(e,t,n){n.d(t,{r:()=>o});var s=n(22022);function o(){const{t:e}=(0,s.Bd)();return[{value:"completions",label:e("文本对话")},{value:"images",label:e("图片生成")}]}},34299(e,t,n){n.r(t),n.d(t,{default:()=>m});n(96540);var s=n(73557),o=n(53995),i=n(18569),l=n(77979),a=n(8263),r=n(69428),c=n.n(r),d=(n(3775),n(21499)),p=n(99214),u=n(19878),h=(n(72411),n(74848));const _=new s.A({html:!0,highlight:function(e,t){if(t&&u.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${u.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${u.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${_.utils.escapeHtml(e)}</code></pre>`}});function m(e){return(0,p.VD)(),(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:_.render(e.context)}})}_.use(o.A).use(i.A).use(l.A).use(a.A).use(c()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,i)=>{const l=t[n],a=l.content.trim(),r=l.info.trim();let c="";if(r&&u.A.getLanguage(r))try{c=u.A.highlight(a,{language:r}).value}catch(t){c=e.utils.escapeHtml(a)}else try{c=u.A.highlightAuto(a).value}catch(t){c=e.utils.escapeHtml(a)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${r||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(a)}">复制</button>\n </div>\n <pre><code class="hljs ${r?`language-${r}`:""}">${c}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,s,o){return o.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,s,o,i)=>{const l=e[n],a=l.attrIndex("href");if(a>=0){const e=l.attrs[a][1];l.attrs[a][1]=(0,d.bi)(window.location.href,e)}return t(e,n,s,o,i)}})},45907(e,t,n){n.d(t,{y:()=>i});var s=n(34843),o=n(82893);function i(){const[e,t]=(0,s.fp)(o.AG.confirm);return({sub_title:e,confirm_fun:n,title:s,context_div:o})=>{t({open:!0,sub_title:e,handle:()=>{n(),t({open:!1,handle:null})},title:s,context_div:o})}}},24659(e,t,n){var s=n(22022);n.d(t,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010,8635],{83277(e,s,t){t.d(s,{$j:()=>o,Lv:()=>a,qq:()=>i});class n{options_agent_url_list;options_agent_key_list;options_agent_model_list}class a{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,s){if(!e||!s?.length)return e;for(const t of s)if(t.value===e)return t.label;return e}static have_label_by_v(e,s){if(!e||!s?.length)return!1;for(const t of s)if(t.value===e)return!0;return!1}}class i extends n{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url}const l=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function o(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}t.d(s,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\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',"cL",0,l])},14016(e,s,t){t.r(s),t.d(s,{default:()=>X});var n=t(96540),a=t(34843),i=t(22022),l=t(61973),o=t(14284),c=t(7463),r=t(78247),d=t(40505),u=t(62042),m=t(45907),h=t(53459),g=t(72693),p=t(96494),x=t(82893),_=t(61443),f=t(83277);function j(e){const s=(0,f.$j)(e.content);if(s)return s;const t=e.content_list??[];return t.length?t.map(e=>(0,f.$j)(e.content)).filter(Boolean).join("\n\n"):""}const v=/\.(md|txt|json|js|jsx|ts|tsx|css|html?|xml|ya?ml|py|java|go|rs|c|cpp|h|hpp|sh|bat|cmd|ini|toml|csv|log|sql|env|gitignore|dockerfile)$/i;function y(e){return e.type?.startsWith("image/")?"image":e.type?.startsWith("text/")||v.test(e.name)?"text":"binary"}function b(e){return e.text()}function S(e){return new Promise((s,t)=>{const n=new FileReader;n.onload=()=>s(n.result),n.onerror=t,n.readAsDataURL(e)})}async function w(e){const s=[];for(const t of e){const e=y(t);let n="";if("text"===e)try{const e=await b(t),s=12e4;n=e.length>s?`${e.slice(0,s)}\n\n[内容已截断,原始长度 ${e.length} 字符]`:e}catch{n="[文本读取失败]"}else if("image"===e)try{n=await S(t)}catch{n=`[图片文件: ${t.name}]`}else n=`[二进制文件: ${t.name}]`;s.push({name:t.name,mime_type:t.type,size:t.size,kind:e,content:n})}return s}var N=t(14944),k=t(92275);var A=t(85997),C=t(34299),I=t(74848);function $(e){const s=e.attachments&&e.attachments.length>0?(0,I.jsx)("div",{className:"chat-message-attachments",children:e.attachments.map((e,s)=>(0,I.jsxs)("div",{className:"chat-message-attachment",children:[(0,I.jsx)(A.In,{icon:"attach_file"}),(0,I.jsx)("span",{children:e.name}),(0,I.jsxs)("small",{children:[e.size," B"]})]},`${e.name}_${s}`))}):null,t=[];e.images&&"bot"===e.sender&&t.push((0,I.jsx)(n.Fragment,{children:(0,I.jsx)(D,{images:e.images,text:e.text})},"images")),e.audio&&"bot"===e.sender&&t.push((0,I.jsx)(n.Fragment,{children:(0,I.jsx)(O,{audio:e.audio,text:e.text})},"audio")),e.embeddings&&"bot"===e.sender&&t.push((0,I.jsx)(n.Fragment,{children:(0,I.jsx)(F,{embeddings:e.embeddings,text:e.text})},"embeddings"));const a=function(e){if("bot"!==e.sender||!e.content_list?.length)return e.text?(0,I.jsx)(C.default,{context:e.text}):null;return(0,I.jsxs)(I.Fragment,{children:[e.content_list.map((e,s)=>{const t=[],a=(0,f.$j)(e.content);return a&&t.push((0,I.jsx)(n.Fragment,{children:(0,I.jsx)(C.default,{context:a})},`content-${s}`)),e.tool_call_ends?.length&&t.push((0,I.jsx)(n.Fragment,{children:(0,I.jsx)(M,{callList:e.tool_call_ends})},`tool-${s}`)),(0,I.jsx)(n.Fragment,{children:t},`part-${s}`)}),!e.content_list.some(e=>e.content)&&e.text?(0,I.jsx)(C.default,{context:e.text}):null]})}(e);return 0===t.length?(0,I.jsxs)(I.Fragment,{children:[s,a]}):(0,I.jsxs)(I.Fragment,{children:[t,s,a]})}function M({callList:e}){const[s,t]=n.useState(!1);if(!e?.length)return null;e.filter(e=>e.success).length;const a=e.filter(e=>!e.success).length;return(0,I.jsxs)("div",{className:"chat-message-call-list",children:[(0,I.jsxs)("div",{className:"call-list-header",onClick:()=>t(!s),children:[(0,I.jsx)(A.In,{icon:s?"expand_less":"expand_more"}),(0,I.jsxs)("span",{className:"call-list-summary",children:["工具调用 (",e.length,")",a>0&&(0,I.jsx)("span",{className:"call-list-fail",children:" 失败 "})]})]}),s&&(0,I.jsx)("div",{className:"call-list-body",children:e.map((e,s)=>(0,I.jsxs)("div",{className:"call-list-item "+(e.success?"call-success":"call-fail"),children:[(0,I.jsxs)("div",{className:"call-list-item-header",children:[(0,I.jsx)(A.In,{icon:e.success?"check_circle":"error"}),(0,I.jsx)("span",{className:"call-list-tool-name",children:e.tool_display_name||e.tool_name}),(0,I.jsxs)("span",{className:"call-list-duration",children:[e.duration_ms,"ms"]})]}),e.tool_args&&(0,I.jsxs)("details",{className:"call-list-details",children:[(0,I.jsx)("summary",{children:"参数"}),(0,I.jsx)("pre",{className:"call-list-pre",children:JSON.stringify(e.tool_args,null,2)})]}),!e.success&&e.error&&(0,I.jsxs)("details",{className:"call-list-details",children:[(0,I.jsx)("summary",{children:"错误"}),(0,I.jsx)("pre",{className:"call-list-pre call-list-error-text",children:e.error})]}),e.success&&e.tool_result&&(0,I.jsxs)("details",{className:"call-list-details",children:[(0,I.jsx)("summary",{children:"结果"}),(0,I.jsx)("pre",{className:"call-list-pre",children:e.tool_result.length>500?e.tool_result.slice(0,500)+"...":e.tool_result})]})]},s))})]})}function D({images:e,text:s}){let t=e||[];if(!t.length&&s)try{t=JSON.parse(s).data||[]}catch{}return t.length?(0,I.jsxs)("div",{className:"image-generation-result",children:[t.map((e,s)=>(0,I.jsxs)("div",{className:"image-generation-item",children:[e.url&&(0,I.jsx)("div",{className:"image-generation-image-wrapper",children:(0,I.jsx)("img",{src:e.url,alt:e.revised_prompt||`生成的图片 ${s+1}`,loading:"lazy"})}),e.b64_json&&(0,I.jsx)("div",{className:"image-generation-image-wrapper",children:(0,I.jsx)("img",{src:`data:image/png;base64,${e.b64_json}`,alt:`生成的图片 ${s+1}`})}),e.revised_prompt&&(0,I.jsx)("p",{className:"image-generation-prompt",children:(0,I.jsx)("small",{children:e.revised_prompt})})]},s)),s&&!e&&(0,I.jsx)(C.default,{context:s})]}):(0,I.jsx)(C.default,{context:s||""})}function O({audio:e,text:s}){if(e){if(e.url)return(0,I.jsx)("div",{className:"audio-result",children:(0,I.jsx)("audio",{controls:!0,src:e.url,children:"您的浏览器不支持音频播放"})});if(e.data){const s=e.mime_type||"audio/mpeg";return(0,I.jsx)("div",{className:"audio-result",children:(0,I.jsx)("audio",{controls:!0,src:`data:${s};base64,${e.data}`,children:"您的浏览器不支持音频播放"})})}}const t=s||"";if(t.startsWith("http://")||t.startsWith("https://"))return(0,I.jsx)("div",{className:"audio-result",children:(0,I.jsx)("audio",{controls:!0,src:t,children:"您的浏览器不支持音频播放"})});try{const e=JSON.parse(t);if(e?.data||e?.audio_data){const s=e.data||e.audio_data;return(0,I.jsx)("div",{className:"audio-result",children:(0,I.jsx)("audio",{controls:!0,src:`data:audio/mpeg;base64,${s}`,children:"您的浏览器不支持音频播放"})})}}catch{}return(0,I.jsx)(C.default,{context:t})}function R({content:e,label:s}){const[t,a]=n.useState(!1);return(0,I.jsxs)("button",{className:"embeddings-copy-btn",onClick:()=>{(0,d.lW)(e),a(!0),setTimeout(()=>a(!1),1500)},children:[(0,I.jsx)(A.In,{icon:t?"check":"content_copy"}),t?"已复制":s||"复制"]})}function F({embeddings:e,text:s}){let t=e||null;if(!t&&s)try{t=JSON.parse(s)}catch{return(0,I.jsx)(C.default,{context:s})}if(!t)return(0,I.jsx)(C.default,{context:s||""});const n=t?.data||[],a=t?.usage,i=JSON.stringify(t,null,2);return(0,I.jsxs)("div",{className:"embeddings-result",children:[(0,I.jsxs)("div",{className:"embeddings-summary",children:[(0,I.jsx)("strong",{children:"向量嵌入结果"}),(0,I.jsxs)("span",{children:["维度: ",n[0]?.embedding?.length??"N/A"]}),(0,I.jsxs)("span",{children:["数量: ",n.length]}),a&&(0,I.jsxs)("span",{children:["使用 tokens: ",a.total_tokens??"N/A"]})]}),(0,I.jsxs)("div",{className:"embeddings-toolbar",children:[(0,I.jsx)(R,{content:i,label:"复制全部结果"}),n.length>0&&n[0]?.embedding&&(0,I.jsx)(R,{content:JSON.stringify(n[0].embedding,null,2),label:"复制第一条向量"}),n.length>0&&(0,I.jsx)(R,{content:JSON.stringify(n.map(e=>e.embedding),null,2),label:"复制所有向量数据"})]}),n.length>0&&n[0]?.embedding&&(0,I.jsx)("div",{className:"embeddings-preview",children:(0,I.jsxs)("span",{children:["向量预览: [",n[0].embedding.slice(0,5).join(", "),n[0].embedding.length>5?", ...":"","]"]})}),n.length>0&&(0,I.jsxs)("details",{children:[(0,I.jsx)("summary",{children:"查看详细数据"}),(0,I.jsx)("pre",{className:"embeddings-raw",children:i})]})]})}async function H(e,s){const t=function(){try{const e=localStorage.getItem("ai_images_extra_params");if(e)return JSON.parse(e)}catch{}return{}}(),n={prompt:e,n:t.n??1,size:t.size??"1024x1024",session_id:s};if(t.quality&&(n.quality=t.quality),t.style&&(n.style=t.style),t.extra_json)try{const e=JSON.parse(t.extra_json);Object.assign(n,e)}catch(e){console.warn("图片额外参数 JSON 解析失败:",e)}const a=await o.jV.post("images/generations",n);if(0!==a.code)throw new Error(a.message||"图片生成失败");const i=a.data||{},l=(i.data||[]).map(e=>({url:e.url,b64_json:e.b64_json,revised_prompt:e.revised_prompt})),c=l.map((e,s)=>`${e.revised_prompt?`\n> ${e.revised_prompt}`:""}`).join("\n\n");return{session_id:i.session_id||s,images:l,text:c||`生成了 ${l.length} 张图片`}}async function L(e,s,t,n){try{switch(e){case"images":{const e=await H(s,t);return e&&n(e.text,{images:e.images}),!0}case"audio_speech":{const e=await async function(e,s){const t={input:e,session_id:s};try{const e=localStorage.getItem("ai_audio_extra_params");if(e){const s=JSON.parse(e);s.voice&&(t.voice=s.voice),s.speed&&(t.speed=parseFloat(s.speed))}}catch{}const n=localStorage.getItem("token")||"",a=await fetch("/api/ai_agent/audio/speech",{method:"POST",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify(t)});if(!a.ok)throw new Error(`语音合成失败: ${a.statusText}`);const i=a.headers.get("X-Session-Id")||s,l=await a.arrayBuffer();return{session_id:i,audio:{data:btoa(String.fromCharCode(...Array.from(new Uint8Array(l)))),mime_type:a.headers.get("content-type")||"audio/mpeg"},text:`[音频文件: ${e.slice(0,50)}...]`}}(s,t);return e&&n(e.text,{audio:e.audio}),!0}case"embeddings":{const e=await async function(e,s){const t=await o.jV.post("embeddings",{input:e,session_id:s});if(0!==t.code)throw new Error(t.message||"Embeddings 请求失败");const n=t.data||{},a=n?.data??[],i=`向量维度: ${a[0]?.embedding?.length??0}, 数量: ${a.length}`;return{session_id:n.session_id||s,embeddings:n,text:`✅ Embeddings 结果 - ${i}\n\`\`\`json\n${JSON.stringify(n,null,2).slice(0,2e3)}\n\`\`\``}}(s,t);return e&&n(e.text,{embeddings:e.embeddings}),!0}default:return!1}}catch(e){return n(`请求失败: ${e?.message||JSON.stringify(e)}`),!0}}var q=t(57952),B=t(23430),V=t(87361),T=t(27690);function z(){try{const e=localStorage.getItem("ai_images_extra_params");if(e)return JSON.parse(e)}catch{}return{size:"1024x1024",n:1}}function J({onClose:e}){const{t:s}=(0,i.Bd)(),[t,a]=(0,n.useState)(z),[l,o]=(0,n.useState)(t.size||"1024x1024"),[c,r]=(0,n.useState)(String(t.n??1)),[d,u]=(0,n.useState)(t.quality||""),[m,h]=(0,n.useState)(t.style||""),[g,p]=(0,n.useState)(t.extra_json||"");return(0,I.jsxs)("div",{className:"card images-params-card",children:[(0,I.jsx)("h3",{children:s("图片生成参数设置")}),(0,I.jsx)("p",{className:"images-params-hint",children:"不同模型支持的参数不同,请参考模型文档。常见 size 值: 1024x1024, 1792x1024, 1024x1792 (DALL-E 3)"}),(0,I.jsxs)("div",{className:"images-params-fields",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:"size (图片尺寸)"}),(0,I.jsx)(_.Sm,{value:l,handleInputChange:o,no_border:!1})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:"n (生成数量)"}),(0,I.jsx)(_.Sm,{value:c,handleInputChange:r,no_border:!1})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:'quality (画质, 如 "standard" / "hd")'}),(0,I.jsx)(_.Sm,{value:d,handleInputChange:u,no_border:!1})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:'style (风格, 如 "vivid" / "natural")'}),(0,I.jsx)(_.Sm,{value:m,handleInputChange:h,no_border:!1})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:"额外参数 (JSON,会合并到请求体中)"}),(0,I.jsx)(_.Sm,{value:g,handleInputChange:p,no_border:!1})]})]}),(0,I.jsxs)("div",{className:"images-params-actions",children:[(0,I.jsx)(A.rA,{icon:"close",title:s("取消"),onClick:e}),(0,I.jsx)(A.rA,{icon:"save",title:s("保存"),onClick:()=>{const s={size:l,n:parseInt(c)||1};d&&(s.quality=d),m&&(s.style=m),g&&(s.extra_json=g),function(e){localStorage.setItem("ai_images_extra_params",JSON.stringify(e))}(s),e()}})]})]})}function E(){const{t:e}=(0,i.Bd)(),[s,t]=(0,a.fp)(x.AG.ai_request_type),[l,o]=(0,n.useState)(!1),c=(0,p.r)(),r=c.find(e=>e.value===s)??c[0];return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(T.MenuSelect,{list:[...c.map(e=>({name:e.label,click:()=>t(e.value)})),..."images"===s?[{name:e("图片参数设置"),click:()=>o(!0)}]:[],..."audio_speech"===s?[{name:e("语音参数设置"),click:()=>{const s=localStorage.getItem("ai_audio_extra_params"),t=s?JSON.parse(s):{},n=t.voice||"alloy",a=t.speed||"1.0",i=prompt(e("输入 voice (如 alloy, echo, fable, onyx, nova, shimmer)"),n);if(null!==i){const s=prompt(e("输入 speed (0.25 ~ 4.0)"),a);null!==s&&localStorage.setItem("ai_audio_extra_params",JSON.stringify({voice:i,speed:parseFloat(s)||1}))}}}]:[]],children:(0,I.jsxs)("div",{className:"menu-select-trigger",children:[(0,I.jsx)("span",{children:r.label}),(0,I.jsx)("span",{className:"menu-select-arrow",children:"▾"})]})}),l&&(0,I.jsx)("div",{className:"modal-overlay",onClick:()=>o(!1),children:(0,I.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,I.jsx)(J,{onClose:()=>o(!1)})})})]})}const K=({currentModelName:e,setCurrentModelName:s,envConfigRef:t,sysPromptList:n,batchMode:c,selectedMsgCount:d,selectedSessionCount:m,onToggleSessionPanel:g,onCreateSession:p,onToggleBatchMode:f,onBatchDeleteMessages:j,onBatchDeleteSessions:v,onClearAllSessions:y})=>{const{t:b}=(0,i.Bd)(),S=(0,l.Zp)(),{check_user_auth:w}=(0,r.MH)(),[,N]=(0,a.fp)(x.AG.ai_session_collapsed);return(0,I.jsxs)(q.A,{children:[(0,I.jsx)(A.rA,{icon:"menu",title:b("会话"),onClick:g}),(0,I.jsx)(A.rA,{icon:"add",title:b("新会话"),onClick:()=>p()}),n.length>0&&(0,I.jsx)(T.MenuSelect,{list:n.map((e,s)=>({name:e.note||`${b("提示词")} ${s+1}`,click:()=>{e.prompt&&p(e.prompt)}})),children:(0,I.jsx)(A.rA,{icon:"add_comment",title:b("提示词模板创建会话")})}),(0,I.jsx)(E,{}),(t.current?.options_agent_model_list?.length??0)>0&&(0,I.jsx)(_.l6,{value:e,options:t.current.options_agent_model_list?.map(e=>({title:e.label,value:e.value}))??[],onChange:e=>{s(e),o.jV.post("set_active_model",{model_name:e}).then(()=>{(0,u.SK)("success"),o.XO.get("ai_agent_setting/env").then(e=>{e.code===h.m.Success&&(t.current=e.data)})}).catch(console.error)},no_border:!0,width:"auto"}),(0,I.jsx)(A.rA,{icon:c?"check_circle":"checklist",title:b(c?"取消批量选择":"批量选择"),onClick:f}),c&&d>0&&(0,I.jsx)(A.rA,{icon:"delete",title:b("删除选中消息"),onClick:j}),c&&m>0&&(0,I.jsx)(A.rA,{icon:"delete",title:b("删除选中会话"),onClick:v}),(0,I.jsx)(A.rA,{icon:"delete_sweep",title:b("清空全部会话"),onClick:y}),w(B.oV.ai_agent_setting)&&(0,I.jsx)(A.rA,{icon:"smart_toy",title:"机器人配置",onClick:()=>{S(`/${V.o.ai_rebot_setting_page}`)}}),w(B.oV.ai_agent_setting)&&(0,I.jsx)(A.rA,{icon:"settings",title:"ai setting",onClick:()=>{S(`/${V.o.ai_agent_setting_page}`)}})]})};function P({sessions:e,activeSessionId:s,onSelectSession:t,onRenameSession:l,onDeleteSession:o,onShowUsageStats:c,batchMode:r,selectedSessionIds:d,onToggleSessionSelect:u}){const{t:m}=(0,i.Bd)(),[h,g]=(0,a.fp)(x.AG.ai_session_collapsed),[p,_]=(0,n.useState)(""),f=p.trim()?e.filter(e=>(e.title||"").toLowerCase().includes(p.toLowerCase())||(e.summary||"").toLowerCase().includes(p.toLowerCase())||(e.long_term_memory||"").toLowerCase().includes(p.toLowerCase())):e;return(0,I.jsxs)("aside",{className:`chat-session-list ${h?"active":""} ${h?"collapsed":""}`,children:[!h&&(0,I.jsx)("div",{className:"chat-session-search",children:(0,I.jsx)("input",{type:"text",className:"chat-session-search-input",placeholder:m("搜索会话"),value:p,onChange:e=>_(e.target.value)})}),f.map(e=>{return(0,I.jsx)("div",{children:(0,I.jsxs)("button",{className:`chat-session-item ${s===e.id?"active":""} ${r?"batch-mode":""}`,onClick:()=>{r&&u?u(e.id):t(e.id)},title:e.summary||e.long_term_memory||e.title,children:[r&&(0,I.jsx)("input",{type:"checkbox",className:"chat-session-checkbox",checked:d?.has(e.id)??!1,onChange:()=>u?.(e.id),onClick:e=>e.stopPropagation()}),(0,I.jsx)("span",{children:(n=e.title,n||"新会话")}),(0,I.jsx)("small",{children:e.message_count}),"web"!==e.source&&(0,I.jsx)("em",{className:"chat-session-source",children:e.source}),!r&&(0,I.jsx)(T.MenuSelect,{list:[{name:m("重命名"),click:()=>l(e.id,e.title)},{name:m("字符消耗统计"),click:()=>c(e.id)},{name:m("删除"),click:()=>o(e.id)}],children:(0,I.jsx)(A.In,{icon:"more_horiz"})})]})},e.id);var n})]})}const G=({messages:e,batchMode:s,selectedMsgIds:t,sending:n,chatContainerRef:a,messagesEndRef:i,onToggleMsgSelect:l,onDelete:o,onCopy:c,t:r})=>(0,I.jsxs)("div",{className:"chat-messages",ref:a,"data-sending":n?"true":"false",children:[e.map(e=>(0,I.jsxs)("div",{className:`chat-message ${e.sender} ${s?"batch-mode":""} ${e.is_loading?"is-loading":""}`,children:[s&&(0,I.jsx)("input",{type:"checkbox",className:"chat-message-checkbox",checked:t.has(e.id),onChange:()=>l(e.id)}),e.is_loading?(0,I.jsxs)("div",{className:"ai-loading-bubble",children:[(0,I.jsxs)("div",{className:"ai-loading-dots",children:[(0,I.jsx)("span",{className:"ai-loading-dot"}),(0,I.jsx)("span",{className:"ai-loading-dot"}),(0,I.jsx)("span",{className:"ai-loading-dot"})]}),(0,I.jsx)("span",{className:"ai-loading-text",children:e.text})]}):(0,I.jsxs)(I.Fragment,{children:[$(e),!s&&(0,I.jsxs)("div",{className:"message-actions",children:[(0,I.jsx)("button",{onClick:()=>o(e.id),children:r("删除")}),(0,I.jsx)("button",{onClick:()=>c(e.text),children:r("复制")})]})]})]},e.id)),(0,I.jsx)("div",{ref:i})]});function W({pendingAttachments:e,onRemove:s}){return 0===e.length?null:(0,I.jsx)("div",{className:"chat-attachment-strip",children:e.map((e,t)=>(0,I.jsxs)("div",{className:"chat-attachment-chip",children:[(0,I.jsx)(A.In,{icon:"attach_file"}),(0,I.jsx)("span",{title:e.name,children:e.name}),(0,I.jsx)("button",{type:"button",onClick:()=>s(t),children:(0,I.jsx)(A.In,{icon:"close"})})]},`${e.name}_${t}`))})}function Q({inputValue:e,onInputChange:s,onKeyDown:t,onPaste:n,onSend:a,sending:l,pendingAttachments:o,onRemoveAttachment:c,onOpenFilePicker:r,onAddFiles:d,onDrop:u,onDragOver:m,fileInputRef:h}){const{t:g}=(0,i.Bd)();return(0,I.jsxs)("div",{className:"chat-input-area",onDrop:u,onDragOver:m,children:[(0,I.jsx)("input",{ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:e=>{e.target.files?.length&&(d(e.target.files),e.currentTarget.value="")}}),(0,I.jsxs)("div",{className:"chat-input-shell",children:[(0,I.jsx)(W,{pendingAttachments:o,onRemove:c}),(0,I.jsx)("textarea",{value:e,onChange:s,onPaste:n,onKeyDown:t,placeholder:g("输入消息"),className:"chat-input"})]}),(0,I.jsx)(A.rA,{title:g("添加文件"),icon:"attach_file",onClick:r}),(0,I.jsx)(A.Vi,{text:g(l?"排队发送":"发送"),clickFun:a}),l&&(0,I.jsx)("div",{className:"ai-thinking-mini",title:"AI 正在回复中...",children:(0,I.jsxs)("div",{className:"ai-thinking-dots",children:[(0,I.jsx)("div",{className:"ai-thinking-dot"}),(0,I.jsx)("div",{className:"ai-thinking-dot"}),(0,I.jsx)("div",{className:"ai-thinking-dot"})]})})]})}const U=e=>null==e||e<0?"0":e.toLocaleString();function X(){const{t:e}=(0,i.Bd)(),s=((0,l.Zp)(),(0,m.y)()),{check_user_auth:t}=(0,r.MH)();(0,g.w)();const[v,y]=(0,n.useState)([]),[b,S]=(0,n.useState)([]),[A,C]=(0,n.useState)(""),[$,M]=(0,n.useState)(!1),[D,O]=(0,n.useState)(""),[R,F]=(0,n.useState)([]),[H,q]=(0,a.fp)(x.AG.ai_session_collapsed),[B,V]=(0,a.fp)(x.AG.ai_request_type),[T,z]=(0,a.fp)(x.AG.prompt_card),[J,E]=(0,n.useState)(!1),[W,X]=(0,n.useState)(new Set),[Z,Y]=(0,n.useState)(new Set),ee=(0,n.useRef)(null),se=(0,n.useRef)(null),te=(0,n.useRef)(null),ne=(0,n.useRef)(!0),ae=(0,n.useRef)(new f.qq),[ie,le]=(0,n.useState)([]),[oe,ce]=(0,n.useState)(""),re=(0,p.r)(),de=(0,n.useRef)((0,c.sg)(e=>{y(e),ne.current&&ue(!1)},50)).current,ue=(e=!1)=>{const s=te.current;s&&s.scrollTo({top:s.scrollHeight,behavior:e?"smooth":"auto"})},me=async()=>{const e=await o.jV.get("sessions");e.code===h.m.Success&&S(e.data??[])},he=function(e){const{getMessages:s,setMessages:t,setMessagesDebounced:a,setSending:i,getActiveSessionId:l,setActiveSessionId:o,refreshSessions:c,scrollToBottom:r,buildRequestMessages:d}=e,u=(0,n.useRef)([]),m=(e,n,l)=>{const o=[...s(),n];t(o),i(!0);const u={id:n.id+1,sender:"bot",text:"AI思考中...",is_loading:!0};o.push(u),t([...o]);const m=new Map;let h=!0,g=u;const p=e=>{const s=e.context||{},t=s.text||"",n=s.chunk_index??0;if("[DONE]"!==t)if(h)h=!1,g.text=t,g.is_loading=!1,g.chunk_index=n,m.set(n,g),a([...o]);else{const e=m.get(n);if(e)e.text+=t,a([...o]);else{const e={id:Date.now()+Math.random(),sender:"bot",text:t,chunk_index:n};o.push(e),m.set(n,e),a([...o])}}},x=e=>{f(),i(!1);const s=e.context||{};if(g.is_loading&&(g.is_loading=!1,g.text&&"AI思考中..."!==g.text||(g.text="(AI 未返回内容)")),s.once_messages_list?.length){const e=[...o].reverse().find(e=>"bot"===e.sender);e&&(e.content_list=s.once_messages_list)}t([...o]),c(),r(!0),l()},_=e=>{f(),i(!1);const s=e.context||{};g.text="AI请求出错: "+(s.message||"未知错误"),g.is_loading=!1,t([...o]),l()},f=()=>{N.ws.off_message(`message_${k.HK.ai_chat_msg}`,p),N.ws.off_message(`message_${k.HK.ai_chat_end}`,x),N.ws.off_message(`message_${k.HK.ai_chat_error}`,_)};N.ws.addMsg(k.HK.ai_chat_msg,p),N.ws.addMsg(k.HK.ai_chat_end,x),N.ws.addMsg(k.HK.ai_chat_error,_),N.ws.sendData(k.HK.ai_chat_req,{messages:d(n),session_id:e})},h=()=>{const e=u.current;if(0===e.length)return;const s=e.shift();if(!s)return;t(e=>e.map(e=>"user"===e.sender&&e.text.includes("⏳(排队中...)")?{...e,text:e.text.replace(" ⏳(排队中...)","")}:e));const n={id:Date.now(),sender:"user",text:s.text,attachments:s.attachments};m(l(),n,h)};return{startChatStream:m,processPendingQueue:h,enqueueMessage:(e,s)=>{u.current.push({text:e,attachments:s})},getQueueLength:()=>u.current.length}}({getMessages:()=>v,setMessages:y,setMessagesDebounced:de,setSending:M,getActiveSessionId:()=>A,setActiveSessionId:C,refreshSessions:me,scrollToBottom:ue,buildRequestMessages:e=>{const s=(e.attachments??[]).filter(e=>"image"===e.kind);if(s.length>0){const t=[];e.text&&t.push({type:"text",text:e.text});for(const e of s)t.push({type:"image_url",image_url:{url:e.content}});return[{content:t,role:"user",attachments:e.attachments??[]}]}return[{content:e.text,role:"bot"===e.sender?"assistant":"user",attachments:e.attachments??[]}]}}),ge=async e=>{const s=await o.jV.get("sessions");if(s.code!==h.m.Success)return;const t=s.data??[];S(t);const n=null===e?t[0]?.id??"":e||A||t[0]?.id||"";n?await pe(n):(y([]),C(""))},pe=async(e,s=!1)=>{const t=await o.jV.post("session/get",{session_id:e});if(t.code!==h.m.Success||!t.data)return;const n=t.data;C(n.id),y(function(e=[]){return e.filter(e=>"user"===e.role||"assistant"===e.role).map((e,s)=>({id:Date.now()+s,sender:"assistant"===e.role?"bot":"user",text:j(e),attachments:e.attachments??[],content_list:e.content_list,images:e.images,audio:e.audio,embeddings:e.embeddings}))}(n.messages)),s&&q(!1),requestAnimationFrame(()=>ue(!1))},xe=async()=>{const e=D.trim();if(!e&&0===R.length)return;if($){const s=await w(R);he.enqueueMessage(e,s),O(""),F([]);const t={id:Date.now(),sender:"user",text:e+(he.getQueueLength()>1?" ⏳(排队中...)":""),attachments:s};return void y(e=>[...e,t])}let s=A;if(!s){const t=await o.jV.post("session",{title:(e||R[0]?.name||"新会话").slice(0,28)});if(t.code!==h.m.Success)return;s=t.data.id,C(s),await ge(s)}const t=await w(R),n={id:Date.now(),sender:"user",text:e,attachments:t};if(O(""),F([]),"completions"!==B){const t={id:n.id+1,sender:"bot",text:"处理中...",is_loading:!0},a=[...v,n,t];y(a),M(!0);return void(await L(B,e,s,async(e,s)=>{t.text=e,t.is_loading=!1,s?.images&&(t.images=s.images),s?.audio&&(t.audio=s.audio),s?.embeddings&&(t.embeddings=s.embeddings),y([...a]),M(!1),me(),ue(!0),he.processPendingQueue()})||(t.text=`请求类型 "${B}" 的专用处理器尚未实现,请使用 completions 类型。`,t.is_loading=!1,y([...a]),M(!1),he.processPendingQueue()))}he.startChatStream(s,n,()=>he.processPendingQueue())},_e=e=>{const s=Array.from(e??[]).filter(Boolean);s.length&&F(e=>[...e,...s])};(0,n.useEffect)(()=>{(async()=>{const e=await o.XO.get("ai_agent_setting/env");if(e.code===h.m.Success){ae.current=e.data;const s=e.data.current_model_note||"",t=(e.data.options_agent_model_list??[]).find(e=>e.label===s);ce(t?t.value:s)}await ge();const s=await o.jV.get("system_prompts");s.code===h.m.Success&&le(s.data??[])})(),requestAnimationFrame(()=>ue(!1))},[]),(0,n.useEffect)(()=>{const e=te.current;if(!e)return;const s=()=>{ne.current=((e,s=120)=>{const{scrollTop:t,scrollHeight:n,clientHeight:a}=e;return n-(t+a)<s})(e)};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)},[]),(0,n.useLayoutEffect)(()=>{ne.current&&ue(!1)},[v]);return(0,I.jsxs)(n.Fragment,{children:[(0,I.jsx)(K,{currentModelName:oe,setCurrentModelName:ce,envConfigRef:ae,sysPromptList:ie,batchMode:J,selectedMsgCount:W.size,selectedSessionCount:Z.size,onToggleSessionPanel:()=>{window.innerWidth<=736?q(!0):q(e=>!e)},onCreateSession:async e=>{const s=await o.jV.post("session",{title:"新会话"});if(s.code!==h.m.Success)return;const t=s.data;C(t.id),e?(O(e),y([])):y([]),q(!1),await ge(t.id),requestAnimationFrame(()=>{const e=document.querySelector(".chat-input");e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,200)+"px")})},onToggleBatchMode:()=>{J&&(X(new Set),Y(new Set)),E(e=>!e)},onBatchDeleteMessages:()=>{0!==W.size&&s({sub_title:e("确认删除选中的聊天消息吗?"),confirm_fun:async()=>{const e=[];v.forEach((s,t)=>{W.has(s.id)&&e.push(t)}),y(v.filter(e=>!W.has(e.id))),X(new Set),E(!1),A&&e.length>0&&o.jV.post("session/message/delete",{session_id:A,indices:e}).catch(console.error)}})},onBatchDeleteSessions:()=>{0!==Z.size&&s({sub_title:e("确认删除选中的会话吗?"),confirm_fun:async()=>{for(const e of Z)await o.jV.post("session/delete",{session_id:e});Y(new Set),E(!1),Z.has(A)?(C(""),await ge(null)):await ge(A)}})},onClearAllSessions:()=>{s({sub_title:e("确认删除全部聊天会话吗?"),confirm_fun:async()=>{await o.jV.post("sessions/clear",{}),C(""),y([]),await ge(null)}})}}),(0,I.jsxs)("div",{className:"chat-page chat-page-with-sessions",children:[H&&(0,I.jsx)("div",{className:"chat-session-overlay",onClick:()=>q(!1)}),(0,I.jsx)(P,{sessions:b,activeSessionId:A,onSelectSession:e=>pe(e,!1),onRenameSession:(e,t)=>{let n=t;s({confirm_fun:async()=>{await o.jV.post("sessions/update/meta",{id:e,title:n}),await ge(A)},context_div:(0,I.jsx)("div",{className:"card-content",children:(0,I.jsx)(_.Sm,{value:n,handleInputChange:e=>{n=e}})})})},onDeleteSession:e=>{s({sub_title:"确认删除这个会话吗?",confirm_fun:async()=>{await o.jV.post("session/delete",{session_id:e}),A===e?(C(""),await ge(null)):await ge(A)}})},onShowUsageStats:async s=>{z({open:!0,title:e("字符消耗统计"),context_div:(0,I.jsx)("div",{className:"usage-stats-loading",children:e("加载中...")}),cancel:()=>z({open:!1})});try{const t=await o.jV.post("session/usage_stats",{session_id:s});if(t.code===h.m.Success&&t.data){const s=t.data;z({open:!0,title:e("字符消耗统计"),context_div:(0,I.jsxs)("div",{className:"usage-stats-panel",children:[[{l:e("对话轮次"),v:(s.turns??0).toString()},{l:e("AI输入字符"),v:U(s.input_chars)},{l:e("AI输出字符"),v:U(s.output_chars)},{l:e("AI输入字符(最近一轮)"),v:U(s.recent_input_chars)},{l:e("AI输出字符(最近一轮)"),v:U(s.recent_output_chars)}].map((e,s)=>(0,I.jsxs)("div",{className:"usage-stats-row",children:[(0,I.jsx)("span",{className:"usage-stats-label",children:e.l}),(0,I.jsx)("span",{className:"usage-stats-value",children:e.v})]},s)),(0,I.jsxs)("div",{className:"usage-stats-row usage-stats-total",children:[(0,I.jsx)("span",{className:"usage-stats-label",children:e("AI字符总计消耗")}),(0,I.jsx)("span",{className:"usage-stats-value",children:U((s.input_chars||0)+(s.output_chars||0))})]})]}),cancel:()=>z({open:!1})})}else z({open:!0,title:e("字符消耗统计"),context_div:(0,I.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>z({open:!1})})}catch{z({open:!0,title:e("字符消耗统计"),context_div:(0,I.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>z({open:!1})})}},batchMode:J,selectedSessionIds:Z,onToggleSessionSelect:e=>{Y(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})}}),(0,I.jsxs)("section",{className:"chat-main",children:[0===v?.length&&(0,I.jsx)("div",{className:"chat-header",children:(0,I.jsx)("div",{children:"completions"===B?e("询问服务器的一切"):re.find(e=>e.value===B)?.label??B})}),(0,I.jsx)(G,{messages:v,batchMode:J,selectedMsgIds:W,sending:$,chatContainerRef:te,messagesEndRef:se,onToggleMsgSelect:e=>{X(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onDelete:t=>{s({sub_title:e("确认删除这条消息吗?"),confirm_fun:async()=>{const e=v.findIndex(e=>e.id===t);if(e<0)return;const s=v.filter(e=>e.id!==t);y(s),A&&o.jV.post("session/message/delete",{session_id:A,indices:[e]}).catch(console.error)}})},onCopy:async e=>{(0,d.lW)(e),(0,u.SK)("复制成功")},t:e}),(0,I.jsx)(Q,{inputValue:D,onInputChange:e=>{const s=e.target;s.style.height="auto",s.style.height=Math.min(s.scrollHeight,200)+"px",O(s.value)},onKeyDown:e=>{"Process"===e.key||e.nativeEvent.isComposing||e.shiftKey||e.ctrlKey||"Enter"===e.key&&(e.preventDefault(),xe())},onPaste:e=>{const s=e.clipboardData?.files;s&&s.length>0&&(e.preventDefault(),_e(s))},onSend:xe,sending:$,pendingAttachments:R,onRemoveAttachment:e=>{F(s=>s.filter((s,t)=>t!==e))},onOpenFilePicker:()=>{ee.current?.click()},onAddFiles:_e,onDrop:e=>{const s=e.dataTransfer?.files;s&&s.length>0&&(e.preventDefault(),_e(s))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},fileInputRef:ee})]})]})]})}},96494(e,s,t){t.d(s,{r:()=>a});var n=t(22022);function a(){const{t:e}=(0,n.Bd)();return[{value:"completions",label:e("文本对话")},{value:"images",label:e("图片生成")}]}},72693(e,s,t){t.d(s,{w:()=>u});var n=t(96540),a=t(22022),i=t(14944),l=t(92275),o=t(34843),c=t(82893),r=t(85997),d=t(74848);function u(){const[e,s]=(0,o.fp)(c.AG.prompt_card),{t}=(0,a.Bd)(),u=(0,n.useRef)([]),m=(0,n.useRef)(!1),h=(0,n.useCallback)(()=>{if(m.current)return;if(0===u.current.length)return m.current=!1,void s({open:!1});m.current=!0;const e=u.current.shift();e?s({open:!0,title:t("命令确认"),cancel:()=>{i.ws.sendData(l.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),s({open:!1}),m.current=!1,h()},context_div:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),(0,d.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,d.jsx)(r.$n,{text:t("拒绝"),color:"var(--red)",clickFun:()=>{i.ws.sendData(l.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),s({open:!1}),m.current=!1,h()}}),(0,d.jsx)(r.$n,{text:t("允许"),clickFun:()=>{i.ws.sendData(l.HK.ai_confirm_cmd,{askId:e.askId,approved:!0}),s({open:!1}),m.current=!1,h()}})]})]})}):m.current=!1},[t]),g=(0,n.useCallback)(e=>{u.current.push(e),h()},[h]);(0,n.useEffect)(()=>(i.ws.addMsg(l.HK.ai_confirm_cmd,e=>{const t=e.context||{};if(t.dismiss&&t.askId)return u.current=u.current.filter(e=>e.askId!==t.askId),void(m.current&&(m.current=!1,s({open:!1}),h()));t.askId&&t.cmd&&g({askId:t.askId,cmd:t.cmd})}),()=>{i.ws.removeMsg(l.HK.ai_confirm_cmd)}),[g]),(0,n.useEffect)(()=>()=>{u.current=[],m.current=!1},[])}},34299(e,s,t){t.r(s),t.d(s,{default:()=>p});t(96540);var n=t(73557),a=t(53995),i=t(18569),l=t(77979),o=t(8263),c=t(69428),r=t.n(c),d=(t(3775),t(21499)),u=t(99214),m=t(19878),h=(t(72411),t(74848));const g=new n.A({html:!0,highlight:function(e,s){if(s&&m.A.getLanguage(s))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${s}">${m.A.highlight(e,{language:s}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${m.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${g.utils.escapeHtml(e)}</code></pre>`}});function p(e){return(0,u.VD)(),(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:g.render(e.context)}})}g.use(a.A).use(i.A).use(l.A).use(o.A).use(r()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(s,t,n,a,i)=>{const l=s[t],o=l.content.trim(),c=l.info.trim();let r="";if(c&&m.A.getLanguage(c))try{r=m.A.highlight(o,{language:c}).value}catch(s){r=e.utils.escapeHtml(o)}else try{r=m.A.highlightAuto(o).value}catch(s){r=e.utils.escapeHtml(o)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${c||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(o)}">复制</button>\n </div>\n <pre><code class="hljs ${c?`language-${c}`:""}">${r}</code></pre>\n </div>`}}).use(e=>{const s=e.renderer.rules.link_open||function(e,s,t,n,a){return a.renderToken(e,s,t)};e.renderer.rules.link_open=(e,t,n,a,i)=>{const l=e[t],o=l.attrIndex("href");if(o>=0){const e=l.attrs[o][1];l.attrs[o][1]=(0,d.bi)(window.location.href,e)}return s(e,t,n,a,i)}})},45907(e,s,t){t.d(s,{y:()=>i});var n=t(34843),a=t(82893);function i(){const[e,s]=(0,n.fp)(a.AG.confirm);return({sub_title:e,confirm_fun:t,title:n,context_div:a})=>{s({open:!0,sub_title:e,handle:()=>{t(),s({open:!1,handle:null})},title:n,context_div:a})}}},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
|