filecat 6.43.6 → 6.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/{1448.c9f76a52d88a488d6da2.js → 1448.9d36cf216585774aa090.js} +1 -1
- package/build/dist/{1472.1a9c627133a364ceeb61.js → 1472.1d82f53e309eceea3e9a.js} +1 -1
- package/build/dist/{1595.5f5ec6122acae3a9cd0b.js → 1595.2c366cdfe302dc5a5050.js} +1 -1
- package/build/dist/{1636.64b2c5dd5956d512a0fc.js → 1636.723781f88d68ed3657cb.js} +1 -1
- package/build/dist/{1832.a01933ba5df99576ecc2.js → 1832.99a4c37ffea35d9b9cb3.js} +1 -1
- package/build/dist/{2502.754728f7e85723b16fc3.js → 2502.cd914e22b13cdaaf78bc.js} +1 -1
- package/build/dist/{2542.26cb302b60de23166227.js → 2542.58c52e3d0bd7af6d9a62.js} +1 -1
- package/build/dist/2674.c58839496f66c6512ae5.js +1 -0
- package/build/dist/{2851.b4b84820b81113718235.js → 2851.a7ecf5bca38c79677f03.js} +1 -1
- package/build/dist/{3402.5d4caccb2e21dbeb3398.js → 3402.62335cc49fe962eaf134.js} +1 -1
- package/build/dist/{3659.f32a94d104cc1353e384.js → 3659.55a733505528331021e0.js} +1 -1
- package/build/dist/{4273.2f3c957012fa1d0c4747.js → 4273.19b11dd57545851ebc50.js} +1 -1
- package/build/dist/{4903.69328b798fc5c52d6069.js → 4903.f8714937dbb91b37c119.js} +1 -1
- package/build/dist/{5516.f442aef7efd919af92cd.js → 5516.e3b6d2b2c1439d8e4cf6.js} +1 -1
- package/build/dist/{5761.0afce3c97ce69979e9ee.js → 5761.2631a6de5c30fbfb66da.js} +1 -1
- package/build/dist/{5937.820d7e5fcf608c346964.js → 5937.9e77a5b78996adbdbe1b.js} +1 -1
- package/build/dist/{6247.cbbbe80520d738798cca.js → 6247.077a555b26c06aa2e96b.js} +1 -1
- package/build/dist/6505.bacc9c5cdd2094604a00.js +1 -0
- package/build/dist/678.f0aed27a613d4dd41080.js +1 -0
- package/build/dist/{6892.fac5b622852f0aad613d.js → 6892.4db4a81a58e94e4356cc.js} +1 -1
- package/build/dist/{7133.cf2a4a51286b78a653af.js → 7133.ae2c0ab24c0d2a3a5a1c.js} +1 -1
- package/build/dist/{7180.e79b454cc9ea523bfebc.js → 7180.32c831dec9865cde8006.js} +1 -1
- package/build/dist/{7181.9f22415130200367cfda.js → 7181.4a60db9c9a2603feeff8.js} +1 -1
- package/build/dist/{7209.de0fc874821ef1cb0684.js → 7209.f4ad503eb484aa601281.js} +1 -1
- package/build/dist/{7759.8041fbbd5fcb8366c098.js → 7759.b58c5676b606e60d7aac.js} +1 -1
- package/build/dist/8090.90cb45de35e21b9cfcb0.js +2 -0
- package/build/dist/{8603.8b4a272c8bbe4d5fd4c4.js → 8603.557bbe67c1b08a3627d6.js} +1 -1
- package/build/dist/{8714.a9a6d15b8cc47c1ae191.js → 8714.3360add5f45201f4c8da.js} +1 -1
- package/build/dist/{8765.32baeac654f4d839c1d0.js → 8765.35d24edc172c477ba795.js} +1 -1
- package/build/dist/8947.f2b4fad4c25fb147ea42.js +2 -0
- package/build/dist/index.html +1 -1
- package/build/dist/{main.427adb2d4ce72b3d6bc1.js → main.151df5e8840564caf370.js} +2 -2
- package/build/main.js +1 -1
- package/build/main.js.LICENSE.txt +1 -1
- package/build/threads.work.filecat.js +1 -1
- package/package.json +2 -2
- package/shell/config/base.webpack.config.js +1 -1
- package/shell/config/webpack.npm.config.js +2 -1
- package/build/dist/2674.570467c7d8e3378316cc.js +0 -1
- package/build/dist/6505.f730960378f6e4b7bc24.js +0 -1
- package/build/dist/678.3cd977536dffed60a0e4.js +0 -1
- package/build/dist/8090.c4e60cb0780036d49258.js +0 -2
- package/build/dist/9572.304acc81bcceeb2ade2a.js +0 -2
- /package/build/dist/{8090.c4e60cb0780036d49258.js.LICENSE.txt → 8090.90cb45de35e21b9cfcb0.js.LICENSE.txt} +0 -0
- /package/build/dist/{9572.304acc81bcceeb2ade2a.js.LICENSE.txt → 8947.f2b4fad4c25fb147ea42.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.427adb2d4ce72b3d6bc1.js.LICENSE.txt → main.151df5e8840564caf370.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1636],{88062(e,n,s){s(96540),s(47022);var o=s(74848);function t(e){return(0,o.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,o.jsxs)("li",{children:[e.click?(0,o.jsx)(t,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,o.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,o.jsx)("ul",{children:e.node.children.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),c=e=>(0,o.jsx)("div",{className:"card-tree-view",children:(0,o.jsx)("ul",{children:e.list&&e.list.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(n,["A",0,c])},81636(e,n,s){s.r(n),s.d(n,{default:()=>w});var o=s(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1636],{88062(e,n,s){s(96540),s(47022);var o=s(74848);function t(e){return(0,o.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,o.jsxs)("li",{children:[e.click?(0,o.jsx)(t,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,o.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,o.jsx)("ul",{children:e.node.children.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),c=e=>(0,o.jsx)("div",{className:"card-tree-view",children:(0,o.jsx)("ul",{children:e.list&&e.list.map((n,s)=>(0,o.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(n,["A",0,c])},81636(e,n,s){s.r(n),s.d(n,{default:()=>w});var o=s(34899),t=s(96540),i=s(34843),c=s(82893),r=s(92275),l=s(14944),d=s(70447),a=s(85997),u=s(57952),x=s(75725),f=s(47071),h=s(34289),m=s(88062),j=s(97856),v=(s(62042),s(15629),s(74848));const k=t.lazy(()=>s.e(3233).then(s.bind(s,85614)));let p,_;function w(e){const{t:n}=(0,o.Bd)(),[s,w]=(0,i.fp)(c.AG.workflow_realtime_show),[g,C]=(0,t.useState)([]),[y,M]=(0,t.useState)([]),[b,q]=(0,t.useState)(!1),[S,F]=(0,t.useState)(void 0),[A,N]=(0,t.useState)([]),$=e=>{for(const n of e){if(null==n.code&&n?.extra_data?.running_type===f.rl.running)n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{running:!0}),n.name]});else if(0===n.code)n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{success:!0}),n.name]});else{if(!(n.code<1)){delete n.children;continue}n.name=(0,v.jsxs)("div",{children:[(0,v.jsx)(d.fq,{success:!1}),n.name]})}n.children&&$(n.children)}};(0,t.useEffect)(()=>(q(!1),p=void 0,_=void 0,(async()=>{const e=new f.v3;e.filename_path=`${(0,h.GG)("file",(0,h.vX)())}${s.filename}`,l.ws.addMsg(r.HK.workflow_realtime_one_rsq,e=>{if(e.context.list&&e.context.list.length>0){const n=e.context.list;$(n),N(n)}e.context.new_log&&B(e.context.new_log)}),l.ws.sendData(r.HK.workflow_realtime_one_req,e)})(),async()=>{l.ws.removeMsg(r.HK.workflow_realtime_one_rsq),_&&(_.dispose(),_=null)}),[]);const B=async e=>{_||await new Promise(e=>{p=e,q(!0),(async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});_=e,F(e)})()}),e&&_.write(e)};return(0,v.jsxs)("div",{children:[(0,v.jsxs)(u.A,{children:[S&&(0,v.jsx)(a.rA,{icon:"print",title:"打印日志",onClick:()=>{q(!b)}}),(0,v.jsx)(a.rA,{icon:"close",title:n("关闭"),onClick:()=>{w({open:!1})}})]}),(0,v.jsx)(x.jW,{isFull:!0,more:!0,children:(0,v.jsx)(x.NN,{children:(0,v.jsx)(m.A,{list:A,click:e=>{}})})}),(0,v.jsx)("div",{style:{display:b?"":"none"},children:(0,v.jsx)(k,{show:!0,terminal:S,init:()=>{p&&(p(1),p=void 0)}})})]})}},15629(e,n,s){s.d(n,{W:()=>r});s(96540);var o=s(70447),t=s(47071),i=s(34899),c=s(74848);function r({item:e}){const{t:n}=(0,i.Bd)();let s,r;return null!=e.code?s=0===e.code:e.extra_data?.running_type===t.rl.running&&(r=!0),(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:s,running:r}),n(s?"成功":"失败")]})}const l=(e,n,s)=>{if(n)for(const s of n??[]){let n;const t=[];s["use-yml"]?(l(t,void 0,s.use_job_children_list),n=`${s["use-yml"]} ;${s.duration??-1}`):s.runs?n=JSON.stringify(s.runs):s.run?n=s.run:s["run-js"]?n=s["run-js"]:s.sleep&&(n=`sleep ${s.sleep}`),n=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:void 0===s.code?void 0:0===s.code})," ",n+" ;"+(s.duration??"")]}),e.push({name:n,children:t,extra_data:{code:s.code,context:s.message}})}else if(s)for(const n of s??[]){const s=(0,c.jsxs)("div",{children:[(0,c.jsx)(o.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:s,extra_data:{code:n.code,is_job:!0,job_data:n}})}};s.d(n,["Y",0,l])}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1832],{61832(e,a,t){t.r(a),t.d(a,{decodePngMetadata:()=>c.ph,encodePngMetadata:()=>c.oh,getTEXtChunk:()=>c.nh});var c=t(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1832],{61832(e,a,t){t.r(a),t.d(a,{decodePngMetadata:()=>c.ph,encodePngMetadata:()=>c.oh,getTEXtChunk:()=>c.nh});var c=t(2352);t(22130)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2502],{2502(t,e,n){n.r(e),n.d(e,{default:()=>A});var i=n(96540),o=n(92275),s=n(14944),r=n(34843),l=n(82893),c=n(57952),a=n(85997),_=n(47022),h=n(34289),x=n(62042),d=n(61443),p=n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2502],{2502(t,e,n){n.r(e),n.d(e,{default:()=>A});var i=n(96540),o=n(92275),s=n(14944),r=n(34843),l=n(82893),c=n(57952),a=n(85997),_=n(47022),h=n(34289),x=n(62042),d=n(61443),p=n(34899),f=n(64694),g=n(70447),u=n(74848);const w=300;let v=!1,m=0,y=!0;var k,b=[],j=-1,C=[];function A(t){const[e,n]=(0,r.fp)(l.AG.log_viewer),A=(0,i.useRef)(null),[H,T]=(0,i.useState)(0),[z,I]=(0,i.useState)(100),[S,K]=(0,i.useState)(!1),[M,$]=(0,i.useState)(""),[E,L]=(0,i.useState)(0),[N,D]=(0,i.useState)(0),[q,G]=(0,i.useState)(0),{t:R}=(0,p.Bd)(),B=(t,e,n,i=!1,o)=>{const s=document.createElement("div");return-1===j?s.textContent=t:s.innerHTML=t,s.style.whiteSpace="pre-wrap",s.style.overflowWrap="break-word",s.setAttribute("position",`${e}`),s.setAttribute("start_position",`${n}`),i?(A.current.insertBefore(s,o),b.unshift(s)):(A.current.appendChild(s),b.push(s)),s},F=t=>{const e=(0,f.I)(b,e=>e===t);e&&A.current.removeChild(e)},W=(t,e,n,i=!1)=>{if(!t)return;const o=Array.isArray(t)?t:t.split("\n");if(i){let t;for(let i=0;i<o.length;i++)t=B(o[i],e[i],n[i],!0,0===i?A.current.firstChild:t);if(b.length>w){let t=b.length-1;for(;t>=w;)F(b[b.length-1]),t--}}else{for(let t=0;t<o.length;t++)B(o[t],e[t],n[t]);if(b.length>w){let t=b.length-w;for(;t>0;)F(b[0]),t--}}},Y=async()=>{k.encoding=e.encoding,k.context="";const t=await s.ws.sendData(o.HK.log_viewer,k);if(t){const e=t.context;if(k=e,e.find_back_enter_index&&e.context_list.length>0)for(let t=0;t<e.context_list.length;t++){const n=new RegExp(e.query_text,"g");e.context_list[t]=e.context_list[t].replace(n,`<span style="color: blue;">${e.query_text}</span>`)}k.find_back_enter_index=!1,W(e.context_list,e.context_position_list,e.context_start_position_list,k.back),k.context_list.length>0&&(k.back&&b.length>0?(k.context_list.length>b.length?T(Math.floor(100*parseInt(b[k.context_list.length-b.length].getAttribute("position"))/k.max_size)):T(Math.floor(100*parseInt(b[b.length-k.context_list.length].getAttribute("position"))/k.max_size)),y=!1):T(Math.floor(100*(k.context_position_list[k.context_position_list.length-1]??0)/k.max_size)))}},Z=t=>{v||(v=!0,T(100),s.ws.addMsg(o.HK.log_viewer_watch,t=>{const e=t.context;e&&(k=e,W(e.context_list,e.context_position_list,e.context_start_position_list,!1),A.current.scrollTop=A.current.scrollHeight)}),k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.position=t,s.ws.sendData(o.HK.log_viewer_watch,k),K(!0))},P=async()=>{A.current&&A.current.remove(),b=[]};if((0,i.useEffect)(()=>{e.show?(async()=>{A.current.addEventListener("scroll",async()=>{const t=A.current;if(t){if(v)return void(m=t.scrollTop);if(m<t.scrollTop&&b.length>0&&t.scrollTop+t.clientHeight+500>=t.scrollHeight){const t=parseInt(b[b.length-1].getAttribute("position"));if(t>=k.max_size)return void Z(t);k.line=20,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!1,k.position=t,await Y()}else if(m>t.scrollTop&&b.length>0&&t.scrollTop-300<=0){const e=parseInt(b[0].getAttribute("start_position"));if(e<=0)return y||(y=!0,(0,x.N9)("到达顶部")),void(m=t.scrollTop);k.line=10,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!0,k.position=e,await Y()}m=t.scrollTop}}),A.current.addEventListener("wheel",t=>{const e=A.current;if(e){t.preventDefault();const n=20;t.deltaY>0?e.scrollTop+=n:e.scrollTop-=n}},{passive:!1}),K(!1),L(0),D(0),$(""),v=!1,G(0),m=0,C=[],j=-1,b=[],(k=new _.d2).line=w,k.path=`${(0,h.GG)("file",(0,h.vX)())}${e.fileName}`,k.token=localStorage.getItem("token"),await Y(),s.ws.addMsg(o.HK.search_file_progress,t=>{try{L(parseInt(t.context))}catch(t){(0,x.zN)(t.message)}}),s.ws.addMsg(o.HK.search_file_index,t=>{try{C.push(...t.context),G(t.context.length)}catch(t){(0,x.zN)(t.message)}})})():P()},[e]),(0,i.useEffect)(()=>()=>{P()},[]),!e.show)return;return(0,u.jsxs)("div",{id:"editor-container",children:[(0,u.jsxs)(c.A,{ignore_tags:!0,left_children:[(0,u.jsx)(a.rA,{title:R("取消"),icon:"close",onClick:()=>{n({show:!1})}},1),(0,u.jsx)("div",{style:{width:"4rem"},children:(0,u.jsx)(g.WA,{context:e.fileName})},2),(0,u.jsxs)(i.Fragment,{children:[" ",(0,u.jsx)(d.$Z,{handleEnterPress:async()=>{M&&(L(.1),D(0),G(0),j=-1,C=[],k.query_text=M,k.encoding=e.encoding,s.ws.sendData(o.HK.search_file,k))},placeholder:R("回车搜索整个文件"),icon:"search",value:M,handleInputChange:t=>{$(t)},max_width:"25em"})]},3),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j+1>=C.length?0:j+1;D(t+1),j=t,k.find_back_enter_index=!0,k.back=!1,k.position=C[j],await Y()},children:"↓"},5),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j-1<0?C.length-1:j-1;D(t+1),j=t,k.back=!1,k.find_back_enter_index=!0,k.position=C[j],await Y()},children:"↑"},6),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:[N,"/",C.length]},7),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:["搜索进度$",E,"%"]},8),0!==E&&100!==E&&(0,u.jsx)(a.rA,{title:R("取消"),icon:"cancel",onClick:()=>{s.ws.sendData(o.HK.search_file_cancel,{}),$(""),L(0)}},4)],children:[(0,u.jsx)("span",{style:{paddingRight:".5rem"},children:e.encoding}),S&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"},children:"正在实时监听 "}),(0,u.jsx)(a.rA,{icon:"close",title:R("关闭实时"),onClick:()=>{v&&(v=!1,K(!1),s.ws.sendData(o.HK.log_viewer_watch_cancel,k))}})]}),(0,u.jsxs)("span",{children:["当前加载进度",H]}),(0,u.jsx)(d.$Z,{max_width:"10rem",placeholder:R("跳转进度"),icon:"percent",value:z,handleInputChange:t=>{I(t)}}),(0,u.jsx)(a.rA,{icon:"play_arrow",title:R("跳转进度"),onClick:async()=>{k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];let t=0;try{if(t=parseInt(z),t>100||t<0)throw(0,x.zN)("范围在0-100"),"超过最大范围";for(const t of b)A.current.removeChild(t);b=[]}catch(t){return void(0,x.N9)(t)}k.back=t>=100,k.position=Math.floor(k.max_size*(t/100)),await Y()}}),(0,u.jsx)(a.rA,{icon:"text_rotate_vertical",title:R("滑动到文件最底部,实时输出"),onClick:async()=>{if(!v){k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[],k.back=!0,k.position=k.max_size,await Y(),A.current.scrollTop=A.current.scrollHeight,Z(k.max_size)}}})]}),(0,u.jsx)("div",{style:{height:"100%"},children:(0,u.jsx)("div",{ref:A,style:{overflowY:"auto",height:"100%"}})})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(61973),u=n(14284),d=(n(23430),n(82893)),r=n(75725),f=n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(61973),u=n(14284),d=(n(23430),n(82893)),r=n(75725),f=n(34899),h=n(7523),p=n(62042),_=n(21469),m=n(74848);_.m.init();const x=function(){const e=(0,o.Zp)(),[t,n]=(0,c.useState)(""),[x,w]=(0,c.useState)(""),{initUserInfo:k}=(0,c.useContext)(h.F),[g,j]=(0,a.fp)(d.AG.custom_fun_opt),{t:C}=(0,f.Bd)();async function I(){const n={username:t,password:x},s=await u.wm.post("login",n,!1);0===s.code?(localStorage.setItem("token",s.data),k(),j(""),e("/file")):(0,p.zN)(s.message)}return(0,c.useEffect)(()=>{localStorage.getItem("token")&&e("/file")},[]),(0,m.jsxs)(r.Y5,{children:[(0,m.jsx)("h1",{children:_.m.web_site_title??"FileCat"}),(0,m.jsxs)("div",{className:"self_win_center_content",children:[(0,m.jsx)(l.Sm,{placeholder:C("账号"),handleInputChange:e=>{n(e)}}),(0,m.jsx)(l.cA,{placeholder:C("密码"),handleInputChange:e=>{w(e)},handleEnterPress:I}),(0,m.jsx)(i.$n,{text:C("登录"),clickFun:I}),s.A.has("tcp_client_num_id")&&(0,m.jsx)(i.$n,{text:C("代理退出"),clickFun:()=>{s.A.delete("tcp_client_num_id"),window.location.reload()}})]})]})};n.d(t,["default",0,x])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>j});var a=n(96540),i=n(82893),o=n(34843),s=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function p(e){{const[t,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),l=e=>{o(e)},h=async()=>{"folder"===e.type?(t||!e.click||i||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},m=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{o(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:h,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,m)},className:"studio-item-title",children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(s.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&i&&(0,d.jsx)("div",{style:{marginLeft:20},children:i.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(p,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:m},n)},n))})]})}}n(61443);function h(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(p,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,children:t.children,click:e.click,size:t.size},n))})}var m=n(14284),u=n(34289),f=n(53459),x=n(78247),w=(n(62042),n(2543)),y=n(27690),v=n(34899),_=n(88815),k=n(61973);const g=a.lazy(()=>Promise.all([n.e(9988),n.e(4091)]).then(n.bind(n,84091)));function j(e){const[t,n]=(0,a.useState)([]),[p,j]=(0,a.useState)(""),[C,E]=(0,a.useState)(""),[N,S]=(0,a.useState)(!1),[M,P]=(0,a.useState)({path:"",name:""}),[$,b]=(0,a.useState)(""),[G,I]=(0,o.fp)(i.AG.confirm),[z,A]=(0,a.useState)(!1),[F,D]=(0,o.fp)(i.AG.fileShellShow),[L,R]=(0,o.fp)(i.AG.file_shell_hidden),T=(0,a.useRef)(null),K=(0,a.useRef)(null),[U,B]=(0,a.useState)(!1),[W,X]=(0,a.useState)(16),[Y,H]=(0,o.fp)(i.AG.showPrompt),{t:Z}=(0,v.Bd)(),q=(0,k.Zp)();let J=(0,k.zy)().pathname.split("/").filter(Boolean).pop();J=decodeURIComponent(J);const O=async()=>{const e=(0,u.GG)("file",J);j(e),P({path:e,name:(0,u.mH)(e)});const t=await m.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{E(""),A(!1),O()},[]);const Q=async(e,t)=>{const n=await m.$M.get(`${encodeURIComponent(t)}`);E(n.data),x.xK.set_value_temp(n.data),P({path:t,name:e}),b(t)},V=(e,t)=>{e.size>_.o5?I({open:!0,handle:()=>{Q(e.name,t),I({open:!1,handle:null}),A(!1)},title:"超过20MB了还要打开吗?"}):Q(e.name,t)};async function ee(){if(!z)return;const e={context:x.xK.get_editor_value()};0===(await m.$M.post(`save/${encodeURIComponent($)}`,e)).code&&A(!1)}const te=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),z&&ee())};(0,a.useEffect)(()=>(document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}),[z]);const ne=(0,a.useCallback)(w.throttle(e=>{const t=parseFloat(getComputedStyle(K.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,i=2.25+T.current.offsetWidth/t;a<=n&&a>=i&&X(parseFloat(a.toFixed(2)))},32),[]),ae=()=>{B(!1),K.current.removeEventListener("pointermove",ne)},ie=[{r:Z("创建文件"),v:"创建文件"},{r:Z("创建目录"),v:"创建目录"},{r:Z("重命名"),v:"重命名"},{r:Z("删除"),v:"删除"}],oe=[{r:Z("重命名"),v:"重命名"},{r:Z("删除"),v:"删除"}],se=(e,t,n,a,i)=>{e.preventDefault();const o=new c.ik;o.path=n,o.filename=t,o.x=e.clientX,o.y=e.clientY,o.items=a?ie:oe,i===O&&(o.items=o.items.slice(0,2)),o.type=a?r.Iw.studio_folder:r.Iw.studio_file;const s=e=>{i(e)};o.textClick=e=>{switch(e){case"创建文件":H({show:!0,type:y.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:s}});break;case"创建目录":H({show:!0,type:y.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:s}});break;case"删除":if(z&&(M.path===n||M.path.includes(n))){const e=()=>{s(a),A(!1),P({}),E(""),x.xK.set_value_temp("")};H({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}H({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{s(!0)}:s}});break;case"重命名":H({show:!0,type:y.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,u.Yp)(n),call:()=>{s(!0)},filename:t}})}},H({show:!0,type:y.PromptEnum.FileMenu,overlay:!1,data:o})};return(0,d.jsxs)("div",{className:"studio",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:"取消",icon:"close",onClick:()=>{D({show:!1,path:""}),R(void 0),q(-1)}},1),(0,d.jsx)("div",{children:M.name},2)],children:[(0,d.jsx)("title",{children:M.name}),(0,c.zr)(M.name)&&(0,d.jsx)(s.rA,{title:"格式化",icon:"data_object",onClick:function(){x.xK.get_editor()?.formatCode()}}),(0,d.jsx)(s.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==L&&!1!==L?F.show?D({show:!1,path:""}):(D({show:!0,path:(0,u.GG)("file",J)}),R(!1)):R(!L)}}),z&&(0,d.jsx)(s.rA,{title:"保存",icon:"save",onClick:ee})]}),(0,d.jsxs)("div",{className:"studio-body",ref:K,children:[(0,d.jsx)("div",{className:"studio-nav",style:{width:W-1+"em"},onContextMenu:e=>{se(e,M.name,(0,u.GG)("file",J),!0,O)},children:(0,d.jsx)(h,{pre_path:p,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await m.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(z)return void I({open:!0,handle:()=>{I({open:!1,handle:null}),A(!1),V(e,n)},title:"确定不保存就切换吗?"});V(e,n)}},handleContextMenu:se,fatherNowToggleExpansion:O})}),(0,d.jsx)("div",{className:"studio__divider",ref:T,onPointerDown:()=>{B(!0),K.current.addEventListener("pointermove",ne)},onPointerUp:ae}),U&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:ae}),(0,d.jsx)("div",{className:"studio-editor",children:M.name&&(0,d.jsx)(g,{name:M.name,on_change:()=>{z||A(!0)}})},M.path)]})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2851],{75897(e,t,s){s.d(t,{L:()=>a});let n=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_workflow_router_key="customer_workflow_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.sys_software="sys_software",e.protection_directory="sys_protection_directory",e.dir_upload_max_num="dir_upload_max_num",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e.extra_env_path_list_key="extra_env_path_list_key",e.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e.auto_upgrade_setting="auto_upgrade_setting",e.ai_long_term_memory_setting="ai_long_term_memory_setting",e}({});const a=n.self_auth_jscode},8694(e,t,s){s.d(t,{$K:()=>o,RB:()=>i,l5:()=>l,qB:()=>n,vo:()=>r,vr:()=>c});class n{targetProxyUrl;proxyPort;sysProxyPort}let a=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class r{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=a.udp}let i=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class c{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class l{enabled;ip;port;bypass;useForLocal;type}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>o});var n=s(96540),a=s(74848);function o(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,t)=>(0,a.jsx)("th",{children:e},t))})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},42851(e,t,s){s.r(t),s.d(t,{default:()=>F});var n=s(96540),a=s(75725),o=s(14284),r=s(62042),i=s(53459),c=s(70447),l=s(61443),d=s(85997),_=s(77481),p=s(8694),h=s(14944),u=s(92275),x=s(22022),m=s(57952),y=s(74848);function v(e){const{t}=(0,x.Bd)(),[s,v]=(0,n.useState)(void 0),[j,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(""),[S,w]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}信息`,t("在线状态"),t("选择")]),[C,b]=(0,n.useState)([]),[I,A]=(0,n.useState)({}),[U,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new u.hf(u.HK.vir_net_serverIno_get);h.ws.addMsg(u.HK.vir_net_serverIno_get,e=>{(e=>{for(const s of e){const e=s[s.length-1];s[s.length-1]=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(c.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,y.jsx)(c.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,y.jsx)(c.xP,{context:s[2],tip_context:s[2]})}})(e.context),b(e.context)}),await h.ws.send(e)})();return(async()=>{const e=await o._U.get("vir/server/get");if(e.code!==i.m.Success)return;const t=e.data;v(t.port),f(t.key),g(t.open)})(),()=>{}},[]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(m.A,{children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,y.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await o._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.$K;e.open=j,e.key=k,U&&(e.async_ips=Object.keys(I)),s&&(e.port=parseInt(s));(await o._U.post("vir/server/save",e)).code===i.m.Success?((0,r.SK)("保存成功"),P(!1)):(0,r.zN)("网络错误")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"port",value:s,handleInputChange:e=>{v(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:k,handleInputChange:e=>{f(e)}}),(0,y.jsxs)("form",{children:[t("状态"),":",(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:j,onchange:()=>{g(!j)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!j,onchange:()=>{g(!j)}})]})]}),!!Object.keys(I).length&&(0,y.jsx)(l.GL,{context:t("同步信息给选中服务器"),selected:U,onchange:()=>{P(!U)}})]}),(0,y.jsx)(c.Zp,{title:"",children:(0,y.jsx)(_.X,{headers:S,rows:C.map(e=>[...e,(0,y.jsx)(l.GL,{context:t(""),selected:I[e[1]],onchange:()=>{const t={...I};t[e[1]]?delete t[e[1]]:t[e[1]]=e,A(t)}})]),width:"10rem"})})]})})]})}function j(e){const{t}=(0,x.Bd)(),[s,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(void 0),[g,k]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(void 0),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(""),[P,K]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await o._U.get("vir/client/get");if(e.code!==i.m.Success)return;const t=e.data;if(C(t.serverPort),k(t.serverIp),m(t.ip),j(t.mask),U(t.key),I(t.open),S(t.client_name),t.open){const e=new u.hf(u.HK.vir_net_client_get),t=(await h.ws.send(e)).context.state;K(t),h.ws.addMsg(u.HK.vir_net_client_get,e=>{K(e.context.state)})}})()},[]);return(0,y.jsx)("div",{children:(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.vo;e.ip=s,e.mask=parseInt(v),e.key=A,e.serverIp=g,e.serverPort=parseInt(w),e.open=b,e.client_name=f;(await o._U.post("vir/client/save",e)).code===i.m.Success?(0,r.SK)("保存成功"):(0,r.zN)("网络错误")}}),titleCom:(0,y.jsxs)("div",{children:[t("连接状态"),(0,y.jsx)(c.fq,{ok:P})]}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:"mask",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} ip`,value:g,handleInputChange:e=>{k(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} part`,value:w,handleInputChange:e=>{C(e)}}),(0,y.jsx)(l.Sm,{placeholder:"名称 ",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{U(e)}}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,y.jsxs)(c.Zp,{title:"",children:[(0,y.jsx)("div",{children:"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"}),(0,y.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,y.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var g=s(34843),k=s(82893),f=s(23430),S=(s(75897),s(78247)),w=s(21499),C=s(24659);function b(e){const{t}=(0,x.Bd)(),[s,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(!1),[P,K]=(0,n.useState)({list:[]}),[F,H]=(0,g.fp)(k.AG.editorSetting),[$,N]=(0,g.fp)(k.AG.user_base_info),B=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[O,Z]=(0,n.useState)([]),z=[t("port"),t("ip"),t("type"),t("开启")],[E,V]=(0,n.useState)([]),M=[t("编辑"),t("开启"),t("备注"),t("删除")],L=(0,C.K)(),X=async()=>{const e=[o._U.post("vir/client/tcp_proxy/get"),o._U.post("http/proxy/server/get")];let t;$.sys===f.XM.mac?t=(async()=>{const e=await o._U.post("http/proxy/get/mac");if(e.code!==i.m.Success)return;const t=[],s=[];for(const n of e.data)"Wi-Fi"===n.name?t.push(n):s.push(n);V([...t,...s])})():$.sys===f.XM.win&&(t=(async()=>{const e=await o._U.post("http/proxy/get/win");if(e.code===i.m.Success){const t=e.data;h(t.ip),m(t.port),I(t.enabled),j(t.bypass),U(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===i.m.Success&&Z(s.data),n.code===i.m.Success&&K(n.data)};(0,n.useEffect)(()=>{X()},[]);return(0,y.jsx)("div",{children:(0,y.jsxs)(a.fI,{children:[$.sys===f.XM.win&&(0,y.jsx)(a.VP,{children:(0,y.jsxs)(c.Zp,{title:"Http Proxy",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.l5;e.port=parseInt(u),e.enabled=b,e.useForLocal=A,e.ip=s,e.bypass=v;(await o._U.post("http/proxy/set/win",e)).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{h(e)}}),(0,y.jsx)(l.Sm,{placeholder:"port ",value:u,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:t("忽略ip"),value:v,handleInputChange:e=>{j(e)}}),(0,y.jsxs)("form",{children:[t("请勿将代理服务器用于本地(Intranet)地址"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:A,onchange:()=>{U(!A)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!A,onchange:()=>{U(!A)}})]})]}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]})}),$.sys===f.XM.mac&&(0,y.jsx)(a.VP,{children:E.map((e,s)=>(0,y.jsxs)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e.name})," "]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=E[e];(await o._U.post("http/proxy/set/mac",[t])).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))})(s)}})}),children:[(0,y.jsx)(_.X,{headers:z,rows:e.proxies.map((e,t)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,y.jsx)("div",{children:1===e.type?"http":"https"}),(0,y.jsx)(l.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...E];n[e].proxies[t].enabled=s,V(n)})(s,t,e)},options:L,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,y.jsx)(l.Sm,{value:e.bypass,handleInputChange:e=>{E[s].bypass=e},no_border:!0})]},s))}),(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{Z([...O,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<O.length;t++)O[t].index=t,e.push(O[t]);(await o._U.post("vir/client/tcp_proxy/save",e)).code===i.m.Success&&((0,r.SK)("保存成功"),X())}})]}),children:(0,y.jsx)(_.X,{headers:B,rows:O.map((e,s)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.l6,{value:e.open,onChange:e=>{O[s].open=e,Z([...O])},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{O.splice(e,1),Z([...O])})(s)})})];return n}),width:"10rem"})}),(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{P.list.push({open:!1,port:0,note:"",list:[]}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await o._U.post("http/proxy/server/save",P)).code===i.m.Success&&(0,r.SK)("保存成功")}})]}),children:P.list.map((e,s)=>(0,y.jsxs)("div",{className:"net-proxy-instance",children:[(0,y.jsxs)("div",{className:"net-proxy-instance__toolbar",children:[(0,y.jsxs)("span",{className:"net-proxy-instance__label",children:[t("端口实例")," #",s+1]}),(0,y.jsx)("span",{children:t("状态")}),(0,y.jsx)(l.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)("span",{children:t("端口")}),(0,y.jsx)(l.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,K({...P})},no_border:!0,width:"80px"}),(0,y.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{P.list.splice(s,1),K({...P})}}),(0,y.jsx)(l.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,K({...P})},no_border:!0})]}),(0,y.jsx)(_.X,{headers:M,rows:e.list.map((n,a)=>{const r=[(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=P.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,w.hU)(),K({...P}));const a=await o._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});H({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{0===(await o._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})).code&&(S.xK.set_value_temp(""),H({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(a.data)})(s,a)}})}),(0,y.jsx)(l.l6,{value:n.open,onChange:t=>{e.list[a].open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(a,1),K({...P})}})})];return r}),width:"10rem"})]},s))})]})]})})}var I=s(87361),A=s(82726),U=s(27690);function P(e){const{t}=(0,x.Bd)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/dnspod");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.id),S(t.account.token)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("id和token都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={id:v,token:f},e.isOpen=w,e.ddnsType=A.E2.dnspod;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("success")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ID",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"TOKEN",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function K(e){const{t}=(0,x.Bd)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/tx");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.secretid),S(t.account.secretkey)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("SecretId和SecretKey都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={secretid:v,secretkey:f},e.isOpen=w,e.ddnsType=A.E2.tengxun;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("成功")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"SecretId",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"SecretKey",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function F(){const{t:e}=(0,x.Bd)(),{check_user_auth:t}=(0,S.MH)(),s=[];return t(f.oV.vir_net)&&s.push({index:1,name:e("系统")+e("代理"),rto:"proxy_sys/",component:(0,y.jsx)(b,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,y.jsx)(j,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,y.jsx)(v,{})}),t(f.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,y.jsx)(P,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,y.jsx)(K,{})}),(0,y.jsx)(a.W1,{optionList:s,father_route:I.o.net})}},24659(e,t,s){var n=s(22022);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2851],{75897(e,t,s){s.d(t,{L:()=>a});let n=function(e){return e.username="username",e.password="password",e.password_hash="password_hash",e.navindex_remote_ssh_key="navindex_remote_ssh_key",e.user_id_name_mapping="user_id_name_mapping",e.user_id_info_data_mapping="user_id_info_data_mapping",e.user_unique_id_num="user_unique_id_num",e.role_unique_id_num="role_unique_id_num",e.sys_all_roles="sys_all_roles",e.ddns_http_url_key="ddns_http_url_key",e.ddns_tx_key="tengxun_ddns_key",e.ddns_dnspod_key="ddns_dnspod",e.ddns_ali_key="ali_ddns_key",e.navindex_net_key_list="navindex_net_key_list",e.navindex_wol_key="navindex_wol_key",e.customer_router_key="customer_router_key",e.customer_workflow_router_key="customer_workflow_router_key",e.customer_api_router_key="customer_api_router_key",e.token_setting="token_setting",e.sys_software="sys_software",e.protection_directory="sys_protection_directory",e.dir_upload_max_num="dir_upload_max_num",e.self_auth_jscode="self_auth_jscode",e.navindex_video_key="navindex_video_tag_key",e.systemd_key="systemd_key",e.vir_server_data_key="vir_server_net_data_key",e.vir_client_data_key="vir_client_net_data_key",e.vir_data_client_hash_key="vir_data_client_hash_key",e.vir_data_server_hash_key="vir_data_server_hash_key",e.language="user_language",e.navindex_rdp_key="navindex_rdp_tag_key",e.navindex_key="navindex_key_list",e.http_tag_key="http_tag_key",e.self_shell_cmd_check_open_status="self_shell_cmd_check_open_status",e.self_shell_cmd_jscode="self_shell_cmd_jscode",e.extra_env_path_list_key="extra_env_path_list_key",e.cmd_use_pty_key="cmd_use_pty_key",e.recycle_bin_key="recycle_bin_key",e.recycle_bin_status="recycle_bin_status",e.guid_key="guid_key",e.tcp_proxy_key="tcp_proxy_key",e.sys_env_key="sys_env_key",e.http_server_key="http_server_key",e.proxy_server_code_prefix="proxy_server_code_prefix",e.ai_agent_model_setting="ai_agent_model_setting",e.ai_agent_mcp_setting="ai_agent_mcp_setting",e.ai_agent_docs_setting="ai_agent_docs_setting",e.ai_agent_chat_session_store="ai_agent_chat_session_store",e.share_file_list_key="share_file_list_key",e.share_file_list_key_download_statics="share_file_list_key_download_statics",e.tcp_proxy_server_base="tcp_proxy_server_base",e.tcp_proxy_server_client_list="tcp_proxy_server_client_list",e.tcp_proxy_client_fig="tcp_proxy_client_fig",e.tcp_proxy_client_all_fig="tcp_proxy_client_all_fig",e.tcp_proxy_sync_task_list="tcp_proxy_sync_task_list",e.workflow_setting_item_list="workflow_setting_item_list",e.server_bridge_config_list="server_bridge_config_list",e.ai_agent_status="ai_agent_status",e.ai_system_prompts="ai_system_prompts",e.filecat_plugin_list="filecat_plugin_list",e.https_setting="https_setting",e.ai_rebot_setting="ai_rebot_setting",e.token_cache="token_cache",e.auto_upgrade_setting="auto_upgrade_setting",e.ai_long_term_memory_setting="ai_long_term_memory_setting",e}({});const a=n.self_auth_jscode},8694(e,t,s){s.d(t,{$K:()=>o,RB:()=>i,l5:()=>l,qB:()=>n,vo:()=>r,vr:()=>c});class n{targetProxyUrl;proxyPort;sysProxyPort}let a=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class r{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=a.udp}let i=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class c{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class l{enabled;ip;port;bypass;useForLocal;type}},77481(e,t,s){s.d(t,{S:()=>r,X:()=>o});var n=s(96540),a=s(74848);function o(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,t)=>(0,a.jsx)("th",{children:e},t))})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},42851(e,t,s){s.r(t),s.d(t,{default:()=>F});var n=s(96540),a=s(75725),o=s(14284),r=s(62042),i=s(53459),c=s(70447),l=s(61443),d=s(85997),_=s(77481),p=s(8694),h=s(14944),u=s(92275),x=s(34899),m=s(57952),y=s(74848);function v(e){const{t}=(0,x.Bd)(),[s,v]=(0,n.useState)(void 0),[j,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(""),[S,w]=(0,n.useState)([t(`${t("名称")}`),t(`${t("虚拟")}ip`),`${t("物理")}信息`,t("在线状态"),t("选择")]),[C,b]=(0,n.useState)([]),[I,A]=(0,n.useState)({}),[U,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=new u.hf(u.HK.vir_net_serverIno_get);h.ws.addMsg(u.HK.vir_net_serverIno_get,e=>{(e=>{for(const s of e){const e=s[s.length-1];s[s.length-1]=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(c.fq,{ok:e}),t(e?"在线":"离线")]}),s[0]=(0,y.jsx)(c.xP,{context:s[0],tip_context:s[0]}),s[2]=(0,y.jsx)(c.xP,{context:s[2],tip_context:s[2]})}})(e.context),b(e.context)}),await h.ws.send(e)})();return(async()=>{const e=await o._U.get("vir/server/get");if(e.code!==i.m.Success)return;const t=e.data;v(t.port),f(t.key),g(t.open)})(),()=>{}},[]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(m.A,{children:[!!Object.keys(I).length&&I[0],!!Object.keys(I).length&&(0,y.jsx)(d.rA,{icon:"delete",title:"删除",onClick:async()=>{await o._U.post("vir/server/delete/client",{ips:Object.keys(I)}),A({})}})]}),(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.$K;e.open=j,e.key=k,U&&(e.async_ips=Object.keys(I)),s&&(e.port=parseInt(s));(await o._U.post("vir/server/save",e)).code===i.m.Success?((0,r.SK)("保存成功"),P(!1)):(0,r.zN)("网络错误")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"port",value:s,handleInputChange:e=>{v(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:k,handleInputChange:e=>{f(e)}}),(0,y.jsxs)("form",{children:[t("状态"),":",(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:j,onchange:()=>{g(!j)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!j,onchange:()=>{g(!j)}})]})]}),!!Object.keys(I).length&&(0,y.jsx)(l.GL,{context:t("同步信息给选中服务器"),selected:U,onchange:()=>{P(!U)}})]}),(0,y.jsx)(c.Zp,{title:"",children:(0,y.jsx)(_.X,{headers:S,rows:C.map(e=>[...e,(0,y.jsx)(l.GL,{context:t(""),selected:I[e[1]],onchange:()=>{const t={...I};t[e[1]]?delete t[e[1]]:t[e[1]]=e,A(t)}})]),width:"10rem"})})]})})]})}function j(e){const{t}=(0,x.Bd)(),[s,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(void 0),[g,k]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(void 0),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(""),[P,K]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{const e=await o._U.get("vir/client/get");if(e.code!==i.m.Success)return;const t=e.data;if(C(t.serverPort),k(t.serverIp),m(t.ip),j(t.mask),U(t.key),I(t.open),S(t.client_name),t.open){const e=new u.hf(u.HK.vir_net_client_get),t=(await h.ws.send(e)).context.state;K(t),h.ws.addMsg(u.HK.vir_net_client_get,e=>{K(e.context.state)})}})()},[]);return(0,y.jsx)("div",{children:(0,y.jsx)(a.fI,{children:(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:"",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.vo;e.ip=s,e.mask=parseInt(v),e.key=A,e.serverIp=g,e.serverPort=parseInt(w),e.open=b,e.client_name=f;(await o._U.post("vir/client/save",e)).code===i.m.Success?(0,r.SK)("保存成功"):(0,r.zN)("网络错误")}}),titleCom:(0,y.jsxs)("div",{children:[t("连接状态"),(0,y.jsx)(c.fq,{ok:P})]}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip ",value:s,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:"mask",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} ip`,value:g,handleInputChange:e=>{k(e)}}),(0,y.jsx)(l.Sm,{placeholder:`${t("服务器")} part`,value:w,handleInputChange:e=>{C(e)}}),(0,y.jsx)(l.Sm,{placeholder:"名称 ",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(l.Sm,{type:"password",placeholder:"key ",value:A,handleInputChange:e=>{U(e)}}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]}),(0,y.jsxs)(c.Zp,{title:"",children:[(0,y.jsx)("div",{children:"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"}),(0,y.jsx)("div",{children:"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"}),(0,y.jsx)("div",{children:"key:用于验证身份信息并加密的和服务器设置的一样"})]})]})})})}var g=s(34843),k=s(82893),f=s(23430),S=(s(75897),s(78247)),w=s(21499),C=s(24659);function b(e){const{t}=(0,x.Bd)(),[s,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[b,I]=(0,n.useState)(!1),[A,U]=(0,n.useState)(!1),[P,K]=(0,n.useState)({list:[]}),[F,H]=(0,g.fp)(k.AG.editorSetting),[$,N]=(0,g.fp)(k.AG.user_base_info),B=[t("端口"),t("目标地址"),t("目标端口"),t("开启"),t("备注"),t("删除")],[O,Z]=(0,n.useState)([]),z=[t("port"),t("ip"),t("type"),t("开启")],[E,V]=(0,n.useState)([]),M=[t("编辑"),t("开启"),t("备注"),t("删除")],L=(0,C.K)(),X=async()=>{const e=[o._U.post("vir/client/tcp_proxy/get"),o._U.post("http/proxy/server/get")];let t;$.sys===f.XM.mac?t=(async()=>{const e=await o._U.post("http/proxy/get/mac");if(e.code!==i.m.Success)return;const t=[],s=[];for(const n of e.data)"Wi-Fi"===n.name?t.push(n):s.push(n);V([...t,...s])})():$.sys===f.XM.win&&(t=(async()=>{const e=await o._U.post("http/proxy/get/win");if(e.code===i.m.Success){const t=e.data;h(t.ip),m(t.port),I(t.enabled),j(t.bypass),U(t.useForLocal)}})()),t&&e.push(t);const[s,n]=await Promise.all(e);s.code===i.m.Success&&Z(s.data),n.code===i.m.Success&&K(n.data)};(0,n.useEffect)(()=>{X()},[]);return(0,y.jsx)("div",{children:(0,y.jsxs)(a.fI,{children:[$.sys===f.XM.win&&(0,y.jsx)(a.VP,{children:(0,y.jsxs)(c.Zp,{title:"Http Proxy",rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{const e=new p.l5;e.port=parseInt(u),e.enabled=b,e.useForLocal=A,e.ip=s,e.bypass=v;(await o._U.post("http/proxy/set/win",e)).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ip (default localhost) ",value:s,handleInputChange:e=>{h(e)}}),(0,y.jsx)(l.Sm,{placeholder:"port ",value:u,handleInputChange:e=>{m(e)}}),(0,y.jsx)(l.Sm,{placeholder:t("忽略ip"),value:v,handleInputChange:e=>{j(e)}}),(0,y.jsxs)("form",{children:[t("请勿将代理服务器用于本地(Intranet)地址"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:A,onchange:()=>{U(!A)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!A,onchange:()=>{U(!A)}})]})]}),(0,y.jsxs)("form",{children:[t("状态"),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:b,onchange:()=>{I(!b)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!b,onchange:()=>{I(!b)}})]})]})]})}),$.sys===f.XM.mac&&(0,y.jsx)(a.VP,{children:E.map((e,s)=>(0,y.jsxs)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e.name})," "]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:()=>{(async e=>{const t=E[e];(await o._U.post("http/proxy/set/mac",[t])).code===i.m.Success&&(X(),(0,r.SK)("保存成功"))})(s)}})}),children:[(0,y.jsx)(_.X,{headers:z,rows:e.proxies.map((e,t)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.ip,handleInputChange:t=>{e.ip=t},no_border:!0}),(0,y.jsx)("div",{children:1===e.type?"http":"https"}),(0,y.jsx)(l.l6,{value:e.enabled,onChange:e=>{((e,t,s)=>{const n=[...E];n[e].proxies[t].enabled=s,V(n)})(s,t,e)},options:L,no_border:!0})];return n}),width:"10rem"}),"ignore ips",(0,y.jsx)(l.Sm,{value:e.bypass,handleInputChange:e=>{E[s].bypass=e},no_border:!0})]},s))}),(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Tcp Proxy")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加"),onClick:()=>{Z([...O,{note:"",open:!1,port:0,target_port:0,target_ip:""}])}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{const e=[];for(let t=0;t<O.length;t++)O[t].index=t,e.push(O[t]);(await o._U.post("vir/client/tcp_proxy/save",e)).code===i.m.Success&&((0,r.SK)("保存成功"),X())}})]}),children:(0,y.jsx)(_.X,{headers:B,rows:O.map((e,s)=>{const n=[(0,y.jsx)(l.Sm,{value:e.port,handleInputChange:t=>{e.port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_ip,handleInputChange:t=>{e.target_ip=t},no_border:!0}),(0,y.jsx)(l.Sm,{value:e.target_port,handleInputChange:t=>{e.target_port=parseInt(t)},no_border:!0}),(0,y.jsx)(l.l6,{value:e.open,onChange:e=>{O[s].open=e,Z([...O])},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:e.note,handleInputChange:t=>{e.note=t},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>{O.splice(e,1),Z([...O])})(s)})})];return n}),width:"10rem"})}),(0,y.jsx)(c.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:t("Http Proxy Server")})," "]}),titleCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(d.rA,{icon:"add",title:t("添加端口实例"),onClick:()=>{P.list.push({open:!1,port:0,note:"",list:[]}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"save",title:t("保存"),onClick:async()=>{(await o._U.post("http/proxy/server/save",P)).code===i.m.Success&&(0,r.SK)("保存成功")}})]}),children:P.list.map((e,s)=>(0,y.jsxs)("div",{className:"net-proxy-instance",children:[(0,y.jsxs)("div",{className:"net-proxy-instance__toolbar",children:[(0,y.jsxs)("span",{className:"net-proxy-instance__label",children:[t("端口实例")," #",s+1]}),(0,y.jsx)("span",{children:t("状态")}),(0,y.jsx)(l.l6,{value:e.open,width:"15%",onChange:t=>{e.open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)("span",{children:t("端口")}),(0,y.jsx)(l.Sm,{value:e.port||"",handleInputChange:t=>{e.port=t?parseInt(t):0,K({...P})},no_border:!0,width:"80px"}),(0,y.jsx)(d.rA,{icon:"add",title:t("添加规则"),onClick:()=>{e.list.push({note:"",open:!1}),K({...P})}}),(0,y.jsx)(d.rA,{icon:"delete",title:t("删除端口实例"),onClick:()=>{P.list.splice(s,1),K({...P})}}),(0,y.jsx)(l.Sm,{placeholder:t("备注"),width:"100%",value:e.note,handleInputChange:t=>{e.note=t,K({...P})},no_border:!0})]}),(0,y.jsx)(_.X,{headers:M,rows:e.list.map((n,a)=>{const r=[(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"edit",title:t("编辑"),onClick:()=>{(async(e,t)=>{const s=P.list[e];if(!s)return;const n=s.list[t];if(!n)return;n.random_key||(n.random_key=(0,w.hU)(),K({...P}));const a=await o._U.post("http/proxy/server/code/get",{key:n.random_key,name:n.random_key});H({model:"ace/mode/javascript",open:!0,fileName:"",can_format:!0,save:async e=>{0===(await o._U.post("http/proxy/server/code/save",{context:e,key:n.random_key})).code&&(S.xK.set_value_temp(""),H({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(a.data)})(s,a)}})}),(0,y.jsx)(l.l6,{value:n.open,onChange:t=>{e.list[a].open=t,K({...P})},options:L,no_border:!0}),(0,y.jsx)(l.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{e.list.splice(a,1),K({...P})}})})];return r}),width:"10rem"})]},s))})]})]})})}var I=s(87361),A=s(82726),U=s(27690);function P(e){const{t}=(0,x.Bd)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/dnspod");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.id),S(t.account.token)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("id和token都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={id:v,token:f},e.isOpen=w,e.ddnsType=A.E2.dnspod;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("success")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"ID",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"TOKEN",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function K(e){const{t}=(0,x.Bd)(),[s,p]=(0,n.useState)([]),[h,u]=(0,n.useState)([]),[v,j]=(0,n.useState)(""),[f,S]=(0,n.useState)(""),[w,C]=(0,n.useState)(!1),[b,I]=(0,g.fp)(k.AG.showPrompt),[P,K]=(0,g.fp)(k.AG.confirm);(0,n.useEffect)(()=>{(async()=>{const e=await o.ez.get("ips/tx");if(e.code!==i.m.Success)return;const t=e.data,s=[],n=[];for(const e of t.ips)e.isIPv4?s.push(e):n.push(e);p(s),u(n),t.account&&(j(t.account.secretid),S(t.account.secretkey)),C(t.isOpen)})()},[]);const F=async e=>{K({open:!0,handle:async()=>{0===(await o.ez.post("http/del",e)).code&&(0,r.SK)("删除成功,稍后请刷新"),K({open:!1,handle:null})},title:t("确定删除吗")})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(m.A,{children:(0,y.jsx)(d.rA,{icon:"add",title:t("添加http获取ip"),onClick:()=>{I({show:!0,type:U.PromptEnum.DdnsAddHttp,overlay:!0,data:{}})}})}),(0,y.jsxs)(a.fI,{children:[(0,y.jsxs)(a.VP,{children:[(0,y.jsx)(c.Zp,{title:"ipv4",children:s.length>0&&s.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))}),(0,y.jsx)(c.Zp,{title:"ipv6",children:h.length>0&&h.map((e,s)=>(0,y.jsxs)("div",{children:[`${e.ifaceOrWww}(${e.ip})`,(0,y.jsx)(l.Sm,{right_placeholder:(0,y.jsx)("div",{children:e.source_type===A.tC.http_get&&(0,y.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{F(e)}})}),placeholder:"a.abc.com b.abc.com ...",value:e.ddnsHost,handleInputChange:t=>{e.ddnsHost=t}})]},s))})]}),(0,y.jsxs)(a.VP,{children:[(0,y.jsxs)(c.Zp,{title:t("账号设置"),rightBottomCom:(0,y.jsx)(d.C3,{text:t("保存"),clickFun:async()=>{if(w&&(!v||!f))return void(0,r.zN)("SecretId和SecretKey都不能为空");const e=new A.yL,t=[];for(const e of[...s,...h])e.ddnsHost&&t.push(e);e.ips=t,e.account={secretid:v,secretkey:f},e.isOpen=w,e.ddnsType=A.E2.tengxun;(await o.ez.post("save",e)).code===i.m.DdnsAuthFail?(0,r.zN)("鉴权失败"):(0,r.SK)("成功")}}),children:[(0,y.jsx)(l.Sm,{placeholder:"SecretId",value:v,handleInputChange:e=>{j(e)}}),(0,y.jsx)(l.cA,{placeholder:"SecretKey",value:f,handleInputChange:e=>{S(e)}}),(0,y.jsx)(_.S,{isFlex:!0,columns:[(0,y.jsx)(l.U6,{value:1,context:t("开启"),selected:w,onchange:()=>{C(!w)}}),(0,y.jsx)(l.U6,{value:1,context:t("关闭"),selected:!w,onchange:()=>{C(!w)}})]})]}),(0,y.jsx)(c.Zp,{title:t("说明"),children:"域名如果不存在会自动创建,空子域名是@,ip6和ipv4可以互相切换。"})]})]})]})}function F(){const{t:e}=(0,x.Bd)(),{check_user_auth:t}=(0,S.MH)(),s=[];return t(f.oV.vir_net)&&s.push({index:1,name:e("系统")+e("代理"),rto:"proxy_sys/",component:(0,y.jsx)(b,{})},{index:2,name:"Tun proxy "+e("客户端"),rto:"client/",component:(0,y.jsx)(j,{})},{index:3,name:"Tun proxy "+e("服务端"),rto:"server/",component:(0,y.jsx)(v,{})}),t(f.oV.ddns)&&s.push({index:4,name:`ddns-dnspod(${e("腾讯")})`,rto:"dnspod/",component:(0,y.jsx)(P,{})},{index:5,name:`ddns-${e("腾讯")}${e("云")}`,rto:"tengxun/",component:(0,y.jsx)(K,{})}),(0,y.jsx)(a.W1,{optionList:s,father_route:I.o.net})}},24659(e,t,s){var n=s(34899);s.d(t,["K",0,()=>{const{t:e}=(0,n.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3402],{72693(e,n,t){t.d(n,{w:()=>u});var s=t(96540),r=t(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3402],{72693(e,n,t){t.d(n,{w:()=>u});var s=t(96540),r=t(34899),a=t(14944),c=t(92275),o=t(34843),d=t(82893),l=t(85997),i=t(74848);function u(){const[e,n]=(0,o.fp)(d.AG.prompt_card),{t}=(0,r.Bd)(),u=(0,s.useRef)([]),f=(0,s.useRef)(!1),m=(0,s.useCallback)(()=>{if(f.current)return;if(0===u.current.length)return f.current=!1,void n({open:!1});f.current=!0;const e=u.current.shift();e?n({open:!0,title:t("命令确认"),cancel:()=>{a.ws.sendData(c.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),n({open:!1}),f.current=!1,m()},context_div:(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),(0,i.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,i.jsx)(l.$n,{text:t("拒绝"),color:"var(--red)",clickFun:()=>{a.ws.sendData(c.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),n({open:!1}),f.current=!1,m()}}),(0,i.jsx)(l.$n,{text:t("允许"),clickFun:()=>{a.ws.sendData(c.HK.ai_confirm_cmd,{askId:e.askId,approved:!0}),n({open:!1}),f.current=!1,m()}})]})]})}):f.current=!1},[t]),h=(0,s.useCallback)(e=>{u.current.push(e),m()},[m]);(0,s.useEffect)(()=>(a.ws.addMsg(c.HK.ai_confirm_cmd,e=>{const t=e.context||{};if(t.dismiss&&t.askId)return u.current=u.current.filter(e=>e.askId!==t.askId),void(f.current&&(f.current=!1,n({open:!1}),m()));t.askId&&t.cmd&&h({askId:t.askId,cmd:t.cmd})}),()=>{a.ws.removeMsg(c.HK.ai_confirm_cmd)}),[h]),(0,s.useEffect)(()=>()=>{u.current=[],f.current=!1},[])}},63402(e,n,t){t.r(n),t.d(n,{default:()=>h});var s=t(96540),r=t(97856),a=t(92275),c=t(14944),o=t(34843),d=t(82893),l=t(64405),i=t(40505),u=t(72693),f=t(74848);const m=s.lazy(()=>Promise.all([t.e(2543),t.e(5614)]).then(t.bind(t,85614)));function h(e){const[n,t]=(0,s.useState)(null),[h,p]=(0,o.fp)(d.AG.fileShellShow),[w,k]=(0,o.fp)(d.AG.file_shell_hidden),[_,g]=(0,o.fp)(d.AG.user_base_info),x=_.user_data.theme?.includes("dark")?"#FFFFFF":"#000000";(0,u.w)();const v=()=>{n?.dispose(),t(null)};(0,s.useEffect)(()=>()=>{v()},[]),(0,s.useEffect)(()=>{h.show?n?h.cmd&&c.ws.sendData(a.HK.shell_send,h.cmd):(async()=>{const e=new r.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:x,cursor:x,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let n;const s=n=>{e.write(n)};n=t=>{e.clear(),e.write(t),n=s},await c.ws.addMsg(a.HK.shell_getting,e=>{n(e.context)}),await c.ws.addMsg(a.HK.shell_copy,n=>{n.context&&(0,i.lW)(n.context),e.focus()}),e.onData(async e=>{const n=new a.hf(a.HK.shell_send);n.context=e,await c.ws.send(n)}),t(e)})():v()},[h]);return(0,f.jsx)(m,{show:h.show,file_shell_hidden:w,terminal:n,init:(e,t)=>{n.writeln("[38;2;29;153;243mopen shell...[0m ");const s=new a.hf(a.HK.shell_open),r=new l.n;r.init_path=h.path,r.rows=e,r.cols=t,r.http_token=localStorage.getItem("token"),s.context=r,c.ws.send(s),h.cmd&&c.ws.sendData(a.HK.shell_send,h.cmd)}})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3659],{22081(e,n,t){var s=t(96540),a=t(16349),i=t(74848);const r=({percentage:e})=>{const n=(0,s.useRef)(null),[t,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=n.current.getContext("2d"),s=new a.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return r(s),()=>{s.destroy()}},[]),(0,s.useEffect)(()=>{t&&(t.data.datasets[0].data=[e,100-e],t.update())},[e]),(0,i.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,i.jsx)("canvas",{ref:n})})};t.d(n,["A",0,r])},77481(e,n,t){t.d(n,{S:()=>r,X:()=>i});var s=t(96540),a=t(74848);function i(e){const[n,t]=s.useState([]);return(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,n)=>(0,a.jsx)("th",{children:e},n))})}),(0,a.jsx)("tbody",{children:n.map((n,t)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,s)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:s===n.length-1?"small":"",children:t},s))},t))})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,a.jsx)("div",{children:e},n))})}},88062(e,n,t){t(96540),t(47022);var s=t(74848);function a(e){return(0,s.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,s.jsxs)("li",{children:[e.click?(0,s.jsx)(a,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,s.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,s.jsx)("ul",{children:e.node.children.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})]}),r=e=>(0,s.jsx)("div",{className:"card-tree-view",children:(0,s.jsx)("ul",{children:e.list&&e.list.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})});t.d(n,["A",0,r])},63659(e,n,t){t.r(n),t.d(n,{default:()=>M});var s=t(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3659],{22081(e,n,t){var s=t(96540),a=t(16349),i=t(74848);const r=({percentage:e})=>{const n=(0,s.useRef)(null),[t,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=n.current.getContext("2d"),s=new a.Ay(t,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return r(s),()=>{s.destroy()}},[]),(0,s.useEffect)(()=>{t&&(t.data.datasets[0].data=[e,100-e],t.update())},[e]),(0,i.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,i.jsx)("canvas",{ref:n})})};t.d(n,["A",0,r])},77481(e,n,t){t.d(n,{S:()=>r,X:()=>i});var s=t(96540),a=t(74848);function i(e){const[n,t]=s.useState([]);return(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,n)=>(0,a.jsx)("th",{children:e},n))})}),(0,a.jsx)("tbody",{children:n.map((n,t)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,s)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:s===n.length-1?"small":"",children:t},s))},t))})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,a.jsx)("div",{children:e},n))})}},88062(e,n,t){t(96540),t(47022);var s=t(74848);function a(e){return(0,s.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,s.jsxs)("li",{children:[e.click?(0,s.jsx)(a,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,s.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,s.jsx)("ul",{children:e.node.children.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})]}),r=e=>(0,s.jsx)("div",{className:"card-tree-view",children:(0,s.jsx)("ul",{children:e.list&&e.list.map((n,t)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},t))})});t.d(n,["A",0,r])},63659(e,n,t){t.r(n),t.d(n,{default:()=>M});var s=t(34899),a=t(96540),i=t(34843),r=t(82893),d=t(92275),o=t(14944),c=(t(14284),t(70447)),l=t(85997),u=t(62042),x=t(57952),h=t(75725),j=(t(22081),t(77481)),p=t(61443),m=t(47071),f=t(34289),w=t(88062),v=t(97856),_=t(88815),g=t(15629),k=t(74848);const y=a.lazy(()=>t.e(3233).then(t.bind(t,85614)));let b,C,S=-1;function M(e){const{t:n}=(0,s.Bd)(),[t,M]=(0,i.fp)(r.AG.workflow_show),[N,A]=(0,a.useState)([]),[F,E]=(0,a.useState)([]),[$,G]=(0,a.useState)(!1),[W,P]=(0,a.useState)(void 0),[X,q]=(0,a.useState)([]),[z,B]=(0,a.useState)(-1),[I,J]=(0,a.useState)(10),[O,D]=(0,a.useState)(0),[H,K]=(0,a.useState)(0),[V,Y]=(0,a.useState)(""),[Z,R]=(0,a.useState)(!1),T=[n("序号"),n("运行名称"),n("状态"),n("运行时长"),n("日期"),n("操作")],L=[n("名称"),n("状态"),n("cwd"),n("运行时长"),n("操作")],Q=async e=>{const n=new m._;n.page_num=e??z,n.page_size=I,n.dir_path=`${(0,f.GG)("file",(0,f.vX)())}`;const t=await o.ws.sendData(d.HK.workflow_get,n);if(!t)return;const s=t.context;s&&(A(s.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),D(s.total),K((0,_.gw)(s.total,I)))};(0,a.useEffect)(()=>(G(!1),b=void 0,C=void 0,S=-1,Q(),async()=>{C&&(C.dispose(),C=null)}),[]);const U=async e=>{const n=e.steps,t=[];(0,g.Y)(t,n??[]),q(t)},ee=async e=>{C||await new Promise(e=>{b=e,G(!0),(async()=>{const e=new v.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});C=e,P(e)})()}),e&&(C.reset(),C.write(e))};return(0,k.jsxs)("div",{children:[(0,k.jsxs)(x.A,{children:[W&&(0,k.jsx)(l.rA,{icon:"print",title:"打印日志",onClick:()=>{G(!$)}}),(0,k.jsx)(l.rA,{icon:"close",title:n("关闭"),onClick:()=>{M(!1)}})]}),(0,k.jsx)(h.jW,{isFull:!0,more:!0,children:(0,k.jsx)(h.NN,{children:(0,k.jsx)(h.xh,{children:(0,k.jsxs)(h.fI,{children:[(0,k.jsx)(h.VP,{children:(0,k.jsx)(c.uF,{self_title:(0,k.jsx)("span",{className:" div-row ",children:(0,k.jsx)("h2",{children:n("历史记录")})}),titleCom:(0,k.jsx)("div",{className:" div-row ",children:(0,k.jsx)(p.Sm,{disabled:Z,value:V,placeholder:"搜索运行名称(支持正则)",handleInputChange:e=>{Y(V)},handlerEnter:e=>{(async e=>{const n=new m._;n.search_name=e,n.dir_path=`${(0,f.GG)("file",(0,f.vX)())}`,R(!0);const t=await o.ws.sendData(d.HK.workflow_search_by_run_name,n);if(!t)return;const s=t.context;A(s.list.map(e=>{const n="string"==typeof e.meta?JSON.parse(e.meta):e.meta;return n.index=e.index,n})),D(s.total),K((0,_.gw)(s.total,I)),B(0),R(!1)})(e)}})}),rightBottomCom:(0,k.jsxs)("span",{className:" div-row ",children:[(0,k.jsxs)("span",{children:[Math.abs(z),"/",H]}),(0,k.jsx)(p.Sm,{placeholder:`max page ${H}`,handleInputChange:e=>{S=parseInt(e)},handlerEnter:()=>{if(S<1||S>H)return void(0,u.zN)("illegal page num");const e=0-S;B(e),Q(e)}}),(0,k.jsx)(l.rA,{icon:"navigate_before",onClick:()=>{const e=z+1;e>-1?(0,u.zN)("max page num"):(B(e),Q(e))},title:"上一页"}),(0,k.jsx)(l.rA,{icon:"navigate_next",onClick:()=>{const e=z-1;Math.abs(e)>H?(0,u.zN)("min page num"):(B(e),Q(e))},title:"下一页"})]}),children:(0,k.jsx)(j.X,{headers:T,rows:N.map((e,t)=>{let s;s=e.is_running?(0,k.jsxs)("div",{children:[(0,k.jsx)(c.fq,{}),n("正在运行")]}):(0,k.jsxs)("div",{children:[(0,k.jsx)(c.fq,{success:e.is_success}),e.is_success?n("成功"):n("失败")]});const a=[(0,k.jsx)("p",{children:e.index}),(0,k.jsx)("p",{style:{wordWrap:"break-word"},children:e["run-name"]}),s,(0,k.jsx)("span",{children:e.duration}),(0,k.jsx)("span",{children:e.timestamp}),(0,k.jsx)("div",{children:(0,k.jsx)(l.rA,{icon:"details",title:n("详情"),onClick:()=>{(async e=>{if(e.is_running)return;q([]);const n=new m._;n.index=e.index,n.dir_path=`${(0,f.GG)("file",(0,f.vX)())}`;const t=(await o.ws.sendData(d.HK.workflow_get,n)).context,s="string"==typeof t.one_data.data?JSON.parse(t.one_data.data):t.one_data.data;E(s.all_jobs)})(e)}})})];return a}),width:"10rem"})})}),(0,k.jsxs)(h.VP,{children:[(0,k.jsx)(c.Zp,{title:n("Job"),children:(0,k.jsx)(j.X,{headers:L,rows:F.map((e,t)=>[(0,k.jsx)("p",{children:e.name}),(0,k.jsx)(g.W,{item:e}),(0,k.jsx)(c.xP,{children:String(e.cwd)}),(0,k.jsx)("span",{children:e.duration}),(0,k.jsxs)("div",{children:[(0,k.jsx)(l.rA,{icon:"details",title:n("详情"),onClick:()=>{U(e)}}),!!e.message&&(0,k.jsx)(l.rA,{icon:"print",title:n("日志"),onClick:()=>{ee(e.message)}})]})]),width:"10rem"})}),(0,k.jsx)(c.Zp,{title:"Step",children:(0,k.jsx)(w.A,{list:X,click:e=>{(async e=>{if(e?.extra_data?.is_job)await U(e.extra_data.job_data);else if(e?.extra_data?.context)ee(e.extra_data.context);else{if(!e?.extra_data.code)return;ee(e.extra_data.code??"")}})(e)}})})]})]})})})}),(0,k.jsx)("div",{style:{display:$?"":"none"},children:(0,k.jsx)(y,{show:!0,terminal:W,init:()=>{b&&(b(1),b=void 0)}})})]})}},15629(e,n,t){t.d(n,{W:()=>d});t(96540);var s=t(70447),a=t(47071),i=t(34899),r=t(74848);function d({item:e}){const{t:n}=(0,i.Bd)();let t,d;return null!=e.code?t=0===e.code:e.extra_data?.running_type===a.rl.running&&(d=!0),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:t,running:d}),n(t?"成功":"失败")]})}const o=(e,n,t)=>{if(n)for(const t of n??[]){let n;const a=[];t["use-yml"]?(o(a,void 0,t.use_job_children_list),n=`${t["use-yml"]} ;${t.duration??-1}`):t.runs?n=JSON.stringify(t.runs):t.run?n=t.run:t["run-js"]?n=t["run-js"]:t.sleep&&(n=`sleep ${t.sleep}`),n=(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:void 0===t.code?void 0:0===t.code})," ",n+" ;"+(t.duration??"")]}),e.push({name:n,children:a,extra_data:{code:t.code,context:t.message}})}else if(t)for(const n of t??[]){const t=(0,r.jsxs)("div",{children:[(0,r.jsx)(s.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:t,extra_data:{code:n.code,is_job:!0,job_data:n}})}};t.d(n,["Y",0,o])}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4273],{77481(e,n,t){t.d(n,{S:()=>r,X:()=>l});var s=t(96540),i=t(74848);function l(e){const[n,t]=s.useState([]);return(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,n)=>(0,i.jsx)("th",{children:e},n))})}),(0,i.jsx)("tbody",{children:n.map((n,t)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,s)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:s===n.length-1?"small":"",children:t},s))},t))})]})}function r(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))})}},94273(e,n,t){t.r(n),t.d(n,{default:()=>K});var s=t(96540),i=t(75725),l=t(22022),r=t(70447),c=t(85997),o=t(77481),a=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),p=t(82893),u=t(62042),j=(t(23430),t(21499),t(14944)),m=t(92275),v=t(6960),f=t(40505),g=t(57952),y=t(24659),S=t(74848);let w={};function C(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:C}=(0,s.useContext)(x.F),[I,k]=(0,h.fp)(p.AG.user_base_info),[b,A]=(0,s.useState)([]),[P,$]=(0,h.fp)(p.AG.prompt_card),F=(0,y.K)(),[K,N]=(0,s.useState)(),[U,G]=(0,s.useState)(void 0),[B,X]=(0,s.useState)([]),[M,Z]=(0,s.useState)([]),E=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],V=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],q=[e("序号"),e("服务端口"),e("转发Client名称"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],z=e=>null==e?"":(0,v.s)(e),H=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=w?.[n.client_num_id]?.client_name??"";Z(e)}},L=async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[],s=[];w={};for(const e of n)U?`${e.index}${e.client_name}${e.note}`.includes(U)&&t.push(e):t.push(e),s.push({label:e.client_name,value:e.client_num_id}),w[e.client_num_id]=e;A(t),X(s)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,S.jsxs)(s.Fragment,{children:[(0,S.jsx)(g.A,{children:K&&(0,S.jsx)("span",{children:`${K.client_name}${K.note?`(${K.note})`:""}`})}),(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,S.jsx)(a.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{G(e)},handlerEnter:()=>{L()}}),children:(0,S.jsx)(o.X,{headers:E,rows:b.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(r.xP,{children:n.client_name}),(0,S.jsx)(r.fq,{ok:n.status}),(0,S.jsx)(r.xP,{children:z(n.status?n.online_start_time:n.offline_time)}),(0,S.jsx)(r.xP,{children:n.note}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>{N({...n}),H(n.client_num_id)}}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{$({open:!0,title:"share file",confirm:async()=>{$({open:!1}),await(async e=>{(await d.s9.post("server_client_del",{client_num_id:e})).code===_.m.Success&&((0,u.SK)("成功"),L())})(n.client_num_id)},context_div:(0,S.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,S.jsx)(i.VP,{widthPer:50,children:K?(0,S.jsxs)(i.xh,{children:[(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",K)).code===_.m.Success&&(0,u.SK)("成功")}})}),children:[(0,S.jsx)(i.Yh,{left:e("远程地址"),center:K?.client_remote_address??""}),(0,S.jsx)(i.Yh,{left:e(K?.status?"在线时间":"离线时间"),center:z(K?.status?K?.online_start_time:K?.offline_time)}),(0,S.jsx)(a.Sm,{placeholder:"名称",value:K.client_name,handleInputChange:e=>{K.client_name=e,N({...K})}}),(0,S.jsxs)("form",{children:[e("filecat代理访问"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}})]})]}),K.open_filecat&&(0,S.jsxs)(s.Fragment,{children:[(0,S.jsxs)("form",{children:[e("filecat代理访问使用服务器前端"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:K.filecat_use_local_page,onchange:()=>{K.filecat_use_local_page=!K.filecat_use_local_page,N({...K})}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!K.filecat_use_local_page,onchange:()=>{K.filecat_use_local_page=!K.filecat_use_local_page,N({...K})}})]})]}),(0,S.jsx)(a.Sm,{placeholderOut:e("自定义filecat代理地址"),placeholder:"127.0.0.1:5567",value:K.filecat_proxy_host_port,handleInputChange:e=>{K.filecat_proxy_host_port=e,N({...K})}}),(0,S.jsx)(c.rA,{icon:"content_copy",title:e("复制filecat代理url"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${K.client_num_id}`;(0,f.lW)(e),(0,u.SK)(e)}})]}),(0,S.jsx)(a.Sm,{placeholder:"备注",value:K.note,handleInputChange:e=>{K.note=e,N({...K})}}),(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{K.proxy_fig_list.push({open:!1}),N({...K})},title:e("添加")}),e("代理"),(0,S.jsx)(o.X,{headers:V,rows:K.proxy_fig_list.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,N({...K})},options:F,no_border:!0}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(K.proxy_fig_list.length??0);n++)n!==t&&e.push(K.proxy_fig_list[n]);K.proxy_fig_list=e,N({...K})}})})]),width:"10rem"})]}),(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{M.push({open:!1,server_client_num_id:K.client_num_id}),Z([...M])},title:e("添加")}),e("代理"),(0,S.jsx)(o.X,{headers:q,rows:M.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_name,options:B,handleInputChange:e=>{const t=(e=>B.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,Z([...M])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,Z([...M])},options:F,no_border:!0}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(M.length??0);n++)n!==t&&e.push(M[n]);Z([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,u.SK)("成功"),H(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,S.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,u.zN)("未选择转发送 client");(await d.s9.post("server_bridge_add_fig",e)).code===_.m.Success&&((0,u.SK)("成功"),H(e.server_client_num_id))})(n)}}):(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,u.zN)("未选择转发送 client");(await d.s9.post("server_bridge_edit_fig",e)).code===_.m.Success&&((0,u.SK)("成功"),H(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,S.jsx)(i.xh,{})})]})]})}class I{open;key;option_keys;port}class k{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}function b(e){const{t:n}=(0,l.Bd)(),[t,x]=(0,s.useState)([]),[h,p]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,w]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],b=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],A=(0,y.K)(),P=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&&w(t.data)};(0,s.useEffect)(()=>{P(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{j.ws.addMsg(m.HK.tcp_proxy_client_status,e=>{P()})})},[]);const $=async e=>{const n=new k;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,u.SK)("保存成功"):(0,u.zN)("网络错误")};return(0,S.jsx)("div",{children:(0,S.jsxs)(i.fI,{children:[(0,S.jsxs)(i.VP,{widthPer:60,children:[(0,S.jsxs)(r.Zp,{title:"",rightBottomCom:(0,S.jsx)(c.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,$(t[0])}}),titleCom:(0,S.jsxs)("div",{children:[n("连接状态"),(0,S.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,S.jsx)(a.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,S.jsx)(a.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,S.jsx)(a.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,S.jsx)(a.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,S.jsxs)("form",{children:[n("状态"),(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,S.jsx)(a.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]}),(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,S.jsx)(o.X,{headers:b,rows:t.slice(1).map((e,s)=>[(0,S.jsx)("p",{children:s}),(0,S.jsx)(a.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,S.jsx)(a.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,S.jsx)(a.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,S.jsx)(a.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,S.jsx)(r.fq,{ok:!!e.status}),(0,S.jsx)(a.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:A,no_border:!0}),(0,S.jsx)(a.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.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,u.SK)("保存成功"),P()):(0,u.zN)("网络错误")})(s+1)}}),e.is_new?(0,S.jsx)(c.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await $(e)}}):(0,S.jsx)(c.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await $(e)}})]})]),width:"10rem"})]})]}),(0,S.jsxs)(i.VP,{widthPer:40,children:[v?.length?(0,S.jsx)(r.Zp,{title:n("桥接服务端口列表"),children:(0,S.jsx)(o.X,{headers:C,rows:v.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})}):(0,S.jsx)(S.Fragment,{}),g?.length?(0,S.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,S.jsx)(o.X,{headers:I,rows:g.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.source_client_name}),(0,S.jsx)(r.xP,{children:e.target_client_name}),(0,S.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})}):(0,S.jsx)(S.Fragment,{})]})]})})}function A(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(p.AG.user_base_info),[y,w]=(0,h.fp)(p.AG.prompt_card),[C,k]=(0,s.useState)(!1),[b,A]=(0,s.useState)([]),[P,$]=(0,s.useState)(null),[F,K]=(0,s.useState)([]),[N,U]=(0,s.useState)(void 0),[G,B]=(0,s.useState)(void 0),X=(0,s.useMemo)(()=>{const e=[...b];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[b,P]),M=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)G?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(G)&&n.push(t):n.push(t);A(n)}},Z=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(U(e.data.port),k(!!e.data.open),K(e.data.option_keys??[])),M()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{Z()}),Z()},[]);const E=async e=>{const n=new I;n.port=N,n.open=C,n.option_keys=F;(await d.s9.post("server_save",{fig:n,notice_client:e})).code===_.m.Success&&(0,u.SK)("成功")};return(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,S.jsxs)("div",{children:[(0,S.jsx)(c.C3,{text:e("保存并通知客户端第一个key和port"),clickFun:()=>{E(!0)}}),(0,S.jsx)(c.C3,{text:e("保存"),clickFun:()=>{E(!1)}})]}),children:[(0,S.jsx)(a.Sm,{placeholder:"port",value:N,handleInputChange:e=>{U(e)}}),(0,S.jsxs)("label",{children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{K([...F,""])},title:e("添加")}),e("key")]}),(F??[]).map((n,t)=>(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("div",{style:{width:"90%"},children:(0,S.jsx)(a.Sm,{type:"password",value:n,handleInputChange:e=>{F[t]=e,K([...F])}})}),(0,S.jsx)(c.rA,{icon:"delete",onClick:()=>{F.splice(t,1),K([...F])},title:e("删除")})]},t)),(0,S.jsxs)("form",{children:[e("状态"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,S.jsx)(a.Sm,{placeholder:e("过滤"),value:G,handleInputChange:e=>{B(e)},handlerEnter:()=>{M()}}),children:(0,S.jsx)(o.X,{headers:[e("序号"),(0,S.jsx)(c.rA,{title:e("服务端口"),onClick:()=>{$(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:X.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.proxy_host}),(0,S.jsx)(r.xP,{children:e.proxy_port}),(0,S.jsx)(r.xP,{children:e.client_name}),(0,S.jsx)(r.fq,{ok:!!e.open_success}),(0,S.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var P=t(78247);function $(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:j}=(0,s.useContext)(x.F),[m,v]=(0,h.fp)(p.AG.user_base_info),[f,g]=(0,h.fp)(p.AG.prompt_card),[,y]=(0,h.fp)(p.AG.confirm),[w,C]=(0,h.fp)(p.AG.editorSetting),[I,k]=(0,s.useState)([]),b=[e("编号"),e("原客户端"),e("原目录"),e("目标客户端"),e("目标目录"),e("忽略目录"),e("开启"),e("双向同步"),e("全量同步"),e("备注")],[A,$]=(0,s.useState)([]);(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 F()}})()},[]);const F=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&k(e.data)},K=e=>A.find(n=>String(n.value)===String(e)),N=async e=>{const n=e;(await d.s9.post("sync_task_save",n)).code===_.m.Success&&((0,u.SK)("成功"),await F())};return(0,S.jsx)(i.fI,{children:(0,S.jsx)(i.VP,{widthPer:100,children:(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("客户端文件同步")}),(0,S.jsx)(c.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,S.jsx)("div",{children:(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:"目前只能同步较小的文件,例如配置文件,代码文件"}),(0,S.jsx)("li",{children:e("默认(没有选中全量同步)不会立即同步两个目录中的文件,而是有文件被修改或者改动后才会同步,如果开启全量同步,每次客户端一上线就会递归的同步全部的文件,如果文件非常多,这会造成很大的执行压力。")}),(0,S.jsx)("li",{children:e("如果开启了双向同步,如果两边初始化的时候各自又有很多文件,这是不太稳定的,暂时不建议这样做。")}),(0,S.jsx)("li",{children:e("同时开启全量同步和双向同步,目前性能也会很差,目前没有提供提供冲突冲突的机制。")}),(0,S.jsx)("li",{children:e("如果想用全量同步,一方的文件是空的,且文件数量比较少,几百这样的数量,效果是不错的,之后会一直走增量更新。")})]})})})},title:"信息"})]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{I.push({open:!1,source_dir:"",target_dir:"",delete_missing:!0}),k([...I])},title:e("添加")}),(0,S.jsx)(o.X,{headers:b,rows:I.map((n,t)=>{const s=K(n.source_client_num_id),i=K(n.target_client_num_id);return[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:s?.label??n.source_client_name,options:A,handleInputChange:e=>{const t=K(e);n.source_client_num_id=parseInt(String(t?.value)),n.source_client_name=t?.label,k([...I])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.source_dir,handleInputChange:e=>{n.source_dir=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:i?.label??n.target_client_name,options:A,handleInputChange:e=>{const t=K(e);n.target_client_num_id=parseInt(String(t?.value)),n.target_client_name=t?.label,k([...I])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.target_dir,handleInputChange:e=>{n.target_dir=e},no_border:!0}),(0,S.jsx)(c.rA,{icon:"edit",title:"额外参数设置",onClick:()=>{P.xK.set_value_temp(n.ignore_text??"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async e=>{n.ignore_text=e,k([...I]),P.xK.set_value_temp(""),N(n)}})}}),(0,S.jsx)(a.GL,{selected:!!n.open,onchange:()=>{n.open=!n.open,k([...I])}}),(0,S.jsx)(a.GL,{selected:!!n.two_way_sync,onchange:()=>{n.two_way_sync=!n.two_way_sync,k([...I])}}),(0,S.jsx)(a.GL,{selected:!!n.full_sync,onchange:()=>{n.full_sync=!n.full_sync,k([...I])}}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:()=>{N(n)}}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{n.id?y({open:!0,title:e("确定删除吗"),handle:async()=>{await(async e=>{(await d.s9.post("sync_task_del",{id:e})).code===_.m.Success&&((0,u.SK)("成功"),await F())})(n.id),(0,u.SK)("删除完成"),y({open:!1,handle:null})}}):(I.splice(t,1),k([...I]))}})]})]}),width:"10rem"})]})})})})}var F=t(87361);function K(){const{t:e}=(0,l.Bd)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,S.jsx)(b,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,S.jsx)(A,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,S.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,S.jsx)($,{})}];return(0,S.jsx)(i.W1,{optionList:n,father_route:F.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const i=1440,l=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<i?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/i).toFixed(0)} ${s.Ay.t("天前")}`:t<l?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/l).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(22022);t.d(n,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4273],{77481(e,n,t){t.d(n,{S:()=>r,X:()=>l});var s=t(96540),i=t(74848);function l(e){const[n,t]=s.useState([]);return(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,n)=>(0,i.jsx)("th",{children:e},n))})}),(0,i.jsx)("tbody",{children:n.map((n,t)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,s)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:s===n.length-1?"small":"",children:t},s))},t))})]})}function r(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))})}},94273(e,n,t){t.r(n),t.d(n,{default:()=>K});var s=t(96540),i=t(75725),l=t(34899),r=t(70447),c=t(85997),o=t(77481),a=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),p=t(82893),u=t(62042),j=(t(23430),t(21499),t(14944)),m=t(92275),v=t(6960),f=t(40505),g=t(57952),y=t(24659),S=t(74848);let w={};function C(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:C}=(0,s.useContext)(x.F),[I,k]=(0,h.fp)(p.AG.user_base_info),[b,A]=(0,s.useState)([]),[P,$]=(0,h.fp)(p.AG.prompt_card),F=(0,y.K)(),[K,N]=(0,s.useState)(),[U,G]=(0,s.useState)(void 0),[B,X]=(0,s.useState)([]),[M,Z]=(0,s.useState)([]),E=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],V=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],q=[e("序号"),e("服务端口"),e("转发Client名称"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],z=e=>null==e?"":(0,v.s)(e),H=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=w?.[n.client_num_id]?.client_name??"";Z(e)}},L=async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[],s=[];w={};for(const e of n)U?`${e.index}${e.client_name}${e.note}`.includes(U)&&t.push(e):t.push(e),s.push({label:e.client_name,value:e.client_num_id}),w[e.client_num_id]=e;A(t),X(s)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,S.jsxs)(s.Fragment,{children:[(0,S.jsx)(g.A,{children:K&&(0,S.jsx)("span",{children:`${K.client_name}${K.note?`(${K.note})`:""}`})}),(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,S.jsx)(a.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{G(e)},handlerEnter:()=>{L()}}),children:(0,S.jsx)(o.X,{headers:E,rows:b.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(r.xP,{children:n.client_name}),(0,S.jsx)(r.fq,{ok:n.status}),(0,S.jsx)(r.xP,{children:z(n.status?n.online_start_time:n.offline_time)}),(0,S.jsx)(r.xP,{children:n.note}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>{N({...n}),H(n.client_num_id)}}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{$({open:!0,title:"share file",confirm:async()=>{$({open:!1}),await(async e=>{(await d.s9.post("server_client_del",{client_num_id:e})).code===_.m.Success&&((0,u.SK)("成功"),L())})(n.client_num_id)},context_div:(0,S.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,S.jsx)(i.VP,{widthPer:50,children:K?(0,S.jsxs)(i.xh,{children:[(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",K)).code===_.m.Success&&(0,u.SK)("成功")}})}),children:[(0,S.jsx)(i.Yh,{left:e("远程地址"),center:K?.client_remote_address??""}),(0,S.jsx)(i.Yh,{left:e(K?.status?"在线时间":"离线时间"),center:z(K?.status?K?.online_start_time:K?.offline_time)}),(0,S.jsx)(a.Sm,{placeholder:"名称",value:K.client_name,handleInputChange:e=>{K.client_name=e,N({...K})}}),(0,S.jsxs)("form",{children:[e("filecat代理访问"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}})]})]}),K.open_filecat&&(0,S.jsxs)(s.Fragment,{children:[(0,S.jsxs)("form",{children:[e("filecat代理访问使用服务器前端"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:K.filecat_use_local_page,onchange:()=>{K.filecat_use_local_page=!K.filecat_use_local_page,N({...K})}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!K.filecat_use_local_page,onchange:()=>{K.filecat_use_local_page=!K.filecat_use_local_page,N({...K})}})]})]}),(0,S.jsx)(a.Sm,{placeholderOut:e("自定义filecat代理地址"),placeholder:"127.0.0.1:5567",value:K.filecat_proxy_host_port,handleInputChange:e=>{K.filecat_proxy_host_port=e,N({...K})}}),(0,S.jsx)(c.rA,{icon:"content_copy",title:e("复制filecat代理url"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${K.client_num_id}`;(0,f.lW)(e),(0,u.SK)(e)}})]}),(0,S.jsx)(a.Sm,{placeholder:"备注",value:K.note,handleInputChange:e=>{K.note=e,N({...K})}}),(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{K.proxy_fig_list.push({open:!1}),N({...K})},title:e("添加")}),e("代理"),(0,S.jsx)(o.X,{headers:V,rows:K.proxy_fig_list.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,N({...K})},options:F,no_border:!0}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsx)("div",{children:(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(K.proxy_fig_list.length??0);n++)n!==t&&e.push(K.proxy_fig_list[n]);K.proxy_fig_list=e,N({...K})}})})]),width:"10rem"})]}),(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{M.push({open:!1,server_client_num_id:K.client_num_id}),Z([...M])},title:e("添加")}),e("代理"),(0,S.jsx)(o.X,{headers:q,rows:M.map((n,t)=>[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_name,options:B,handleInputChange:e=>{const t=(e=>B.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,Z([...M])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,S.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,Z([...M])},options:F,no_border:!0}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(M.length??0);n++)n!==t&&e.push(M[n]);Z([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,u.SK)("成功"),H(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,S.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,u.zN)("未选择转发送 client");(await d.s9.post("server_bridge_add_fig",e)).code===_.m.Success&&((0,u.SK)("成功"),H(e.server_client_num_id))})(n)}}):(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,u.zN)("未选择转发送 client");(await d.s9.post("server_bridge_edit_fig",e)).code===_.m.Success&&((0,u.SK)("成功"),H(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,S.jsx)(i.xh,{})})]})]})}class I{open;key;option_keys;port}class k{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}function b(e){const{t:n}=(0,l.Bd)(),[t,x]=(0,s.useState)([]),[h,p]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,w]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],b=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],A=(0,y.K)(),P=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&&w(t.data)};(0,s.useEffect)(()=>{P(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{j.ws.addMsg(m.HK.tcp_proxy_client_status,e=>{P()})})},[]);const $=async e=>{const n=new k;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,u.SK)("保存成功"):(0,u.zN)("网络错误")};return(0,S.jsx)("div",{children:(0,S.jsxs)(i.fI,{children:[(0,S.jsxs)(i.VP,{widthPer:60,children:[(0,S.jsxs)(r.Zp,{title:"",rightBottomCom:(0,S.jsx)(c.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,$(t[0])}}),titleCom:(0,S.jsxs)("div",{children:[n("连接状态"),(0,S.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,S.jsx)(a.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,S.jsx)(a.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,S.jsx)(a.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,S.jsx)(a.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,S.jsxs)("form",{children:[n("状态"),(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,S.jsx)(a.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]}),(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,S.jsx)(o.X,{headers:b,rows:t.slice(1).map((e,s)=>[(0,S.jsx)("p",{children:s}),(0,S.jsx)(a.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,S.jsx)(a.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,S.jsx)(a.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,S.jsx)(a.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,S.jsx)(r.fq,{ok:!!e.status}),(0,S.jsx)(a.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:A,no_border:!0}),(0,S.jsx)(a.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.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,u.SK)("保存成功"),P()):(0,u.zN)("网络错误")})(s+1)}}),e.is_new?(0,S.jsx)(c.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await $(e)}}):(0,S.jsx)(c.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await $(e)}})]})]),width:"10rem"})]})]}),(0,S.jsxs)(i.VP,{widthPer:40,children:[v?.length?(0,S.jsx)(r.Zp,{title:n("桥接服务端口列表"),children:(0,S.jsx)(o.X,{headers:C,rows:v.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})}):(0,S.jsx)(S.Fragment,{}),g?.length?(0,S.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,S.jsx)(o.X,{headers:I,rows:g.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.source_client_name}),(0,S.jsx)(r.xP,{children:e.target_client_name}),(0,S.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})}):(0,S.jsx)(S.Fragment,{})]})]})})}function A(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(p.AG.user_base_info),[y,w]=(0,h.fp)(p.AG.prompt_card),[C,k]=(0,s.useState)(!1),[b,A]=(0,s.useState)([]),[P,$]=(0,s.useState)(null),[F,K]=(0,s.useState)([]),[N,U]=(0,s.useState)(void 0),[G,B]=(0,s.useState)(void 0),X=(0,s.useMemo)(()=>{const e=[...b];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[b,P]),M=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)G?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(G)&&n.push(t):n.push(t);A(n)}},Z=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(U(e.data.port),k(!!e.data.open),K(e.data.option_keys??[])),M()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{Z()}),Z()},[]);const E=async e=>{const n=new I;n.port=N,n.open=C,n.option_keys=F;(await d.s9.post("server_save",{fig:n,notice_client:e})).code===_.m.Success&&(0,u.SK)("成功")};return(0,S.jsxs)(i.fI,{children:[(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,S.jsxs)("div",{children:[(0,S.jsx)(c.C3,{text:e("保存并通知客户端第一个key和port"),clickFun:()=>{E(!0)}}),(0,S.jsx)(c.C3,{text:e("保存"),clickFun:()=>{E(!1)}})]}),children:[(0,S.jsx)(a.Sm,{placeholder:"port",value:N,handleInputChange:e=>{U(e)}}),(0,S.jsxs)("label",{children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{K([...F,""])},title:e("添加")}),e("key")]}),(F??[]).map((n,t)=>(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("div",{style:{width:"90%"},children:(0,S.jsx)(a.Sm,{type:"password",value:n,handleInputChange:e=>{F[t]=e,K([...F])}})}),(0,S.jsx)(c.rA,{icon:"delete",onClick:()=>{F.splice(t,1),K([...F])},title:e("删除")})]},t)),(0,S.jsxs)("form",{children:[e("状态"),":",(0,S.jsx)(o.S,{isFlex:!0,columns:[(0,S.jsx)(a.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,S.jsx)(a.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,S.jsx)(i.VP,{widthPer:50,children:(0,S.jsx)(i.xh,{children:(0,S.jsx)(r.uF,{self_title:(0,S.jsx)("span",{className:" div-row ",children:(0,S.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,S.jsx)(a.Sm,{placeholder:e("过滤"),value:G,handleInputChange:e=>{B(e)},handlerEnter:()=>{M()}}),children:(0,S.jsx)(o.X,{headers:[e("序号"),(0,S.jsx)(c.rA,{title:e("服务端口"),onClick:()=>{$(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:X.map((e,n)=>[(0,S.jsx)("p",{children:n}),(0,S.jsx)(r.xP,{children:e.server_port}),(0,S.jsx)(r.xP,{children:e.proxy_host}),(0,S.jsx)(r.xP,{children:e.proxy_port}),(0,S.jsx)(r.xP,{children:e.client_name}),(0,S.jsx)(r.fq,{ok:!!e.open_success}),(0,S.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var P=t(78247);function $(){const{t:e,i18n:n}=(0,l.Bd)(),{initUserInfo:t,reloadUserInfo:j}=(0,s.useContext)(x.F),[m,v]=(0,h.fp)(p.AG.user_base_info),[f,g]=(0,h.fp)(p.AG.prompt_card),[,y]=(0,h.fp)(p.AG.confirm),[w,C]=(0,h.fp)(p.AG.editorSetting),[I,k]=(0,s.useState)([]),b=[e("编号"),e("原客户端"),e("原目录"),e("目标客户端"),e("目标目录"),e("忽略目录"),e("开启"),e("双向同步"),e("全量同步"),e("备注")],[A,$]=(0,s.useState)([]);(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 F()}})()},[]);const F=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&k(e.data)},K=e=>A.find(n=>String(n.value)===String(e)),N=async e=>{const n=e;(await d.s9.post("sync_task_save",n)).code===_.m.Success&&((0,u.SK)("成功"),await F())};return(0,S.jsx)(i.fI,{children:(0,S.jsx)(i.VP,{widthPer:100,children:(0,S.jsx)(i.xh,{children:(0,S.jsxs)(r.Zp,{self_title:(0,S.jsxs)("span",{className:" div-row ",children:[(0,S.jsx)("h2",{children:e("客户端文件同步")}),(0,S.jsx)(c.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,S.jsx)("div",{children:(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:"目前只能同步较小的文件,例如配置文件,代码文件"}),(0,S.jsx)("li",{children:e("默认(没有选中全量同步)不会立即同步两个目录中的文件,而是有文件被修改或者改动后才会同步,如果开启全量同步,每次客户端一上线就会递归的同步全部的文件,如果文件非常多,这会造成很大的执行压力。")}),(0,S.jsx)("li",{children:e("如果开启了双向同步,如果两边初始化的时候各自又有很多文件,这是不太稳定的,暂时不建议这样做。")}),(0,S.jsx)("li",{children:e("同时开启全量同步和双向同步,目前性能也会很差,目前没有提供提供冲突冲突的机制。")}),(0,S.jsx)("li",{children:e("如果想用全量同步,一方的文件是空的,且文件数量比较少,几百这样的数量,效果是不错的,之后会一直走增量更新。")})]})})})},title:"信息"})]}),children:[(0,S.jsx)(c.rA,{icon:"add",onClick:()=>{I.push({open:!1,source_dir:"",target_dir:"",delete_missing:!0}),k([...I])},title:e("添加")}),(0,S.jsx)(o.X,{headers:b,rows:I.map((n,t)=>{const s=K(n.source_client_num_id),i=K(n.target_client_num_id);return[(0,S.jsx)("p",{children:t}),(0,S.jsx)(a.Sm,{value:s?.label??n.source_client_name,options:A,handleInputChange:e=>{const t=K(e);n.source_client_num_id=parseInt(String(t?.value)),n.source_client_name=t?.label,k([...I])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.source_dir,handleInputChange:e=>{n.source_dir=e},no_border:!0}),(0,S.jsx)(a.Sm,{value:i?.label??n.target_client_name,options:A,handleInputChange:e=>{const t=K(e);n.target_client_num_id=parseInt(String(t?.value)),n.target_client_name=t?.label,k([...I])},no_border:!0}),(0,S.jsx)(a.Sm,{value:n.target_dir,handleInputChange:e=>{n.target_dir=e},no_border:!0}),(0,S.jsx)(c.rA,{icon:"edit",title:"额外参数设置",onClick:()=>{P.xK.set_value_temp(n.ignore_text??"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async e=>{n.ignore_text=e,k([...I]),P.xK.set_value_temp(""),N(n)}})}}),(0,S.jsx)(a.GL,{selected:!!n.open,onchange:()=>{n.open=!n.open,k([...I])}}),(0,S.jsx)(a.GL,{selected:!!n.two_way_sync,onchange:()=>{n.two_way_sync=!n.two_way_sync,k([...I])}}),(0,S.jsx)(a.GL,{selected:!!n.full_sync,onchange:()=>{n.full_sync=!n.full_sync,k([...I])}}),(0,S.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,S.jsxs)("div",{children:[(0,S.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:()=>{N(n)}}),(0,S.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>{n.id?y({open:!0,title:e("确定删除吗"),handle:async()=>{await(async e=>{(await d.s9.post("sync_task_del",{id:e})).code===_.m.Success&&((0,u.SK)("成功"),await F())})(n.id),(0,u.SK)("删除完成"),y({open:!1,handle:null})}}):(I.splice(t,1),k([...I]))}})]})]}),width:"10rem"})]})})})})}var F=t(87361);function K(){const{t:e}=(0,l.Bd)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,S.jsx)(b,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,S.jsx)(A,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,S.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,S.jsx)($,{})}];return(0,S.jsx)(i.W1,{optionList:n,father_route:F.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const i=1440,l=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<i?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/i).toFixed(0)} ${s.Ay.t("天前")}`:t<l?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/l).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(34899);t.d(n,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4903],{64903(e,t,n){n.r(t),n.d(t,{default:()=>f});var c=n(96540),i=n(34843),l=n(82893),s=n(85997),o=n(57952),a=(n(62042),n(21499),n(40505),n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4903],{64903(e,t,n){n.r(t),n.d(t,{default:()=>f});var c=n(96540),i=n(34843),l=n(82893),s=n(85997),o=n(57952),a=(n(62042),n(21499),n(40505),n(34899)),d=(n(99214),n(74848));const r=c.lazy(()=>Promise.all([n.e(1595),n.e(6010)]).then(n.bind(n,34299)));function f(e){const{t}=(0,a.Bd)(),[n,c]=(0,i.fp)(l.AG.markdown);if(n.context)return(0,d.jsxs)("div",{id:"md-container",children:[(0,d.jsx)(o.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:t("取消"),icon:"close",onClick:function(){c({context:"",filename:""}),n?.close?.()}},1),(0,d.jsx)("title",{children:n.filename},2)]}),(0,d.jsx)("div",{className:"md-context ",children:(0,d.jsx)(r,{context:n.context})})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5516],{52811(e,t,a){a.r(t),a.d(t,{default:()=>h});var s=a(96540),l=a(60882),i=a(34843),n=a(82893),r=a(14284),c=a(34289),o=a(62042),d=a(61973),g=a(57889),u=a(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5516],{52811(e,t,a){a.r(t),a.d(t,{default:()=>h});var s=a(96540),l=a(60882),i=a(34843),n=a(82893),r=a(14284),c=a(34289),o=a(62042),d=a(61973),g=a(57889),u=a(34899),A=a(53459),x=(a(3561),a(74848));function h(){const[e,t]=(0,i.fp)(n.AG.excalidraw_editor),[a,h]=(0,s.useState)(null),[f,m]=(0,s.useState)(null),[w,p]=(0,s.useState)(!1),v=(0,d.Zp)(),{t:S}=(0,u.Bd)();(0,s.useEffect)(()=>{let t=!1;return(async()=>{if(e?.url){p(!0);try{const a=await g.l.get(e.url);if(t)return;const s=function(e){if(!e)return null;const t="string"==typeof e?e:e.context??e.data??e;if(!t)return null;try{return"string"==typeof t?JSON.parse(t):t}catch{return null}}(a);if(!s)throw new Error("invalid excalidraw scene");m(s)}catch{t||(m(null),(0,o.zN)("Load Excalidraw file failed"))}finally{t||p(!1)}}else m(null)})(),()=>{t=!0}},[e?.url]);return(0,x.jsx)("div",{id:"excalidraw-container",children:(0,x.jsxs)("div",{className:"excalidraw-context",children:[w&&(0,x.jsx)("div",{className:"common-box common-box-center",children:"Loading..."}),!w&&f&&(0,x.jsx)(l.Td,{langCode:"zh-CN",initialData:f,excalidrawAPI:e=>h(e),UIOptions:{dockedSidebarBreakpoint:0},children:(0,x.jsxs)(l.zU,{children:[(0,x.jsx)(l.zU.Item,{onSelect:()=>{t({}),v((0,c.vX)()),e?.close?.()},children:S("关闭")}),(0,x.jsx)(l.zU.Item,{onSelect:async()=>{if(!a)return void(0,o.zN)("Editor is not ready");const t=a.getSceneElements(),s=a.getAppState(),i=a.getFiles(),n=(0,l.nu)(t,s,i,"local"),d=JSON.parse(n);d.appState={...d.appState??{},zoom:s.zoom,scrollX:s.scrollX,scrollY:s.scrollY,viewBackgroundColor:s.viewBackgroundColor,gridSize:s.gridSize};(await r.$M.post(`save/${encodeURIComponent((0,c.GG)("file",(0,c.vX)()))}${e.name}`,{context:JSON.stringify(d)})).code===A.m.Success&&(0,o.SK)("保存成功")},children:S("保存到服务器")}),(0,x.jsxs)(l.zU.Group,{title:"Excalidraw items",children:[(0,x.jsx)(l.zU.DefaultItems.LoadScene,{}),(0,x.jsx)(l.zU.DefaultItems.Export,{}),(0,x.jsx)(l.zU.DefaultItems.SaveToActiveFile,{}),(0,x.jsx)(l.zU.DefaultItems.SaveAsImage,{}),(0,x.jsx)(l.zU.DefaultItems.ClearCanvas,{}),(0,x.jsx)(l.zU.DefaultItems.ToggleTheme,{}),(0,x.jsx)(l.zU.DefaultItems.ChangeCanvasBackground,{})]})]})},e.url??"excalidraw")]})})}},51953(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},17834(e){e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},56933(e){e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5761,6010],{83277(e,t,n){n.d(t,{$j:()=>a,Lv:()=>o,qq:()=>i});class s{options_agent_url_list;options_agent_key_list;options_agent_model_list;options_local_file_path_prompt_list}class o{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const n of t)if(n.value===e)return n.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const n of t)if(n.value===e)return!0;return!1}}class i extends s{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url;open_pick_model;max_recent_messages=12;compress_message_count=16;max_tool_content_chars=200}const l=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function a(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}n.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n',"cL",0,l])},77481(e,t,n){n.d(t,{S:()=>l,X:()=>i});var s=n(96540),o=n(74848);function i(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((e,t)=>(0,o.jsx)("th",{children:e},t))})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>(0,o.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,o.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},1038(e,t,n){n.r(t),n.d(t,{default:()=>I});var s=n(22022),o=n(96540),i=n(85997),l=n(57952),a=n(34843),r=n(82893),c=n(75725),d=n(77481),p=n(61443),_=n(70447),m=n(34299),u=n(74848);var h=n(14284),x=n(53459),j=n(62042),v=n(7523),g=n(78247),f=n(23430),y=n(61973),w=n(14944),C=n(92275),k=n(88815),b=n(45907),A=n(12721),S=n(24659),$=n(83277);function I(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(v.F),n=[e("编号"),e("url"),e("model类型"),e("是否开启"),e("key"),"model",e("成为tool"),e("更多属性"),e("备注")],I=function(){const{t:e}=(0,s.Bd)();return[{value:"completions",label:e("文本对话")},{value:"images",label:e("图片生成")}]}(),K=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[N,P]=(0,o.useState)([]),[O,X]=(0,o.useState)([]),[M,V]=(0,o.useState)([]),[L,F]=(0,o.useState)(null),H=(0,o.useRef)(),Y=(0,o.useRef)(!1),q=(0,o.useRef)(!1),[G,z]=(0,o.useState)([]),[B,R]=(0,o.useState)(!1),[T,D]=(0,a.fp)(r.AG.prompt_card),[E,J]=(0,a.fp)(r.AG.user_base_info),[W,Z]=(0,o.useState)(!1),U=M.filter(e=>"http"!==(e.transport??"stdio")),Q=M.filter(e=>"http"===e.transport),ee=[e("编号"),e("名称"),e("是否开启"),"command","args","cwd",e("tools|env"),e("备注")],te=[e("编号"),e("名称"),e("是否开启"),e("endpoint"),e("tools|headers"),e("备注")],ne=[e("编号"),e("提示词"),e("备注")],[se,oe]=(0,o.useState)([]),[ie,le]=(0,o.useState)(!1),ae=function(){const[e,t]=(0,a.fp)(r.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,u.jsx)("div",{children:(0,u.jsx)(m.default,{context:e})})})}}(),{check_user_auth:re}=(0,g.MH)(),[ce,de]=(0,a.fp)(r.AG.editorSetting),pe=(0,y.Zp)(),_e=(0,b.y)(),me=(0,S.K)(),ue=async()=>{const e=await h.jV.get("docs_on_get");e.code===x.m.Success&&Z(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await h.XO.get("ai_agent_setting");e.code===x.m.Success&&P(e.data.models),await w.ws.addMsg(C.HK.ai_load_info,e=>{F(e.context)});const t=await w.ws.sendData(C.HK.ai_load_info,{});t?.context&&F(t.context);const n=await h.XO.get("ai_docs_setting");n.code===x.m.Success&&(H.current=n.data.param,n.data.list?.length&&X(n.data.list));const s=await h.XO.get("ai_mcp_setting");s.code===x.m.Success&&V(s.data.list??[]),await fe(),ue();const o=await h.XO.get("ai_system_prompts");o.code===x.m.Success&&oe(o.data??[]);const i=await h.XO.get("ai_long_term_memory_setting");i.code===x.m.Success&&le(i.data?.open??!1)})()},[]);const he=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};V([...M,t]),Y.current=!0},xe=e=>{const t=M.indexOf(e);t<0||(M.splice(t,1),V([...M]),Y.current=!0)},je=e=>{V([...M,{...e,open:!1}]),Y.current=!0},ve=async e=>{for(let e=0;e<N.length;e++)N[e].index=e;(await h.XO.post("ai_agent_setting/save",{models:e??N})).code===x.m.Success&&(0,j.SK)("保存成功")},ge=async e=>{for(let e=0;e<M.length;e++)M[e].index=e;(await h.XO.post("ai_mcp_setting/save",{list:e??M})).code===x.m.Success&&((0,j.SK)("保存成功"),Y.current=!1,await fe())},fe=async()=>{const e=await h.XO.get("ai_mcp_tools");return e.code===x.m.Success?(z(e.data??[]),e.data??[]):[]},ye=async e=>{R(!0);try{const t=await h.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await fe(),(0,j.SK)("MCP工具加载成功"),t.data??null}finally{R(!1)}return null},we=async(t,n,s,o)=>{const i=o??G.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},l=(i.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));D({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,u.jsx)(A.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${i.transport??"stdio"} | ${i.open?e("是"):e("否")} | ${i.loaded?"loaded":"idle"} | ${i.tool_count} tools`,pages:l,initialPageId:s,onRefresh:async()=>{const e=await ye(n);e&&await we(t,n,s,e)},renderPage:t=>{if(!t)return(0,u.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=i.tools?.find(e=>e.runtime_name===t.id);return n?(0,u.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,u.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,u.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,u.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,u.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("strong",{children:"schema:"}),(0,u.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,u.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>D({open:!1})})},Ce=async e=>{for(let e=0;e<N.length;e++)N[e].index=e;let t={list:O,docs_update_tag:q.current};null!=e&&(t={param:e}),q.current=!1;(await h.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,j.SK)("保存成功")},ke=async()=>{for(let e=0;e<se.length;e++)se[e].index=e;(await h.XO.post("ai_system_prompts/save",{list:se})).code===x.m.Success&&(0,j.SK)("保存成功")};return(0,u.jsxs)("div",{children:[(0,u.jsx)(l.A,{children:re(f.oV.ai_agent_setting)&&(0,u.jsx)(i.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{pe(-1)}})}),(0,u.jsx)(c.jW,{isFull:!0,more:!0,children:(0,u.jsx)(c.NN,{children:(0,u.jsxs)(c.xh,{children:[(0,u.jsx)(c.fI,{children:(0,u.jsx)(c.VP,{widthPer:100,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. 只能使用符合openai风格的ai接口,接口不能只填域名,而是类似 https://ark.cn-beijing.volces.com/api/v3/chat/completions 这样的全路径链接聊天url\n2. 对话的历史越长,消耗的大模型token费用越贵,目前不具备长期记忆简化能力,可以在系统prompt中设置一下让AI回答的简洁一点,节省tokens\n3. model请求参数json编写,里面只能编写json,来用于编写openai风格ai支持的属性,比如 temperature thinking(豆包的深度思考开关)等\n4. 可以在model请求参数中开启 "stream":true 提高响应速度\n5. 深度思考现在会影响输出速度,建议设置`{\n "thinking" : { \n "type":"disabled"\n }\n}`关闭(豆包例子)\n6. 使用AI功能来查询服务器信息,那么AI就需要能够之一些命令,需要先在用户设置中,给用户设置命令权限,建议设置 `*` 允许全部命令,在设置禁止不能执行的危险命令。\n7. 成为tool 后,该模型将会作为一个工具被加载,可以实现不同模型作为不能角色的能力。\n8. model 类型是必须要设置的,因为不同类型的 model 接口格式不同。\n')},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...N,{note:"",open:!1,path:"",dotenv:$.CP,json_params:$.cL}])}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:async()=>{await ve()}})]}),children:(0,u.jsx)(d.X,{headers:n,rows:N.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,u.jsx)(p.l6,{value:t.request_type??"completions",onChange:e=>{t.request_type=e,P([...N])},options:I,no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<N.length;e++)N[e].open=e===n&&t,s.push(N[e]);P(s)})(0,e,n)},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{type:$.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:$.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,u.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,u.jsx)(p.l6,{value:t.tool_mode,onChange:n=>{t.open&&!0===n?(0,j.zN)(e("开启状态不能成为tool")):(t.tool_mode=n,P([...N]))},options:me,no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"short_text",title:"prompt",onClick:()=>{g.xK.set_value_temp(N[n].sys_prompt??""),de({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{N[n].sys_prompt=e,P(N),g.xK.set_value_temp(""),ve(N)}})}}),(0,u.jsx)(i.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{g.xK.set_value_temp(N[n].json_params),de({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{N[n].json_params=e,P(N),g.xK.set_value_temp(""),ve(N)},can_format:!0})}}),(0,u.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(N[n].dotenv),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{N[n].dotenv=e,P(N),g.xK.set_value_temp(""),ve(N)}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),P([...N])})(n)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{P([...N,{...N[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,u.jsx)(c.fI,{children:(0,u.jsx)(c.VP,{widthPer:70,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("stdio")}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,u.jsx)(d.X,{headers:ee,rows:U.map((t,n)=>{const s=M.indexOf(t);return[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,V([...M]),Y.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,u.jsx)(i.rA,{icon:"settings",title:"env",onClick:()=>{g.xK.set_value_temp(t.env??""),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,V([...M]),g.xK.set_value_temp(""),Y.current=!0,ge()}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>xe(t)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})})})}),(0,u.jsx)(c.fI,{children:(0,u.jsxs)(c.VP,{widthPer:70,children:[(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("http")}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,u.jsx)(d.X,{headers:te,rows:Q.map((t,n)=>{const s=M.indexOf(t);return[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,V([...M]),Y.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,u.jsx)(i.rA,{icon:"settings",title:"headers",onClick:()=>{g.xK.set_value_temp(t.headers??""),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,V([...M]),g.xK.set_value_temp(""),Y.current=!0,ge()}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>xe(t)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})}),(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("系统会话提示词")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n')},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{oe([...se,{prompt:"",note:""}])}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ke()}})]}),children:(0,u.jsx)(d.X,{headers:ne,rows:se.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)("div",{children:(0,u.jsx)(i.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{g.xK.set_value_temp(t.prompt??""),de({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,oe([...se]),g.xK.set_value_temp(""),ke()}})}})}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsx)("div",{children:(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{se.splice(e,1),oe([...se])})(n)})})];return s}),width:"10rem"})}),(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("长期记忆")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),titleCom:(0,u.jsx)("div",{children:(0,u.jsx)(i.Ay,{checked:ie,onChange:async t=>{le(t),await h.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,j.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,u.jsx)("div",{style:{display:"flex",gap:"0.5rem",padding:"0.5rem 0",flexWrap:"wrap"},children:[{type:"week",label:e("周记忆"),tip:e("上限3000字")},{type:"month",label:e("月记忆"),tip:e("上限6000字")},{type:"year",label:e("年记忆"),tip:e("上限9000字")},{type:"forever",label:e("永久记忆"),tip:e("上限12000字")}].map(({type:t,label:n,tip:s})=>(0,u.jsx)(i.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const s=await h.XO.get(`ai_long_term_memory_bucket/${t}`),o=s.code===x.m.Success?s.data??"":"";g.xK.set_value_temp(o),de({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async s=>{await h.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:s}),g.xK.set_value_temp(""),(0,j.SK)(`${n} ${e("已保存")}`)}})}},t))})})]})}),(0,u.jsxs)(c.fI,{children:[(0,u.jsx)(c.VP,{widthPer:50,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("本地知识库")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.Ay,{checked:W,onChange:async e=>{await h.jV.post("docs_on_set",{status:e}),ue(),t()},title:e("知识库开关")}),(0,u.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(H.current),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{H.current=e,g.xK.set_value_temp(""),Ce(H.current)}})}}),(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...O,{note:"",auto_load:!1,dir:""}]),q.current=!0}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{Ce()}})]}),children:(0,u.jsx)(d.X,{headers:K,rows:O.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,q.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,X([...O]),q.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{O.splice(e,1),X([...O]),q.current=!0})(n)}),(0,u.jsx)(i.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{_e({sub_title:"手动加载",confirm_fun:()=>{h.jV.post("ai_load_one_file",{param_path:t.dir}),(0,j.SK)("ok")}})}}),(0,u.jsx)(i.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{_e({sub_title:"从索引删除",confirm_fun:()=>{h.jV.post("ai_del",{param_path:t.dir}),(0,j.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),L&&(0,u.jsx)(c.VP,{widthPer:50,children:(0,u.jsxs)(_.Zp,{title:e("知识库加载信息"),children:[(0,u.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:L?.progress}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:L?.num}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:L?.char_num}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,k.v7)(L?.size)}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,k.a3)(L?.consume_time_ms_len)}),(0,u.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:L?.total_num})]})})]})]})})})]})}},34299(e,t,n){n.r(t),n.d(t,{default:()=>h});n(96540);var s=n(73557),o=n(53995),i=n(18569),l=n(77979),a=n(8263),r=n(69428),c=n.n(r),d=(n(3775),n(21499)),p=n(99214),_=n(19878),m=(n(72411),n(74848));const u=new s.A({html:!0,highlight:function(e,t){if(t&&_.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${_.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${_.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${u.utils.escapeHtml(e)}</code></pre>`}});function h(e){return(0,p.VD)(),(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:u.render(e.context)}})}u.use(o.A).use(i.A).use(l.A).use(a.A).use(c()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,i)=>{const l=t[n],a=l.content.trim(),r=l.info.trim();let c="";if(r&&_.A.getLanguage(r))try{c=_.A.highlight(a,{language:r}).value}catch(t){c=e.utils.escapeHtml(a)}else try{c=_.A.highlightAuto(a).value}catch(t){c=e.utils.escapeHtml(a)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${r||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(a)}">复制</button>\n </div>\n <pre><code class="hljs ${r?`language-${r}`:""}">${c}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,s,o){return o.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,s,o,i)=>{const l=e[n],a=l.attrIndex("href");if(a>=0){const e=l.attrs[a][1];l.attrs[a][1]=(0,d.bi)(window.location.href,e)}return t(e,n,s,o,i)}})},45907(e,t,n){n.d(t,{y:()=>i});var s=n(34843),o=n(82893);function i(){const[e,t]=(0,s.fp)(o.AG.confirm);return({sub_title:e,confirm_fun:n,title:s,context_div:o})=>{t({open:!0,sub_title:e,handle:()=>{n(),t({open:!1,handle:null})},title:s,context_div:o})}}},24659(e,t,n){var s=n(22022);n.d(t,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5761,6010],{83277(e,t,n){n.d(t,{$j:()=>a,Lv:()=>o,qq:()=>i});class s{options_agent_url_list;options_agent_key_list;options_agent_model_list;options_local_file_path_prompt_list}class o{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const n of t)if(n.value===e)return n.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const n of t)if(n.value===e)return!0;return!1}}class i extends s{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url;open_pick_model;max_recent_messages=12;compress_message_count=16;max_tool_content_chars=200}const l=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function a(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}n.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n',"cL",0,l])},77481(e,t,n){n.d(t,{S:()=>l,X:()=>i});var s=n(96540),o=n(74848);function i(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((e,t)=>(0,o.jsx)("th",{children:e},t))})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>(0,o.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,o.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},1038(e,t,n){n.r(t),n.d(t,{default:()=>I});var s=n(34899),o=n(96540),i=n(85997),l=n(57952),a=n(34843),r=n(82893),c=n(75725),d=n(77481),p=n(61443),_=n(70447),m=n(34299),u=n(74848);var h=n(14284),x=n(53459),j=n(62042),v=n(7523),g=n(78247),f=n(23430),y=n(61973),w=n(14944),C=n(92275),k=n(88815),b=n(45907),A=n(12721),S=n(24659),$=n(83277);function I(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(v.F),n=[e("编号"),e("url"),e("model类型"),e("是否开启"),e("key"),"model",e("成为tool"),e("更多属性"),e("备注")],I=function(){const{t:e}=(0,s.Bd)();return[{value:"completions",label:e("文本对话")},{value:"images",label:e("图片生成")}]}(),K=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[N,P]=(0,o.useState)([]),[O,X]=(0,o.useState)([]),[M,V]=(0,o.useState)([]),[L,F]=(0,o.useState)(null),H=(0,o.useRef)(),Y=(0,o.useRef)(!1),q=(0,o.useRef)(!1),[G,z]=(0,o.useState)([]),[B,R]=(0,o.useState)(!1),[T,D]=(0,a.fp)(r.AG.prompt_card),[E,J]=(0,a.fp)(r.AG.user_base_info),[W,Z]=(0,o.useState)(!1),U=M.filter(e=>"http"!==(e.transport??"stdio")),Q=M.filter(e=>"http"===e.transport),ee=[e("编号"),e("名称"),e("是否开启"),"command","args","cwd",e("tools|env"),e("备注")],te=[e("编号"),e("名称"),e("是否开启"),e("endpoint"),e("tools|headers"),e("备注")],ne=[e("编号"),e("提示词"),e("备注")],[se,oe]=(0,o.useState)([]),[ie,le]=(0,o.useState)(!1),ae=function(){const[e,t]=(0,a.fp)(r.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,u.jsx)("div",{children:(0,u.jsx)(m.default,{context:e})})})}}(),{check_user_auth:re}=(0,g.MH)(),[ce,de]=(0,a.fp)(r.AG.editorSetting),pe=(0,y.Zp)(),_e=(0,b.y)(),me=(0,S.K)(),ue=async()=>{const e=await h.jV.get("docs_on_get");e.code===x.m.Success&&Z(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await h.XO.get("ai_agent_setting");e.code===x.m.Success&&P(e.data.models),await w.ws.addMsg(C.HK.ai_load_info,e=>{F(e.context)});const t=await w.ws.sendData(C.HK.ai_load_info,{});t?.context&&F(t.context);const n=await h.XO.get("ai_docs_setting");n.code===x.m.Success&&(H.current=n.data.param,n.data.list?.length&&X(n.data.list));const s=await h.XO.get("ai_mcp_setting");s.code===x.m.Success&&V(s.data.list??[]),await fe(),ue();const o=await h.XO.get("ai_system_prompts");o.code===x.m.Success&&oe(o.data??[]);const i=await h.XO.get("ai_long_term_memory_setting");i.code===x.m.Success&&le(i.data?.open??!1)})()},[]);const he=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};V([...M,t]),Y.current=!0},xe=e=>{const t=M.indexOf(e);t<0||(M.splice(t,1),V([...M]),Y.current=!0)},je=e=>{V([...M,{...e,open:!1}]),Y.current=!0},ve=async e=>{for(let e=0;e<N.length;e++)N[e].index=e;(await h.XO.post("ai_agent_setting/save",{models:e??N})).code===x.m.Success&&(0,j.SK)("保存成功")},ge=async e=>{for(let e=0;e<M.length;e++)M[e].index=e;(await h.XO.post("ai_mcp_setting/save",{list:e??M})).code===x.m.Success&&((0,j.SK)("保存成功"),Y.current=!1,await fe())},fe=async()=>{const e=await h.XO.get("ai_mcp_tools");return e.code===x.m.Success?(z(e.data??[]),e.data??[]):[]},ye=async e=>{R(!0);try{const t=await h.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await fe(),(0,j.SK)("MCP工具加载成功"),t.data??null}finally{R(!1)}return null},we=async(t,n,s,o)=>{const i=o??G.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},l=(i.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));D({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,u.jsx)(A.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${i.transport??"stdio"} | ${i.open?e("是"):e("否")} | ${i.loaded?"loaded":"idle"} | ${i.tool_count} tools`,pages:l,initialPageId:s,onRefresh:async()=>{const e=await ye(n);e&&await we(t,n,s,e)},renderPage:t=>{if(!t)return(0,u.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=i.tools?.find(e=>e.runtime_name===t.id);return n?(0,u.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,u.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,u.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,u.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,u.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("strong",{children:"schema:"}),(0,u.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,u.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>D({open:!1})})},Ce=async e=>{for(let e=0;e<N.length;e++)N[e].index=e;let t={list:O,docs_update_tag:q.current};null!=e&&(t={param:e}),q.current=!1;(await h.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,j.SK)("保存成功")},ke=async()=>{for(let e=0;e<se.length;e++)se[e].index=e;(await h.XO.post("ai_system_prompts/save",{list:se})).code===x.m.Success&&(0,j.SK)("保存成功")};return(0,u.jsxs)("div",{children:[(0,u.jsx)(l.A,{children:re(f.oV.ai_agent_setting)&&(0,u.jsx)(i.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{pe(-1)}})}),(0,u.jsx)(c.jW,{isFull:!0,more:!0,children:(0,u.jsx)(c.NN,{children:(0,u.jsxs)(c.xh,{children:[(0,u.jsx)(c.fI,{children:(0,u.jsx)(c.VP,{widthPer:100,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. 只能使用符合openai风格的ai接口,接口不能只填域名,而是类似 https://ark.cn-beijing.volces.com/api/v3/chat/completions 这样的全路径链接聊天url\n2. 对话的历史越长,消耗的大模型token费用越贵,目前不具备长期记忆简化能力,可以在系统prompt中设置一下让AI回答的简洁一点,节省tokens\n3. model请求参数json编写,里面只能编写json,来用于编写openai风格ai支持的属性,比如 temperature thinking(豆包的深度思考开关)等\n4. 可以在model请求参数中开启 "stream":true 提高响应速度\n5. 深度思考现在会影响输出速度,建议设置`{\n "thinking" : { \n "type":"disabled"\n }\n}`关闭(豆包例子)\n6. 使用AI功能来查询服务器信息,那么AI就需要能够之一些命令,需要先在用户设置中,给用户设置命令权限,建议设置 `*` 允许全部命令,在设置禁止不能执行的危险命令。\n7. 成为tool 后,该模型将会作为一个工具被加载,可以实现不同模型作为不能角色的能力。\n8. model 类型是必须要设置的,因为不同类型的 model 接口格式不同。\n')},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{P([...N,{note:"",open:!1,path:"",dotenv:$.CP,json_params:$.cL}])}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:async()=>{await ve()}})]}),children:(0,u.jsx)(d.X,{headers:n,rows:N.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,u.jsx)(p.l6,{value:t.request_type??"completions",onChange:e=>{t.request_type=e,P([...N])},options:I,no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<N.length;e++)N[e].open=e===n&&t,s.push(N[e]);P(s)})(0,e,n)},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{type:$.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:$.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,u.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,u.jsx)(p.l6,{value:t.tool_mode,onChange:n=>{t.open&&!0===n?(0,j.zN)(e("开启状态不能成为tool")):(t.tool_mode=n,P([...N]))},options:me,no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"short_text",title:"prompt",onClick:()=>{g.xK.set_value_temp(N[n].sys_prompt??""),de({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{N[n].sys_prompt=e,P(N),g.xK.set_value_temp(""),ve(N)}})}}),(0,u.jsx)(i.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{g.xK.set_value_temp(N[n].json_params),de({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{N[n].json_params=e,P(N),g.xK.set_value_temp(""),ve(N)},can_format:!0})}}),(0,u.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(N[n].dotenv),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{N[n].dotenv=e,P(N),g.xK.set_value_temp(""),ve(N)}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{N.splice(e,1),P([...N])})(n)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{P([...N,{...N[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,u.jsx)(c.fI,{children:(0,u.jsx)(c.VP,{widthPer:70,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("stdio")}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,u.jsx)(d.X,{headers:ee,rows:U.map((t,n)=>{const s=M.indexOf(t);return[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,V([...M]),Y.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,u.jsx)(i.rA,{icon:"settings",title:"env",onClick:()=>{g.xK.set_value_temp(t.env??""),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,V([...M]),g.xK.set_value_temp(""),Y.current=!0,ge()}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>xe(t)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})})})}),(0,u.jsx)(c.fI,{children:(0,u.jsxs)(c.VP,{widthPer:70,children:[(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("http")}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,u.jsx)(d.X,{headers:te,rows:Q.map((t,n)=>{const s=M.indexOf(t);return[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,V([...M]),Y.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{we(t,s)}}),(0,u.jsx)(i.rA,{icon:"settings",title:"headers",onClick:()=>{g.xK.set_value_temp(t.headers??""),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,V([...M]),g.xK.set_value_temp(""),Y.current=!0,ge()}})}})]}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>xe(t)}),(0,u.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})}),(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("系统会话提示词")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n')},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{oe([...se,{prompt:"",note:""}])}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ke()}})]}),children:(0,u.jsx)(d.X,{headers:ne,rows:se.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)("div",{children:(0,u.jsx)(i.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{g.xK.set_value_temp(t.prompt??""),de({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,oe([...se]),g.xK.set_value_temp(""),ke()}})}})}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsx)("div",{children:(0,u.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{se.splice(e,1),oe([...se])})(n)})})];return s}),width:"10rem"})}),(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("长期记忆")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),titleCom:(0,u.jsx)("div",{children:(0,u.jsx)(i.Ay,{checked:ie,onChange:async t=>{le(t),await h.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,j.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,u.jsx)("div",{style:{display:"flex",gap:"0.5rem",padding:"0.5rem 0",flexWrap:"wrap"},children:[{type:"week",label:e("周记忆"),tip:e("上限3000字")},{type:"month",label:e("月记忆"),tip:e("上限6000字")},{type:"year",label:e("年记忆"),tip:e("上限9000字")},{type:"forever",label:e("永久记忆"),tip:e("上限12000字")}].map(({type:t,label:n,tip:s})=>(0,u.jsx)(i.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const s=await h.XO.get(`ai_long_term_memory_bucket/${t}`),o=s.code===x.m.Success?s.data??"":"";g.xK.set_value_temp(o),de({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async s=>{await h.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:s}),g.xK.set_value_temp(""),(0,j.SK)(`${n} ${e("已保存")}`)}})}},t))})})]})}),(0,u.jsxs)(c.fI,{children:[(0,u.jsx)(c.VP,{widthPer:50,children:(0,u.jsx)(_.uF,{self_title:(0,u.jsxs)("span",{className:" div-row ",children:[(0,u.jsx)("h2",{children:e("本地知识库")})," ",(0,u.jsx)(i.rA,{icon:"info",onClick:()=>{ae("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,u.jsxs)("div",{children:[(0,u.jsx)(i.Ay,{checked:W,onChange:async e=>{await h.jV.post("docs_on_set",{status:e}),ue(),t()},title:e("知识库开关")}),(0,u.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{g.xK.set_value_temp(H.current),de({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{H.current=e,g.xK.set_value_temp(""),Ce(H.current)}})}}),(0,u.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...O,{note:"",auto_load:!1,dir:""}]),q.current=!0}}),(0,u.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{Ce()}})]}),children:(0,u.jsx)(d.X,{headers:K,rows:O.map((t,n)=>{const s=[(0,u.jsx)("div",{children:n}),(0,u.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,q.current=!0},no_border:!0}),(0,u.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,X([...O]),q.current=!0},options:me,no_border:!0}),(0,u.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,u.jsxs)("div",{children:[(0,u.jsx)(i.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{O.splice(e,1),X([...O]),q.current=!0})(n)}),(0,u.jsx)(i.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{_e({sub_title:"手动加载",confirm_fun:()=>{h.jV.post("ai_load_one_file",{param_path:t.dir}),(0,j.SK)("ok")}})}}),(0,u.jsx)(i.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{_e({sub_title:"从索引删除",confirm_fun:()=>{h.jV.post("ai_del",{param_path:t.dir}),(0,j.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),L&&(0,u.jsx)(c.VP,{widthPer:50,children:(0,u.jsxs)(_.Zp,{title:e("知识库加载信息"),children:[(0,u.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:L?.progress}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:L?.num}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:L?.char_num}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,k.v7)(L?.size)}),(0,u.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,k.a3)(L?.consume_time_ms_len)}),(0,u.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:L?.total_num})]})})]})]})})})]})}},34299(e,t,n){n.r(t),n.d(t,{default:()=>h});n(96540);var s=n(73557),o=n(53995),i=n(18569),l=n(77979),a=n(8263),r=n(69428),c=n.n(r),d=(n(3775),n(21499)),p=n(99214),_=n(19878),m=(n(72411),n(74848));const u=new s.A({html:!0,highlight:function(e,t){if(t&&_.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${_.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${_.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${u.utils.escapeHtml(e)}</code></pre>`}});function h(e){return(0,p.VD)(),(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:u.render(e.context)}})}u.use(o.A).use(i.A).use(l.A).use(a.A).use(c()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,i)=>{const l=t[n],a=l.content.trim(),r=l.info.trim();let c="";if(r&&_.A.getLanguage(r))try{c=_.A.highlight(a,{language:r}).value}catch(t){c=e.utils.escapeHtml(a)}else try{c=_.A.highlightAuto(a).value}catch(t){c=e.utils.escapeHtml(a)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${r||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(a)}">复制</button>\n </div>\n <pre><code class="hljs ${r?`language-${r}`:""}">${c}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,s,o){return o.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,s,o,i)=>{const l=e[n],a=l.attrIndex("href");if(a>=0){const e=l.attrs[a][1];l.attrs[a][1]=(0,d.bi)(window.location.href,e)}return t(e,n,s,o,i)}})},45907(e,t,n){n.d(t,{y:()=>i});var s=n(34843),o=n(82893);function i(){const[e,t]=(0,s.fp)(o.AG.confirm);return({sub_title:e,confirm_fun:n,title:s,context_div:o})=>{t({open:!0,sub_title:e,handle:()=>{n(),t({open:!1,handle:null})},title:s,context_div:o})}}},24659(e,t,n){var s=n(34899);n.d(t,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
|