filecat 6.63.0 → 6.63.1
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/{1472.aa45fb8492220bde638b.js → 1472.895b811ec7f9765b8afc.js} +1 -1
- package/build/dist/index.html +1 -1
- package/build/dist/{main.08c996d0497ce06ca15d.js → main.f074592fdc7851278bc0.js} +2 -2
- package/build/main.js +1 -1
- package/package.json +1 -1
- /package/build/dist/{main.08c996d0497ce06ca15d.js.LICENSE.txt → main.f074592fdc7851278bc0.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1472],{77481(e,t,s){s.d(t,{S:()=>o,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 o(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>E});var n=s(96540),i=s(75725),l=s(23430),o=s(70447),a=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),_=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function f(e){const{t}=(0,u.B)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.title}),e.info_click&&(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,v.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const o=[];for(let t=0;t<e.headers.length;t++)o.push((0,v.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return o.push((0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,v.jsx)(a.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,_.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,v.jsx)(a.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)}})]})),o}),width:"10rem"})})})}var g=s(34843),w=s(78247),S=s(24659);function C(){const{t:e}=(0,u.B)(),[t,s]=(0,g.fp)(p.AG.prompt_card),l=(0,S.K)(),f=[e("路由"),e("auth"),e("备注")],[C,y]=(0,g.fp)(p.AG.editorSetting),[k,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)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自定义api路由")})," ",(0,v.jsx)(a.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)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b([{note:"",needAuth:!1,router:""},...k])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",k)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,v.jsx)(h.X,{headers:f,rows:k.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,b([...k])},no_border:!0}),(0,v.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,b([...k])},options:l,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,b([...k])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),b([...k])})(s)}),(0,v.jsx)(a.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)}`);y({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&&(w.xK.set_value_temp(""),y({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),w.xK.set_value_temp(t.data)})(t)}),t.router&&(0,v.jsx)(a.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,_.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem"})})})}var y=s(23496),k=s(57952);function b(){const{t:e}=(0,u.B)(),[t,s]=(0,g.fp)(p.AG.prompt_card),[l,o]=(0,g.fp)(p.AG.router_jump),a=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(k.A,{}),(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(f,{title:e("页面资源路由"),headers:a,getItems:async()=>{const e=await c.XO.get(y.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],o({})}return e.data}return[]},save:async e=>{(await c.XO.post(y.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(y.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(y.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)(C,{})})]})]})}var A=s(74777),I=s(6960),V=s(7523);function X(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,w.MH)(),[s,i]=(0,n.useState)(!1),[h,_]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(180),[C,y]=(0,n.useState)(!1),[k,b]=(0,g.fp)(p.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),_(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),S(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自动升级")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,v.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!f||f<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new A.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=f;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,v.jsx)("div",{children:e("系统版本检测地址")}),(0,v.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{_(e)}}),(0,v.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,v.jsxs)(v.Fragment,{children:[!1,(0,v.jsx)("div",{children:e("检测频率(秒)")}),(0,v.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:f,handleInputChange:e=>{S(Number(e)||180)}}),(0,v.jsx)("div",{style:{marginTop:"12px"},children:(0,v.jsx)(a.C3,{text:e(C?"升级检测中...":"立即升级"),clickFun:async()=>{y(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{y(!1)}}})})]})]}):null}function N(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[_,m]=(0,n.useState)(""),[j,f]=(0,n.useState)(!1),[S,C]=(0,n.useState)(""),[b,N]=(0,g.fp)(p.AG.prompt_card),[O,F]=(0,n.useState)(!1),[K,z]=(0,n.useState)(""),[P,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(A.aM.close),[G,E]=(0,n.useState)(!1),[T,H]=(0,n.useState)(void 0),{t:q,i18n:U}=(0,u.B)(),[Z,D]=(0,g.fp)(p.AG.user_base_info),{check_user_auth:W}=(0,w.MH)(),{initUserInfo:L}=(0,n.useContext)(V.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){f(e.data.recycle_open),C(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info),m(s?.http_proxy||"");const n=e.data.https_setting;n&&(F(n.open),z(n.cert_path||""),B(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&&H(e.length),e.mode&&$(e.mode),void 0!==e.persist&&E(e.persist)}})()},[]);return(0,v.jsxs)("div",{children:[(0,v.jsx)(k.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[q("系统运行于"),": ",(0,I.s)(Z.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.63.0",null!=Z.latest_version&&"6.63.0"!==Z.latest_version?` -> ${Z.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:q("官网地址"),target:"_blank",children:`filecat ${q("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[q("安装方式")," :",Z.process_env_run_env]})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:q("通用设置")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{N({open:!0,title:q("信息"),context_div:(0,v.jsx)("div",{children:q("HTTP 代理说明")})})},title:q("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.sys_env,value:{web_site_title:e,show_login_user_info:s,http_proxy:_}})).code===d.m.Success&&((0,x.SK)("修改成功"),L())}}),children:[q("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),(0,v.jsx)("div",{children:q("HTTP 代理地址")}),(0,v.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:_,handleInputChange:e=>{m(e)}}),q("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(o.Zp,{title:q("HTTPS 设置"),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(O){if(!K)return void(0,x.zN)("证书路径不能为空");if(!P)return void(0,x.zN)("私钥路径不能为空")}const e=new A.CH;e.open=O,e.cert_path=K,e.key_path=P;(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.https,value:e,open:O})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:O,onChange:e=>{F(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]}),O&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:q("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:q("证书文件路径(cert.pem/fullchain.pem)"),value:K,handleInputChange:e=>{z(e)}}),(0,v.jsx)("div",{children:q("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:q("私钥文件路径(privkey.pem)"),value:P,handleInputChange:e=>{B(e)}})]})]}),(0,v.jsx)(X,{})]}),(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:q("文件回收站")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{N({open:!0,title:q("信息"),context_div:(0,v.jsx)("div",{children:q("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:q("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(j&&!S)return void(0,x.zN)("目录不能为空");(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.cyc,value:S,open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:q("目录"),value:S,handleInputChange:e=>{C(e)}}),(0,v.jsx)(r.l6,{value:j,onChange:e=>{f(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]})]}),(0,v.jsxs)(o.Zp,{title:q("token过期时间"),rightBottomCom:(0,v.jsx)(h.S,{isFlex:!0,columns:[(0,v.jsx)(a.C3,{text:q("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(a.C3,{text:q("保存"),clickFun:async()=>{const e=new A.Gd;e.mode=M,e.persist=G,A.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)(h.S,{isFlex:!0,columns:[(0,v.jsx)(r.U6,{value:1,context:q("关闭"),selected:M===A.aM.close,onchange:()=>{$(A.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:q("指定时间"),selected:M===A.aM.length,onchange:()=>{$(A.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:q("永不过期"),selected:M===A.aM.forver,onchange:()=>{$(A.aM.forver)}})]}),M===A.aM.length&&(0,v.jsx)(r.Sm,{placeholder:q("秒"),value:T,handleInputChange:e=>{H(e)}}),(0,v.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,v.jsx)("input",{type:"checkbox",checked:G,onChange:()=>E(!G)}),q("持久化")]})]})]})]})})]})}var O=s(64694),F=s(92350);function K(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(V.F),[_,m]=(0,n.useState)([]),[j,f]=(0,n.useState)([]),[C,y]=(0,g.fp)(p.AG.prompt_card),[,k]=(0,g.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]),[I,X]=(0,n.useState)([]),[N,K]=(0,n.useState)([]),[z,P]=(0,n.useState)([]),[B,M]=(0,n.useState)(""),[$,G]=(0,n.useState)([]),E=(0,S.K)(),T=[e("软件"),e("是否安装"),e("路径")],H=[e("编号"),e("路径"),e("备注")],q=[e("编号"),e("路径"),e("是否开启"),e("备注")],U=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],D=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:W}=(0,w.MH)(),L=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&K(e.data)},Q=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&&M(t.data),L(),Q();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&A(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&X(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&G(i.data??[])})()},[]);const J=(0,F.Q)(),R=async()=>{(await c.XO.post("plugin/list/save",$)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(i.J,{widthPer:100,children:(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("文件上传")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...I,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of I)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,O.di)(I,e=>e.index);(await c.XO.post("dir_upload_max_num/save",I)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(h.X,{headers:Z,rows:I.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,X([...I])},options:E,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{I.splice(e,1),X([...I])})(s)})];return n}),width:"10rem"})})}),(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PATH")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("环境路径")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?y({open:!0,title:e("进程环境变量"),context_div:(0,v.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(w.xK.set_value_temp(t.data??""),k({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,x.SK)(e("保存成功")):(0,x.zN)(e("保存失败")),w.xK.set_value_temp("")}})):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...N,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:N})).code===d.m.Success&&((0,x.SK)("保存成功"),L(),s())}})]}),children:(0,v.jsx)(h.X,{headers:q,rows:N.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,K([...N])},options:E,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),K([...N])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PTY CMD")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("pty")},title:e("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:B})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:B,handleInputChange:e=>{M(e)}})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("Workflow Job")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("Workflow")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...z,{open:!1}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",z)).code===d.m.Success&&((0,x.SK)("ok"),Q())}})]}),children:(0,v.jsx)(h.X,{headers:U,rows:z.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...z])},options:E,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...z])},options:E,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{z.splice(e,1),P([...z])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("插件配置")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("插件配置")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{G([...$,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:R})]}),children:(0,v.jsx)(h.X,{headers:D,rows:$.map((t,s)=>{const n=[s,(0,v.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,G([...$])},options:E,no_border:!0}),(0,v.jsx)(a.mu,{icon:"edit",save:async e=>{t.params=e,await R()},title:""}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{$.splice(e,1),G([...$])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("系统保护路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("保护目录")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",b)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(h.X,{headers:H,rows:b.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{title:e("外部软件"),titleCom:(0,v.jsx)(a.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)(h.X,{headers:T,rows:j.map((t,s)=>[(0,v.jsx)("div",{children:t.id}),(0,v.jsx)(o.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)(a.rA,{icon:"info",onClick:()=>{J(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function z(e){const{t,i18n:s}=(0,u.B)(),[i,o]=(0,g.fp)(p.AG.user_base_info),a=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd管理"),permission:l.oV.systemd},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai Chat Page"),permission:l.oV.ai_agent_page},{title:t("允许切换 AI 模型"),permission:l.oV.ai_model_switch}]},{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("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("系统保护路径更新"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("网址导航"),permission:l.oV.net_site_tag_update},{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("端口扫描"),permission:l.oV.port_scan},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("网址导航"),permission:l.oV.nav_net_tag},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,v.jsx)(n.Fragment,{children:a.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 P=new Map;function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(V.F),[j,f]=(0,g.fp)(p.AG.user_base_info),[w,S]=(0,n.useState)([]),[C,y]=(0,g.fp)(p.AG.prompt_card),[k,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[X,N]=(0,g.fp)(p.AG.confirm),[K,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,E]=(0,n.useState)(""),[T,H]=(0,n.useState)([]),[q,U]=(0,n.useState)([]),[Z,D]=(0,n.useState)([]),[W,L]=(0,n.useState)(""),[Q,J]=(0,n.useState)(""),[R,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,le]=(0,n.useState)(""),[oe,ae]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),_e=(0,F.o)(),[xe,me]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ge=async()=>{const e=await c.wm.get("all_users");if(e.code===d.m.Success){const t=e.data??[];if(je){const e=[];for(const s of t)`${s.id}${s.username}${s.cwd}${s.note}`.includes(je)&&e.push(s);S(e)}else S(t)}const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),P.clear();for(const e of t.data)P.set(e.role_id,e)}},we=e=>{B(e?.username??""),$(e?.password??""),E(e?.cwd??""),H(e?.access_dirs??[]),U(e?.not_access_dirs??[]),D(e?.only_read_dirs??[]),L(e?.access_cmd??""),J(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),le(e?.note??""),ae(e?.is_root??!1),ce(e?.id??""),e?.bind_role_id?Se(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ge()},[]);const Se=(e,t=[])=>{if(!e)return he(""),void pe({});const s=P.get(e);if(s){if(s.cwd&&E(s.cwd),s.access_dirs&&s.access_dirs.length>0&&H(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&U(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&D(s.only_read_dirs),s.access_cmd&&L(s.access_cmd),s.not_access_cmd&&J(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}he(e),pe(s)}},Ce=()=>{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=T,e.username=K,e.password=M,e.not_access_dirs=q,e.only_read_dirs=Z,e.cwd=G,e.note=ie,e.access_cmd=W,e.not_access_cmd=Q,e.auth_list=se,e.bind_role_id=de,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(o.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("用户")})}),titleCom:(0,v.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,v.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),I(!1),we(void 0)}})]}),children:(0,v.jsx)(h.X,{headers:fe,rows:w.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.id}),(0,v.jsx)(o.xP,{children:t.username}),(0,v.jsx)(o.xP,{children:t.cwd}),(0,v.jsx)(o.xP,{children:t.note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),I(!0),we(e)})(t)}),!t.is_root&&(0,v.jsx)(a.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)("删除完成"),ge(),N({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(k||A)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(k?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),I(!1),we(void 0)}}),k&&(0,v.jsx)(a.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=Ce(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ge(),b(!1),I(!1),we(void 0))}}),A&&(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=Ce();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ge())}})]}),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:[!ue?.access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{H([...T,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:G,handleInputChange:e=>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!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,H([...T])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{T.splice(s,1),H([...T])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{U([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).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!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,U([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{q.splice(s,1),U([...q])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{D([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{Z[s]=e,D([...Z])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),D([...Z])},title:e("删除")})]},s)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>L(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:Q,placeholder:"use blank split",handleInputChange:e=>J(e)}),!oe&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("label",{children:e("角色")}),(0,v.jsx)(r.l6,{value:de,onChange:e=>{Se(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:""!==ue.language&&void 0!==ue.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:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:_e}),(0,v.jsx)(z,{is_disable:e=>{if(!0===oe)return!0;if(de){const t=P.get(de);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===oe||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,u.B)(),{initUserInfo:s}=(0,n.useContext)(V.F),[_,m]=(0,n.useState)([]),[j,f]=(0,g.fp)(p.AG.prompt_card),[w,S]=(0,n.useState)(!1),[C,y]=(0,n.useState)(!1),[k,b]=(0,g.fp)(p.AG.confirm),[A,I]=(0,n.useState)(""),[X,N]=(0,n.useState)(""),[K,P]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[E,T]=(0,n.useState)(""),[H,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[D,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)([]),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),P(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),T(e?.access_cmd??""),q(e?.not_access_cmd??""),Z(e?.language??""),W(e?.theme??""),Q(e?.auth_list??[]),R(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!A)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=U,e.theme=D,e.access_dirs=K,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=X,e.access_cmd=E,e.not_access_cmd=H,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)(o.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)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{S(!0),y(!1),ie(void 0)}})}),children:(0,v.jsx)(h.X,{headers:se,rows:_.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.role_id}),(0,v.jsx)(o.xP,{children:t.role_name}),(0,v.jsx)(o.xP,{children:t.role_note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{S(!1),y(!0),ie(e)})(t)}),!t.is_root&&(0,v.jsx)(a.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:(w||C)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(w?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{S(!1),y(!1),ie(void 0)}}),w&&(0,v.jsx)(a.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(),S(!1),y(!1),ie(void 0))}}),C&&(0,v.jsx)(a.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)(a.rA,{icon:"add",onClick:()=>{P([...K,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:X,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,P([...K])}})}),(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{K.splice(t,1),P([...K])},title:"删除"})]},t)),(0,v.jsxs)("label",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"delete",onClick:()=>{B.splice(s,1),M([...B])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"delete",onClick:()=>{$.splice(t,1),G([...$])},title:"删除"})]},t)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{value:E,placeholder:"use blank split",handleInputChange:e=>T(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{value:H,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:U,onChange:e=>{Z(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{value:D,onChange:e=>{W(e)},options:te}),(0,v.jsx)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,O.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function $(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(V.F),[m,j]=(0,n.useState)([]),[f,w]=(0,g.fp)(p.AG.prompt_card),[C,k]=(0,n.useState)([]),[b,I]=(0,n.useState)([]),[X,N]=(0,n.useState)([]),[O,K]=(0,g.fp)(p.AG.user_base_info),z=(0,S.K)(),P=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,T]=(0,n.useState)(""),[H,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),I(e.data.quick_cmd),N(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&k(t.data??[])})(),Q(O?.user_data?.language),R(O?.user_data?.theme),ee(O?.user_data?.upload_file_ignore)},[]);const te=(0,F.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{title:e("修改密码"),rightBottomCom:(0,v.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!H)return void(0,x.zN)("账号密码不能为空");if(H!==U)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=E,e.password=H,e.confirm_password=U,e.user_id=O.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{T(e)}}),(0,v.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{q(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(e)}})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{title:e("个性化设置"),rightBottomCom:(0,v.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.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:P}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>{ee(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,v.jsxs)(i.VP,{children:[(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件夹路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("文件夹路径")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,v.jsx)(a.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)("保存成功"),_(),s())}})]}),children:(0,v.jsx)(h.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:z,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("个人保护路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("保护目录")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{k([...C,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",C)).code===d.m.Success&&((0,x.SK)("保存成功"),_())}})]}),children:(0,v.jsx)(h.X,{headers:M,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),k([...C])})(s)})];return n}),width:"10rem"})})]}),(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("目录快捷命令")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("目录快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...b,{cmd:"",note:""}])}}),(0,v.jsx)(a.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)(h.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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),I([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件快捷命令")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("文件快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...X,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:X})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(h.X,{headers:G,rows:X.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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{X.splice(e,1),N([...X])})(s)})];return n}),width:"10rem"})})]})]})]})})}var G=s(87361);function E(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,w.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:()=>h,o:()=>p});var n=s(34843),i=s(82893),l=s(74777),o=s(96540),a=s(86149),r=s(23430),c=s(14284),d=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:o}=(0,a.B)();return e=>{let n;e===l.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];u=[...r.Ky,...s],t(u)}else console.warn("获取主题列表失败,使用默认列表"),t(u)}catch(e){t(u)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>o});var n=s(72635);const i=1440,l=525600;function o(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1472],{77481(e,t,s){s.d(t,{S:()=>o,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 o(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},61472(e,t,s){s.r(t),s.d(t,{default:()=>E});var n=s(96540),i=s(75725),l=s(23430),o=s(70447),a=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),_=s(40505),x=s(62042),m=s(21499),j=s(21469),v=s(74848);function f(e){const{t}=(0,u.B)(),[s,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();l(t)}})()},[]);return(0,v.jsx)(i.xh,{children:(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.title}),e.info_click&&(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,v.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const o=[];for(let t=0;t<e.headers.length;t++)o.push((0,v.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,l([...s])},no_border:!0}));return o.push((0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),l([...s])})(i)}),n[0]&&(0,v.jsx)(a.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,_.lW)(e),(0,x.SK)(e)}}),n[0]&&e.need_copy&&(0,v.jsx)(a.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)}})]})),o}),width:"10rem"})})})}var g=s(34843),w=s(78247),S=s(24659);function C(){const{t:e}=(0,u.B)(),[t,s]=(0,g.fp)(p.AG.prompt_card),l=(0,S.K)(),f=[e("路由"),e("auth"),e("备注")],[C,y]=(0,g.fp)(p.AG.editorSetting),[k,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)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自定义api路由")})," ",(0,v.jsx)(a.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)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b([{note:"",needAuth:!1,router:""},...k])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",k)).code===d.m.Success&&(0,x.SK)("保存成功")}})]}),children:(0,v.jsx)(h.X,{headers:f,rows:k.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,b([...k])},no_border:!0}),(0,v.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,b([...k])},options:l,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,b([...k])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{k.splice(e,1),b([...k])})(s)}),(0,v.jsx)(a.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)}`);y({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&&(w.xK.set_value_temp(""),y({open:!1,model:"",fileName:"",save:null}),(0,x.SK)("成功"))}}),w.xK.set_value_temp(t.data)})(t)}),t.router&&(0,v.jsx)(a.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,_.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,x.SK)(e("已复制"))}})]})];return n}),width:"10rem"})})})}var y=s(23496),k=s(57952);function b(){const{t:e}=(0,u.B)(),[t,s]=(0,g.fp)(p.AG.prompt_card),[l,o]=(0,g.fp)(p.AG.router_jump),a=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(k.A,{}),(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{children:[(0,v.jsx)(f,{title:e("页面资源路由"),headers:a,getItems:async()=>{const e=await c.XO.get(y.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],o({})}return e.data}return[]},save:async e=>{(await c.XO.post(y.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(y.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(y.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)(C,{})})]})]})}var A=s(74777),I=s(6960),V=s(7523);function X(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,w.MH)(),[s,i]=(0,n.useState)(!1),[h,_]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(180),[C,y]=(0,n.useState)(!1),[k,b]=(0,g.fp)(p.AG.prompt_card);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("auto_upgrade_setting");if(e.code===d.m.Success){const t=e.data;i(t.open||!1),_(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),S(t.check_interval_seconds||180)}})()},[]);return t(l.oV.sys_setting_page)?(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("自动升级")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,v.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,x.zN)(e("版本检测地址不能为空"));if(s&&(!f||f<10))return void(0,x.zN)(e("检测间隔不能小于10秒"));const t=new A.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=f;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,x.SK)(e("保存成功"))}}),children:[(0,v.jsx)("div",{children:e("系统版本检测地址")}),(0,v.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{_(e)}}),(0,v.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,v.jsxs)(v.Fragment,{children:[!1,(0,v.jsx)("div",{children:e("检测频率(秒)")}),(0,v.jsx)(r.Sm,{placeholder:e("默认180秒(3分钟)"),value:f,handleInputChange:e=>{S(Number(e)||180)}}),(0,v.jsx)("div",{style:{marginTop:"12px"},children:(0,v.jsx)(a.C3,{text:e(C?"升级检测中...":"立即升级"),clickFun:async()=>{y(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,x.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,x.zN)(e("触发升级失败"))}finally{y(!1)}}})})]})]}):null}function N(){const[e,t]=(0,n.useState)(""),[s,l]=(0,n.useState)(!1),[_,m]=(0,n.useState)(""),[j,f]=(0,n.useState)(!1),[S,C]=(0,n.useState)(""),[b,N]=(0,g.fp)(p.AG.prompt_card),[O,F]=(0,n.useState)(!1),[K,z]=(0,n.useState)(""),[P,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(A.aM.close),[G,E]=(0,n.useState)(!1),[T,H]=(0,n.useState)(void 0),{t:q,i18n:U}=(0,u.B)(),[Z,D]=(0,g.fp)(p.AG.user_base_info),{check_user_auth:W}=(0,w.MH)(),{initUserInfo:L}=(0,n.useContext)(V.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){f(e.data.recycle_open),C(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),l(s?.show_login_user_info),m(s?.http_proxy||"");const n=e.data.https_setting;n&&(F(n.open),z(n.cert_path||""),B(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&&H(e.length),e.mode&&$(e.mode),void 0!==e.persist&&E(e.persist)}})()},[]);return(0,v.jsxs)("div",{children:[(0,v.jsx)(k.A,{left_children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"credits",children:[q("系统运行于"),": ",(0,I.s)(Z.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.63.1",null!=Z.latest_version&&"6.63.1"!==Z.latest_version?` -> ${Z.latest_version}`:""]})}),(0,v.jsx)("span",{className:"credits",children:(0,v.jsx)("a",{href:q("官网地址"),target:"_blank",children:`filecat ${q("功能文档")}`})}),(0,v.jsxs)("span",{className:"credits",children:[q("安装方式")," :",Z.process_env_run_env]})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:q("通用设置")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{N({open:!0,title:q("信息"),context_div:(0,v.jsx)("div",{children:q("HTTP 代理说明")})})},title:q("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.sys_env,value:{web_site_title:e,show_login_user_info:s,http_proxy:_}})).code===d.m.Success&&((0,x.SK)("修改成功"),L())}}),children:[q("网站标题"),(0,v.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),(0,v.jsx)("div",{children:q("HTTP 代理地址")}),(0,v.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:_,handleInputChange:e=>{m(e)}}),q("登陆展示用户信息"),(0,v.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{l(!s)}})]}),(0,v.jsxs)(o.Zp,{title:q("HTTPS 设置"),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(O){if(!K)return void(0,x.zN)("证书路径不能为空");if(!P)return void(0,x.zN)("私钥路径不能为空")}const e=new A.CH;e.open=O,e.cert_path=K,e.key_path=P;(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.https,value:e,open:O})).code===d.m.Success&&(0,x.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,v.jsx)(r.l6,{value:O,onChange:e=>{F(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]}),O&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{children:q("SSL 证书路径")}),(0,v.jsx)(r.Sm,{placeholder:q("证书文件路径(cert.pem/fullchain.pem)"),value:K,handleInputChange:e=>{z(e)}}),(0,v.jsx)("div",{children:q("SSL 私钥路径")}),(0,v.jsx)(r.Sm,{placeholder:q("私钥文件路径(privkey.pem)"),value:P,handleInputChange:e=>{B(e)}})]})]}),(0,v.jsx)(X,{})]}),(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:q("文件回收站")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{N({open:!0,title:q("信息"),context_div:(0,v.jsx)("div",{children:q("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:q("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:q("确定修改"),clickFun:async()=>{if(j&&!S)return void(0,x.zN)("目录不能为空");(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.Mu.cyc,value:S,open:j})).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:q("目录"),value:S,handleInputChange:e=>{C(e)}}),(0,v.jsx)(r.l6,{value:j,onChange:e=>{f(e)},options:[{title:q("开启"),value:!0},{title:q("关闭"),value:!1}]})]}),(0,v.jsxs)(o.Zp,{title:q("token过期时间"),rightBottomCom:(0,v.jsx)(h.S,{isFlex:!0,columns:[(0,v.jsx)(a.C3,{text:q("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,x.SK)("清理完成,重新登录")}}),(0,v.jsx)(a.C3,{text:q("保存"),clickFun:async()=>{const e=new A.Gd;e.mode=M,e.persist=G,A.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)(h.S,{isFlex:!0,columns:[(0,v.jsx)(r.U6,{value:1,context:q("关闭"),selected:M===A.aM.close,onchange:()=>{$(A.aM.close)}}),(0,v.jsx)(r.U6,{value:1,context:q("指定时间"),selected:M===A.aM.length,onchange:()=>{$(A.aM.length)}}),(0,v.jsx)(r.U6,{value:1,context:q("永不过期"),selected:M===A.aM.forver,onchange:()=>{$(A.aM.forver)}})]}),M===A.aM.length&&(0,v.jsx)(r.Sm,{placeholder:q("秒"),value:T,handleInputChange:e=>{H(e)}}),(0,v.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,v.jsx)("input",{type:"checkbox",checked:G,onChange:()=>E(!G)}),q("持久化")]})]})]})]})})]})}var O=s(64694),F=s(92350);function K(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:l}=(0,n.useContext)(V.F),[_,m]=(0,n.useState)([]),[j,f]=(0,n.useState)([]),[C,y]=(0,g.fp)(p.AG.prompt_card),[,k]=(0,g.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]),[I,X]=(0,n.useState)([]),[N,K]=(0,n.useState)([]),[z,P]=(0,n.useState)([]),[B,M]=(0,n.useState)(""),[$,G]=(0,n.useState)([]),E=(0,S.K)(),T=[e("软件"),e("是否安装"),e("路径")],H=[e("编号"),e("路径"),e("备注")],q=[e("编号"),e("路径"),e("是否开启"),e("备注")],U=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("是否开启大文件断点"),e("大文件判断大小MB"),e("大文件并发数量"),e("大文件分块大小MB"),e("备注")],D=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:W}=(0,w.MH)(),L=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&K(e.data)},Q=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&&M(t.data),L(),Q();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&A(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&X(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&G(i.data??[])})()},[]);const J=(0,F.Q)(),R=async()=>{(await c.XO.post("plugin/list/save",$)).code===d.m.Success&&(0,x.SK)(e("保存成功"))};return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(i.J,{widthPer:100,children:(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件上传最大并发限制")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("文件上传")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...I,{path:"",note:"",user_upload_num:2,sys_upload_num:6,ws_file_standard_size:52428800,ws_file_parallel_num:2,ws_file_block_mb_size:524288}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of I)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,x.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,x.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,x.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,O.di)(I,e=>e.index);(await c.XO.post("dir_upload_max_num/save",I)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(h.X,{headers:Z,rows:I.map((t,s)=>{const n=[(0,v.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,v.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,X([...I])},options:E,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{I.splice(e,1),X([...I])})(s)})];return n}),width:"10rem"})})}),(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PATH")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("环境路径")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?y({open:!0,title:e("进程环境变量"),context_div:(0,v.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:"60vh",overflow:"auto",margin:0,fontSize:"0.85rem",lineHeight:"1.5"},children:t.data})}):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(w.xK.set_value_temp(t.data??""),k({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,x.SK)(e("保存成功")):(0,x.zN)(e("保存失败")),w.xK.set_value_temp("")}})):(0,x.zN)(e("获取失败"))}}),(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...N,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:N})).code===d.m.Success&&((0,x.SK)("保存成功"),L(),s())}})]}),children:(0,v.jsx)(h.X,{headers:q,rows:N.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,K([...N])},options:E,no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),K([...N])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("PTY CMD")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("pty")},title:e("信息")})]}),rightBottomCom:(0,v.jsx)(a.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:B})).code===d.m.Success&&((0,x.SK)("保存成功"),l())}}),children:(0,v.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:B,handleInputChange:e=>{M(e)}})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("Workflow Job")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("Workflow")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...z,{open:!1}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",z)).code===d.m.Success&&((0,x.SK)("ok"),Q())}})]}),children:(0,v.jsx)(h.X,{headers:U,rows:z.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...z])},options:E,no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...z])},options:E,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{z.splice(e,1),P([...z])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("插件配置")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("插件配置")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{G([...$,{name:"",path:"",note:"",open:!1}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:R})]}),children:(0,v.jsx)(h.X,{headers:D,rows:$.map((t,s)=>{const n=[s,(0,v.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,G([...$])},options:E,no_border:!0}),(0,v.jsx)(a.mu,{icon:"edit",save:async e=>{t.params=e,await R()},title:""}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{$.splice(e,1),G([...$])})(s)})];return n}),width:"10rem"})})]})}),(0,v.jsx)(i.VP,{children:(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("系统保护路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{J("保护目录")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",b)).code===d.m.Success&&((0,x.SK)("保存成功"),l())}})]}),children:(0,v.jsx)(h.X,{headers:H,rows:b.map((t,s)=>{const n=[(0,v.jsx)("div",{children:s}),(0,v.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,v.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,v.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{title:e("外部软件"),titleCom:(0,v.jsx)(a.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)(h.X,{headers:T,rows:j.map((t,s)=>[(0,v.jsx)("div",{children:t.id}),(0,v.jsx)(o.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)(a.rA,{icon:"info",onClick:()=>{J(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function z(e){const{t,i18n:s}=(0,u.B)(),[i,o]=(0,g.fp)(p.AG.user_base_info),a=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:l.oV.user_manage},{title:t("角色管理"),permission:l.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:l.oV.all_sys},{title:t("系统进程关闭"),permission:l.oV.sys_process_close},{title:t("docker容器停止、删除"),permission:l.oV.docker_container_update},{title:t("docker镜像删除"),permission:l.oV.docker_images_delete},{title:t("systemd管理"),permission:l.oV.systemd},{title:t("防火墙管理"),permission:l.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:l.oV.vir_net},{title:t("内网穿透"),permission:l.oV.tcp_proxy},{title:"ddns",permission:l.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:l.oV.ai_agent_setting},{title:t("Ai Chat Page"),permission:l.oV.ai_agent_page},{title:t("允许切换 AI 模型"),permission:l.oV.ai_model_switch}]},{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("修改密码"),permission:l.oV.update_password},{title:t("磁盘挂载"),permission:l.oV.sys_disk_mount},{title:t("通用设置"),permission:l.oV.sys_env_setting_key}]},{title:t("系统环境设置"),list:[{title:t("系统环境设置页面"),permission:l.oV.sys_env_page},{title:t("目录文件上传数量限制修改"),permission:l.oV.dir_upload_max_num},{title:t("PATH路径修改"),permission:l.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:l.oV.pty_cmd_update},{title:"workflow job",permission:l.oV.workflow_job},{title:t("系统保护路径更新"),permission:l.oV.sys_protection_dir},{title:t("外部软件路径"),permission:l.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:l.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:l.oV.auth_router_page},{title:t("workflow触发api 修改"),permission:l.oV.workflow_api},{title:t("自定义资源路由"),permission:l.oV.code_resource},{title:t("自定义api路由"),permission:l.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("网址导航"),permission:l.oV.net_site_tag_update},{title:t("ssh代理"),permission:l.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:l.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:l.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:l.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:l.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:l.oV.ssh_proxy},{title:t("http代理"),permission:l.oV.http_proxy},{title:t("http代理下载关闭"),permission:l.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:l.oV.browser_proxy},{title:t("rdp代理"),permission:l.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("workflow 执行"),permission:l.oV.workflow_exe},{title:t("workflow 执行用户"),permission:l.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:l.oV.wol_proxy},{title:t("端口扫描"),permission:l.oV.port_scan},{title:t("rtsp播放器"),permission:l.oV.rtsp_proxy},{title:t("ssh密钥保存到磁盘"),permission:l.oV.crypto_ssh_file},{title:t("网址导航"),permission:l.oV.nav_net_tag},{title:t("filecat-restart重启命令"),permission:l.oV.shell_cmd_filecat_restart},{title:t("filecat-upgrade升级命令"),permission:l.oV.shell_cmd_filecat_upgrade},{title:t("filecat-down关闭主进程命令"),permission:l.oV.shell_cmd_filecat_kill_self},{title:t("ai 命令(Ai 聊天)"),permission:l.oV.ai_chat_cmd}]}];return(0,v.jsx)(n.Fragment,{children:a.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 P=new Map;function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(V.F),[j,f]=(0,g.fp)(p.AG.user_base_info),[w,S]=(0,n.useState)([]),[C,y]=(0,g.fp)(p.AG.prompt_card),[k,b]=(0,n.useState)(!1),[A,I]=(0,n.useState)(!1),[X,N]=(0,g.fp)(p.AG.confirm),[K,B]=(0,n.useState)(""),[M,$]=(0,n.useState)(""),[G,E]=(0,n.useState)(""),[T,H]=(0,n.useState)([]),[q,U]=(0,n.useState)([]),[Z,D]=(0,n.useState)([]),[W,L]=(0,n.useState)(""),[Q,J]=(0,n.useState)(""),[R,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,le]=(0,n.useState)(""),[oe,ae]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),_e=(0,F.o)(),[xe,me]=(0,n.useState)([]),[je,ve]=(0,n.useState)(void 0),fe=[e("用户id"),e("用户名"),e("目录范围"),e("备注")],ge=async()=>{const e=await c.wm.get("all_users");if(e.code===d.m.Success){const t=e.data??[];if(je){const e=[];for(const s of t)`${s.id}${s.username}${s.cwd}${s.note}`.includes(je)&&e.push(s);S(e)}else S(t)}const t=await c.wm.get("all_roles");if(t.code===d.m.Success){me(t.data),P.clear();for(const e of t.data)P.set(e.role_id,e)}},we=e=>{B(e?.username??""),$(e?.password??""),E(e?.cwd??""),H(e?.access_dirs??[]),U(e?.not_access_dirs??[]),D(e?.only_read_dirs??[]),L(e?.access_cmd??""),J(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),le(e?.note??""),ae(e?.is_root??!1),ce(e?.id??""),e?.bind_role_id?Se(e.bind_role_id,e.auth_list??[]):(he(""),pe({}))};(0,n.useEffect)(()=>{ge()},[]);const Se=(e,t=[])=>{if(!e)return he(""),void pe({});const s=P.get(e);if(s){if(s.cwd&&E(s.cwd),s.access_dirs&&s.access_dirs.length>0&&H(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&U(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&D(s.only_read_dirs),s.access_cmd&&L(s.access_cmd),s.not_access_cmd&&J(s.not_access_cmd),s.language&&Y(s.language),s.theme&&te(s.theme),s.auth_list&&s.auth_list.length>0){const e=new Set(s.auth_list);for(const s of t)e.add(s);ne(Array.from(e))}he(e),pe(s)}},Ce=()=>{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=T,e.username=K,e.password=M,e.not_access_dirs=q,e.only_read_dirs=Z,e.cwd=G,e.note=ie,e.access_cmd=W,e.not_access_cmd=Q,e.auth_list=se,e.bind_role_id=de,e};return(0,v.jsxs)(i.fI,{children:[(0,v.jsx)(i.VP,{widthPer:50,children:(0,v.jsx)(i.xh,{children:(0,v.jsx)(o.uF,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e("用户")})}),titleCom:(0,v.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,v.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{b(!0),I(!1),we(void 0)}})]}),children:(0,v.jsx)(h.X,{headers:fe,rows:w.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.id}),(0,v.jsx)(o.xP,{children:t.username}),(0,v.jsx)(o.xP,{children:t.cwd}),(0,v.jsx)(o.xP,{children:t.note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{b(!1),I(!0),we(e)})(t)}),!t.is_root&&(0,v.jsx)(a.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)("删除完成"),ge(),N({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,v.jsx)(i.VP,{widthPer:50,children:(k||A)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(k?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{b(!1),I(!1),we(void 0)}}),k&&(0,v.jsx)(a.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=Ce(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,x.SK)("创建完成"),ge(),b(!1),I(!1),we(void 0))}}),A&&(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=Ce();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,x.SK)("保存完成"),ge())}})]}),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:[!ue?.access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{H([...T,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:G,handleInputChange:e=>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!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{T[s]=e,H([...T])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{T.splice(s,1),H([...T])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{U([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).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!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,U([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{q.splice(s,1),U([...q])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,v.jsx)(a.rA,{icon:"add",onClick:()=>{D([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).map((t,s)=>(0,v.jsxs)("div",{style:{display:"flex"},children:[(0,v.jsx)("div",{style:{width:"90%"},children:(0,v.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{Z[s]=e,D([...Z])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),D([...Z])},title:e("删除")})]},s)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:W,placeholder:"use blank split",handleInputChange:e=>L(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:Q,placeholder:"use blank split",handleInputChange:e=>J(e)}),!oe&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("label",{children:e("角色")}),(0,v.jsx)(r.l6,{value:de,onChange:e=>{Se(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:""!==ue.language&&void 0!==ue.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:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:_e}),(0,v.jsx)(z,{is_disable:e=>{if(!0===oe)return!0;if(de){const t=P.get(de);if(t)return(t.auth_list??[]).includes(e)}return!1},is_selected:(e,t)=>!t&&!0===oe||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,u.B)(),{initUserInfo:s}=(0,n.useContext)(V.F),[_,m]=(0,n.useState)([]),[j,f]=(0,g.fp)(p.AG.prompt_card),[w,S]=(0,n.useState)(!1),[C,y]=(0,n.useState)(!1),[k,b]=(0,g.fp)(p.AG.confirm),[A,I]=(0,n.useState)(""),[X,N]=(0,n.useState)(""),[K,P]=(0,n.useState)([]),[B,M]=(0,n.useState)([]),[$,G]=(0,n.useState)([]),[E,T]=(0,n.useState)(""),[H,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[D,W]=(0,n.useState)(""),[L,Q]=(0,n.useState)([]),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,F.o)(),se=[e("角色id"),e("角色名"),e("备注")],ne=async()=>{const e=await c.wm.get("all_roles");e.code===d.m.Success&&m(e.data)},ie=e=>{I(e?.role_name??""),N(e?.cwd??""),P(e?.access_dirs??[]),M(e?.not_access_dirs??[]),G(e?.only_read_dirs??[]),T(e?.access_cmd??""),q(e?.not_access_cmd??""),Z(e?.language??""),W(e?.theme??""),Q(e?.auth_list??[]),R(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const le=()=>{if(!A)return void(0,x.zN)("role_name not empty");const e=new l.E0;return e.language=U,e.theme=D,e.access_dirs=K,e.role_name=A,e.not_access_dirs=B,e.only_read_dirs=$,e.cwd=X,e.access_cmd=E,e.not_access_cmd=H,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)(o.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)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{S(!0),y(!1),ie(void 0)}})}),children:(0,v.jsx)(h.X,{headers:se,rows:_.map((t,s)=>{const n=[(0,v.jsx)("p",{children:t.role_id}),(0,v.jsx)(o.xP,{children:t.role_name}),(0,v.jsx)(o.xP,{children:t.role_note}),(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{S(!1),y(!0),ie(e)})(t)}),!t.is_root&&(0,v.jsx)(a.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:(w||C)&&(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e(""+(w?"添加":"编辑"))})," "]}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>{S(!1),y(!1),ie(void 0)}}),w&&(0,v.jsx)(a.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(),S(!1),y(!1),ie(void 0))}}),C&&(0,v.jsx)(a.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)(a.rA,{icon:"add",onClick:()=>{P([...K,""])},title:"添加"}),e("目录范围")]}),(0,v.jsx)(r.Sm,{value:X,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,P([...K])}})}),(0,v.jsx)(a.rA,{icon:"delete",onClick:()=>{K.splice(t,1),P([...K])},title:"删除"})]},t)),(0,v.jsxs)("label",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"delete",onClick:()=>{B.splice(s,1),M([...B])},title:e("删除")})]},s)),(0,v.jsxs)("label",{children:[(0,v.jsx)(a.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)(a.rA,{icon:"delete",onClick:()=>{$.splice(t,1),G([...$])},title:"删除"})]},t)),(0,v.jsx)("label",{children:e("可执行的命令")}),(0,v.jsx)(r.Sm,{value:E,placeholder:"use blank split",handleInputChange:e=>T(e)}),(0,v.jsx)("label",{children:e("禁止执行的命令")}),(0,v.jsx)(r.Sm,{value:H,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,v.jsx)("label",{children:e("语言")}),(0,v.jsx)(r.l6,{value:U,onChange:e=>{Z(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,v.jsx)("label",{children:e("主题")}),(0,v.jsx)(r.l6,{value:D,onChange:e=>{W(e)},options:te}),(0,v.jsx)(z,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==L?.find(t=>t===e),select_auth:e=>{L?(L.find(t=>t==e)?(0,O.I)(L,t=>t===e):L.push(e),Q([...L])):Q([e])}})]})})})]})}function $(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:_}=(0,n.useContext)(V.F),[m,j]=(0,n.useState)([]),[f,w]=(0,g.fp)(p.AG.prompt_card),[C,k]=(0,n.useState)([]),[b,I]=(0,n.useState)([]),[X,N]=(0,n.useState)([]),[O,K]=(0,g.fp)(p.AG.user_base_info),z=(0,S.K)(),P=(0,F.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],M=[e("编号"),e("路径"),e("备注")],$=[e("编号"),e("命令"),e("父编号"),e("备注")],G=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,T]=(0,n.useState)(""),[H,q]=(0,n.useState)(""),[U,Z]=(0,n.useState)(""),[D,W]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,R]=(0,n.useState)(""),[Y,ee]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),I(e.data.quick_cmd),N(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&k(t.data??[])})(),Q(O?.user_data?.language),R(O?.user_data?.theme),ee(O?.user_data?.upload_file_ignore)},[]);const te=(0,F.Q)();return(0,v.jsx)(n.Fragment,{children:(0,v.jsxs)(i.fI,{children:[(0,v.jsxs)(i.VP,{widthPer:33,children:[(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{title:e("修改密码"),rightBottomCom:(0,v.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!H)return void(0,x.zN)("账号密码不能为空");if(H!==U)return void(0,x.zN)("两次密码不一样");const e=new l.tl;e.username=E,e.password=H,e.confirm_password=U,e.user_id=O.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,x.SK)("修改成功")}}),children:[(0,v.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{T(e)}}),(0,v.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{q(e)}}),(0,v.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{Z(e)}})]})}),(0,v.jsx)(i.xh,{children:(0,v.jsxs)(o.Zp,{title:e("个性化设置"),rightBottomCom:(0,v.jsx)(a.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(y.s.setting_sys_option_status_save,{type:A.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:P}),(0,v.jsx)(r.Sm,{value:Y,handleInputChange:e=>{ee(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,v.jsxs)(i.VP,{children:[(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件夹路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("文件夹路径")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,v.jsx)(a.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)("保存成功"),_(),s())}})]}),children:(0,v.jsx)(h.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:z,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("个人保护路径")})," ",(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("保护目录")},title:e("信息")})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{k([...C,{path:"",note:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",C)).code===d.m.Success&&((0,x.SK)("保存成功"),_())}})]}),children:(0,v.jsx)(h.X,{headers:M,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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),k([...C])})(s)})];return n}),width:"10rem"})})]}),(0,v.jsxs)(i.xh,{children:[(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("目录快捷命令")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("目录快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...b,{cmd:"",note:""}])}}),(0,v.jsx)(a.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)(h.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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),I([...b])})(s)})];return n}),width:"10rem"})}),(0,v.jsx)(o.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("文件快捷命令")}),(0,v.jsx)(a.rA,{icon:"info",onClick:()=>{te("文件快捷命令")},title:"info"})]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{N([...X,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,v.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:X})).code===d.m.Success&&((0,x.SK)("保存成功"),s())}})]}),children:(0,v.jsx)(h.X,{headers:G,rows:X.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)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{X.splice(e,1),N([...X])})(s)})];return n}),width:"10rem"})})]})]})]})})}var G=s(87361);function E(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,w.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:()=>h,o:()=>p});var n=s(34843),i=s(82893),l=s(74777),o=s(96540),a=s(86149),r=s(23430),c=s(14284),d=s(74848);function h(){const[e,t]=(0,n.fp)(i.AG.prompt_card),{t:s,i18n:o}=(0,a.B)();return e=>{let n;e===l.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===l.jk.smartmontools?n=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?n=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?n=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?n=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?n=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?n=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?n=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?n=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?n=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(n=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,d.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,d.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,d.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:n})})}}let u=r.Ky;function p(){const[e,t]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];u=[...r.Ky,...s],t(u)}else console.warn("获取主题列表失败,使用默认列表"),t(u)}catch(e){t(u)}})()},[]),e}},6960(e,t,s){s.d(t,{s:()=>o});var n=s(72635);const i=1440,l=525600;function o(e){e=e>1e12?e:1e3*e;const t=Date.now(),s=Math.abs(t-e)/6e4;return s<1?n.Ay.t("小于一分钟"):s<60?`${s.toFixed(0)} ${n.Ay.t("分钟前")}`:s<i?`${(s/60).toFixed(0)} ${n.Ay.t("小时前")}`:s<43200?`${(s/i).toFixed(0)} ${n.Ay.t("天前")}`:s<l?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/l).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
package/build/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.f074592fdc7851278bc0.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
|