filecat 7.1.0 → 7.1.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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2851],{8694(e,t,s){s.d(t,{$K:()=>a,RB:()=>r,l5:()=>i,qB:()=>n,vo:()=>c,vr:()=>l});class n{targetProxyUrl;proxyPort;sysProxyPort}let o=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class a{open=!1;port;key="";async_ips=[]}class c{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=o.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class i{enabled;ip;port;bypass;useForLocal;type}},47996(e,t,s){s.d(t,{d:()=>o});s(96540);var n=s(74848);function o(e){return(0,n.jsxs)("div",{className:"instance-item",children:[(0,n.jsxs)("div",{className:"instance-item__toolbar",children:[(0,n.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>c});var n=s(96540),o=s(61443),a=s(74848);function c(e){const[t,s]=n.useState([]),c=(0,n.useRef)(-1),[r,l]=(0,n.useState)(-1),[i,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const p=()=>{c.current=-1,l(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let c=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(c=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(o.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:c}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(r===s?"row-dragging":"")+(i===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(c.current=s,l(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||c.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=c.current,s=i;p(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:p,children:t.map((s,n)=>{const o=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:o,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},42851(e,t,s){s.r(t),s.d(t,{default:()=>H});var n=s(96540),o=s(75725),a=s(14284),c=s(62042),r=s(53459),l=s(70447),i=s(61443),d=s(85997),p=s(77481),h=s(8694),u=s(14944),x=s(92275),j=s(86149),m=s(4412),v=s(74848);function g(e){const{t}=(0,j.B)(),[s,g]=(0,n.useState)(void 0),[f,y]=(0,n.useState)(!1),[_,S]=(0,n.useState)(""),[w,C]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}`,t("在线状态"),t("选择")]),[k,b]=(0,n.useState)([]),[I,A]=(0,n.useState)({}),[P,U]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new x.hf(x.HK.vir_net_serverIno_get);u.ws.addMsg(x.HK.vir_net_serverIno_get,e=>{(e=>{for(const s of e){const e=s[s.length-1];s[s.length-1]=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,v.jsx)(l.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,v.jsx)(l.xP,{context:s[2],tip_context:s[2]})}})(e.context),b(e.context)}),await u.ws.send(e)})();return(async()=>{const e=await a._U.get("vir/server/get");if(e.code!==r.m.Success)return;const t=e.data;g(t.port),S(t.key),y(t.open)})(),()=>{}},[]);return(0,v.jsxs)("div",{children:[(0,v.jsxs)(m.aZ,{position:"right",children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,v.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await a._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,v.jsx)(o.fI,{children:(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:"",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.$K;e.open=f,e.key=_,P&&(e.async_ips=Object.keys(I)),s&&(e.port=parseInt(s));(await a._U.post("vir/server/save",e)).code===r.m.Success?((0,c.SK)("保存成功"),U(!1)):(0,c.zN)("网络错误")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"port",value:s,handleInputChange:e=>{g(e)}}),(0,v.jsx)(i.Sm,{type:"password",placeholder:"key ",value:_,handleInputChange:e=>{S(e)}}),(0,v.jsxs)("form",{children:[t("状态"),":",(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:f,onchange:()=>{y(!f)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!f,onchange:()=>{y(!f)}})]})]}),!!Object.keys(I).length&&(0,v.jsx)(i.GL,{context:t("sync_sv"),selected:P,onchange:()=>{U(!P)}})]}),(0,v.jsx)(l.Zp,{title:"",children:(0,v.jsx)(p.X,{headers:w,rows:k.map(e=>[...e,(0,v.jsx)(i.GL,{context:t(""),selected:I[e[1]],onchange:()=>{const t={...I};t[e[1]]?delete t[e[1]]:t[e[1]]=e,A(t)}})]),width:"10rem"})})]})})]})}function f(e){const{t}=(0,j.B)(),[s,m]=(0,n.useState)(""),[g,f]=(0,n.useState)(void 0),[y,_]=(0,n.useState)(""),[S,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(void 0),[b,I]=(0,n.useState)(!1),[A,P]=(0,n.useState)(""),[U,F]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await a._U.get("vir/client/get");if(e.code!==r.m.Success)return;const t=e.data;if(k(t.serverPort),_(t.serverIp),m(t.ip),f(t.mask),P(t.key),I(t.open),w(t.client_name),t.open){const e=new x.hf(x.HK.vir_net_client_get),t=(await u.ws.send(e)).context.state;F(t),u.ws.addMsg(x.HK.vir_net_client_get,e=>{F(e.context.state)})}})()},[]);return(0,v.jsx)("div",{children:(0,v.jsx)(o.fI,{children:(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:"",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.vo;e.ip=s,e.mask=parseInt(g),e.key=A,e.serverIp=y,e.serverPort=parseInt(C),e.open=b,e.client_name=S;(await a._U.post("vir/client/save",e)).code===r.m.Success?(0,c.SK)("保存成功"):(0,c.zN)("网络错误")}}),titleCom:(0,v.jsxs)("div",{children:[t("连接状态"),(0,v.jsx)(l.fq,{ok:U})]}),children:[(0,v.jsx)(i.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,v.jsx)(i.Sm,{placeholder:"mask",value:g,handleInputChange:e=>{f(e)}}),(0,v.jsx)(i.Sm,{placeholder:`${t("服务器")} ip`,value:y,handleInputChange:e=>{_(e)}}),(0,v.jsx)(i.Sm,{placeholder:`${t("服务器")} part`,value:C,handleInputChange:e=>{k(e)}}),(0,v.jsx)(i.Sm,{placeholder:"名称 ",value:S,handleInputChange:e=>{w(e)}}),(0,v.jsx)(i.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{P(e)}}),(0,v.jsxs)("form",{children:[t("状态"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,v.jsxs)(l.Zp,{title:"",children:[(0,v.jsx)("div",{children:"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"}),(0,v.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,v.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var y=s(47996),_=s(34843),S=s(82893),w=s(23430),C=s(78247),k=s(21499),b=s(24659),I=s(64694);function A(e){const{t}=(0,j.B)(),[s,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[A,P]=(0,n.useState)(!1),[U,F]=(0,n.useState)(!1),[K,$]=(0,n.useState)({list:[]}),[H,N]=(0,_.fp)(S.AG.editorSetting),[Z,O]=(0,_.fp)(S.AG.user_base_info),B=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[D,E]=(0,n.useState)([]),z=[t("port"),t("ip"),t("type"),t("开启")],[V,M]=(0,n.useState)([]),T=[t("编辑"),t("开启"),t("备注"),t("删除")],X=(0,b.K)(),G=async()=>{const e=[a._U.post("vir/client/tcp_proxy/get"),a._U.post("http/proxy/server/get")];let t;Z.sys===w.XM.mac?t=(async()=>{const e=await a._U.post("http/proxy/get/mac");if(e.code!==r.m.Success)return;const t=[],s=[];for(const n of e.data)"Wi-Fi"===n.name?t.push(n):s.push(n);M([...t,...s])})():Z.sys===w.XM.win&&(t=(async()=>{const e=await a._U.post("http/proxy/get/win");if(e.code===r.m.Success){const t=e.data;u(t.ip),m(t.port),P(t.enabled),f(t.bypass),F(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===r.m.Success&&E(s.data),n.code===r.m.Success&&$(n.data)};(0,n.useEffect)(()=>{G()},[]);return(0,v.jsx)("div",{children:(0,v.jsxs)(o.fI,{children:[Z.sys===w.XM.win&&(0,v.jsx)(o.VP,{widthPer:33,children:(0,v.jsxs)(l.Zp,{title:"Http Proxy",rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new h.l5;e.port=parseInt(x),e.enabled=A,e.useForLocal=U,e.ip=s,e.bypass=g;(await a._U.post("http/proxy/set/win",e)).code===r.m.Success&&(G(),(0,c.SK)("保存成功"))}}),children:[(0,v.jsx)(i.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{u(e)}}),(0,v.jsx)(i.Sm,{placeholder:"port ",value:x,handleInputChange:e=>{m(e)}}),(0,v.jsx)(i.Sm,{placeholder:t("忽略ip"),value:g,handleInputChange:e=>{f(e)}}),(0,v.jsxs)("form",{children:[t("pxy_nln"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:U,onchange:()=>{F(!U)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!U,onchange:()=>{F(!U)}})]})]}),(0,v.jsxs)("form",{children:[t("状态"),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:A,onchange:()=>{P(!A)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!A,onchange:()=>{P(!A)}})]})]})]})}),Z.sys===w.XM.mac&&(0,v.jsx)(o.VP,{children:V.map((e,s)=>(0,v.jsxs)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e.name})," "]}),titleCom:(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=V[e];(await a._U.post("http/proxy/set/mac",[t])).code===r.m.Success&&(G(),(0,c.SK)("保存成功"))})(s)}})}),children:[(0,v.jsx)(p.X,{headers:z,rows:e.proxies.map((e,t)=>{const n=[(0,v.jsx)(i.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,v.jsx)("div",{children:1===e.type?"http":"https"}),(0,v.jsx)(i.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...V];n[e].proxies[t].enabled=s,M(n)})(s,t,e)},options:X,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,v.jsx)(i.Sm,{value:e.bypass,handleInputChange:e=>{V[s].bypass=e},no_border:!0})]},s))}),(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{E([...D,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<D.length;t++)D[t].index=t,e.push(D[t]);(await a._U.post("vir/client/tcp_proxy/save",e)).code===r.m.Success&&((0,c.SK)("保存成功"),G())}})]}),children:(0,v.jsx)(p.X,{headers:B,rows:D.map((e,s)=>{const n=[(0,v.jsx)(i.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,v.jsx)(i.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,v.jsx)(i.l6,{value:e.open,onChange:e=>{D[s].open=e,E([...D])},options:X,no_border:!0}),(0,v.jsx)(i.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{D.splice(e,1),E([...D])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{E((0,I.TI)(D,e,t))}})}),(0,v.jsx)(l.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{K.list.push({open:!1,port:0,note:"",list:[]}),$({...K})}}),(0,v.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await a._U.post("http/proxy/server/save",K)).code===r.m.Success&&(0,c.SK)("保存成功")}})]}),children:K.list.map((e,s)=>(0,v.jsx)(y.d,{title:`${t("端口实例")} #${s+1}`,toolbar:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{children:t("状态")}),(0,v.jsx)(i.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,$({...K})},options:X,no_border:!0}),(0,v.jsx)("span",{children:t("端口")}),(0,v.jsx)(i.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,$({...K})},no_border:!0,width:"80px"}),(0,v.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),$({...K})}}),(0,v.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{K.list.splice(s,1),$({...K})}}),(0,v.jsx)(i.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,$({...K})},no_border:!0})]}),children:(0,v.jsx)(p.X,{headers:T,rows:e.list.map((n,o)=>{const c=[(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=K.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,k.hU)(),$({...K}));const o=await a._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});N({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{0===(await a._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})).code&&(C.xK.set_value_temp(""),N({open:!1,model:"",fileName:"",save:null}))}}),C.xK.set_value_temp(o.data)})(s,o)}})}),(0,v.jsx)(i.l6,{value:n.open,onChange:t=>{e.list[o].open=t,$({...K})},options:X,no_border:!0}),(0,v.jsx)(i.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,v.jsx)("div",{children:(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(o,1),$({...K})}})})];return c}),width:"10rem"})},s))})]})]})})}var P=s(87361),U=s(82726),F=s(83529);function K(e){const{t}=(0,j.B)(),[s,h]=(0,n.useState)([]),[u,x]=(0,n.useState)([]),[g,f]=(0,n.useState)(""),[y,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(!1),[b,I]=(0,_.fp)(S.AG.showPrompt),[A,P]=(0,_.fp)(S.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await a.ez.get("ips/dnspod");if(e.code!==r.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);h(s),x(n),t.account&&(f(t.account.id),w(t.account.token)),k(t.isOpen)})()},[]);const K=async e=>{P({open:!0,handle:async()=>{0===(await a.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),P({open:!1,handle:null})},title:t("确定删除吗")})};return(0,v.jsxs)("div",{children:[(0,v.jsx)(m.aZ,{position:"right",children:(0,v.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:F.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,v.jsxs)(o.fI,{children:[(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===U.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,v.jsx)(l.Zp,{title:"ipv6",children:u.length>0&&u.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===U.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:t("账号设置"),rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(C&&(!g||!y))return void(0,c.zN)("id和token都不能为空");const e=new U.yL,t=[];for(const e of[...s,...u])e.ddnsHost&&t.push(e);e.ips=t,e.account={id:g,token:y},e.isOpen=C,e.ddnsType=U.E2.dnspod;(await a.ez.post("save",e)).code===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("success")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"ID",value:g,handleInputChange:e=>{f(e)}}),(0,v.jsx)(i.cA,{placeholder:"TOKEN",value:y,handleInputChange:e=>{w(e)}}),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:C,onchange:()=>{k(!C)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]}),(0,v.jsx)(l.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function $(e){const{t}=(0,j.B)(),[s,h]=(0,n.useState)([]),[u,x]=(0,n.useState)([]),[g,f]=(0,n.useState)(""),[y,w]=(0,n.useState)(""),[C,k]=(0,n.useState)(!1),[b,I]=(0,_.fp)(S.AG.showPrompt),[A,P]=(0,_.fp)(S.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await a.ez.get("ips/tx");if(e.code!==r.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);h(s),x(n),t.account&&(f(t.account.secretid),w(t.account.secretkey)),k(t.isOpen)})()},[]);const K=async e=>{P({open:!0,handle:async()=>{0===(await a.ez.post("http/del",e)).code&&(0,c.SK)("删除成功,稍后请刷新"),P({open:!1,handle:null})},title:t("确定删除吗")})};return(0,v.jsxs)("div",{children:[(0,v.jsx)(m.aZ,{position:"right",children:(0,v.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:F.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,v.jsxs)(o.fI,{children:[(0,v.jsxs)(o.VP,{children:[(0,v.jsx)(l.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===U.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,v.jsx)(l.Zp,{title:"ipv6",children:u.length>0&&u.map((e,s)=>(0,v.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,v.jsx)(i.Sm,{right_placeholder:(0,v.jsx)("div",{children:e.source_type===U.tC.http_get&&(0,v.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{K(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,v.jsxs)(o.VP,{children:[(0,v.jsxs)(l.Zp,{title:t("账号设置"),rightBottomCom:(0,v.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(C&&(!g||!y))return void(0,c.zN)("SecretId和SecretKey都不能为空");const e=new U.yL,t=[];for(const e of[...s,...u])e.ddnsHost&&t.push(e);e.ips=t,e.account={secretid:g,secretkey:y},e.isOpen=C,e.ddnsType=U.E2.tengxun;(await a.ez.post("save",e)).code===r.m.DdnsAuthFail?(0,c.zN)("鉴权失败"):(0,c.SK)("成功")}}),children:[(0,v.jsx)(i.Sm,{placeholder:"SecretId",value:g,handleInputChange:e=>{f(e)}}),(0,v.jsx)(i.cA,{placeholder:"SecretKey",value:y,handleInputChange:e=>{w(e)}}),(0,v.jsx)(p.S,{isFlex:!0,columns:[(0,v.jsx)(i.U6,{value:1,context:t("开启"),selected:C,onchange:()=>{k(!C)}}),(0,v.jsx)(i.U6,{value:1,context:t("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]}),(0,v.jsx)(l.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function H(){const{t:e}=(0,j.B)(),{check_user_auth:t}=(0,C.MH)(),s=[];return t(w.oV.vir_net)&&s.push({index:1,name:e("系统代理"),rto:"proxy_sys/",component:(0,v.jsx)(A,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,v.jsx)(f,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,v.jsx)(g,{})}),t(w.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,v.jsx)(K,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,v.jsx)($,{})}),(0,v.jsx)(o.W1,{optionList:s,father_route:P.o.net})}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3328],{77481(e,t,s){s.d(t,{S:()=>o,X:()=>l});var n=s(96540),i=s(61443),a=s(74848);function l(e){const[t,s]=n.useState([]),l=(0,n.useRef)(-1),[o,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const h=()=>{l.current=-1,r(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let l=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(l=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(o===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(l.current=s,r(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=l.current,s=c;h(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:h,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function o(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},53328(e,t,s){s.r(t),s.d(t,{default:()=>U});var n=s(96540),i=s(75725),a=s(23430),l=s(70447),o=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),x=s(40505),_=s(62042),m=s(21499),j=s(21469),v=s(64694),f=s(74848);function g(e){const{t}=(0,u.B)(),[s,a]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();a(t)}})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e.title}),e.info_click&&(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");a([t,...s])}}),(0,f.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,f.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const l=[];for(let t=0;t<e.headers.length;t++)l.push((0,f.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,a([...s])},no_border:!0}));return l.push((0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),a([...s])})(i)}),n[0]&&(0,f.jsx)(o.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,x.lW)(e),(0,_.SK)(e)}}),n[0]&&e.need_copy&&(0,f.jsx)(o.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),l}),width:"10rem",onRowDrag:(e,t)=>{a((0,v.TI)(s,e,t))}})})})}var w=s(34843),S=s(78247),y=s(24659);function C(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),a=(0,y.K)(),g=[e("路由"),e("auth"),e("备注")],[C,k]=(0,w.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&A(e.data)})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("api_rt")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([{note:"",needAuth:!1,router:""},...b])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",b)).code===d.m.Success&&(0,_.SK)("保存成功")}})]}),children:(0,f.jsx)(h.X,{headers:g,rows:b.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,A([...b])},no_border:!0}),(0,f.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,A([...b])},options:a,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,A([...b])},no_border:!0}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)}),(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,_.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);k({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&&(S.xK.set_value_temp(""),k({open:!1,model:"",fileName:"",save:null}),(0,_.SK)("成功"))}}),S.xK.set_value_temp(t.data)})(t)}),t.router&&(0,f.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,x.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,_.SK)(e("已复制"))}})]})];return n}),width:"10rem",onRowDrag:(e,t)=>{A((0,v.TI)(b,e,t))}})})})}var k=s(23496),b=s(4412);function A(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),[a,l]=(0,w.fp)(p.AG.router_jump),o=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(b.aZ,{position:"right"}),(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{maxWidth:"50rem",children:[(0,f.jsx)(g,{title:e("页面资源路由"),headers:o,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_router);if(e.code===d.m.Success){if(a?.page_self_router_api_data){for(const t of e.data)t[1]===a?.page_self_router_api_data[1]&&(0,_.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,a?.page_self_router_api_data),e.data=[t,...e.data],l({})}return e.data}return[]},save:async e=>{(await c.XO.post(k.s.setting_customer_router_save,e)).code===d.m.Success&&(0,_.SK)("success")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})},need_copy:!0}),(0,f.jsx)(g,{title:e("wf_rt"),headers:r,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(k.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,_.SK)("保存成功")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})}})]}),(0,f.jsx)(i.VP,{maxWidth:"50rem",children:(0,f.jsx)(C,{})})]})]})}var I=s(74777),V=s(6960),N=s(7523);function K(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),[s,i]=(0,n.useState)(!1),[h,x]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[v,g]=(0,n.useState)(180),[y,C]=(0,n.useState)(!1),[k,b]=(0,w.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),x(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),g(t.check_interval_seconds||180)}})()},[]);return t(a.oV.sys_setting_page)?(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自动升级")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,f.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,_.zN)(e("ver_req"));if(s&&(!v||v<10))return void(0,_.zN)(e("chk_10s"));const t=new I.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=v;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,_.SK)(e("保存成功"))}}),children:[(0,f.jsx)("div",{children:e("ver_url")}),(0,f.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{x(e)}}),(0,f.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,f.jsxs)(f.Fragment,{children:[!1,(0,f.jsx)("div",{children:e("检测频率(秒)")}),(0,f.jsx)(r.Sm,{placeholder:e("def_180"),value:v,handleInputChange:e=>{g(Number(e)||180)}}),(0,f.jsx)("div",{style:{marginTop:"12px"},children:(0,f.jsx)(o.C3,{text:e(y?"升级检测中...":"立即升级"),clickFun:async()=>{C(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,_.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,_.zN)(e("触发升级失败"))}finally{C(!1)}}})})]})]}):null}function X(){const[e,t]=(0,n.useState)(""),[s,a]=(0,n.useState)(""),[x,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),[C,A]=(0,n.useState)(""),[X,z]=(0,w.fp)(p.AG.prompt_card),[F,O]=(0,n.useState)(!1),[P,$]=(0,n.useState)(""),[B,D]=(0,n.useState)(""),[M,T]=(0,n.useState)(I.aM.close),[E,G]=(0,n.useState)(!1),[q,W]=(0,n.useState)(void 0),{t:Z,i18n:R}=(0,u.B)(),[U,H]=(0,w.fp)(p.AG.user_base_info),{check_user_auth:L}=(0,S.MH)(),{initUserInfo:Q}=(0,n.useContext)(N.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){y(e.data.recycle_open),A(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),a(s?.logo||""),m(s?.show_login_user_info),v(s?.http_proxy||"");const n=e.data.https_setting;n&&(O(n.open),$(n.cert_path||""),D(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&&W(e.length),e.mode&&T(e.mode),void 0!==e.persist&&G(e.persist)}})()},[]);return(0,f.jsxs)("div",{children:[(0,f.jsx)(b.aZ,{children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"credits",children:[Z("系统运行于"),": ",(0,V.s)(U.runing_time_length)]}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:7.1.0",null!=U.latest_version&&"7.1.0"!==U.latest_version?` -> ${U.latest_version}`:""]})}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsx)("a",{href:Z("官网地址"),target:"_blank",children:`filecat ${Z("功能文档")}`})}),(0,f.jsxs)("span",{className:"credits",children:[Z("安装方式")," :",U.process_env_run_env]})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:Z("通用设置")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:Z("信息"),context_div:(0,f.jsx)("div",{children:Z("pxy_tip")})})},title:Z("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:x,http_proxy:j,logo:s}})).code===d.m.Success&&((0,_.SK)("修改成功"),Q())}}),children:[Z("网站标题"),(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),Z("网站 Logo"),(0,f.jsx)(r.Sm,{placeholder:Z("lclorur"),value:s,handleInputChange:e=>{a(e)}}),(0,f.jsx)("div",{children:Z("pxy_url")}),(0,f.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:j,handleInputChange:e=>{v(e)}}),Z("lgn_usr"),(0,f.jsx)("input",{type:"checkbox",checked:x,onChange:()=>{m(!x)}})]}),(0,f.jsxs)(l.Zp,{title:Z("https_s"),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{if(F){if(!P)return void(0,_.zN)("证书路径不能为空");if(!B)return void(0,_.zN)("私钥路径不能为空")}const e=new I.CH;e.open=F,e.cert_path=P,e.key_path=B;(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:F})).code===d.m.Success&&(0,_.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,f.jsx)(r.l6,{value:F,onChange:e=>{O(e)},options:[{title:Z("开启"),value:!0},{title:Z("关闭"),value:!1}]}),F&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:Z("ssl_crt")}),(0,f.jsx)(r.Sm,{placeholder:Z("crt_pth"),value:P,handleInputChange:e=>{$(e)}}),(0,f.jsx)("div",{children:Z("ssl_key")}),(0,f.jsx)(r.Sm,{placeholder:Z("ky_pth"),value:B,handleInputChange:e=>{D(e)}})]})]}),(0,f.jsx)(K,{})]}),(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:Z("文件回收站")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:Z("信息"),context_div:(0,f.jsx)("div",{children:Z("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:Z("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{if(g&&!C)return void(0,_.zN)("目录不能为空");(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:C,open:g})).code===d.m.Success&&(0,_.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:Z("目录"),value:C,handleInputChange:e=>{A(e)}}),(0,f.jsx)(r.l6,{value:g,onChange:e=>{y(e)},options:[{title:Z("开启"),value:!0},{title:Z("关闭"),value:!1}]})]}),(0,f.jsxs)(l.Zp,{title:Z("tk_exp"),rightBottomCom:(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(o.C3,{text:Z("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,_.SK)("清理完成,重新登录")}}),(0,f.jsx)(o.C3,{text:Z("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=M,e.persist=E,I.aM.length!==e.mode||q||(0,_.zN)("秒数不能为空"),e.length=parseInt(q);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,_.SK)("保存成功")}})]}),children:[(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(r.U6,{value:1,context:Z("关闭"),selected:M===I.aM.close,onchange:()=>{T(I.aM.close)}}),(0,f.jsx)(r.U6,{value:1,context:Z("指定时间"),selected:M===I.aM.length,onchange:()=>{T(I.aM.length)}}),(0,f.jsx)(r.U6,{value:1,context:Z("永不过期"),selected:M===I.aM.forver,onchange:()=>{T(I.aM.forver)}})]}),M===I.aM.length&&(0,f.jsx)(r.Sm,{placeholder:Z("秒"),value:q,handleInputChange:e=>{W(e)}}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:E,onChange:()=>G(!E)}),Z("持久化")]})]})]})]})})]})}var z=s(92350);function F(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:a}=(0,n.useContext)(N.F),[x,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[C,k]=(0,w.fp)(p.AG.prompt_card),[,b]=(0,w.fp)(p.AG.editorSetting),[A,I]=(0,n.useState)([]),[V,K]=(0,n.useState)([]),[X,F]=(0,n.useState)([]),[O,P]=(0,n.useState)([]),[$,B]=(0,n.useState)(""),[D,M]=(0,n.useState)([]),T=(0,y.K)(),E=[e("软件"),e("是否安装"),e("路径")],G=[e("编号"),e("路径"),e("备注")],q=[e("编号"),e("路径"),e("是否开启"),e("备注")],W=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("big_res"),e("big_sz"),e("大文件并发数量"),e("big_ck"),e("备注")],R=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:U}=(0,S.MH)(),H=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&F(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&g(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&B(t.data),H(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&I(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&K(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&M(i.data??[])})()},[]);const Q=(0,z.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",D)).code===d.m.Success&&(0,_.SK)(e("保存成功"))};return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("up_conc")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...V,{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,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of V)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,_.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,_.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,_.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,v.di)(V,e=>e.index??0);(await c.XO.post("dir_upload_max_num/save",V)).code===d.m.Success&&((0,_.SK)("保存成功"),a())}})]}),children:(0,f.jsx)(h.X,{headers:Z,rows:V.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,K([...V])},options:T,no_border:!0}),(0,f.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,f.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,f.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,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),K([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{K((0,v.TI)(V,e,t))}})})}),(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PATH")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?k({open:!0,title:e("进程环境变量"),context_div:(0,f.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,_.zN)(e("获取失败"))}}),(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(S.xK.set_value_temp(t.data??""),b({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,_.SK)(e("保存成功")):(0,_.zN)(e("保存失败")),S.xK.set_value_temp("")}})):(0,_.zN)(e("获取失败"))}}),(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{F([...X,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:X})).code===d.m.Success&&((0,_.SK)("保存成功"),H(),s())}})]}),children:(0,f.jsx)(h.X,{headers:q,rows:X.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,F([...X])},options:T,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{X.splice(e,1),F([...X])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{F((0,v.TI)(X,e,t))}})}),(0,f.jsx)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PTY CMD")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:$})).code===d.m.Success&&((0,_.SK)("保存成功"),a())}}),children:(0,f.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:$,handleInputChange:e=>{B(e)}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("Workflow Job")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...O,{open:!1}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",O)).code===d.m.Success&&((0,_.SK)("ok"),L())}})]}),children:(0,f.jsx)(h.X,{headers:W,rows:O.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...O])},options:T,no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...O])},options:T,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),P([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,v.TI)(O,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("插件配置")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...D,{name:"",path:"",note:"",open:!1}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,f.jsx)(h.X,{headers:R,rows:D.map((t,s)=>{const n=[s,(0,f.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,M([...D])},options:T,no_border:!0}),(0,f.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{D.splice(e,1),M([...D])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{M((0,v.TI)(D,e,t))}})})]})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("系统保护路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",A)).code===d.m.Success&&((0,_.SK)("保存成功"),a())}})]}),children:(0,f.jsx)(h.X,{headers:G,rows:A.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{I((0,v.TI)(A,e,t))}})}),(0,f.jsx)(l.uF,{title:e("外部软件"),titleCom:(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,_.SK)("保存成功"),s())}}),children:(0,f.jsx)(h.X,{headers:E,rows:j.map((t,s)=>[(0,f.jsx)("div",{children:t.id}),(0,f.jsx)(l.fq,{ok:t.installed}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("use_env")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function O(e){const{t,i18n:s}=(0,u.B)(),[i,l]=(0,w.fp)(p.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:a.oV.user_manage},{title:t("角色管理"),permission:a.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:a.oV.all_sys},{title:t("系统进程关闭"),permission:a.oV.sys_process_close},{title:t("dc_ctdl"),permission:a.oV.docker_container_update},{title:t("dc_idl"),permission:a.oV.docker_images_delete},{title:t("systemd管理"),permission:a.oV.systemd},{title:t("防火墙管理"),permission:a.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:a.oV.vir_net},{title:t("内网穿透"),permission:a.oV.tcp_proxy},{title:"ddns",permission:a.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:a.oV.ai_agent_setting},{title:t("ai_page"),permission:a.oV.ai_agent_page},{title:t("sw_mdl"),permission:a.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("log_del"),permission:a.oV.filecat_file_delete_cut_rename},{title:t("log_wr"),permission:a.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:a.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:a.oV.recycle_file_save},{title:t("文件分享"),permission:a.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:a.oV.sys_setting_page},{title:t("htts"),permission:a.oV.https_file},{title:t("tk_time"),permission:a.oV.token_update},{title:t("修改密码"),permission:a.oV.update_password},{title:t("磁盘挂载"),permission:a.oV.sys_disk_mount},{title:t("通用设置"),permission:a.oV.sys_env_setting_key},{title:t("md_set"),permission:a.oV.md_editor_setting},{title:t("目录挂载"),permission:a.oV.file_mount}]},{title:t("系统环境设置"),list:[{title:t("sys_env"),permission:a.oV.sys_env_page},{title:t("up_lim"),permission:a.oV.dir_upload_max_num},{title:t("path_md"),permission:a.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:a.oV.pty_cmd_update},{title:"workflow job",permission:a.oV.workflow_job},{title:t("path_up"),permission:a.oV.sys_protection_dir},{title:t("外部软件路径"),permission:a.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:a.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:a.oV.auth_router_page},{title:t("wf_api"),permission:a.oV.workflow_api},{title:t("自定义资源路由"),permission:a.oV.code_resource},{title:t("api_rt"),permission:a.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:a.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:a.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:a.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:a.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy},{title:t("http代理"),permission:a.oV.http_proxy},{title:t("pxy_off"),permission:a.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:a.oV.browser_proxy},{title:t("rdp代理"),permission:a.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("wf_run"),permission:a.oV.workflow_exe},{title:t("wf_user"),permission:a.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:a.oV.wol_proxy},{title:t("端口扫描"),permission:a.oV.port_scan},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy},{title:t("ssh_sv"),permission:a.oV.crypto_ssh_file},{title:t("cmd_rst"),permission:a.oV.shell_cmd_filecat_restart},{title:t("cmd_upg"),permission:a.oV.shell_cmd_filecat_upgrade},{title:t("cmd_dwn"),permission:a.oV.shell_cmd_filecat_kill_self},{title:t("cmd_ai"),permission:a.oV.ai_chat_cmd}]}];return(0,f.jsx)(n.Fragment,{children:o.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.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 $(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(N.F),[j,g]=(0,w.fp)(p.AG.user_base_info),[S,y]=(0,n.useState)([]),[C,k]=(0,w.fp)(p.AG.prompt_card),[b,A]=(0,n.useState)(!1),[I,V]=(0,n.useState)(!1),[K,X]=(0,w.fp)(p.AG.confirm),[F,$]=(0,n.useState)(""),[B,D]=(0,n.useState)(""),[M,T]=(0,n.useState)(""),[E,G]=(0,n.useState)([]),[q,W]=(0,n.useState)([]),[Z,R]=(0,n.useState)([]),[U,H]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,ae]=(0,n.useState)(""),[le,oe]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),xe=(0,z.o)(),[_e,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);y(e)}else y(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=>{$(e?.username??""),D(e?.password??""),T(e?.cwd??""),G(e?.access_dirs??[]),W(e?.not_access_dirs??[]),R(e?.only_read_dirs??[]),H(e?.access_cmd??""),Q(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),ae(e?.note??""),oe(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&&T(s.cwd),s.access_dirs&&s.access_dirs.length>0&&G(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&W(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&R(s.only_read_dirs),s.access_cmd&&H(s.access_cmd),s.not_access_cmd&&Q(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)}},ye=()=>{if(!F)return void(0,_.zN)("username not empty");if((0,m.CB)(F))return void(0,_.zN)("username not empty char");if(!M)return void(0,_.zN)("cwd not empty");const e=new a.E0;return e.language=J,e.theme=ee,e.access_dirs=E,e.username=F,e.password=B,e.not_access_dirs=q,e.only_read_dirs=Z,e.cwd=M,e.note=ie,e.access_cmd=U,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=de,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("用户")})}),titleCom:(0,f.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,f.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A(!0),V(!1),we(void 0)}})]}),children:(0,f.jsx)(h.X,{headers:fe,rows:S.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.id}),(0,f.jsx)(l.xP,{children:t.username}),(0,f.jsx)(l.xP,{children:t.cwd}),(0,f.jsx)(l.xP,{children:t.note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{A(!1),V(!0),we(e)})(t)}),!t.is_root&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{X({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new a.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,_.SK)("删除完成"),ge(),X({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(b||I)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(b?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{A(!1),V(!1),we(void 0)}}),b&&(0,f.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!B)return void(0,_.zN)("password not empty");if((0,m.CB)(B))return void(0,_.zN)("username not empty char");const e=ye(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,_.SK)("创建完成"),ge(),A(!1),V(!1),we(void 0))}}),I&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ye();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,_.SK)("保存完成"),ge())}})]}),children:[(0,f.jsx)("label",{children:e("用户名")}),(0,f.jsx)(r.Sm,{value:F,handleInputChange:e=>$(e)}),(0,f.jsx)("label",{children:e("密码")}),(0,f.jsx)(r.Sm,{type:"password",value:B,handleInputChange:e=>D(e)}),(0,f.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{G([...E,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:M,handleInputChange:e=>T(e)}),(E??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,G([...E])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),G([...E])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{W([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,W([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{q.splice(s,1),W([...q])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{R([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{Z[s]=e,R([...Z])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),R([...Z])},title:e("删除")})]},s)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:U,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>Q(e)}),!le&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("label",{children:e("角色")}),(0,f.jsx)(r.l6,{value:de,onChange:e=>{Se(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of _e)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:J,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:xe}),(0,f.jsx)(O,{is_disable:e=>{if(!0===le)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===le||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,v.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,f.jsx)("label",{children:e("备注")}),(0,f.jsx)(r.Sm,{value:ie,handleInputChange:e=>ae(e)})]})})})]})}function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s}=(0,n.useContext)(N.F),[x,m]=(0,n.useState)([]),[j,g]=(0,w.fp)(p.AG.prompt_card),[S,y]=(0,n.useState)(!1),[C,k]=(0,n.useState)(!1),[b,A]=(0,w.fp)(p.AG.confirm),[I,V]=(0,n.useState)(""),[K,X]=(0,n.useState)(""),[F,P]=(0,n.useState)([]),[$,B]=(0,n.useState)([]),[D,M]=(0,n.useState)([]),[T,E]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[W,Z]=(0,n.useState)(""),[R,U]=(0,n.useState)(""),[H,L]=(0,n.useState)([]),[Q,J]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,z.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=>{V(e?.role_name??""),X(e?.cwd??""),P(e?.access_dirs??[]),B(e?.not_access_dirs??[]),M(e?.only_read_dirs??[]),E(e?.access_cmd??""),q(e?.not_access_cmd??""),Z(e?.language??""),U(e?.theme??""),L(e?.auth_list??[]),J(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const ae=()=>{if(!I)return void(0,_.zN)("role_name not empty");const e=new a.E0;return e.language=W,e.theme=R,e.access_dirs=F,e.role_name=I,e.not_access_dirs=$,e.only_read_dirs=D,e.cwd=K,e.access_cmd=T,e.not_access_cmd=G,e.auth_list=H,e.role_note=Y,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("角色")})}),titleCom:(0,f.jsx)("div",{children:(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{y(!0),k(!1),ie(void 0)}})}),children:(0,f.jsx)(h.X,{headers:se,rows:x.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.role_id}),(0,f.jsx)(l.xP,{children:t.role_name}),(0,f.jsx)(l.xP,{children:t.role_note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{y(!1),k(!0),ie(e)})(t)}),!t.is_root&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{A({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new a.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,_.SK)("删除完成"),ne(),A({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(S||C)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{y(!1),k(!1),ie(void 0)}}),S&&(0,f.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=ae();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,_.SK)("创建完成"),ne(),y(!1),k(!1),ie(void 0))}}),C&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ae();if(!e)return;e.role_id=Q;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,_.SK)("保存完成"),ne())}})]}),children:[(0,f.jsx)("label",{children:e("角色名")}),(0,f.jsx)(r.Sm,{value:I,handleInputChange:e=>V(e)}),(0,f.jsx)("label",{children:e("角色备注")}),(0,f.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{P([...F,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{value:K,handleInputChange:e=>X(e)}),(F??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{F[t]=e,P([...F])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{F.splice(t,1),P([...F])},title:"删除"})]},t)),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{B([...$,""])},title:"添加"}),e("禁止目录范围")]}),($??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:t,handleInputChange:e=>{$[s]=e,B([...$])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{$.splice(s,1),B([...$])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{M([...D,""])},title:e("添加")}),e("只读目录范围")]}),(D??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{D[t]=e,M([...D])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{D.splice(t,1),M([...D])},title:"删除"})]},t)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{value:T,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{value:G,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{value:W,onChange:e=>{Z(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{value:R,onChange:e=>{U(e)},options:te}),(0,f.jsx)(O,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==H?.find(t=>t===e),select_auth:e=>{H?(H.find(t=>t==e)?(0,v.I)(H,t=>t===e):H.push(e),L([...H])):L([e])}})]})})})]})}function D(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(N.F),[m,j]=(0,n.useState)([]),[g,S]=(0,w.fp)(p.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,V]=(0,n.useState)([]),[K,X]=(0,n.useState)([]),[F,O]=(0,w.fp)(p.AG.user_base_info),P=(0,y.K)(),$=(0,z.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],D=[e("编号"),e("路径"),e("备注")],M=[e("编号"),e("命令"),e("父编号"),e("备注")],T=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,G]=(0,n.useState)(""),[q,W]=(0,n.useState)(""),[Z,R]=(0,n.useState)(""),[U,H]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),V(e.data.quick_cmd),X(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&b(t.data??[])})(),Q(F?.user_data?.language),Y(F?.user_data?.theme),te(F?.user_data?.upload_file_ignore)},[]);const se=(0,z.Q)();return(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{title:e("修改密码"),rightBottomCom:(0,f.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!q)return void(0,_.zN)("账号密码不能为空");if(q!==Z)return void(0,_.zN)("两次密码不一样");const e=new a.tl;e.username=E,e.password=q,e.confirm_password=Z,e.user_id=F.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,_.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{G(e)}}),(0,f.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{W(e)}}),(0,f.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{R(e)}})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{title:e("个性化设置"),rightBottomCom:(0,f.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:ee}})).code===d.m.Success&&((0,_.SK)("修改成功"),s())}}),children:[e("语言"),(0,f.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,f.jsx)(r.l6,{value:J,onChange:e=>{Y(e)},options:$}),(0,f.jsx)(r.Sm,{value:ee,handleInputChange:e=>{te(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,f.jsxs)(i.VP,{children:[(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件夹路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("文件夹路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,_.SK)("保存成功"),x(),s())}})]}),children:(0,f.jsx)(h.X,{headers:B,rows:m.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)("div",{children:0!==s&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&j((0,v.TI)(m,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("个人保护路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...C,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",C)).code===d.m.Success&&((0,_.SK)("保存成功"),x())}})]}),children:(0,f.jsx)(h.X,{headers:D,rows:C.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{b((0,v.TI)(C,e,t))}})})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("目录快捷命令")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("目录快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...A,{cmd:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:A})).code===d.m.Success&&((0,_.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:M,rows:A.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),V([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,v.TI)(A,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件快捷命令")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("文件快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...K,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:K})).code===d.m.Success&&((0,_.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:T,rows:K.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{K.splice(e,1),X([...K])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{X((0,v.TI)(K,e,t))}})})]})]})]})})}const M=["password","private_key","secret_key"],T="webdav";function E(){const{t:e}=(0,u.B)(),[,t]=(0,w.fp)(p.AG.prompt_card),[s,i]=(0,n.useState)([]),[a,d]=(0,n.useState)([]),[x,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,S]=(0,n.useState)(T),[y,C]=(0,n.useState)(""),[k,b]=(0,n.useState)({}),[A,I]=(0,n.useState)(!1),V=async()=>{try{const[e,t]=await Promise.all([c.I2.post("credential/list",{}),c.I2.post("credential/meta",{})]);i(Array.isArray(e?.data)?e.data:[]),d(Array.isArray(t?.data)?t.data:[])}catch(e){}};(0,n.useEffect)(()=>{V()},[]);const N=a.find(e=>e.type===g)?.fields??[],K=()=>{m(!1),v(""),S(T),C(""),b({}),I(!1)};return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("普通凭据管理")}),(0,f.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{t({open:!0,title:e("信息"),context_div:(0,f.jsxs)("div",{children:[(0,f.jsxs)("ul",{children:[(0,f.jsx)("li",{children:e("crd_tp")}),(0,f.jsx)("li",{children:e("bidacct")}),(0,f.jsx)("li",{children:e("pwdkept")}),(0,f.jsx)("li",{children:e("tstbfrs")})]}),(0,f.jsxs)("ul",{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"WebDAV"}),":",e("prtwbdv")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"SSH / SFTP"}),":",e("prtsftp")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"S3 兼容对象存储"}),":",e("prt_s3")]})]})]})})}})]}),rightBottomCom:(0,f.jsxs)("div",{children:[!x&&(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{K(),m(!0)}}),x&&(0,f.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{try{const t=await c.I2.post("credential/test",{id:j||void 0,type:g,config:k}),s=t?.data;s?.ok?(0,_.SK)(`${e("连接成功")}(${s.count??0})`):(0,_.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}}}),x&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(y.trim()){for(const t of N){const s=String(k[t.key]??"").trim()||j&&M.includes(t.key);if(t.required&&!s)return void(0,_.zN)(`${e("请填写")}${e(t.label)}`)}try{await c.I2.post(j?"credential/update":"credential/add",{id:j||void 0,type:g,name:y,config:k,enabled:!0}),(0,_.SK)(e("保存成功")),K(),await V()}catch(e){}}else(0,_.zN)(e("请填写名称"))}}),x&&(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:K})]}),children:[x&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.Sm,{placeholder:e("名称"),value:y,handleInputChange:C}),(0,f.jsx)(r.l6,{value:g,options:a.map(e=>({title:e.name,value:e.type})),onChange:e=>{S(e),b({})}}),N.map(t=>(0,f.jsx)(n.Fragment,{children:(0,f.jsx)(r.Sm,{type:M.includes(t.key)?"password":"text",placeholder:M.includes(t.key)&&A?e("留空表示不修改"):t.label,value:k[t.key]??"",handleInputChange:e=>b({...k,[t.key]:e})})},t.key))]}),!x&&(0,f.jsx)(h.X,{headers:[e("名称"),e("类型"),e("操作")],rows:s.map(t=>{return[(0,f.jsx)(l.xP,{context:t.name}),(0,f.jsx)(l.xP,{context:(s=t.type,a.find(e=>e.type===s)?.name??s)}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{m(!0),v(e.id),S(e.type),C(e.name??""),b({...e.config??{}}),I(Boolean(e.has_password))})(t)}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{try{await c.I2.post("credential/delete",{id:t.id}),(0,_.SK)(e("已删除")),await V()}catch(e){}})(t)})]})];var s})})]})}var G=s(17903);function q(){const{t:e}=(0,u.B)(),[t,s]=(0,n.useState)([]),[i,a]=(0,n.useState)([]),[d,p]=(0,n.useState)([]),[x,m]=(0,n.useState)([]),[j,v]=(0,n.useState)(!1),[g,w]=(0,n.useState)(""),[S,y]=(0,n.useState)("webdav"),[C,k]=(0,n.useState)(""),[b,A]=(0,n.useState)(""),[I,V]=(0,n.useState)(""),[N,K]=(0,n.useState)(""),X=async()=>{try{const[e,t,n,i]=await Promise.all([c.I2.post("list",{}),c.I2.post("credential/list",{}),c.I2.post("driver/list",{}),c.I2.post("baidu/app/get",{})]);s(Array.isArray(e?.data)?e.data:[]),a(Array.isArray(t?.data)?t.data:[]),p(Array.isArray(n?.data)?n.data:[]),m(Array.isArray(i?.data?.accounts)?i.data.accounts:[])}catch(e){}};(0,n.useEffect)(()=>{X()},[]);const z=()=>{v(!1),w(""),y("webdav"),k(""),A(""),V(""),K("")};return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("挂载列表")})}),rightBottomCom:(0,f.jsxs)("div",{children:[!j&&(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{z(),v(!0)}}),j&&(0,f.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{if(b)try{const t=await c.I2.post("test",{id:g||void 0,driver:S,credential_id:b,root_dir:I}),s=t?.data;s?.ok?(0,_.SK)(`${e("连接成功")}(${s.count??0})`):(0,_.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}else(0,_.zN)(e("请选择凭据"))}}),j&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(b)if(C.trim())try{await c.I2.post(g?"update":"add",{id:g||void 0,driver:S,mount_path:C,credential_id:b,root_dir:I,name:N,color:G.OT,readonly:!1,enabled:!0}),(0,_.SK)(e("保存成功")),z(),await X()}catch(e){}else(0,_.zN)(e("munt_rq"));else(0,_.zN)(e("请选择凭据"))}}),j&&(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:z})]}),children:[j&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.BC,{label:e("挂载类型"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:S,options:d.map(e=>({title:e.name,value:e.type})),onChange:e=>{y(e),A("")}})}),(0,f.jsx)(r.BC,{label:e("凭据"),label_width:"6rem",required:!0,children:(0,f.jsx)(r.l6,{value:b,options:(e=>{if("baidu"===e)return x.map(e=>({title:e.name||e.baidu_name||String(e.uk),value:String(e.uk)}));const t=G.UW[e];return i.filter(e=>!t||e.type===t).map(e=>({title:e.name,value:e.id}))})(S),onChange:A})}),(0,f.jsx)(r.BC,{label:e("本地目录"),label_width:"6rem",required:!0,children:(0,f.jsx)(r.Sm,{placeholder:e("被挂载的本地绝对路径"),value:C,handleInputChange:k})}),(0,f.jsx)(r.BC,{label:e("strtdrt"),label_width:"6rem",children:(0,f.jsx)(r.Sm,{placeholder:e("远端目录"),value:I,handleInputChange:V})}),(0,f.jsx)(r.BC,{label:e("dspnmtp"),label_width:"6rem",children:(0,f.jsx)(r.Sm,{placeholder:e("列表显示的名称"),value:N,handleInputChange:K})})]}),!j&&(0,f.jsx)(h.X,{headers:[e("名称"),e("挂载类型"),e("凭据"),e("操作")],rows:t.map(t=>{const s=i.find(e=>e.id===t.credential_id),n="baidu"===t.driver?x.find(e=>String(e.uk)===String(t.credential_id)):void 0;return[(0,f.jsx)("p",{children:t.name}),(0,f.jsx)("p",{children:(a=t.driver,d.find(e=>e.type===a)?.name??a)}),(0,f.jsx)("p",{children:n?n.name||n.baidu_name||String(n.uk):s?s.name:e("凭据已丢失")}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{v(!0),w(e.id),y(e.driver),k(e.mount_path??""),A(e.credential_id??""),V(e.root_dir??""),K(e.name??"")})(t)}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{try{await c.I2.post("delete",{id:t.id}),(0,_.SK)(e("已删除")),await X()}catch(e){}})(t)})]})];var a})})]})}function W({on_credential_change:e}){const{t}=(0,u.B)(),[,s]=(0,w.fp)(p.AG.prompt_card),[i,a]=(0,n.useState)(null),[d,x]=(0,n.useState)([]),[m,j]=(0,n.useState)("百度网盘"),[v,g]=(0,n.useState)(""),[S,y]=(0,n.useState)(""),[C,k]=(0,n.useState)(""),[b,A]=(0,n.useState)("oob"),[I,V]=(0,n.useState)(!0),[N,K]=(0,n.useState)(!0),X="oob"===b,[z,F]=(0,n.useState)(!1),[O,P]=(0,n.useState)(!1),[$,B]=(0,n.useState)(""),D=async()=>{try{const e=await c.I2.post("baidu/app/get",{}),t=e?.data?.app??null;a(t),x(e?.data?.accounts??[]),j(t?.name??"百度网盘"),g(t?.app_id??""),y(t?.app_key??""),A("one_click"===t?.auth_mode?"one_click":"oob"),V(!1!==t?.enabled),K(!1!==t?.auto_refresh)}catch(e){}};(0,n.useEffect)(()=>{D();const s=new URLSearchParams(window.location.search),n=s.get("baidu_auth");"success"===n?((0,_.SK)(`${t("授权成功")}:${s.get("name")??""}`),e()):"failed"===n&&(0,_.zN)(`${t("授权失败")}:${s.get("reason")??""}`),n&&window.history.replaceState({},"",window.location.pathname)},[]);return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:t("百度网盘")}),(0,f.jsx)(o.rA,{icon:"info",title:t("信息"),onClick:()=>{s({open:!0,title:t("信息"),context_div:(0,f.jsxs)("ul",{children:[(0,f.jsx)("li",{children:t("atathtp")}),(0,f.jsx)("li",{children:t("atathnt")}),(0,f.jsx)("li",{children:t("pstatht")})]})})}})]}),rightBottomCom:(0,f.jsxs)("div",{children:[!z&&(0,f.jsx)(o.rA,{icon:"apps",title:t("应用配置"),onClick:()=>F(!0)}),z&&(0,f.jsx)(o.rA,{icon:"save",title:t("保存应用配置"),onClick:async()=>{if(S.trim())if(i?.configured||C.trim())try{await c.I2.post("baidu/app/save",{name:m,app_id:v,app_key:S,secret_key:C,auth_mode:b,remark:i?.remark??"",enabled:I,auto_refresh:N}),(0,_.SK)(t("保存成功")),k(""),F(!1),await D()}catch(e){}else(0,_.zN)(t("rq_scrt"));else(0,_.zN)(t("rqappky"))}}),z&&(0,f.jsx)(o.rA,{icon:"cancel",title:t("取消"),onClick:()=>F(!1)}),!z&&(0,f.jsx)(o.rA,{icon:"key",title:t("授权"),onClick:()=>P(!0)}),(0,f.jsx)(o.rA,{icon:"refresh",title:t("授权检测/刷新"),onClick:async()=>{try{await c.I2.post("baidu/verify/all",{}),(0,_.SK)(t("检测完成")),await D()}catch(e){}}})]}),children:[z&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.Sm,{placeholder:t("名称"),value:m,handleInputChange:j}),(0,f.jsx)(r.Sm,{placeholder:"AppID",value:v,handleInputChange:g}),(0,f.jsx)(r.Sm,{placeholder:"AppKey",value:S,handleInputChange:y}),(0,f.jsx)(r.Sm,{type:"password",placeholder:i?.configured?t("scrtkep"):"SecretKey",value:C,handleInputChange:k}),(0,f.jsx)(r.BC,{label:t("授权方式"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:b,options:(0,G.K1)(t),onChange:e=>A("one_click"===e?"one_click":"oob")})}),(0,f.jsx)(r.BC,{label:t("网盘使用"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:I,options:(0,G.Dd)(t),onChange:V})}),(0,f.jsx)(r.BC,{label:t("atrfrsh"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:N,options:(0,G.Dd)(t),onChange:K})})]}),O&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.BC,{label:t("授权方式"),label_width:"6rem",children:(0,f.jsxs)("div",{className:"div-row",children:[(0,f.jsx)(r.U6,{value:"one_click",context:t("一键授权"),name:"baidu_auth_mode",selected:"one_click"===b,onchange:()=>A("one_click")}),(0,f.jsx)(r.U6,{value:"oob",context:t("outh_ob"),name:"baidu_auth_mode",selected:"oob"===b,onchange:()=>A("oob")})]})}),X&&(0,f.jsx)(r.Sm,{placeholder:t("pst_cd"),value:$,handleInputChange:B}),(0,f.jsxs)("div",{className:"div-row mount-actions",children:[(0,f.jsx)(o.C3,{text:t(X?"去授权(手动)":"去授权(一键)"),clickFun:async()=>{if(i?.configured)try{const e=await c.I2.post("baidu/authorize_url",{mode:b});e?.data&&window.open(e.data,"_blank","noopener,noreferrer")}catch(e){}else(0,_.zN)(t("svappfr"))}}),X&&(0,f.jsx)(o.C3,{text:t("完成授权"),clickFun:async()=>{if($.trim())try{const s=await c.I2.post("baidu/exchange",{code:$.trim(),mode:b});(0,_.SK)(`${t("授权成功")}:${s?.data?.baidu_name??""}`),B(""),P(!1),await D(),e()}catch(e){}else(0,_.zN)(t("请填写授权码"))}}),(0,f.jsx)(o.C3,{text:t("取消"),clickFun:()=>P(!1)})]})]}),!z&&!O&&(0,f.jsx)(h.X,{headers:[t("账号名"),t("百度账号"),t("授权状态"),t("使用"),t("授权时间"),t("操作")],rows:d.map(s=>{return[(0,f.jsx)(r.Sm,{value:s.name,no_border:!0,handleInputChange:t=>(async(t,s)=>{try{await c.I2.post("baidu/account/update",{uk:t.uk,name:s}),e()}catch(e){}})(s,t)}),(0,f.jsx)(l.xP,{context:s.baidu_name||"-"}),(0,f.jsx)(l.xP,{context:(n=s,n.authorized?n.expired?t("已过期"):t("已授权"):t("未授权"))}),(0,f.jsx)(r.l6,{value:s.enabled,no_border:!0,options:(0,G.Dd)(t),onChange:()=>(async t=>{try{await c.I2.post("baidu/account/update",{uk:t.uk,enabled:!t.enabled}),await D(),e()}catch(e){}})(s)}),(0,f.jsx)("p",{children:(0,G.eK)(s.created_at)}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"network_check",title:t("授权检测"),onClick:()=>(async e=>{try{const s=await c.I2.post("baidu/verify",{uk:e.uk});s?.data?.valid?(0,_.SK)(t("账号可用")):(0,_.zN)(`${t("账号不可用")}:${s?.data?.error??""}`),await D()}catch(e){}})(s)}),(0,f.jsx)(o.rA,{icon:"link_off",title:t("取消授权"),onClick:()=>(async e=>{try{await c.I2.post("baidu/deauthorize",{uk:e.uk}),(0,_.SK)(t("已取消授权")),await D()}catch(e){}})(s)}),(0,f.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(async s=>{try{await c.I2.post("baidu/delete",{uk:s.uk}),(0,_.SK)(t("已删除")),await D(),e()}catch(e){}})(s)})]})];var n})})]})}function Z(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=t(a.oV.file_mount),[r,d]=(0,w.fp)(p.AG.mount_enabled);(0,n.useEffect)(()=>{s&&(async()=>{try{const e=await c.I2.post("enabled/get",{});d(!0===e?.data)}catch(e){d(!1)}})()},[s]);return s?(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)(b.aZ,{position:"right",children:[(0,f.jsx)("span",{className:"header-label",children:e("总开关")}),(0,f.jsx)(o.rA,{icon:!0===r?"cloud_done":"cloud_off",title:e(!0===r?"muntont":"muntoff"),selected:!0===r,onClick:async()=>{const t=!r;try{const s=await c.I2.post("enabled/set",{enabled:t}),n=!0===s?.data;d(n),(0,_.SK)(e(n?"挂载已启用":"挂载已停用"))}catch(e){}}})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,f.jsx)(E,{})}),(0,f.jsx)(i.VP,{widthPer:60,maxWidth:"60rem",children:(0,f.jsx)(W,{on_credential_change:()=>window.location.reload()})})]}),(0,f.jsx)(i.fI,{children:(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"60rem",children:(0,f.jsx)(q,{})})})]})]}):(0,f.jsx)(i.fI,{children:(0,f.jsx)(i.VP,{children:(0,f.jsx)(l.Zp,{self_title:(0,f.jsx)("h2",{children:e("网盘挂载")}),children:(0,f.jsx)("p",{children:e("nmuntpr")})})})})}var R=s(87361);function U(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,f.jsx)(D,{})}];return t(a.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,f.jsx)(X,{})}),t(a.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,f.jsx)(F,{})}),t(a.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,f.jsx)(A,{})}),t(a.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,f.jsx)($,{})}),t(a.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,f.jsx)(B,{})}),t(a.oV.file_mount)&&s.push({index:1,name:e("网盘挂载"),rto:"mount_setting/",component:(0,f.jsx)(Z,{})}),(0,f.jsx)(i.W1,{optionList:s,father_route:R.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),a=s(74777),l=s(96540),o=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:l}=(0,o.B)();return e=>{let n;e===a.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===a.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,l.useState)([]);return(0,l.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:()=>l});var n=s(72635);const i=1440,a=525600;function l(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<a?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/a).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([[3328],{77481(e,t,s){s.d(t,{S:()=>o,X:()=>l});var n=s(96540),i=s(61443),a=s(74848);function l(e){const[t,s]=n.useState([]),l=(0,n.useRef)(-1),[o,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const h=()=>{l.current=-1,r(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let l=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(l=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(o===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(l.current=s,r(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=l.current,s=c;h(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:h,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function o(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},53328(e,t,s){s.r(t),s.d(t,{default:()=>U});var n=s(96540),i=s(75725),a=s(23430),l=s(70447),o=s(85997),r=s(61443),c=s(14284),d=s(53459),h=s(77481),u=s(86149),p=s(82893),x=s(40505),_=s(62042),m=s(21499),j=s(21469),v=s(64694),f=s(74848);function g(e){const{t}=(0,u.B)(),[s,a]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{if(e.getItems){const t=await e.getItems();a(t)}})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e.title}),e.info_click&&(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{e.info_click()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:t("添加"),onClick:()=>{const t=[];for(let s=0;s<e.headers.length-1;s++)t.push("");a([t,...s])}}),(0,f.jsx)(o.rA,{icon:"save",title:t("保存"),onClick:async()=>{e.save&&await e.save(s)}})]}),children:(0,f.jsx)(h.X,{headers:e.headers,rows:s.map((n,i)=>{const l=[];for(let t=0;t<e.headers.length;t++)l.push((0,f.jsx)(r.Sm,{value:n[t],handleInputChange:e=>{n[t]=e,a([...s])},no_border:!0}));return l.push((0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{s.splice(e,1),a([...s])})(i)}),n[0]&&(0,f.jsx)(o.rA,{icon:"content_copy",title:t("复制地址"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);(0,x.lW)(e),(0,_.SK)(e)}}),n[0]&&e.need_copy&&(0,f.jsx)(o.rA,{icon:"open_in_new",title:t("打开新页面"),onClick:()=>{const e=(0,m.bi)(`${window.location.origin}${j.m.base_url}`,n[0]);window.open(e)}})]})),l}),width:"10rem",onRowDrag:(e,t)=>{a((0,v.TI)(s,e,t))}})})})}var w=s(34843),S=s(78247),y=s(24659);function C(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),a=(0,y.K)(),g=[e("路由"),e("auth"),e("备注")],[C,k]=(0,w.fp)(p.AG.editorSetting),[b,A]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("api/customer_router");e.code===d.m.Success&&A(e.data)})()},[]);return(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("api_rt")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{(()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})})()},title:"信息"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([{note:"",needAuth:!1,router:""},...b])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("api/customer_router/save",b)).code===d.m.Success&&(0,_.SK)("保存成功")}})]}),children:(0,f.jsx)(h.X,{headers:g,rows:b.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.router,handleInputChange:e=>{t.router=e,A([...b])},no_border:!0}),(0,f.jsx)(r.l6,{defaultValue:t.needAuth,onChange:e=>{t.needAuth=e,A([...b])},options:a,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e,A([...b])},no_border:!0}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(s)}),(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(async e=>{if(!e.router)return void(0,_.zN)("路由不能为空");const t=await c.XO.get(`jscode/${encodeURIComponent(e.router)}`);k({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&&(S.xK.set_value_temp(""),k({open:!1,model:"",fileName:"",save:null}),(0,_.SK)("成功"))}}),S.xK.set_value_temp(t.data)})(t)}),t.router&&(0,f.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{(0,x.lW)((0,m.bi)(window.location.origin+j.m.base_url,t.router)),(0,_.SK)(e("已复制"))}})]})];return n}),width:"10rem",onRowDrag:(e,t)=>{A((0,v.TI)(b,e,t))}})})})}var k=s(23496),b=s(4412);function A(){const{t:e}=(0,u.B)(),[t,s]=(0,w.fp)(p.AG.prompt_card),[a,l]=(0,w.fp)(p.AG.router_jump),o=[e("路由"),e("路径"),e("过期时间(s)"),e("备注")],r=[e("路由"),e("文件路径"),"token","user id",e("备注")];return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(b.aZ,{position:"right"}),(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{maxWidth:"50rem",children:[(0,f.jsx)(g,{title:e("页面资源路由"),headers:o,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_router);if(e.code===d.m.Success){if(a?.page_self_router_api_data){for(const t of e.data)t[1]===a?.page_self_router_api_data[1]&&(0,_.N9)("已经存在的页面资源路由配置目录设置");const t={};Object.assign(t,a?.page_self_router_api_data),e.data=[t,...e.data],l({})}return e.data}return[]},save:async e=>{(await c.XO.post(k.s.setting_customer_router_save,e)).code===d.m.Success&&(0,_.SK)("success")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,会自动识别地址,将页面转到对应结果。路径支持文件路径(如果是文件夹路径的最后最后一个名字将会成为资源实际地址,整个目录将会变成一个http目录),http地址。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})},need_copy:!0}),(0,f.jsx)(g,{title:e("wf_rt"),headers:r,getItems:async()=>{const e=await c.XO.get(k.s.setting_customer_workflow_router);return e.code===d.m.Success?e.data:[]},save:async e=>{(await c.XO.post(k.s.setting_customer_workflow_router_save,e)).code===d.m.Success&&(0,_.SK)("保存成功")},info_click:()=>{let e=(0,f.jsx)("div",{children:'默认需要以 "/api" 开头的路由,文件路径是有效的workflow路径。token也可以是文件绝对路径,请求的时候请设置同样的authorization请求头字段。'});s({open:!0,title:"信息",context_div:(0,f.jsx)("div",{children:e})})}})]}),(0,f.jsx)(i.VP,{maxWidth:"50rem",children:(0,f.jsx)(C,{})})]})]})}var I=s(74777),V=s(6960),N=s(7523);function K(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),[s,i]=(0,n.useState)(!1),[h,x]=(0,n.useState)("https://registry.npmjs.org"),[m,j]=(0,n.useState)(""),[v,g]=(0,n.useState)(180),[y,C]=(0,n.useState)(!1),[k,b]=(0,w.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),x(t.version_check_url||"https://registry.npmjs.org"),j(t.exe_download_url||""),g(t.check_interval_seconds||180)}})()},[]);return t(a.oV.sys_setting_page)?(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("自动升级")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{b({open:!0,title:e("信息"),context_div:(0,f.jsx)("div",{children:e("自动升级在 windows 下目前可能不稳定")})})},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:e("保存"),clickFun:async()=>{if(!h)return void(0,_.zN)(e("ver_req"));if(s&&(!v||v<10))return void(0,_.zN)(e("chk_10s"));const t=new I.Mm;t.open=s,t.version_check_url=h,t.exe_download_url=m,t.check_interval_seconds=v;(await c.XO.post("auto_upgrade_setting/save",t)).code===d.m.Success&&(0,_.SK)(e("保存成功"))}}),children:[(0,f.jsx)("div",{children:e("ver_url")}),(0,f.jsx)(r.Sm,{placeholder:"https://registry.npmjs.org",value:h,handleInputChange:e=>{x(e)}}),(0,f.jsx)(r.l6,{value:s,onChange:e=>{i(e)},options:[{title:e("开启"),value:!0},{title:e("关闭"),value:!1}]}),s&&(0,f.jsxs)(f.Fragment,{children:[!1,(0,f.jsx)("div",{children:e("检测频率(秒)")}),(0,f.jsx)(r.Sm,{placeholder:e("def_180"),value:v,handleInputChange:e=>{g(Number(e)||180)}}),(0,f.jsx)("div",{style:{marginTop:"12px"},children:(0,f.jsx)(o.C3,{text:e(y?"升级检测中...":"立即升级"),clickFun:async()=>{C(!0);try{(await c.XO.post("auto_upgrade_setting/upgrade_now",{})).code===d.m.Success&&(0,_.SK)(e("已触发升级检测,请查看服务端日志"))}catch(t){(0,_.zN)(e("触发升级失败"))}finally{C(!1)}}})})]})]}):null}function X(){const[e,t]=(0,n.useState)(""),[s,a]=(0,n.useState)(""),[x,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),[C,A]=(0,n.useState)(""),[X,z]=(0,w.fp)(p.AG.prompt_card),[F,O]=(0,n.useState)(!1),[P,$]=(0,n.useState)(""),[B,D]=(0,n.useState)(""),[M,T]=(0,n.useState)(I.aM.close),[E,G]=(0,n.useState)(!1),[q,W]=(0,n.useState)(void 0),{t:Z,i18n:R}=(0,u.B)(),[U,H]=(0,w.fp)(p.AG.user_base_info),{check_user_auth:L}=(0,S.MH)(),{initUserInfo:Q}=(0,n.useContext)(N.F);(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("sys_option/status");if(e.code===d.m.Success){y(e.data.recycle_open),A(e.data.recycle_dir);const s=e.data.sys_env;t(s?.web_site_title),a(s?.logo||""),m(s?.show_login_user_info),v(s?.http_proxy||"");const n=e.data.https_setting;n&&(O(n.open),$(n.cert_path||""),D(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&&W(e.length),e.mode&&T(e.mode),void 0!==e.persist&&G(e.persist)}})()},[]);return(0,f.jsxs)("div",{children:[(0,f.jsx)(b.aZ,{children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"credits",children:[Z("系统运行于"),": ",(0,V.s)(U.runing_time_length)]}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsxs)("a",{href:"https://github.com/xiaobaidadada/filecat",target:"_blank",children:["version:7.1.1",null!=U.latest_version&&"7.1.1"!==U.latest_version?` -> ${U.latest_version}`:""]})}),(0,f.jsx)("span",{className:"credits",children:(0,f.jsx)("a",{href:Z("官网地址"),target:"_blank",children:`filecat ${Z("功能文档")}`})}),(0,f.jsxs)("span",{className:"credits",children:[Z("安装方式")," :",U.process_env_run_env]})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:Z("通用设置")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:Z("信息"),context_div:(0,f.jsx)("div",{children:Z("pxy_tip")})})},title:Z("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.sys_env,value:{web_site_title:e,show_login_user_info:x,http_proxy:j,logo:s}})).code===d.m.Success&&((0,_.SK)("修改成功"),Q())}}),children:[Z("网站标题"),(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{t(e)}}),Z("网站 Logo"),(0,f.jsx)(r.Sm,{placeholder:Z("lclorur"),value:s,handleInputChange:e=>{a(e)}}),(0,f.jsx)("div",{children:Z("pxy_url")}),(0,f.jsx)(r.Sm,{placeholder:"http://127.0.0.1:7890",value:j,handleInputChange:e=>{v(e)}}),Z("lgn_usr"),(0,f.jsx)("input",{type:"checkbox",checked:x,onChange:()=>{m(!x)}})]}),(0,f.jsxs)(l.Zp,{title:Z("https_s"),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{if(F){if(!P)return void(0,_.zN)("证书路径不能为空");if(!B)return void(0,_.zN)("私钥路径不能为空")}const e=new I.CH;e.open=F,e.cert_path=P,e.key_path=B;(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.https,value:e,open:F})).code===d.m.Success&&(0,_.SK)("HTTPS 设置已保存,需重启服务器才能生效")}}),children:[(0,f.jsx)(r.l6,{value:F,onChange:e=>{O(e)},options:[{title:Z("开启"),value:!0},{title:Z("关闭"),value:!1}]}),F&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:Z("ssl_crt")}),(0,f.jsx)(r.Sm,{placeholder:Z("crt_pth"),value:P,handleInputChange:e=>{$(e)}}),(0,f.jsx)("div",{children:Z("ssl_key")}),(0,f.jsx)(r.Sm,{placeholder:Z("ky_pth"),value:B,handleInputChange:e=>{D(e)}})]})]}),(0,f.jsx)(K,{})]}),(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:Z("文件回收站")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{z({open:!0,title:Z("信息"),context_div:(0,f.jsx)("div",{children:Z("格式:[被删除的文件所在父目录] 回收站目录 [; ...]")})})},title:Z("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:Z("确定修改"),clickFun:async()=>{if(g&&!C)return void(0,_.zN)("目录不能为空");(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.cyc,value:C,open:g})).code===d.m.Success&&(0,_.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:Z("目录"),value:C,handleInputChange:e=>{A(e)}}),(0,f.jsx)(r.l6,{value:g,onChange:e=>{y(e)},options:[{title:Z("开启"),value:!0},{title:Z("关闭"),value:!1}]})]}),(0,f.jsxs)(l.Zp,{title:Z("tk_exp"),rightBottomCom:(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(o.C3,{text:Z("清空token"),clickFun:async()=>{(await c.XO.get("token/clear")).code===d.m.Success&&(0,_.SK)("清理完成,重新登录")}}),(0,f.jsx)(o.C3,{text:Z("保存"),clickFun:async()=>{const e=new I.Gd;e.mode=M,e.persist=E,I.aM.length!==e.mode||q||(0,_.zN)("秒数不能为空"),e.length=parseInt(q);(await c.XO.post("token/save",e)).code===d.m.Success&&(0,_.SK)("保存成功")}})]}),children:[(0,f.jsx)(h.S,{isFlex:!0,columns:[(0,f.jsx)(r.U6,{value:1,context:Z("关闭"),selected:M===I.aM.close,onchange:()=>{T(I.aM.close)}}),(0,f.jsx)(r.U6,{value:1,context:Z("指定时间"),selected:M===I.aM.length,onchange:()=>{T(I.aM.length)}}),(0,f.jsx)(r.U6,{value:1,context:Z("永不过期"),selected:M===I.aM.forver,onchange:()=>{T(I.aM.forver)}})]}),M===I.aM.length&&(0,f.jsx)(r.Sm,{placeholder:Z("秒"),value:q,handleInputChange:e=>{W(e)}}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8,whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:E,onChange:()=>G(!E)}),Z("持久化")]})]})]})]})})]})}var z=s(92350);function F(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:a}=(0,n.useContext)(N.F),[x,m]=(0,n.useState)([]),[j,g]=(0,n.useState)([]),[C,k]=(0,w.fp)(p.AG.prompt_card),[,b]=(0,w.fp)(p.AG.editorSetting),[A,I]=(0,n.useState)([]),[V,K]=(0,n.useState)([]),[X,F]=(0,n.useState)([]),[O,P]=(0,n.useState)([]),[$,B]=(0,n.useState)(""),[D,M]=(0,n.useState)([]),T=(0,y.K)(),E=[e("软件"),e("是否安装"),e("路径")],G=[e("编号"),e("路径"),e("备注")],q=[e("编号"),e("路径"),e("是否开启"),e("备注")],W=[e("编号"),e("文件路径"),e("是否开启"),e("系统启动执行"),e("corn表达式"),e("用户id"),e("备注")],Z=[e("编号"),e("路径"),e("单用户并发数量"),e("系统并发数量"),e("big_res"),e("big_sz"),e("大文件并发数量"),e("big_ck"),e("备注")],R=[e("编号"),e("名称"),e("路径"),e("是否开启"),e("params"),e("备注")],{check_user_auth:U}=(0,S.MH)(),H=async()=>{const e=await c.XO.get("env/path/get");e.code===d.m.Success&&F(e.data)},L=async()=>{const e=await c.XO.get("workflow_setting_get");e.code===d.m.Success&&P(e.data)};(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("outside/software/get");e.code===d.m.Success&&g(e.data);const t=await c.XO.get("pty_cmd");t.code===d.m.Success&&B(t.data),H(),L();const s=await c.XO.get("protection_dir/sys");s.code===d.m.Success&&I(s.data??[]);const n=await c.XO.get("dir_upload_max_num");n.code===d.m.Success&&K(n.data??[]);const i=await c.XO.get("plugin/list");i.code===d.m.Success&&M(i.data??[])})()},[]);const Q=(0,z.Q)(),J=async()=>{(await c.XO.post("plugin/list/save",D)).code===d.m.Success&&(0,_.SK)(e("保存成功"))};return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(i.J,{widthPer:100,maxWidth:"100rem",children:(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("up_conc")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("文件上传")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...V,{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,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(const e of V)if(e.open_ws_file){if("number"!=typeof e.ws_file_block_mb_size)return void(0,_.zN)(`编号:${e.index??""} 文件块的大小设置有问题`);if("number"!=typeof e.ws_file_parallel_num)return void(0,_.zN)(`编号:${e.index??""} 并发数量设置有问题`);if("number"!=typeof e.ws_file_standard_size)return void(0,_.zN)(`编号:${e.index??""} 大文件size设置有问题`)}(0,v.di)(V,e=>e.index??0);(await c.XO.post("dir_upload_max_num/save",V)).code===d.m.Success&&((0,_.SK)("保存成功"),a())}})]}),children:(0,f.jsx)(h.X,{headers:Z,rows:V.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,placeholder:s,handleInputChange:e=>{t.index=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_upload_num,handleInputChange:e=>{t.user_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.sys_upload_num,handleInputChange:e=>{t.sys_upload_num=parseInt(e)},no_border:!0}),(0,f.jsx)(r.l6,{value:!0===t.open_ws_file,onChange:e=>{t.open_ws_file=e,K([...V])},options:T,no_border:!0}),(0,f.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,f.jsx)(r.Sm,{value:t.ws_file_parallel_num,handleInputChange:e=>{t.ws_file_parallel_num=parseInt(e)},no_border:!0}),(0,f.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,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{V.splice(e,1),K([...V])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{K((0,v.TI)(V,e,t))}})})}),(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PATH")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("环境路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"list",title:e("查看"),onClick:async()=>{const t=await c.XO.get("env/process/view");t.code===d.m.Success?k({open:!0,title:e("进程环境变量"),context_div:(0,f.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,_.zN)(e("获取失败"))}}),(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:async()=>{const t=await c.XO.get("env/process/get");t.code===d.m.Success?(S.xK.set_value_temp(t.data??""),b({model:"ace/mode/ini",open:!0,fileName:"",save:async t=>{(await c.XO.post("env/process/save",{text:t})).code===d.m.Success?(0,_.SK)(e("保存成功")):(0,_.zN)(e("保存失败")),S.xK.set_value_temp("")}})):(0,_.zN)(e("获取失败"))}}),(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{F([...X,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("env/path/save",{paths:X})).code===d.m.Success&&((0,_.SK)("保存成功"),H(),s())}})]}),children:(0,f.jsx)(h.X,{headers:q,rows:X.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,F([...X])},options:T,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{X.splice(e,1),F([...X])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{F((0,v.TI)(X,e,t))}})}),(0,f.jsx)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("PTY CMD")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("pty")},title:e("信息")})]}),rightBottomCom:(0,f.jsx)(o.C3,{text:e("更新"),clickFun:async()=>{(await c.XO.post("pty_cmd/save",{str:$})).code===d.m.Success&&((0,_.SK)("保存成功"),a())}}),children:(0,f.jsx)(r.Sm,{placeholder:e("cmd need pty env"),value:$,handleInputChange:e=>{B(e)}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("Workflow Job")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("Workflow")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...O,{open:!1}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("workflow_setting_save",O)).code===d.m.Success&&((0,_.SK)("ok"),L())}})]}),children:(0,f.jsx)(h.X,{headers:W,rows:O.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.file_path,handleInputChange:e=>{t.file_path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,P([...O])},options:T,no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.sys_power_on,onChange:e=>{t.sys_power_on=e,P([...O])},options:T,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cron_str,handleInputChange:e=>{t.cron_str=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.user_id,handleInputChange:e=>{t.user_id=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),P([...O])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{P((0,v.TI)(O,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("插件配置")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("插件配置")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...D,{name:"",path:"",note:"",open:!1}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:J})]}),children:(0,f.jsx)(h.X,{headers:R,rows:D.map((t,s)=>{const n=[s,(0,f.jsx)(r.Sm,{value:t.name,handleInputChange:e=>{t.name=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:!!t.open,onChange:e=>{t.open=e,M([...D])},options:T,no_border:!0}),(0,f.jsx)(o.mu,{icon:"edit",save:async e=>{t.params=e,await J()},title:""}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{D.splice(e,1),M([...D])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{M((0,v.TI)(D,e,t))}})})]})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"50rem",children:(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("系统保护路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{I([...A,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/sys/save",A)).code===d.m.Success&&((0,_.SK)("保存成功"),a())}})]}),children:(0,f.jsx)(h.X,{headers:G,rows:A.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),I([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{I((0,v.TI)(A,e,t))}})}),(0,f.jsx)(l.uF,{title:e("外部软件"),titleCom:(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("outside/software/save",j)).code===d.m.Success&&((0,_.SK)("保存成功"),s())}}),children:(0,f.jsx)(h.X,{headers:E,rows:j.map((t,s)=>[(0,f.jsx)("div",{children:t.id}),(0,f.jsx)(l.fq,{ok:t.installed}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0,placeholder:e("use_env")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{Q(t.id)},title:e("信息")})]),width:"10rem"})})]})})]})]})}function O(e){const{t,i18n:s}=(0,u.B)(),[i,l]=(0,w.fp)(p.AG.user_base_info),o=[{title:t("用户权限"),list:[{title:t("用户管理"),permission:a.oV.user_manage},{title:t("角色管理"),permission:a.oV.role_manage}]},{title:t("系统管理权限"),list:[{title:t("系统信息"),permission:a.oV.all_sys},{title:t("系统进程关闭"),permission:a.oV.sys_process_close},{title:t("dc_ctdl"),permission:a.oV.docker_container_update},{title:t("dc_idl"),permission:a.oV.docker_images_delete},{title:t("systemd管理"),permission:a.oV.systemd},{title:t("防火墙管理"),permission:a.oV.firewall}]},{title:t("网络功能权限"),list:[{title:t("系统网络"),permission:a.oV.vir_net},{title:t("内网穿透"),permission:a.oV.tcp_proxy},{title:"ddns",permission:a.oV.ddns}]},{title:t("Ai 设置权限"),list:[{title:t("Ai 配置"),permission:a.oV.ai_agent_setting},{title:t("ai_page"),permission:a.oV.ai_agent_page},{title:t("sw_mdl"),permission:a.oV.ai_model_switch}]},{title:t("文件权限"),list:[{title:t("log_del"),permission:a.oV.filecat_file_delete_cut_rename},{title:t("log_wr"),permission:a.oV.filecat_file_context_update_upload_created_copy_decompression},{title:t("内容更新"),permission:a.oV.filecat_file_context_update},{title:t("文件回收站修改"),permission:a.oV.recycle_file_save},{title:t("文件分享"),permission:a.oV.share_file}]},{title:t("系统设置权限"),list:[{title:t("系统页面"),permission:a.oV.sys_setting_page},{title:t("htts"),permission:a.oV.https_file},{title:t("tk_time"),permission:a.oV.token_update},{title:t("修改密码"),permission:a.oV.update_password},{title:t("磁盘挂载"),permission:a.oV.sys_disk_mount},{title:t("通用设置"),permission:a.oV.sys_env_setting_key},{title:t("md_set"),permission:a.oV.md_editor_setting},{title:t("目录挂载"),permission:a.oV.file_mount}]},{title:t("系统环境设置"),list:[{title:t("sys_env"),permission:a.oV.sys_env_page},{title:t("up_lim"),permission:a.oV.dir_upload_max_num},{title:t("path_md"),permission:a.oV.env_path_update},{title:"pty cmd "+t("更新"),permission:a.oV.pty_cmd_update},{title:"workflow job",permission:a.oV.workflow_job},{title:t("path_up"),permission:a.oV.sys_protection_dir},{title:t("外部软件路径"),permission:a.oV.outside_software_path}]},{title:t("个人环境设置"),list:[{title:t("个性化设置"),permission:a.oV.private_sys_env}]},{title:t("自定义路由"),list:[{title:t("自定义路由页面"),permission:a.oV.auth_router_page},{title:t("wf_api"),permission:a.oV.workflow_api},{title:t("自定义资源路由"),permission:a.oV.code_resource},{title:t("api_rt"),permission:a.oV.code_api}]},{title:t("标签编辑权限"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy_tag_update},{title:t("http代理"),permission:a.oV.http_proxy_tag_update},{title:t("浏览器代理"),permission:a.oV.browser_proxy_tag_update},{title:t("rdp代理"),permission:a.oV.rdp_proxy_tag_update},{title:t("网络唤醒"),permission:a.oV.wol_proxy_tag_update},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy_tag_update}]},{title:t("代理功能"),list:[{title:t("ssh代理"),permission:a.oV.ssh_proxy},{title:t("http代理"),permission:a.oV.http_proxy},{title:t("pxy_off"),permission:a.oV.http_proxy_download_cancel},{title:t("浏览器代理"),permission:a.oV.browser_proxy},{title:t("rdp代理"),permission:a.oV.rdp_proxy}]},{title:t("其他功能"),list:[{title:t("wf_run"),permission:a.oV.workflow_exe},{title:t("wf_user"),permission:a.oV.workflow_exe_user,noDisable:!0},{title:t("网络唤醒"),permission:a.oV.wol_proxy},{title:t("端口扫描"),permission:a.oV.port_scan},{title:t("rtsp播放器"),permission:a.oV.rtsp_proxy},{title:t("ssh_sv"),permission:a.oV.crypto_ssh_file},{title:t("cmd_rst"),permission:a.oV.shell_cmd_filecat_restart},{title:t("cmd_upg"),permission:a.oV.shell_cmd_filecat_upgrade},{title:t("cmd_dwn"),permission:a.oV.shell_cmd_filecat_kill_self},{title:t("cmd_ai"),permission:a.oV.ai_chat_cmd}]}];return(0,f.jsx)(n.Fragment,{children:o.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{children:t.title}),t.list.map((t,s)=>(0,f.jsxs)("div",{children:[(0,f.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 $(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(N.F),[j,g]=(0,w.fp)(p.AG.user_base_info),[S,y]=(0,n.useState)([]),[C,k]=(0,w.fp)(p.AG.prompt_card),[b,A]=(0,n.useState)(!1),[I,V]=(0,n.useState)(!1),[K,X]=(0,w.fp)(p.AG.confirm),[F,$]=(0,n.useState)(""),[B,D]=(0,n.useState)(""),[M,T]=(0,n.useState)(""),[E,G]=(0,n.useState)([]),[q,W]=(0,n.useState)([]),[Z,R]=(0,n.useState)([]),[U,H]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)("en"),[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)([]),[ie,ae]=(0,n.useState)(""),[le,oe]=(0,n.useState)(!1),[re,ce]=(0,n.useState)(""),[de,he]=(0,n.useState)(""),[ue,pe]=(0,n.useState)({}),xe=(0,z.o)(),[_e,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);y(e)}else y(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=>{$(e?.username??""),D(e?.password??""),T(e?.cwd??""),G(e?.access_dirs??[]),W(e?.not_access_dirs??[]),R(e?.only_read_dirs??[]),H(e?.access_cmd??""),Q(e?.not_access_cmd??""),Y(e?.language??""),te(e?.theme??""),ne(e?.auth_list??[]),ae(e?.note??""),oe(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&&T(s.cwd),s.access_dirs&&s.access_dirs.length>0&&G(s.access_dirs),s.not_access_dirs&&s.not_access_dirs.length>0&&W(s.not_access_dirs),s.only_read_dirs&&s.only_read_dirs.length>0&&R(s.only_read_dirs),s.access_cmd&&H(s.access_cmd),s.not_access_cmd&&Q(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)}},ye=()=>{if(!F)return void(0,_.zN)("username not empty");if((0,m.CB)(F))return void(0,_.zN)("username not empty char");if(!M)return void(0,_.zN)("cwd not empty");const e=new a.E0;return e.language=J,e.theme=ee,e.access_dirs=E,e.username=F,e.password=B,e.not_access_dirs=q,e.only_read_dirs=Z,e.cwd=M,e.note=ie,e.access_cmd=U,e.not_access_cmd=L,e.auth_list=se,e.bind_role_id=de,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("用户")})}),titleCom:(0,f.jsxs)("div",{className:"div-row",style:{gap:"0.5rem"},children:[(0,f.jsx)(r.Sm,{placeholder:e("过滤"),value:je,handleInputChange:e=>{ve(e)},handlerEnter:()=>{ge()}}),(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A(!0),V(!1),we(void 0)}})]}),children:(0,f.jsx)(h.X,{headers:fe,rows:S.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.id}),(0,f.jsx)(l.xP,{children:t.username}),(0,f.jsx)(l.xP,{children:t.cwd}),(0,f.jsx)(l.xP,{children:t.note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{A(!1),V(!0),we(e)})(t)}),!t.is_root&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{X({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new a.E0;e.username=t,(await c.wm.post("delete_user",e)).code===d.m.Success&&((0,_.SK)("删除完成"),ge(),X({open:!1,handle:null}))}})})(t.username)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(b||I)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(b?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{A(!1),V(!1),we(void 0)}}),b&&(0,f.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{if(!B)return void(0,_.zN)("password not empty");if((0,m.CB)(B))return void(0,_.zN)("username not empty char");const e=ye(),t=await c.wm.post("create_user",e);ge(),t.code===d.m.Success&&((0,_.SK)("创建完成"),ge(),A(!1),V(!1),we(void 0))}}),I&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ye();if(!e)return;e.id=re;(await c.wm.post("save_user",e)).code===d.m.Success&&((0,_.SK)("保存完成"),ge())}})]}),children:[(0,f.jsx)("label",{children:e("用户名")}),(0,f.jsx)(r.Sm,{value:F,handleInputChange:e=>$(e)}),(0,f.jsx)("label",{children:e("密码")}),(0,f.jsx)(r.Sm,{type:"password",value:B,handleInputChange:e=>D(e)}),(0,f.jsxs)("label",{children:[!ue?.access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{G([...E,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{disabled:""!==ue.cwd&&void 0!==ue.cwd,value:M,handleInputChange:e=>T(e)}),(E??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.access_dirs?.length&&void 0!==ue?.access_dirs?.length,value:t,handleInputChange:e=>{E[s]=e,G([...E])}})}),0===ue?.access_dirs?.length||void 0===ue?.access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{E.splice(s,1),G([...E])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.not_access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{W([...q,""])},title:e("添加")}),e("禁止目录范围")]}),(q??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.not_access_dirs?.length&&void 0!==ue?.not_access_dirs?.length,value:t,handleInputChange:e=>{q[s]=e,W([...q])}})}),0===ue?.not_access_dirs?.length||void 0===ue?.not_access_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{q.splice(s,1),W([...q])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[!ue?.only_read_dirs?.length&&(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{R([...Z,""])},title:e("添加")}),e("只读目录范围")]}),(Z??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{disabled:0!==ue?.only_read_dirs?.length&&void 0!==ue?.only_read_dirs?.length,value:t,handleInputChange:e=>{Z[s]=e,R([...Z])}})}),0===ue?.only_read_dirs?.length||void 0===ue?.only_read_dirs?.length&&(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{Z.splice(s,1),R([...Z])},title:e("删除")})]},s)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.access_cmd&&void 0!==ue.access_cmd,value:U,placeholder:"use blank split",handleInputChange:e=>H(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{disabled:""!==ue.not_access_cmd&&void 0!==ue.not_access_cmd,value:L,placeholder:"use blank split",handleInputChange:e=>Q(e)}),!le&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("label",{children:e("角色")}),(0,f.jsx)(r.l6,{value:de,onChange:e=>{Se(e)},options:(()=>{const e=[];e.push({title:"NOT",value:""});for(let t of _e)e.push({title:t.role_name,value:t.role_id});return e})()})]}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{disabled:""!==ue.language&&void 0!==ue.language,value:J,onChange:e=>{Y(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{disabled:""!==ue.theme&&void 0!==ue.theme,value:ee,onChange:e=>{te(e)},options:xe}),(0,f.jsx)(O,{is_disable:e=>{if(!0===le)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===le||void 0!==se?.find(t=>t===e),select_auth:e=>{se?se.includes(e)?((0,v.I)(se,t=>t===e),ne([...se])):ne([...se,e]):ne([e])}}),(0,f.jsx)("label",{children:e("备注")}),(0,f.jsx)(r.Sm,{value:ie,handleInputChange:e=>ae(e)})]})})})]})}function B(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s}=(0,n.useContext)(N.F),[x,m]=(0,n.useState)([]),[j,g]=(0,w.fp)(p.AG.prompt_card),[S,y]=(0,n.useState)(!1),[C,k]=(0,n.useState)(!1),[b,A]=(0,w.fp)(p.AG.confirm),[I,V]=(0,n.useState)(""),[K,X]=(0,n.useState)(""),[F,P]=(0,n.useState)([]),[$,B]=(0,n.useState)([]),[D,M]=(0,n.useState)([]),[T,E]=(0,n.useState)(""),[G,q]=(0,n.useState)(""),[W,Z]=(0,n.useState)(""),[R,U]=(0,n.useState)(""),[H,L]=(0,n.useState)([]),[Q,J]=(0,n.useState)(""),[Y,ee]=(0,n.useState)(""),te=(0,z.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=>{V(e?.role_name??""),X(e?.cwd??""),P(e?.access_dirs??[]),B(e?.not_access_dirs??[]),M(e?.only_read_dirs??[]),E(e?.access_cmd??""),q(e?.not_access_cmd??""),Z(e?.language??""),U(e?.theme??""),L(e?.auth_list??[]),J(e?.role_id??""),ee(e?.role_note??"")};(0,n.useEffect)(()=>{ne()},[]);const ae=()=>{if(!I)return void(0,_.zN)("role_name not empty");const e=new a.E0;return e.language=W,e.theme=R,e.access_dirs=F,e.role_name=I,e.not_access_dirs=$,e.only_read_dirs=D,e.cwd=K,e.access_cmd=T,e.not_access_cmd=G,e.auth_list=H,e.role_note=Y,e};return(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(0,f.jsx)(i.xh,{children:(0,f.jsx)(l.uF,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("角色")})}),titleCom:(0,f.jsx)("div",{children:(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{y(!0),k(!1),ie(void 0)}})}),children:(0,f.jsx)(h.X,{headers:se,rows:x.map((t,s)=>{const n=[(0,f.jsx)("p",{children:t.role_id}),(0,f.jsx)(l.xP,{children:t.role_name}),(0,f.jsx)(l.xP,{children:t.role_note}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{y(!1),k(!0),ie(e)})(t)}),!t.is_root&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{A({open:!0,title:e("确定删除吗"),handle:async()=>{const e=new a.E0;e.role_id=t,(await c.wm.post("delete_role",e)).code===d.m.Success&&((0,_.SK)("删除完成"),ne(),A({open:!1,handle:null}))}})})(t.role_id)})]})];return n}),width:"10rem"})})})}),(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"40rem",children:(S||C)&&(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e(""+(S?"添加":"编辑"))})," "]}),rightBottomCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:()=>{y(!1),k(!1),ie(void 0)}}),S&&(0,f.jsx)(o.rA,{icon:"add_circle",title:e("添加"),onClick:async()=>{const e=ae();if(!e)return;const t=await c.wm.post("create_role",e);ne(),t.code===d.m.Success&&((0,_.SK)("创建完成"),ne(),y(!1),k(!1),ie(void 0))}}),C&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{const e=ae();if(!e)return;e.role_id=Q;(await c.wm.post("save_role",e)).code===d.m.Success&&((0,_.SK)("保存完成"),ne())}})]}),children:[(0,f.jsx)("label",{children:e("角色名")}),(0,f.jsx)(r.Sm,{value:I,handleInputChange:e=>V(e)}),(0,f.jsx)("label",{children:e("角色备注")}),(0,f.jsx)(r.Sm,{value:Y,handleInputChange:e=>ee(e)}),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{P([...F,""])},title:"添加"}),e("目录范围")]}),(0,f.jsx)(r.Sm,{value:K,handleInputChange:e=>X(e)}),(F??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{F[t]=e,P([...F])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{F.splice(t,1),P([...F])},title:"删除"})]},t)),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{B([...$,""])},title:"添加"}),e("禁止目录范围")]}),($??[]).map((t,s)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:t,handleInputChange:e=>{$[s]=e,B([...$])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{$.splice(s,1),B([...$])},title:e("删除")})]},s)),(0,f.jsxs)("label",{children:[(0,f.jsx)(o.rA,{icon:"add",onClick:()=>{M([...D,""])},title:e("添加")}),e("只读目录范围")]}),(D??[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{width:"90%"},children:(0,f.jsx)(r.Sm,{value:e,handleInputChange:e=>{D[t]=e,M([...D])}})}),(0,f.jsx)(o.rA,{icon:"delete",onClick:()=>{D.splice(t,1),M([...D])},title:"删除"})]},t)),(0,f.jsx)("label",{children:e("可执行的命令")}),(0,f.jsx)(r.Sm,{value:T,placeholder:"use blank split",handleInputChange:e=>E(e)}),(0,f.jsx)("label",{children:e("禁止执行的命令")}),(0,f.jsx)(r.Sm,{value:G,placeholder:"use blank split",handleInputChange:e=>q(e)}),(0,f.jsx)("label",{children:e("语言")}),(0,f.jsx)(r.l6,{value:W,onChange:e=>{Z(e)},options:[{title:e("跟随系统"),value:"sys"},{title:"NOT",value:""},{title:"English",value:"en"},{title:"中文",value:"zh"}]}),(0,f.jsx)("label",{children:e("主题")}),(0,f.jsx)(r.l6,{value:R,onChange:e=>{U(e)},options:te}),(0,f.jsx)(O,{is_disable:()=>!1,is_selected:(e,t)=>void 0!==H?.find(t=>t===e),select_auth:e=>{H?(H.find(t=>t==e)?(0,v.I)(H,t=>t===e):H.push(e),L([...H])):L([e])}})]})})})]})}function D(){const{t:e,i18n:t}=(0,u.B)(),{initUserInfo:s,reloadUserInfo:x}=(0,n.useContext)(N.F),[m,j]=(0,n.useState)([]),[g,S]=(0,w.fp)(p.AG.prompt_card),[C,b]=(0,n.useState)([]),[A,V]=(0,n.useState)([]),[K,X]=(0,n.useState)([]),[F,O]=(0,w.fp)(p.AG.user_base_info),P=(0,y.K)(),$=(0,z.o)(),B=[e("编号"),e("路径"),e("是否默认"),e("备注")],D=[e("编号"),e("路径"),e("备注")],M=[e("编号"),e("命令"),e("父编号"),e("备注")],T=[e("文件后缀"),e("命令"),e("其他参数"),e("备注")],[E,G]=(0,n.useState)(""),[q,W]=(0,n.useState)(""),[Z,R]=(0,n.useState)(""),[U,H]=(0,n.useState)(!1),[L,Q]=(0,n.useState)(""),[J,Y]=(0,n.useState)(""),[ee,te]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{const e=await c.XO.get("filesSetting");e.code===d.m.Success&&(j(e.data.dirs),V(e.data.quick_cmd),X(e.data.file_quick_cmd));const t=await c.XO.get("protection_dir");t.code===d.m.Success&&b(t.data??[])})(),Q(F?.user_data?.language),Y(F?.user_data?.theme),te(F?.user_data?.upload_file_ignore)},[]);const se=(0,z.Q)();return(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(i.fI,{children:[(0,f.jsxs)(i.VP,{widthPer:33,children:[(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{title:e("修改密码"),rightBottomCom:(0,f.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{if(!E||!q)return void(0,_.zN)("账号密码不能为空");if(q!==Z)return void(0,_.zN)("两次密码不一样");const e=new a.tl;e.username=E,e.password=q,e.confirm_password=Z,e.user_id=F.user_data.id;(await c.wm.post("updatePassword",e)).code===d.m.Success&&(0,_.SK)("修改成功")}}),children:[(0,f.jsx)(r.Sm,{placeholder:e("新账号"),value:E,handleInputChange:e=>{G(e)}}),(0,f.jsx)(r.cA,{placeholder:e("新密码"),handleInputChange:e=>{W(e)}}),(0,f.jsx)(r.cA,{placeholder:e("确认密码"),handleInputChange:e=>{R(e)}})]})}),(0,f.jsx)(i.xh,{children:(0,f.jsxs)(l.Zp,{title:e("个性化设置"),rightBottomCom:(0,f.jsx)(o.C3,{text:e("确定修改"),clickFun:async()=>{(await c.XO.post(k.s.setting_sys_option_status_save,{type:I.Mu.private_sys_env,value:{language:L,theme:J,upload_file_ignore:ee}})).code===d.m.Success&&((0,_.SK)("修改成功"),s())}}),children:[e("语言"),(0,f.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,f.jsx)(r.l6,{value:J,onChange:e=>{Y(e)},options:$}),(0,f.jsx)(r.Sm,{value:ee,handleInputChange:e=>{te(e)},placeholderOut:e("拖拽文件上传忽略列表"),placeholder:"node_modules *.js",no_border:!0})]})})]}),(0,f.jsxs)(i.VP,{children:[(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件夹路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("文件夹路径")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{j([...m,{note:"",default:!1,path:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{for(let e=0;e<m.length;e++)m[e].index=e;(await c.XO.post("filesSetting/save",{dirs:m})).code===d.m.Success&&((0,_.SK)("保存成功"),x(),s())}})]}),children:(0,f.jsx)(h.X,{headers:B,rows:m.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.l6,{value:t.default,onChange:e=>{((e,t,s)=>{const n=[];for(let e=0;e<m.length;e++)m[e].default=e===s&&t,n.push(m[e]);j(n)})(0,e,s)},options:P,no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)("div",{children:0!==s&&(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{m.splice(e,1),j([...m])})(s)})})];return n}),width:"10rem",onRowDrag:(e,t)=>{0!==e&&0!==t&&j((0,v.TI)(m,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("个人保护路径")})," ",(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("保护目录")},title:e("信息")})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{b([...C,{path:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("protection_dir/save",C)).code===d.m.Success&&((0,_.SK)("保存成功"),x())}})]}),children:(0,f.jsx)(h.X,{headers:D,rows:C.map((t,s)=>{const n=[(0,f.jsx)("div",{children:s}),(0,f.jsx)(r.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{C.splice(e,1),b([...C])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{b((0,v.TI)(C,e,t))}})})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("目录快捷命令")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("目录快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{V([...A,{cmd:"",note:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{quick_cmd:A})).code===d.m.Success&&((0,_.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:M,rows:A.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.index,handleInputChange:e=>{t.index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.father_index,handleInputChange:e=>{t.father_index=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{A.splice(e,1),V([...A])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{V((0,v.TI)(A,e,t))}})}),(0,f.jsx)(l.uF,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("文件快捷命令")}),(0,f.jsx)(o.rA,{icon:"info",onClick:()=>{se("文件快捷命令")},title:"info"})]}),titleCom:(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...K,{cmd:"",note:"",file_suffix:"",params:""}])}}),(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await c.XO.post("filesSetting/save",{file_quick_cmd:K})).code===d.m.Success&&((0,_.SK)("保存成功"),s())}})]}),children:(0,f.jsx)(h.X,{headers:T,rows:K.map((t,s)=>{const n=[(0,f.jsx)(r.Sm,{value:t.file_suffix,handleInputChange:e=>{t.file_suffix=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.cmd,handleInputChange:e=>{t.cmd=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.params,handleInputChange:e=>{t.params=e},no_border:!0}),(0,f.jsx)(r.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{K.splice(e,1),X([...K])})(s)})];return n}),width:"10rem",onRowDrag:(e,t)=>{X((0,v.TI)(K,e,t))}})})]})]})]})})}const M=["password","private_key","secret_key"],T="webdav";function E(){const{t:e}=(0,u.B)(),[,t]=(0,w.fp)(p.AG.prompt_card),[s,i]=(0,n.useState)([]),[a,d]=(0,n.useState)([]),[x,m]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[g,S]=(0,n.useState)(T),[y,C]=(0,n.useState)(""),[k,b]=(0,n.useState)({}),[A,I]=(0,n.useState)(!1),V=async()=>{try{const[e,t]=await Promise.all([c.I2.post("credential/list",{}),c.I2.post("credential/meta",{})]);i(Array.isArray(e?.data)?e.data:[]),d(Array.isArray(t?.data)?t.data:[])}catch(e){}};(0,n.useEffect)(()=>{V()},[]);const N=a.find(e=>e.type===g)?.fields??[],K=()=>{m(!1),v(""),S(T),C(""),b({}),I(!1)};return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:e("普通凭据管理")}),(0,f.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{t({open:!0,title:e("信息"),context_div:(0,f.jsxs)("div",{children:[(0,f.jsxs)("ul",{children:[(0,f.jsx)("li",{children:e("crd_tp")}),(0,f.jsx)("li",{children:e("bidacct")}),(0,f.jsx)("li",{children:e("pwdkept")}),(0,f.jsx)("li",{children:e("tstbfrs")})]}),(0,f.jsxs)("ul",{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"WebDAV"}),":",e("prtwbdv")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"SSH / SFTP"}),":",e("prtsftp")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("b",{children:"S3 兼容对象存储"}),":",e("prt_s3")]})]})]})})}})]}),rightBottomCom:(0,f.jsxs)("div",{children:[!x&&(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{K(),m(!0)}}),x&&(0,f.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{try{const t=await c.I2.post("credential/test",{id:j||void 0,type:g,config:k}),s=t?.data;s?.ok?(0,_.SK)(`${e("连接成功")}(${s.count??0})`):(0,_.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}}}),x&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(y.trim()){for(const t of N){const s=String(k[t.key]??"").trim()||j&&M.includes(t.key);if(t.required&&!s)return void(0,_.zN)(`${e("请填写")}${e(t.label)}`)}try{await c.I2.post(j?"credential/update":"credential/add",{id:j||void 0,type:g,name:y,config:k,enabled:!0}),(0,_.SK)(e("保存成功")),K(),await V()}catch(e){}}else(0,_.zN)(e("请填写名称"))}}),x&&(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:K})]}),children:[x&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.Sm,{placeholder:e("名称"),value:y,handleInputChange:C}),(0,f.jsx)(r.l6,{value:g,options:a.map(e=>({title:e.name,value:e.type})),onChange:e=>{S(e),b({})}}),N.map(t=>(0,f.jsx)(n.Fragment,{children:(0,f.jsx)(r.Sm,{type:M.includes(t.key)?"password":"text",placeholder:M.includes(t.key)&&A?e("留空表示不修改"):t.label,value:k[t.key]??"",handleInputChange:e=>b({...k,[t.key]:e})})},t.key))]}),!x&&(0,f.jsx)(h.X,{headers:[e("名称"),e("类型"),e("操作")],rows:s.map(t=>{return[(0,f.jsx)(l.xP,{context:t.name}),(0,f.jsx)(l.xP,{context:(s=t.type,a.find(e=>e.type===s)?.name??s)}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{m(!0),v(e.id),S(e.type),C(e.name??""),b({...e.config??{}}),I(Boolean(e.has_password))})(t)}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{try{await c.I2.post("credential/delete",{id:t.id}),(0,_.SK)(e("已删除")),await V()}catch(e){}})(t)})]})];var s})})]})}var G=s(17903);function q(){const{t:e}=(0,u.B)(),[t,s]=(0,n.useState)([]),[i,a]=(0,n.useState)([]),[d,p]=(0,n.useState)([]),[x,m]=(0,n.useState)([]),[j,v]=(0,n.useState)(!1),[g,w]=(0,n.useState)(""),[S,y]=(0,n.useState)("webdav"),[C,k]=(0,n.useState)(""),[b,A]=(0,n.useState)(""),[I,V]=(0,n.useState)(""),[N,K]=(0,n.useState)(""),X=async()=>{try{const[e,t,n,i]=await Promise.all([c.I2.post("list",{}),c.I2.post("credential/list",{}),c.I2.post("driver/list",{}),c.I2.post("baidu/app/get",{})]);s(Array.isArray(e?.data)?e.data:[]),a(Array.isArray(t?.data)?t.data:[]),p(Array.isArray(n?.data)?n.data:[]),m(Array.isArray(i?.data?.accounts)?i.data.accounts:[])}catch(e){}};(0,n.useEffect)(()=>{X()},[]);const z=()=>{v(!1),w(""),y("webdav"),k(""),A(""),V(""),K("")};return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsx)("span",{className:" div-row ",children:(0,f.jsx)("h2",{children:e("挂载列表")})}),rightBottomCom:(0,f.jsxs)("div",{children:[!j&&(0,f.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{z(),v(!0)}}),j&&(0,f.jsx)(o.rA,{icon:"network_check",title:e("测试连接"),onClick:async()=>{if(b)try{const t=await c.I2.post("test",{id:g||void 0,driver:S,credential_id:b,root_dir:I}),s=t?.data;s?.ok?(0,_.SK)(`${e("连接成功")}(${s.count??0})`):(0,_.zN)(`${e("连接失败")}:${s?.error??""}`)}catch(e){}else(0,_.zN)(e("请选择凭据"))}}),j&&(0,f.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(b)if(C.trim())try{await c.I2.post(g?"update":"add",{id:g||void 0,driver:S,mount_path:C,credential_id:b,root_dir:I,name:N,color:G.OT,readonly:!1,enabled:!0}),(0,_.SK)(e("保存成功")),z(),await X()}catch(e){}else(0,_.zN)(e("munt_rq"));else(0,_.zN)(e("请选择凭据"))}}),j&&(0,f.jsx)(o.rA,{icon:"cancel",title:e("取消"),onClick:z})]}),children:[j&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.BC,{label:e("挂载类型"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:S,options:d.map(e=>({title:e.name,value:e.type})),onChange:e=>{y(e),A("")}})}),(0,f.jsx)(r.BC,{label:e("凭据"),label_width:"6rem",required:!0,children:(0,f.jsx)(r.l6,{value:b,options:(e=>{if("baidu"===e)return x.map(e=>({title:e.name||e.baidu_name||String(e.uk),value:String(e.uk)}));const t=G.UW[e];return i.filter(e=>!t||e.type===t).map(e=>({title:e.name,value:e.id}))})(S),onChange:A})}),(0,f.jsx)(r.BC,{label:e("本地目录"),label_width:"6rem",required:!0,children:(0,f.jsx)(r.Sm,{placeholder:e("被挂载的本地绝对路径"),value:C,handleInputChange:k})}),(0,f.jsx)(r.BC,{label:e("strtdrt"),label_width:"6rem",children:(0,f.jsx)(r.Sm,{placeholder:e("远端目录"),value:I,handleInputChange:V})}),(0,f.jsx)(r.BC,{label:e("dspnmtp"),label_width:"6rem",children:(0,f.jsx)(r.Sm,{placeholder:e("列表显示的名称"),value:N,handleInputChange:K})})]}),!j&&(0,f.jsx)(h.X,{headers:[e("名称"),e("挂载类型"),e("凭据"),e("操作")],rows:t.map(t=>{const s=i.find(e=>e.id===t.credential_id),n="baidu"===t.driver?x.find(e=>String(e.uk)===String(t.credential_id)):void 0;return[(0,f.jsx)("p",{children:t.name}),(0,f.jsx)("p",{children:(a=t.driver,d.find(e=>e.type===a)?.name??a)}),(0,f.jsx)("p",{children:n?n.name||n.baidu_name||String(n.uk):s?s.name:e("凭据已丢失")}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{v(!0),w(e.id),y(e.driver),k(e.mount_path??""),A(e.credential_id??""),V(e.root_dir??""),K(e.name??"")})(t)}),(0,f.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(async t=>{try{await c.I2.post("delete",{id:t.id}),(0,_.SK)(e("已删除")),await X()}catch(e){}})(t)})]})];var a})})]})}function W({on_credential_change:e}){const{t}=(0,u.B)(),[,s]=(0,w.fp)(p.AG.prompt_card),[i,a]=(0,n.useState)(null),[d,x]=(0,n.useState)([]),[m,j]=(0,n.useState)("百度网盘"),[v,g]=(0,n.useState)(""),[S,y]=(0,n.useState)(""),[C,k]=(0,n.useState)(""),[b,A]=(0,n.useState)("oob"),[I,V]=(0,n.useState)(!0),[N,K]=(0,n.useState)(!0),X="oob"===b,[z,F]=(0,n.useState)(!1),[O,P]=(0,n.useState)(!1),[$,B]=(0,n.useState)(""),D=async()=>{try{const e=await c.I2.post("baidu/app/get",{}),t=e?.data?.app??null;a(t),x(e?.data?.accounts??[]),j(t?.name??"百度网盘"),g(t?.app_id??""),y(t?.app_key??""),A("one_click"===t?.auth_mode?"one_click":"oob"),V(!1!==t?.enabled),K(!1!==t?.auto_refresh)}catch(e){}};(0,n.useEffect)(()=>{D();const s=new URLSearchParams(window.location.search),n=s.get("baidu_auth");"success"===n?((0,_.SK)(`${t("授权成功")}:${s.get("name")??""}`),e()):"failed"===n&&(0,_.zN)(`${t("授权失败")}:${s.get("reason")??""}`),n&&window.history.replaceState({},"",window.location.pathname)},[]);return(0,f.jsxs)(l.Zp,{self_title:(0,f.jsxs)("span",{className:" div-row ",children:[(0,f.jsx)("h2",{children:t("百度网盘")}),(0,f.jsx)(o.rA,{icon:"info",title:t("信息"),onClick:()=>{s({open:!0,title:t("信息"),context_div:(0,f.jsxs)("ul",{children:[(0,f.jsx)("li",{children:t("atathtp")}),(0,f.jsx)("li",{children:t("atathnt")}),(0,f.jsx)("li",{children:t("pstatht")})]})})}})]}),rightBottomCom:(0,f.jsxs)("div",{children:[!z&&(0,f.jsx)(o.rA,{icon:"apps",title:t("应用配置"),onClick:()=>F(!0)}),z&&(0,f.jsx)(o.rA,{icon:"save",title:t("保存应用配置"),onClick:async()=>{if(S.trim())if(i?.configured||C.trim())try{await c.I2.post("baidu/app/save",{name:m,app_id:v,app_key:S,secret_key:C,auth_mode:b,remark:i?.remark??"",enabled:I,auto_refresh:N}),(0,_.SK)(t("保存成功")),k(""),F(!1),await D()}catch(e){}else(0,_.zN)(t("rq_scrt"));else(0,_.zN)(t("rqappky"))}}),z&&(0,f.jsx)(o.rA,{icon:"cancel",title:t("取消"),onClick:()=>F(!1)}),!z&&(0,f.jsx)(o.rA,{icon:"key",title:t("授权"),onClick:()=>P(!0)}),(0,f.jsx)(o.rA,{icon:"refresh",title:t("授权检测/刷新"),onClick:async()=>{try{await c.I2.post("baidu/verify/all",{}),(0,_.SK)(t("检测完成")),await D()}catch(e){}}})]}),children:[z&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.Sm,{placeholder:t("名称"),value:m,handleInputChange:j}),(0,f.jsx)(r.Sm,{placeholder:"AppID",value:v,handleInputChange:g}),(0,f.jsx)(r.Sm,{placeholder:"AppKey",value:S,handleInputChange:y}),(0,f.jsx)(r.Sm,{type:"password",placeholder:i?.configured?t("scrtkep"):"SecretKey",value:C,handleInputChange:k}),(0,f.jsx)(r.BC,{label:t("授权方式"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:b,options:(0,G.K1)(t),onChange:e=>A("one_click"===e?"one_click":"oob")})}),(0,f.jsx)(r.BC,{label:t("网盘使用"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:I,options:(0,G.Dd)(t),onChange:V})}),(0,f.jsx)(r.BC,{label:t("atrfrsh"),label_width:"6rem",children:(0,f.jsx)(r.l6,{value:N,options:(0,G.Dd)(t),onChange:K})})]}),O&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(r.BC,{label:t("授权方式"),label_width:"6rem",children:(0,f.jsxs)("div",{className:"div-row",children:[(0,f.jsx)(r.U6,{value:"one_click",context:t("一键授权"),name:"baidu_auth_mode",selected:"one_click"===b,onchange:()=>A("one_click")}),(0,f.jsx)(r.U6,{value:"oob",context:t("outh_ob"),name:"baidu_auth_mode",selected:"oob"===b,onchange:()=>A("oob")})]})}),X&&(0,f.jsx)(r.Sm,{placeholder:t("pst_cd"),value:$,handleInputChange:B}),(0,f.jsxs)("div",{className:"div-row mount-actions",children:[(0,f.jsx)(o.C3,{text:t(X?"去授权(手动)":"去授权(一键)"),clickFun:async()=>{if(i?.configured)try{const e=await c.I2.post("baidu/authorize_url",{mode:b});e?.data&&window.open(e.data,"_blank","noopener,noreferrer")}catch(e){}else(0,_.zN)(t("svappfr"))}}),X&&(0,f.jsx)(o.C3,{text:t("完成授权"),clickFun:async()=>{if($.trim())try{const s=await c.I2.post("baidu/exchange",{code:$.trim(),mode:b});(0,_.SK)(`${t("授权成功")}:${s?.data?.baidu_name??""}`),B(""),P(!1),await D(),e()}catch(e){}else(0,_.zN)(t("请填写授权码"))}}),(0,f.jsx)(o.C3,{text:t("取消"),clickFun:()=>P(!1)})]})]}),!z&&!O&&(0,f.jsx)(h.X,{headers:[t("账号名"),t("百度账号"),t("授权状态"),t("使用"),t("授权时间"),t("操作")],rows:d.map(s=>{return[(0,f.jsx)(r.Sm,{value:s.name,no_border:!0,handleInputChange:t=>(async(t,s)=>{try{await c.I2.post("baidu/account/update",{uk:t.uk,name:s}),e()}catch(e){}})(s,t)}),(0,f.jsx)(l.xP,{context:s.baidu_name||"-"}),(0,f.jsx)(l.xP,{context:(n=s,n.authorized?n.expired?t("已过期"):t("已授权"):t("未授权"))}),(0,f.jsx)(r.l6,{value:s.enabled,no_border:!0,options:(0,G.Dd)(t),onChange:()=>(async t=>{try{await c.I2.post("baidu/account/update",{uk:t.uk,enabled:!t.enabled}),await D(),e()}catch(e){}})(s)}),(0,f.jsx)("p",{children:(0,G.eK)(s.created_at)}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.rA,{icon:"network_check",title:t("授权检测"),onClick:()=>(async e=>{try{const s=await c.I2.post("baidu/verify",{uk:e.uk});s?.data?.valid?(0,_.SK)(t("账号可用")):(0,_.zN)(`${t("账号不可用")}:${s?.data?.error??""}`),await D()}catch(e){}})(s)}),(0,f.jsx)(o.rA,{icon:"link_off",title:t("取消授权"),onClick:()=>(async e=>{try{await c.I2.post("baidu/deauthorize",{uk:e.uk}),(0,_.SK)(t("已取消授权")),await D()}catch(e){}})(s)}),(0,f.jsx)(o.rA,{icon:"delete",title:t("删除"),onClick:()=>(async s=>{try{await c.I2.post("baidu/delete",{uk:s.uk}),(0,_.SK)(t("已删除")),await D(),e()}catch(e){}})(s)})]})];var n})})]})}function Z(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=t(a.oV.file_mount),[r,d]=(0,w.fp)(p.AG.mount_enabled);(0,n.useEffect)(()=>{s&&(async()=>{try{const e=await c.I2.post("enabled/get",{});d(!0===e?.data)}catch(e){d(!1)}})()},[s]);return s?(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)(b.aZ,{position:"right",children:[(0,f.jsx)("span",{className:"header-label",children:e("总开关")}),(0,f.jsx)(o.rA,{icon:!0===r?"cloud_done":"cloud_off",title:e(!0===r?"muntont":"muntoff"),selected:!0===r,onClick:async()=>{const t=!r;try{const s=await c.I2.post("enabled/set",{enabled:t}),n=!0===s?.data;d(n),(0,_.SK)(e(n?"挂载已启用":"挂载已停用"))}catch(e){}}})]}),(0,f.jsxs)(i.xh,{children:[(0,f.jsxs)(i.fI,{children:[(0,f.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,f.jsx)(E,{})}),(0,f.jsx)(i.VP,{widthPer:60,maxWidth:"60rem",children:(0,f.jsx)(W,{on_credential_change:()=>window.location.reload()})})]}),(0,f.jsx)(i.fI,{children:(0,f.jsx)(i.VP,{widthPer:50,maxWidth:"60rem",children:(0,f.jsx)(q,{})})})]})]}):(0,f.jsx)(i.fI,{children:(0,f.jsx)(i.VP,{children:(0,f.jsx)(l.Zp,{self_title:(0,f.jsx)("h2",{children:e("网盘挂载")}),children:(0,f.jsx)("p",{children:e("nmuntpr")})})})})}var R=s(87361);function U(){const{t:e}=(0,u.B)(),{check_user_auth:t}=(0,S.MH)(),s=[{index:1,name:`${e("个人环境")}`,rto:"private_env_setting",component:(0,f.jsx)(D,{})}];return t(a.oV.sys_setting_page)&&s.unshift({index:1,name:e("系统"),rto:"password",component:(0,f.jsx)(X,{})}),t(a.oV.sys_env_page)&&s.push({index:1,name:`${e("系统环境")}`,rto:"env_setting/",component:(0,f.jsx)(F,{})}),t(a.oV.auth_router_page)&&s.push({index:1,name:e("自定义路由"),rto:"customer_router/",component:(0,f.jsx)(A,{})}),t(a.oV.user_manage)&&s.push({index:1,name:e("用户管理"),rto:"user_manager/",component:(0,f.jsx)($,{})}),t(a.oV.role_manage)&&s.push({index:1,name:e("角色管理"),rto:"role_manager/",component:(0,f.jsx)(B,{})}),t(a.oV.file_mount)&&s.push({index:1,name:e("网盘挂载"),rto:"mount_setting/",component:(0,f.jsx)(Z,{})}),(0,f.jsx)(i.W1,{optionList:s,father_route:R.o.setting})}},92350(e,t,s){s.d(t,{Q:()=>h,o:()=>p});var n=s(34843),i=s(82893),a=s(74777),l=s(96540),o=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:l}=(0,o.B)();return e=>{let n;e===a.jk.ffmpeg?n=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===a.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,l.useState)([]);return(0,l.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:()=>l});var n=s(72635);const i=1440,a=525600;function l(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<a?`${(s/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(s/a).toFixed(0)} ${n.Ay.t("年前")}`}},24659(e,t,s){var n=s(86149);s.d(t,["K",0,()=>{const{t:e}=(0,n.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6805],{18840(e,n,t){t.d(n,{I:()=>s,gE:()=>l});class s{open;key;option_keys;port}class l{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}t.d(n,["FG",0,{content_max_width:"70%",content_padding:"4%",font_size:"16px",line_height:"1.8"},"mo",0,"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"])},47996(e,n,t){t.d(n,{d:()=>l});t(96540);var s=t(74848);function l(e){return(0,s.jsxs)("div",{className:"instance-item",children:[(0,s.jsxs)("div",{className:"instance-item__toolbar",children:[(0,s.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,n,t){t.d(n,{S:()=>a,X:()=>r});var s=t(96540),l=t(61443),i=t(74848);function r(e){const[n,t]=s.useState([]),r=(0,s.useRef)(-1),[a,c]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]);const _=()=>{r.current=-1,c(-1),d(-1)};return(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((n,t)=>{const s=!!e.filter&&(e.filter.column??0)===t;let r=n;if(s){const t=e.filter,s=t.options.find(e=>e.value===t.value);null!=t.value&&s&&(r=`${n} (${s.label})`)}return(0,i.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,i.jsx)(l.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):n},t)})})}),(0,i.jsx)("tbody",{children:n.map((n,t)=>{const s=!!e.onRowDrag;return(0,i.jsx)("tr",{className:s?(a===t?"row-dragging":"")+(o===t?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},onDragStart:e=>{s&&(r.current=t,c(t),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(t))},onDrop:n=>{s&&(n.preventDefault(),(()=>{const n=r.current,t=o;_(),n<0||t<0||n===t||e.onRowDrag?.(n,t)})())},onDragEnd:_,children:n.map((t,s)=>{const l=s===n.length-1?"small":"";return(0,i.jsx)("td",{className:l,style:{width:e.width??"auto"},children:t},s)})},t)})})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,i.jsx)("div",{children:e},n))})}},36805(e,n,t){t.r(n),t.d(n,{default:()=>K});var s=t(96540),l=t(75725),i=t(86149),r=t(70447),a=t(85997),c=t(77481),o=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),u=t(82893),p=t(62042),j=(t(23430),t(21499),t(14944)),m=t(92275),v=t(6960),f=t(40505),g=t(4412),w=t(24659),y=t(74848);let S={};function C(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:C}=(0,s.useContext)(x.F),[b,k]=(0,h.fp)(u.AG.user_base_info),[I,A]=(0,s.useState)([]),[P,N]=(0,h.fp)(u.AG.prompt_card),$=(0,w.K)(),[F,K]=(0,s.useState)(),[B,U]=(0,s.useState)(void 0),[E,G]=(0,s.useState)(null),[D,V]=(0,s.useState)([]),[q,z]=(0,s.useState)([]),M=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],X=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],Z=[e("序号"),e("服务端口"),e("fwd_nm"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],H=e=>null==e?"":(0,v.s)(e),O=async e=>{const n=await d.s9.post("server_bridge_get_one_fig",{server_client_num_id:e});if(n.code===_.m.Success){const e=n.data;for(const n of e)n.client_name=S?.[n.client_num_id]?.client_name??"";z(e)}},L=async e=>{const n=void 0===e?E:e,t=await d.s9.get("server_client_get");if(t.code===_.m.Success){const e=t.data,s=[],l=[];S={};for(const t of e)null!==n&&!!t.status!==n||(B?`${t.index}${t.client_name}${t.note}`.includes(B)&&s.push(t):s.push(t),l.push({label:t.client_name,value:t.client_num_id}),S[t.client_num_id]=t);A(s),V(l)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,y.jsxs)(s.Fragment,{children:[(0,y.jsx)(g.aZ,{position:"right",children:F&&(0,y.jsx)("span",{children:`${F.client_name}${F.note?`(${F.note})`:""}`})}),(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:B,handleInputChange:e=>{U(e)},handlerEnter:()=>{L()}}),children:(0,y.jsx)(c.X,{headers:M,filter:{title:e("在线状态"),column:2,value:E,options:[{label:e("全部"),value:null},{label:e("在线"),value:!0},{label:e("离线"),value:!1}],onChange:e=>{G(e),L(e)}},rows:I.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.client_name}),(0,y.jsx)(r.fq,{ok:n.status}),(0,y.jsx)(r.xP,{children:H(n.status?n.online_start_time:n.offline_time)}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>{K({...n}),O(n.client_num_id)}}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{N({open:!0,title:"share file",confirm:async()=>{N({open:!1}),await(async e=>{(await d.s9.post("server_client_del",{client_num_id:e})).code===_.m.Success&&((0,p.SK)("成功"),L())})(n.client_num_id)},context_div:(0,y.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:F?(0,y.jsxs)(l.xh,{children:[(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",F)).code===_.m.Success&&(0,p.SK)("成功")}})}),children:[(0,y.jsx)(l.Yh,{left:e("远程地址"),center:F?.client_remote_address??""}),(0,y.jsx)(l.Yh,{left:e(F?.status?"在线时间":"离线时间"),center:H(F?.status?F?.online_start_time:F?.offline_time)}),(0,y.jsx)(o.Sm,{placeholder:"名称",value:F.client_name,handleInputChange:e=>{F.client_name=e,K({...F})}}),(0,y.jsxs)("form",{children:[e("fc_pxy"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}})]})]}),F.open_filecat&&(0,y.jsxs)(s.Fragment,{children:[(0,y.jsxs)("form",{children:[e("fc_pxyw"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}})]})]}),(0,y.jsx)(o.Sm,{placeholderOut:e("fc_pxyr"),placeholder:"127.0.0.1:5567",value:F.filecat_proxy_host_port,handleInputChange:e=>{F.filecat_proxy_host_port=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"content_copy",title:e("复制filecat代理url"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${F.client_num_id}`;(0,f.lW)(e),(0,p.SK)(e)}})]}),(0,y.jsx)(o.Sm,{placeholder:"备注",value:F.note,handleInputChange:e=>{F.note=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F.proxy_fig_list.push({open:!1}),K({...F})},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:X,rows:F.proxy_fig_list.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,K({...F})},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(F.proxy_fig_list.length??0);n++)n!==t&&e.push(F.proxy_fig_list[n]);F.proxy_fig_list=e,K({...F})}})})]),width:"10rem"})]}),(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{q.push({open:!1,server_client_num_id:F.client_num_id}),z([...q])},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:Z,rows:q.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_name,options:D,handleInputChange:e=>{const t=(e=>D.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,z([...q])},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,z([...q])},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(q.length??0);n++)n!==t&&e.push(q[n]);z([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,p.SK)("成功"),O(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_add_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}}):(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_edit_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,y.jsx)(l.xh,{})})]})]})}var b=t(18840),k=t(7463);function I(e){const{t:n}=(0,i.B)(),[t,x]=(0,s.useState)([]),[h,u]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,S]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],A=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],P=(0,w.K)(),N=async()=>{const e=await d.s9.get("client_get");if(e.code===_.m.Success){const n=e.data;x(n.list)}const n=await d.s9.get("client_bridge_get_all_fig");n.code===_.m.Success&&f(n.data);const t=await d.s9.get("client_sync_task_get");t.code===_.m.Success&&S(t.data)};(0,s.useEffect)(()=>(N(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{const e=(0,k.sg)(()=>N(),500);j.ws.addMsg(m.HK.tcp_proxy_client_status,e)}),()=>{j.ws.removeMsg(m.HK.tcp_proxy_client_status)}),[]);const $=async e=>{const n=new b.gE;n.index=e.index,n.key=e.key,n.serverIp=e.serverIp,n.serverPort=e.serverPort,n.open=e.open,n.client_name=e.client_name,n.client_num_id=e.client_num_id;(await d.s9.post("client_save",n)).code===_.m.Success?(0,p.SK)("保存成功"):(0,p.zN)("网络错误")};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsxs)(r.Zp,{title:"",rightBottomCom:(0,y.jsx)(a.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,$(t[0])}}),titleCom:(0,y.jsxs)("div",{children:[n("连接状态"),(0,y.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,y.jsx)(o.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,y.jsx)(o.Sm,{type:"number",placeholder:`${n("服务器")} port`,value:t[0]?.serverPort,handleInputChange:e=>{const n=parseInt(e);!isNaN(n)&&n>=0&&n<=65535&&(t[0].serverPort=n)}}),(0,y.jsx)(o.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,y.jsx)(o.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,y.jsxs)("form",{children:[n("状态"),(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,y.jsx)(o.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]})}),(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,y.jsx)(c.X,{headers:A,rows:t.slice(1).map((e,s)=>[(0,y.jsx)("p",{children:s}),(0,y.jsx)(o.Sm,{type:"number",value:e.serverPort,handleInputChange:n=>{const t=parseInt(n);!isNaN(t)&&t>=0&&t<=65535&&(e.serverPort=t)},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,y.jsx)(r.fq,{ok:!!e.status}),(0,y.jsx)(o.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:P,no_border:!0}),(0,y.jsx)(o.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:n("删除"),onClick:async()=>{if(e.is_new){const e=[];for(let n=0;n<(t.length??0);n++)n!==s&&e.push(t[n]);x([...e])}else await(async e=>{(await d.s9.post("client_del",{index:e})).code===_.m.Success?((0,p.SK)("保存成功"),N()):(0,p.zN)("网络错误")})(s+1)}}),e.is_new?(0,y.jsx)(a.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await $(e)}}):(0,y.jsx)(a.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await $(e)}})]})]),width:"10rem"})]})})]}),(0,y.jsxs)(l.fI,{children:[!!v?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("br_port"),children:(0,y.jsx)(c.X,{headers:C,rows:v.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})})}),!!g?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,y.jsx)(c.X,{headers:I,rows:g.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.source_client_name}),(0,y.jsx)(r.xP,{children:e.target_client_name}),(0,y.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})})})]})]})}function A(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(u.AG.user_base_info),[w,S]=(0,h.fp)(u.AG.prompt_card),[C,k]=(0,s.useState)(!1),[I,A]=(0,s.useState)([]),[P,N]=(0,s.useState)(null),[$,F]=(0,s.useState)([]),[K,B]=(0,s.useState)(void 0),[U,E]=(0,s.useState)(void 0),G=(0,s.useMemo)(()=>{const e=[...I];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[I,P]),D=async()=>{const e=await d.s9.get("get_all_open_server_client_proxy_fig");if(e.code===_.m.Success){const n=[];for(const t of e.data)U?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(U)&&n.push(t):n.push(t);A(n)}},V=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(B(e.data.port),k(!!e.data.open),F(e.data.option_keys??[])),D()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{V()}),V()},[]);const q=async e=>{const n=new b.I;n.port=K,n.open=C,n.option_keys=$;(await d.s9.post("server_save",{fig:n,notice_client:e})).code===_.m.Success&&(0,p.SK)("成功")};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.C3,{text:e("sv_ntf"),clickFun:()=>{q(!0)}}),(0,y.jsx)(a.C3,{text:e("保存"),clickFun:()=>{q(!1)}})]}),children:[(0,y.jsx)(o.Sm,{placeholder:"port",value:K,handleInputChange:e=>{B(e)}}),(0,y.jsxs)("label",{children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F([...$,""])},title:e("添加")}),e("key")]}),($??[]).map((n,t)=>(0,y.jsxs)("div",{style:{display:"flex"},children:[(0,y.jsx)("div",{style:{width:"90%"},children:(0,y.jsx)(o.Sm,{type:"password",value:n,handleInputChange:e=>{$[t]=e,F([...$])}})}),(0,y.jsx)(a.rA,{icon:"delete",onClick:()=>{$.splice(t,1),F([...$])},title:e("删除")})]},t)),(0,y.jsxs)("form",{children:[e("状态"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{E(e)},handlerEnter:()=>{D()}}),children:(0,y.jsx)(c.X,{headers:[e("序号"),(0,y.jsx)(a.rA,{title:e("服务端口"),onClick:()=>{N(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:G.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.proxy_host}),(0,y.jsx)(r.xP,{children:e.proxy_port}),(0,y.jsx)(r.xP,{children:e.client_name}),(0,y.jsx)(r.fq,{ok:!!e.open_success}),(0,y.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var P=t(47996),N=t(78247);function $(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:j}=(0,s.useContext)(x.F),[m,v]=(0,h.fp)(u.AG.user_base_info),[f,g]=(0,h.fp)(u.AG.prompt_card),[,w]=(0,h.fp)(u.AG.confirm),[S,C]=(0,h.fp)(u.AG.editorSetting),[k,I]=(0,s.useState)([]),[A,$]=(0,s.useState)([]),F=[e("编号"),e("原客户端"),e("开启"),e("备注"),e("操作")],[K,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{(async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[];for(const e of n)t.push({label:e.client_name,value:e.client_num_id});$(t),await U()}})()},[]);const U=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&I(e.data)},E=e=>A.find(n=>String(n.value)===String(e))?.label??"",G=e=>A.find(n=>String(n.value)===String(e)),D=(e,n,t)=>{K?.targets&&(K.targets[e]={...K.targets[e],[n]:t},B({...K,targets:[...K.targets]}))},V=async n=>{const t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),await U()):(0,p.zN)(t.message??e("操作失败"))};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,maxWidth:"40rem",children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("客户端文件同步")}),(0,y.jsx)(a.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:e("sy_tp1")}),(0,y.jsx)("li",{children:e("sy_tp2")}),(0,y.jsx)("li",{children:e("sy_tp3")})]})})})},title:e("信息")})]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{B({open:!1,source_client_num_id:void 0,source_dir:"",targets:[],delete_missing:!0,is_new:!0})}})}),children:(0,y.jsx)(c.X,{headers:F,rows:k.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.source_client_name}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(r.fq,{ok:!!n.open}),n.open?e("开启"):e("关闭")]}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{B(JSON.parse(JSON.stringify(e)))})(n)}),(0,y.jsx)(a.rA,{icon:"sync",title:e("立即同步"),onClick:()=>(async n=>{if(!n.id||!n.open)return void(0,p.zN)(e("tsk_off"));const t=await d.s9.post("sync_task_rescan",{id:n.id});t.code===_.m.Success?(0,p.SK)(e("已触发同步")):(0,p.zN)(t.message??e("操作失败"))})(n)}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{w({open:!0,title:e("确定删除吗"),handle:async()=>{await(async n=>{(await d.s9.post("sync_task_del",{id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),K?.id===n&&B(null),await U())})(n.id),w({open:!1,handle:null})}})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:K&&(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e(""+(K.is_new?"添加":"编辑"))})}),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>B(null)}),(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(!K)return;const n=K,t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),B(null),await U()):(0,p.zN)(t.message??e("操作失败"))}})]}),children:[(0,y.jsx)(o.BC,{label:e("开启"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!K.open,onchange:()=>{B({...K,open:!K.open})}})}),(0,y.jsx)(o.BC,{label:e("备注"),label_width:"6rem",children:(0,y.jsx)(o.Sm,{value:K.note,handleInputChange:e=>{B({...K,note:e})}})}),(0,y.jsx)(o.BC,{label:e("原客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(K.source_client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&B({...K,source_client_num_id:parseInt(String(n.value))})}})}),(0,y.jsx)(o.BC,{label:e("原目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:K.source_dir,placeholder:e("被同步的源目录"),handleInputChange:e=>{B({...K,source_dir:e})}})}),(0,y.jsx)("label",{children:e("目标列表")}),(K.targets??[]).map((n,t)=>(0,y.jsxs)(P.d,{title:`${e("目标")}${t+1}`,toolbar:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o.BC,{label:e("全量同步"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!n.full_sync,onchange:()=>D(t,"full_sync",!n.full_sync)})}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{if(!K?.targets)return;const n=[...K.targets];n.splice(e,1),B({...K,targets:n})})(t)})]}),children:[(0,y.jsx)(o.BC,{label:e("客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(n.client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&D(t,"client_num_id",parseInt(String(n.value)))}})}),(0,y.jsx)(o.BC,{label:e("目标目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:n.dir,handleInputChange:e=>D(t,"dir",e)})})]},t)),(0,y.jsxs)("div",{className:"div-row",children:[(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{if(!K)return;const e=[...K.targets??[],{client_num_id:void 0,dir:"",full_sync:!1}];B({...K,targets:e})}}),(0,y.jsx)(a.rA,{icon:"edit",title:e("忽略目录"),onClick:()=>{var e;e=K,N.xK.set_value_temp(e.ignore_text??b.mo),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async n=>{e.ignore_text=n,B({...e}),N.xK.set_value_temp(""),await V(e)}})}})]})]})})})]})}var F=t(87361);function K(){const{t:e}=(0,i.B)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,y.jsx)(I,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,y.jsx)(A,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,y.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,y.jsx)($,{})}];return(0,y.jsx)(l.W1,{optionList:n,father_route:F.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const l=1440,i=525600;function r(e){e=e>1e12?e:1e3*e;const n=Date.now(),t=Math.abs(n-e)/6e4;return t<1?s.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${s.Ay.t("分钟前")}`:t<l?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/l).toFixed(0)} ${s.Ay.t("天前")}`:t<i?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/i).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(86149);t.d(n,["K",0,()=>{const{t:e}=(0,s.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
@@ -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" href="{{{logo_favicon}}}"/><script defer="defer" src="main.f7d3e41cbec1e3c89682.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.d07c1bd328b47164e2a8.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>