filecat 6.63.1 → 6.64.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.232c15e7a54d5fd63ecf.js +1 -0
- package/build/dist/1472.a47fd247c34b46b447b3.js +1 -0
- package/build/dist/1893.4caf367bf06a83c09adf.js +1 -0
- package/build/dist/2542.98a0391ad37c342ef5d0.js +1 -0
- package/build/dist/2674.4822fb467f3da4255c10.js +1 -0
- package/build/dist/{2851.feefe2fc4a39ad506719.js → 2851.baea584c36417d65ded8.js} +1 -1
- package/build/dist/{3215.aed023089c03fa4b3c40.js → 3215.1d29fa4eb2be01d77fea.js} +2 -2
- package/build/dist/4273.9d196861ce7907a19e13.js +1 -0
- package/build/dist/5308.78bd4ed591fdfdcd82e7.js +1 -0
- package/build/dist/5516.14b0319983e46a1880ca.js +1 -0
- package/build/dist/5877.803d7b1a9f6d6e1264e9.js +1 -0
- package/build/dist/5937.2505cb3d3bcf2393e063.js +1 -0
- package/build/dist/6247.f337a0766a216e034bde.js +1 -0
- package/build/dist/6505.f37ff577812fccac9b45.js +1 -0
- package/build/dist/676.98b607bbe65d44bc5df1.js +1 -0
- package/build/dist/6919.a65dcb5e95df23edd818.js +1 -0
- package/build/dist/8302.53fffbe4b9ecef206405.js +1 -0
- package/build/dist/8319.307ec20219e2828c9a47.js +1 -0
- package/build/dist/8603.72dcd1e8f1337a1b72bb.js +1 -0
- package/build/dist/8714.859f6f455bef5c6af36c.js +1 -0
- package/build/dist/8765.afede4d25bab0100d561.js +1 -0
- package/build/dist/8947.8b6aa577603dd4cf3d2d.js +2 -0
- package/build/dist/8947.8b6aa577603dd4cf3d2d.js.LICENSE.txt +3 -0
- package/build/dist/9546.bd518f38fcce8f30331d.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.d78288d2045812740886.js +2 -0
- package/build/dist/{main.f074592fdc7851278bc0.js.LICENSE.txt → main.d78288d2045812740886.js.LICENSE.txt} +1 -1
- package/build/main.js +1 -1
- package/build/threads.work.filecat.js +1 -1
- package/package.json +1 -1
- package/build/dist/1448.bec31a359f572e75c1ff.js +0 -1
- package/build/dist/1472.895b811ec7f9765b8afc.js +0 -1
- package/build/dist/1893.f2725744511511fde713.js +0 -1
- package/build/dist/2542.78f4821c3f796775f225.js +0 -1
- package/build/dist/2674.42bc8edcb369615417fd.js +0 -1
- package/build/dist/4273.2b31ae7645819802cf52.js +0 -1
- package/build/dist/5308.8059b2d04eb5de133d15.js +0 -1
- package/build/dist/5516.f96b5a3874804392788c.js +0 -1
- package/build/dist/5877.49ca6d4e542f022dbb0d.js +0 -1
- package/build/dist/5937.8d7e5116bbc7d2b4e478.js +0 -1
- package/build/dist/6247.9bbd3852fd64eadebd20.js +0 -1
- package/build/dist/6505.ac89deebae8c008595a1.js +0 -1
- package/build/dist/676.2854877784f5c96f2f52.js +0 -1
- package/build/dist/6892.bd3adea0ce83f685bfa5.js +0 -1
- package/build/dist/6919.c7510e6ed23cff35cd52.js +0 -1
- package/build/dist/8302.ac3c41dd08d3109cf766.js +0 -1
- package/build/dist/8319.fc897106bf47394f677c.js +0 -1
- package/build/dist/8603.8819e88398056f0e0562.js +0 -1
- package/build/dist/8714.76bcf304b61c484f32df.js +0 -1
- package/build/dist/8765.8f7b9458371b88887661.js +0 -1
- package/build/dist/8947.23e0d2bbb7604e1e0063.js +0 -2
- package/build/dist/8947.23e0d2bbb7604e1e0063.js.LICENSE.txt +0 -1
- package/build/dist/9546.fa400fbfc3c4ae7850ad.js +0 -1
- package/build/dist/main.f074592fdc7851278bc0.js +0 -2
- /package/build/dist/{3215.aed023089c03fa4b3c40.js.LICENSE.txt → 3215.1d29fa4eb2be01d77fea.js.LICENSE.txt} +0 -0
|
@@ -0,0 +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:()=>N});var s=t(96540),i=t(75725),l=t(86149),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),w=t(74848);let S={};function C(){const{t:e,i18n:n}=(0,l.B)(),{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,M]=(0,s.useState)([]),[V,X]=(0,s.useState)([]),Z=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],E=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],H=[e("序号"),e("服务端口"),e("转发Client名称"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],q=e=>null==e?"":(0,v.s)(e),z=async e=>{const n=await d.s9.post("server_bridge_get_one_fig",{server_client_num_id:e});if(n.code===_.m.Success){const e=n.data;for(const n of e)n.client_name=S?.[n.client_num_id]?.client_name??"";X(e)}},L=async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[],s=[];S={};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}),S[e.client_num_id]=e;A(t),M(s)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,w.jsxs)(s.Fragment,{children:[(0,w.jsx)(g.A,{children:K&&(0,w.jsx)("span",{children:`${K.client_name}${K.note?`(${K.note})`:""}`})}),(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:50,children:(0,w.jsx)(i.xh,{children:(0,w.jsx)(r.uF,{self_title:(0,w.jsx)("span",{className:" div-row ",children:(0,w.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,w.jsx)(a.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{G(e)},handlerEnter:()=>{L()}}),children:(0,w.jsx)(o.X,{headers:Z,rows:b.map((n,t)=>[(0,w.jsx)("p",{children:t}),(0,w.jsx)(r.xP,{children:n.client_name}),(0,w.jsx)(r.fq,{ok:n.status}),(0,w.jsx)(r.xP,{children:q(n.status?n.online_start_time:n.offline_time)}),(0,w.jsx)(r.xP,{children:n.note}),(0,w.jsxs)("div",{children:[(0,w.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>{N({...n}),z(n.client_num_id)}}),(0,w.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,w.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,w.jsx)(i.VP,{widthPer:50,children:K?(0,w.jsxs)(i.xh,{children:[(0,w.jsxs)(r.Zp,{self_title:(0,w.jsxs)("span",{className:" div-row ",children:[(0,w.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,w.jsx)("div",{children:(0,w.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,w.jsx)(i.Yh,{left:e("远程地址"),center:K?.client_remote_address??""}),(0,w.jsx)(i.Yh,{left:e(K?.status?"在线时间":"离线时间"),center:q(K?.status?K?.online_start_time:K?.offline_time)}),(0,w.jsx)(a.Sm,{placeholder:"名称",value:K.client_name,handleInputChange:e=>{K.client_name=e,N({...K})}}),(0,w.jsxs)("form",{children:[e("filecat代理访问"),":",(0,w.jsx)(o.S,{isFlex:!0,columns:[(0,w.jsx)(a.U6,{value:1,context:e("开启"),selected:K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}}),(0,w.jsx)(a.U6,{value:1,context:e("关闭"),selected:!K.open_filecat,onchange:()=>{K.open_filecat=!K.open_filecat,N({...K})}})]})]}),K.open_filecat&&(0,w.jsxs)(s.Fragment,{children:[(0,w.jsxs)("form",{children:[e("filecat代理访问使用服务器前端"),":",(0,w.jsx)(o.S,{isFlex:!0,columns:[(0,w.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,w.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,w.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,w.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,w.jsx)(a.Sm,{placeholder:"备注",value:K.note,handleInputChange:e=>{K.note=e,N({...K})}}),(0,w.jsx)(c.rA,{icon:"add",onClick:()=>{K.proxy_fig_list.push({open:!1}),N({...K})},title:e("添加")}),e("代理"),(0,w.jsx)(o.X,{headers:E,rows:K.proxy_fig_list.map((n,t)=>[(0,w.jsx)("p",{children:t}),(0,w.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,w.jsx)(a.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,w.jsx)(a.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,w.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,N({...K})},options:F,no_border:!0}),(0,w.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,w.jsx)("div",{children:(0,w.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,w.jsxs)(r.Zp,{self_title:(0,w.jsxs)("span",{className:" div-row ",children:[(0,w.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,w.jsx)(c.rA,{icon:"add",onClick:()=>{V.push({open:!1,server_client_num_id:K.client_num_id}),X([...V])},title:e("添加")}),e("代理"),(0,w.jsx)(o.X,{headers:H,rows:V.map((n,t)=>[(0,w.jsx)("p",{children:t}),(0,w.jsx)(a.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,w.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,X([...V])},no_border:!0}),(0,w.jsx)(a.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,w.jsx)(a.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,w.jsx)(a.l6,{value:!!n.open,onChange:e=>{n.open=e,X([...V])},options:F,no_border:!0}),(0,w.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,w.jsxs)("div",{children:[(0,w.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(V.length??0);n++)n!==t&&e.push(V[n]);X([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,u.SK)("成功"),z(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,w.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)("成功"),z(e.server_client_num_id))})(n)}}):(0,w.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)("成功"),z(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,w.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}var b=t(7463);function A(e){const{t:n}=(0,l.B)(),[t,x]=(0,s.useState)([]),[h,p]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,S]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],A=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],P=(0,y.K)(),$=async()=>{const e=await d.s9.get("client_get");if(e.code===_.m.Success){const n=e.data;x(n.list)}const n=await d.s9.get("client_bridge_get_all_fig");n.code===_.m.Success&&f(n.data);const t=await d.s9.get("client_sync_task_get");t.code===_.m.Success&&S(t.data)};(0,s.useEffect)(()=>($(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{const e=(0,b.sg)(()=>$(),500);j.ws.addMsg(m.HK.tcp_proxy_client_status,e)}),()=>{j.ws.removeMsg(m.HK.tcp_proxy_client_status)}),[]);const F=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,w.jsxs)("div",{children:[(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:33,children:(0,w.jsxs)(r.Zp,{title:"",rightBottomCom:(0,w.jsx)(c.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,F(t[0])}}),titleCom:(0,w.jsxs)("div",{children:[n("连接状态"),(0,w.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,w.jsx)(a.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,w.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,w.jsx)(a.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,w.jsx)(a.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,w.jsxs)("form",{children:[n("状态"),(0,w.jsx)(o.S,{isFlex:!0,columns:[(0,w.jsx)(a.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,w.jsx)(a.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]})}),(0,w.jsx)(i.VP,{widthPer:40,children:(0,w.jsxs)(r.Zp,{self_title:(0,w.jsxs)("span",{className:" div-row ",children:[(0,w.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,w.jsx)(c.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,w.jsx)(o.X,{headers:A,rows:t.slice(1).map((e,s)=>[(0,w.jsx)("p",{children:s}),(0,w.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,w.jsx)(a.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,w.jsx)(a.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,w.jsx)(a.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,w.jsx)(r.fq,{ok:!!e.status}),(0,w.jsx)(a.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:P,no_border:!0}),(0,w.jsx)(a.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,w.jsxs)("div",{children:[(0,w.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)("保存成功"),$()):(0,u.zN)("网络错误")})(s+1)}}),e.is_new?(0,w.jsx)(c.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await F(e)}}):(0,w.jsx)(c.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await F(e)}})]})]),width:"10rem"})]})})]}),(0,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:40,children:v?.length?(0,w.jsx)(r.Zp,{title:n("桥接服务端口列表"),children:(0,w.jsx)(o.X,{headers:C,rows:v.map((e,n)=>[(0,w.jsx)("p",{children:n}),(0,w.jsx)(r.xP,{children:e.server_port}),(0,w.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})}):(0,w.jsx)(w.Fragment,{})}),(0,w.jsx)(i.VP,{widthPer:40,children:g?.length?(0,w.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,w.jsx)(o.X,{headers:I,rows:g.map((e,n)=>[(0,w.jsx)("p",{children:n}),(0,w.jsx)(r.xP,{children:e.source_client_name}),(0,w.jsx)(r.xP,{children:e.target_client_name}),(0,w.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})}):(0,w.jsx)(w.Fragment,{})})]})]})}function P(){const{t:e,i18n:n}=(0,l.B)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(p.AG.user_base_info),[y,S]=(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),M=(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]),V=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)}},X=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??[])),V()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{X()}),X()},[]);const Z=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,w.jsxs)(i.fI,{children:[(0,w.jsx)(i.VP,{widthPer:33,children:(0,w.jsx)(i.xh,{children:(0,w.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,w.jsxs)("div",{children:[(0,w.jsx)(c.C3,{text:e("保存并通知客户端第一个key和port"),clickFun:()=>{Z(!0)}}),(0,w.jsx)(c.C3,{text:e("保存"),clickFun:()=>{Z(!1)}})]}),children:[(0,w.jsx)(a.Sm,{placeholder:"port",value:N,handleInputChange:e=>{U(e)}}),(0,w.jsxs)("label",{children:[(0,w.jsx)(c.rA,{icon:"add",onClick:()=>{K([...F,""])},title:e("添加")}),e("key")]}),(F??[]).map((n,t)=>(0,w.jsxs)("div",{style:{display:"flex"},children:[(0,w.jsx)("div",{style:{width:"90%"},children:(0,w.jsx)(a.Sm,{type:"password",value:n,handleInputChange:e=>{F[t]=e,K([...F])}})}),(0,w.jsx)(c.rA,{icon:"delete",onClick:()=>{F.splice(t,1),K([...F])},title:e("删除")})]},t)),(0,w.jsxs)("form",{children:[e("状态"),":",(0,w.jsx)(o.S,{isFlex:!0,columns:[(0,w.jsx)(a.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,w.jsx)(a.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,w.jsx)(i.VP,{widthPer:50,children:(0,w.jsx)(i.xh,{children:(0,w.jsx)(r.uF,{self_title:(0,w.jsx)("span",{className:" div-row ",children:(0,w.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,w.jsx)(a.Sm,{placeholder:e("过滤"),value:G,handleInputChange:e=>{B(e)},handlerEnter:()=>{V()}}),children:(0,w.jsx)(o.X,{headers:[e("序号"),(0,w.jsx)(c.rA,{title:e("服务端口"),onClick:()=>{$(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:M.map((e,n)=>[(0,w.jsx)("p",{children:n}),(0,w.jsx)(r.xP,{children:e.server_port}),(0,w.jsx)(r.xP,{children:e.proxy_host}),(0,w.jsx)(r.xP,{children:e.proxy_port}),(0,w.jsx)(r.xP,{children:e.client_name}),(0,w.jsx)(r.fq,{ok:!!e.open_success}),(0,w.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var $=t(78247);function F(){const{t:e,i18n:n}=(0,l.B)(),{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),[S,C]=(0,h.fp)(p.AG.editorSetting),[I,k]=(0,s.useState)([]),b=[e("编号"),e("原客户端"),e("原目录"),e("目标客户端"),e("目标目录"),e("忽略目录"),e("开启"),e("双向同步"),e("全量同步"),e("备注")],[A,P]=(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});P(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,w.jsx)(i.fI,{children:(0,w.jsx)(i.VP,{widthPer:100,children:(0,w.jsx)(i.xh,{children:(0,w.jsxs)(r.Zp,{self_title:(0,w.jsxs)("span",{className:" div-row ",children:[(0,w.jsx)("h2",{children:e("客户端文件同步")}),(0,w.jsx)(c.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,w.jsx)("div",{children:(0,w.jsxs)("ul",{children:[(0,w.jsx)("li",{children:"目前只能同步较小的文件,例如配置文件,代码文件"}),(0,w.jsx)("li",{children:e("默认(没有选中全量同步)不会立即同步两个目录中的文件,而是有文件被修改或者改动后才会同步,如果开启全量同步,每次客户端一上线就会递归的同步全部的文件,如果文件非常多,这会造成很大的执行压力。")}),(0,w.jsx)("li",{children:e("如果开启了双向同步,如果两边初始化的时候各自又有很多文件,这是不太稳定的,暂时不建议这样做。")}),(0,w.jsx)("li",{children:e("同时开启全量同步和双向同步,目前性能也会很差,目前没有提供提供冲突冲突的机制。")}),(0,w.jsx)("li",{children:e("如果想用全量同步,一方的文件是空的,且文件数量比较少,几百这样的数量,效果是不错的,之后会一直走增量更新。")})]})})})},title:"信息"})]}),children:[(0,w.jsx)(c.rA,{icon:"add",onClick:()=>{I.push({open:!1,source_dir:"",target_dir:"",delete_missing:!0}),k([...I])},title:e("添加")}),(0,w.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,w.jsx)("p",{children:t}),(0,w.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,w.jsx)(a.Sm,{value:n.source_dir,handleInputChange:e=>{n.source_dir=e},no_border:!0}),(0,w.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,w.jsx)(a.Sm,{value:n.target_dir,handleInputChange:e=>{n.target_dir=e},no_border:!0}),(0,w.jsx)(c.rA,{icon:"edit",title:"额外参数设置",onClick:()=>{$.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]),$.xK.set_value_temp(""),N(n)}})}}),(0,w.jsx)(a.GL,{selected:!!n.open,onchange:()=>{n.open=!n.open,k([...I])}}),(0,w.jsx)(a.GL,{selected:!!n.two_way_sync,onchange:()=>{n.two_way_sync=!n.two_way_sync,k([...I])}}),(0,w.jsx)(a.GL,{selected:!!n.full_sync,onchange:()=>{n.full_sync=!n.full_sync,k([...I])}}),(0,w.jsx)(a.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,w.jsxs)("div",{children:[(0,w.jsx)(c.rA,{icon:"save",title:e("保存"),onClick:()=>{N(n)}}),(0,w.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 K=t(87361);function N(){const{t:e}=(0,l.B)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,w.jsx)(A,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,w.jsx)(P,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,w.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,w.jsx)(F,{})}];return(0,w.jsx)(i.W1,{optionList:n,father_route:K.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(86149);t.d(n,["K",0,()=>{const{t:e}=(0,s.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5308],{65308(e,t,a){a.r(t),a.d(t,{default:()=>w});var o=a(96540),n=a(34843),i=a(82893),s=a(34289),r=a(14284),c=a(38240),l=a(62042),d=a(47022),m=a(78247),p=a(86090),f=a(74848);let u,g=!1;const b=1024e3;function w(){const[e,t]=(0,n.fp)(i.AG.image_editor),a=(0,p.Zp)();(0,p.zy)();return(0,o.useEffect)(()=>((async()=>{if(!g)try{await(0,c.J)("filerobot-image-editor.min.js"),g=!0}catch(e){return void(0,l.zN)("加载资源失败")}const o=(0,s.GG)("file",e.path),n=window.FilerobotImageEditor,{TABS:i,TOOLS:p}=n,f={defaultSavedImageName:e.name,source:r.$M.getDownloadUrl(o),onSave:async(t,a)=>{const n=t.imageBase64.split(",")[1],i=(t.mimeType,t.extension),c=t.name??e.name,p=`base64/save/${encodeURIComponent(`${(0,s.Yp)(o)}${c}.${i}`)}`;if(n.length<=b){const e={base64_context:n,type:d.t7.all};await r.$M.post(p,e)}else{const e=(0,m.L6)(n,b),t={base64_context:e[0],type:d.t7.start};t.type=d.t7.part,await r.$M.post(p+`?type${d.t7.start}`,t);for(let a=1;a<e.length;a++)t.base64_context=e[a],await r.$M.post(p,t)}(0,l.SK)("保存成功")},annotationsCommon:{fill:"#151717",stroke:"#ec0f42",shadowColor:"#151717"},Text:{text:""},Rotate:{angle:90,componentType:"slider"},tabsIds:[Object.values(i)],defaultTabId:i.ANNOTATE,defaultToolId:p.ANNOTATE};u=new n(document.querySelector("#editor_container"),f),u.render({onClose:e=>{u.terminate(),t({}),a((0,s.vX)())}})})(),()=>{u&&u.terminate()}),[]),(0,f.jsx)("div",{id:"image-editor-container",children:(0,f.jsx)("div",{className:"image-editor-context",children:(0,f.jsx)("div",{id:"editor_container",className:"image-editor-context"})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5516],{52811(e,t,a){a.r(t),a.d(t,{default:()=>A});var n=a(96540),s=a(51946),r=a(34843),l=a(82893),o=a(14284),i=a(34289),c=a(62042),d=a(86090),u=a(57889),g=a(86149),m=a(53459),w=(a(3561),a(74848));function A(){const[e,t]=(0,r.fp)(l.AG.excalidraw_editor),[a,A]=(0,n.useState)(null),[f,x]=(0,n.useState)(null),[p,v]=(0,n.useState)(!1),h=(0,d.Zp)(),{t:y}=(0,g.B)(),S=(0,n.useRef)(()=>{});(0,n.useEffect)(()=>{S.current=k}),(0,n.useEffect)(()=>{let t=!1;return(async()=>{if(e?.url){v(!0);try{const a=await u.l.get(e.url);if(t)return;const n=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(!n)throw new Error("invalid excalidraw scene");x(n)}catch{t||(x(null),(0,c.zN)("Load Excalidraw file failed"))}finally{t||v(!1)}}else x(null)})(),()=>{t=!0}},[e?.url]);const k=async()=>{if(!a)return void(0,c.zN)("Editor is not ready");const t=a.getSceneElements(),n=a.getAppState(),r=a.getFiles(),l=(0,s.nu)(t,n,r,"local"),d=JSON.parse(l);d.appState={...d.appState??{},zoom:n.zoom,scrollX:n.scrollX,scrollY:n.scrollY,viewBackgroundColor:n.viewBackgroundColor,gridSize:n.gridSize};(await o.$M.post(`save/${encodeURIComponent((0,i.GG)("file",(0,i.vX)()))}${e.name}`,{context:JSON.stringify(d)})).code===m.m.Success&&(0,c.SK)("保存成功")};return(0,n.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),S.current())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]),(0,w.jsx)("div",{id:"excalidraw-container",children:(0,w.jsxs)("div",{className:"excalidraw-context",children:[p&&(0,w.jsx)("div",{className:"common-box common-box-center",children:"Loading..."}),!p&&f&&(0,w.jsx)(s.Td,{langCode:"zh-CN",initialData:f,excalidrawAPI:e=>A(e),onKeyDown:e=>!(!e.ctrlKey&&!e.metaKey||"s"!==e.key&&"S"!==e.key&&83!==e.keyCode)&&(e.preventDefault(),S.current(),!0),UIOptions:{dockedSidebarBreakpoint:0},children:(0,w.jsxs)(s.zU,{children:[(0,w.jsx)(s.zU.Item,{onSelect:()=>{t({}),h((0,i.vX)()),e?.close?.()},children:y("关闭")}),(0,w.jsx)(s.zU.Item,{onSelect:k,children:y("保存到服务器")}),(0,w.jsxs)(s.zU.Group,{title:"Excalidraw items",children:[(0,w.jsx)(s.zU.DefaultItems.LoadScene,{}),(0,w.jsx)(s.zU.DefaultItems.Export,{}),(0,w.jsx)(s.zU.DefaultItems.SaveToActiveFile,{}),(0,w.jsx)(s.zU.DefaultItems.SaveAsImage,{}),(0,w.jsx)(s.zU.DefaultItems.ClearCanvas,{}),(0,w.jsx)(s.zU.DefaultItems.ToggleTheme,{}),(0,w.jsx)(s.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>'}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5877],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>r});var s=n(96540),a=n(74848);function r(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,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,n)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(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))})}},83029(e,t,n){n.d(t,{N:()=>v});var s=n(96540),a=n(34843),r=n(82893),l=n(74848);function c(e){const[t,n]=(0,a.fp)(r.AG.user_base_info);return(0,l.jsx)("div",{children:e.div?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,l.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var i=n(64694),o=n(61443),d=n(85997),u=n(86090),h=n(86149);const p=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let x,m,j=[];const _=[];function v(e){const[t,n]=(0,s.useState)([]),[v,f]=(0,s.useState)(-1),g=(0,u.zy)(),[y,S]=(0,s.useState)(!1),[C,k]=(0,s.useState)(!1),{t:w}=(0,h.B)(),[b,I]=(0,s.useState)([]),[N,A]=(0,a.fp)(r.AG.nav_index_add_item_by_now_list),D=e=>{-1!==v?_[v]._children=e:j=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();j=t,n(j)})()},[g]);(0,s.useEffect)(()=>{if(N){const e=[...t,{name:"",color:(0,i.Lr)(p),...N}];D(e),n(e),S(!0),A(void 0)}},[N]);const z=e=>{f(v+1),n(e._children),_.push(e)};return(0,l.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,l.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{n(0===v?j:_[v-1]._children),f(v-1),_.pop()}}),t.map((a,r)=>(0,l.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{x=t})(0,r),onDrop:e=>((e,s)=>{e.preventDefault();const a=t[x],r=t[s];if(r&&"dir"===r._type){const e=[...t];return e.splice(x,1),r._children||(r._children=[]),r._children.push(a),D(e),void n(e)}const l=[...t],c=l[x];l.splice(x,1),l.splice(s,0,c),D(l),n(l)})(e,r),style:{cursor:y?"move":"pointer"},children:[(0,l.jsx)(c,{name:a.name,item:a,...a,div:y,target:"_blank",click_dir:z,clickItem:e.clickItem}),y&&(void 0!==b.find(e=>e===r)||C)&&(0,l.jsxs)("div",{className:C?"":" site_edit ",children:["dir"===a._type?(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(o.Sm,{value:a.name,handleInputChange:e=>{a.name=e},placeholder:w("输入类目名"),no_border:!0}),(0,l.jsx)(o.Sm,{value:a.color,handleInputChange:e=>{a.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,l.jsx)("div",{children:(0,l.jsx)(o.Sm,{value:a[e.key],handleInputChange:t=>{a[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!C&&(0,l.jsx)(d.C3,{text:w("折叠"),clickFun:()=>{I((0,i.P1)(b,r))}})]}),y&&(0,l.jsx)("div",{style:{display:"block"},children:(0,l.jsxs)("span",{className:"div-row ",children:[(0,l.jsx)(d.C3,{text:w("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),D(s),n(s)})(r)}}),(0,l.jsx)(d.C3,{text:w("编辑"),clickFun:()=>{void 0===b.find(e=>e===r)&&I([...b,r])}})]})})]},r)),y&&(0,l.jsxs)("div",{style:{display:"block"},children:[(0,l.jsx)(d.rA,{title:w("取消"),icon:"cancel",onClick:()=>{I([]),S(!1),m&&(n(m),D(m)),k(!1)}}),(0,l.jsx)(d.rA,{title:w("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,i.Lr)(p),...e.get_pre_add_item&&await e.get_pre_add_item()}];D(s),n(s)}}),(0,l.jsx)(d.rA,{title:w("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];D(e),n(e)}}),(0,l.jsx)(d.rA,{title:w("全部编辑"),icon:C?"unfold_less":"unfold_more",onClick:()=>{k(!C)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,l.jsx)(d.rA,{icon:y?"save":"edit",title:w(y?"保存":"编辑"),onClick:async()=>{y?e.save&&await e.save(j):m=t,S(!y)}})]})}},65877(e,t,n){n.r(t),n.d(t,{default:()=>D});var s=n(96540),a=n(75725),r=n(61443),l=n(70447),c=n(85997),i=n(34289),o=n(86149),d=n(62042),u=n(14284),h=n(53459),p=n(74848);function x(e){const{t}=(0,o.B)(),[n,x]=(0,s.useState)(t("毫秒")),[m,j]=(0,s.useState)(""),[_,v]=(0,s.useState)(""),[f,g]=(0,s.useState)(null),[y,S]=(0,s.useState)(null),[C,k]=(0,s.useState)(Date.now());return(0,s.useEffect)(()=>{(async()=>{const e=await u.Yu.get("sys_time/get");if(e.code===h.m.Success){const t=await e.data;g(t.timestamp),S(t.timezone),k(t.timestamp)}})();const e=setInterval(()=>{k(e=>e+1e3)},1e3);return()=>clearInterval(e)},[]),(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{widthPer:33,children:(0,p.jsxs)(l.Zp,{title:t("时间转换器"),rightBottomCom:(0,p.jsx)(c.C3,{text:t("确定"),clickFun:function(){if(!m&&!_)return void(0,d.zN)("不能都为空");let e=0;const t=""!==m&&0!==m;if(t){if(!(0,i.kf)(m))return void(0,d.zN)("must be number !");e=parseInt(m),"分秒"===n&&(e*=1e3)}const s=new Date(t?e:_),a=new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(s);if(v(a),!m){const e=s.getTime();j("毫秒"===n?e:e/1e3)}}}),children:[(0,p.jsx)(r.l6,{value:n,options:[{title:t("毫秒"),value:"毫秒"},{title:t("分秒"),value:"分秒"}],onChange:function(e){x(e)}}),(0,p.jsx)(r.Sm,{placeholder:n,value:m,handleInputChange:e=>{j(e)}}),(0,p.jsx)(r.Sm,{placeholder:t("格式化时间"),value:_,handleInputChange:e=>{v(e)}})]})}),(0,p.jsx)(a.VP,{children:null!==f&&null!==y&&(0,p.jsxs)(l.Zp,{title:t("服务器时间"),children:[(0,p.jsxs)("h1",{children:[t("时区"),": ",y]}),(0,p.jsxs)("h1",{children:[t("时间"),": ",new Date(C).toLocaleString(navigator.language,{timeZone:y})]})]})})]})}var m=n(57952),j=n(83029),_=n(78247),v=n(23430);function f(e){const{t}=(0,o.B)(),{check_user_auth:n}=(0,_.MH)(),[a,l]=(0,s.useState)(""),i=async e=>{const t=e||a;if(!t)return void(0,d.zN)("mac地址不能为空");(await u._U.post("wol/exec",{mac:t})).code===h.m.Success&&(0,d.SK)("发送唤醒命令成功")};return(0,p.jsxs)("div",{children:[(0,p.jsxs)(m.A,{children:[(0,p.jsx)(c.rA,{icon:"play_arrow",title:t("发送"),onClick:()=>{i()}}),(0,p.jsx)(r.$Z,{placeholder:t("目标设备mac地址"),icon:"laptop_mac",value:a,handleInputChange:e=>l(e)})]}),(0,p.jsx)(j.N,{have_auth_edit:n(v.oV.wol_proxy_tag_update),getItems:async()=>{const e=await u._U.get("wol/tag");return e.code===h.m.Success?e.data:[]},save:async e=>{(await u._U.post("wol/tag/save",e)).code!==h.m.Success&&(0,d.zN)("网络错误")},clickItem:async e=>{l(e.mac),i(e.mac)},items:[{key:"name",preName:t("名字")},{key:"mac",preName:"mac"+t("地址")},{key:"color",preName:"color"}]})]})}var g=n(77481),y=n(34843),S=n(82893),C=n(40505);let k;function w(){const[e,t]=(0,s.useState)("rsa"),[n,i]=(0,s.useState)("pem"),{t:x,i18n:j}=(0,o.B)(),[_,v]=(0,y.fp)(S.AG.confirm),[f,w]=(0,s.useState)(""),[b,I]=(0,s.useState)(""),N=async t=>{if(!b||!f)return void(0,d.zN)("密钥不能为空");let n="id_"+e;"pub"===t&&(n+=".pub"),v({open:!0,title:x("将覆盖密钥文件"),sub_title:`之前的密钥将作废。 将会作为 ${n} 文件保存到系统上的"${k}"目录下,此目录会作为openssh(git)所使用的默认目录。`,handle:async()=>{(await u.cD.post("save_openssh",{name:n,context:"pub"===t?f:b})).code===h.m.Success&&((0,d.SK)("完成"),v({open:!1,handle:null}))}})};return(0,p.jsxs)(s.Fragment,{children:[(0,p.jsx)(m.A,{children:(0,p.jsx)(g.S,{isFlex:!0,columns:[(0,p.jsx)(r.l6,{tip:x("加密算法"),value:e,width:"auto",onChange:e=>{t(e)},options:[{title:x("RSA"),value:"rsa"},{title:x("DSA"),value:"dsa"},{title:x("ECDSA"),value:"ecdsa"}]}),(0,p.jsx)(r.l6,{tip:x("输出格式"),value:n,width:"auto",onChange:e=>{i(e)},options:[{title:x("普通PEM"),value:"pem"},{title:x("opensshPEM"),value:"openssh_pem"}]}),(0,p.jsx)(c.rA,{icon:"play_arrow",title:x("生成"),onClick:()=>{(async()=>{const t=await u.cD.post("generate",{type:e,form:n});t.code===h.m.Success&&(w(t.data.public_key),I(t.data.private_key),k=t.data.home_path)})()}})]})}),(0,p.jsx)(a.xh,{children:(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:x("公钥"),titleCom:(0,p.jsx)(c.rA,{title:x("复制"),icon:"copy_all",onClick:()=>{f&&((0,C.lW)(f),(0,d.SK)("完成"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:x("保存到.ssh目录"),clickFun:()=>{N("pub")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},onChange:e=>{w(e.target.value)},value:f})})}),(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:x("私钥"),titleCom:(0,p.jsx)(c.rA,{title:x("复制"),icon:"copy_all",onClick:()=>{b&&((0,C.lW)(b),(0,d.SK)("成功"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:x("保存到.ssh目录"),clickFun:()=>{N("pri")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},value:b,onChange:e=>{I(e.target.value)}})})})]})})]})}var b=n(14944),I=n(92275);function N(){const{t:e}=(0,o.B)(),[t,n]=(0,s.useState)(""),[i,u]=(0,s.useState)("1"),[h,x]=(0,s.useState)("65535"),[m,j]=(0,s.useState)("100"),[_,v]=(0,s.useState)("2000"),[f,y]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[k,w]=(0,s.useState)([]),[N,A]=(0,s.useState)(null),D=(0,s.useRef)([]),z=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!z.current)return z.current=!0,b.ws.addMsg(I.HK.port_scan_progress,e=>{C(e.context)}),b.ws.addMsg(I.HK.port_scan_result,e=>{const t=e.context,n=[...D.current,t];D.current=n,w(n)}),b.ws.addMsg(I.HK.port_scan_end,t=>{A(t.context),y(!1),t.context.cancelled?(0,d.zN)(e("扫描已取消")):(0,d.SK)(e("扫描完成"))}),()=>{b.ws.sendData(I.HK.port_scan_cancel,{}),b.ws.removeMsg(I.HK.port_scan_progress),b.ws.removeMsg(I.HK.port_scan_result),b.ws.removeMsg(I.HK.port_scan_end),z.current=!1}},[]);return(0,p.jsx)(a.xh,{children:(0,p.jsx)(a.fI,{children:(0,p.jsx)(a.VP,{children:(0,p.jsxs)(l.Zp,{title:e("TCP ")+e("端口扫描"),titleCom:(0,p.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.85em",color:"var(--textSecondary)"},children:[S&&(0,p.jsxs)("span",{children:[e("已发现"),": ",S.openCount]}),N&&(0,p.jsxs)("span",{children:[e("总计扫描"),": ",N.totalScanned," | ",e("开放"),": ",N.totalOpen]})]}),children:[(0,p.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap",marginBottom:"1rem"},children:[(0,p.jsx)(r.$Z,{placeholder:e("目标主机"),icon:"dns",value:t,handleInputChange:e=>n(e)}),(0,p.jsx)(r.$Z,{placeholder:e("起始端口"),icon:"login",value:i,handleInputChange:e=>u(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("结束端口"),icon:"logout",value:h,handleInputChange:e=>x(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("并发数"),icon:"shuffle",value:m,handleInputChange:e=>j(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("超时(ms)"),icon:"timer",value:_,handleInputChange:e=>v(e),type:"number"}),f?(0,p.jsx)(c.C3,{text:e("取消"),clickFun:()=>{b.ws.sendData(I.HK.port_scan_cancel,{}).catch(()=>{})}}):(0,p.jsx)(c.C3,{text:e("扫描"),clickFun:()=>(()=>{if(!t)return void(0,d.zN)(e("主机地址不能为空"));const n=parseInt(i),s=parseInt(h);isNaN(n)||isNaN(s)||n<1||s<1||n>65535||s>65535?(0,d.zN)(e("端口范围无效")):n>s?(0,d.zN)(e("起始端口不能大于结束端口")):(y(!0),C(null),w([]),D.current=[],A(null),b.ws.sendData(I.HK.port_scan_req,{host:t,startPort:n,endPort:s,concurrency:parseInt(m)||100,timeout:parseInt(_)||2e3}).catch(()=>{}))})()})]}),f&&S&&(0,p.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,p.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8em",color:"var(--textSecondary)",marginBottom:"0.3rem"},children:[(0,p.jsxs)("span",{children:[e("当前"),": ",S.currentPort]}),(0,p.jsxs)("span",{children:[S.scanned," / ",S.total]})]}),(0,p.jsx)(l.gz,{progress:S.percent})]}),k.length>0&&(0,p.jsx)(g.X,{headers:[e("端口"),e("状态")],rows:k.map(t=>[t.port,(0,p.jsx)("span",{style:{color:"var(--icon-green)"},children:e("开放")})])}),f&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("正在扫描...")}),!f&&N&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("未发现开放端口")}),!f&&!N&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("请输入参数后点击扫描")})]})})})})}var A=n(87361);function D(e){const{t}=(0,o.B)(),{check_user_auth:n}=(0,_.MH)(),s=[];return s.push({index:1,name:t("时间工具"),rto:"timeutil/",component:(0,p.jsx)(x,{})},{index:1,name:t("非对称密钥"),rto:"crypto/",component:(0,p.jsx)(w,{})}),n(v.oV.port_scan)&&s.push({index:1,name:t("端口扫描"),rto:"portscan/",component:(0,p.jsx)(N,{})}),n(v.oV.wol_proxy)&&s.push({index:1,name:t("网络唤醒"),rto:"netwol/",component:(0,p.jsx)(f,{})}),(0,p.jsx)(a.W1,{optionList:s,father_route:A.o.toolbox})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5937],{8694(e,t,a){a.d(t,{$K:()=>o,RB:()=>r,l5:()=>c,qB:()=>s,vo:()=>i,vr:()=>l});class s{targetProxyUrl;proxyPort;sysProxyPort}let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class i{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class c{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var s=a(85997),n=a(74848);function o(e){return(0,n.jsxs)("h2",{className:"message",children:[(0,n.jsx)(s.In,{icon:"sentiment_dissatisfied"}),(0,n.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>p});var s=a(96540),n=a(86090),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(86149),d=a(85997),u=a(74848);function p(e){let t=(0,n.zy)();const[a,p]=(0,s.useState)([]),[h,m]=(0,s.useState)("/"),[f,y]=(0,s.useState)(void 0),{t:_,i18n:v}=(0,c.B)();s.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const s=a.indexOf(e.baseRoute),n=[];if(-1!=s){t=(0,o.IO)(a.slice(0,s),e.baseRoute);const i=a.slice(s+1);for(let e=0;e<i.length;e++){const a=i[e];n.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(n[e-1].href,a)})}m(t),p(n)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)};return(0,u.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,u.jsx)(s.Fragment,{children:void 0===f?(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("span",{className:"chevron",children:(0,u.jsx)(n.N_,{to:h,onClick:x,children:(0,u.jsx)(d.In,{icon:"home"})})}),a.map((e,t)=>(0,u.jsxs)("span",{className:"chevron",children:[(0,u.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,u.jsx)(n.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t))]}):(0,u.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,u.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>i,X:()=>o});var s=a(96540),n=a(74848);function o(e){const[t,a]=s.useState([]);return(0,s.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]),(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{children:e.headers?.map((e,t)=>(0,n.jsx)("th",{children:e},t))})}),(0,n.jsx)("tbody",{children:t.map((t,a)=>(0,n.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((a,s)=>(0,n.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:a},s))},a))})]})}function i(e){return(0,n.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,n.jsx)("div",{children:e},t))})}},83029(e,t,a){a.d(t,{N:()=>v});var s=a(96540),n=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,n.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),c=a(61443),d=a(85997),u=a(86090),p=a(86149);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function v(e){const[t,a]=(0,s.useState)([]),[v,x]=(0,s.useState)(-1),w=(0,u.zy)(),[g,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(!1),{t:K}=(0,p.B)(),[b,S]=(0,s.useState)([]),[C,A]=(0,n.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==v?_[v]._children=e:y=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[w]);(0,s.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{x(v+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===v?y:_[v-1]._children),x(v-1),_.pop()}}),t.map((n,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,s)=>{e.preventDefault();const n=t[m],o=t[s];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(n),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(s,0,r),F(i),a(i)})(e,o),style:{cursor:g?"move":"pointer"},children:[(0,i.jsx)(r,{name:n.name,item:n,...n,div:g,target:"_blank",click_dir:D,clickItem:e.clickItem}),g&&(void 0!==b.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===n._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(c.Sm,{value:n.name,handleInputChange:e=>{n.name=e},placeholder:K("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:n.color,handleInputChange:e=>{n.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:n[e.key],handleInputChange:t=>{n[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:K("折叠"),clickFun:()=>{S((0,l.P1)(b,o))}})]}),g&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:K("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),F(s),a(s)})(o)}}),(0,i.jsx)(d.C3,{text:K("编辑"),clickFun:()=>{void 0===b.find(e=>e===o)&&S([...b,o])}})]})})]},o)),g&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:K("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),N(!1)}}),(0,i.jsx)(d.rA,{title:K("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(s),a(s)}}),(0,i.jsx)(d.rA,{title:K("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:K("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{N(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:g?"save":"edit",title:K(g?"保存":"编辑"),onClick:async()=>{g?e.save&&await e.save(y):f=t,j(!g)}})]})}},15937(e,t,a){a.r(t),a.d(t,{default:()=>me});var s=a(96540),n=a(70447),o=a(75725),i=a(61443),r=a(85997),l=a(57952),c=a(14284),d=a(8694),u=a(53459),p=a(83029),h=a(86149),m=a(82893),f=a(34843),y=a(78247),_=a(23430),v=a(62042),x=a(74848);function w(e){const{t}=(0,h.B)(),[a,n]=(0,f.fp)(m.AG.header_min),[w,g]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,K]=(0,s.useState)(void 0),[b,S]=(0,s.useState)(!1),{check_user_auth:C}=(0,y.MH)(),A=async()=>{const e=new d.qB;e.targetProxyUrl="string"==typeof w?w:j;(await c._U.post("close",e)).code===u.m.Success&&(k(""),n(!1))},F=async e=>{const t=new d.qB;if(t.targetProxyUrl="string"==typeof e?e:w,!t.targetProxyUrl.startsWith("http"))return void(0,v.zN)("must start with http[s]://");const a=await c._U.post("start",t);if(a.code!==u.m.Success)return;const s=`${window.location.protocol}//${window.location.hostname}:${a.data}`;k(s)};(0,s.useEffect)(()=>()=>{A()},[]);return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("要代理的url"),icon:"link",value:w,handleInputChange:e=>{g(e)}}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("开始代理"),onClick:F}),(0,x.jsx)(r.rA,{icon:"fullscreen",title:t("全屏"),onClick:()=>{S(!b),n(!b)}}),(0,x.jsx)(r.rA,{icon:"close",title:t(t("关闭")),onClick:()=>{A(),S(!1),g("")}})]}),(0,x.jsx)(o.jW,{isFull:b,children:(0,x.jsxs)("div",{id:"browser",children:[!j&&(0,x.jsx)(p.N,{have_auth_edit:C(_.oV.browser_proxy_tag_update),getItems:async()=>{const e=await c._U.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{g(e.url),F(e.url)},items:[{key:"name",preName:t("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]}),(0,x.jsx)("iframe",{id:"webview",src:j})]})})]})}var g=a(34289),j=(a(75007),a(97856)),k=a(92275),N=a(14944),K=a(64405);const b=s.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(()=>a(85614)));function S(e){const[t,a]=(0,s.useState)(null),[n,o]=(0,f.fp)(m.AG.remoteShellShow),[i,r]=(0,s.useState)(!1),[l,c]=(0,f.fp)(m.AG.sshInfo),[d,u]=(0,f.fp)(m.AG.shellNowDir),[p,h]=(0,f.fp)(m.AG.user_base_info),y=p.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,s.useEffect)(()=>()=>{_()},[]),(0,s.useEffect)(()=>{n.show?t||((async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const s=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=s},N.ws.addMsg(k.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new K.x;t.key=l.key,t.cmd=e;const a=new k.hf(k.HK.remote_shell_send);a.context=t,await N.ws.send(a)}),a(e)})(),r(!0)):_()},[n]);return(0,x.jsx)(b,{show:n.show,terminal:t,init:(e,a)=>{t.writeln("[38;2;29;153;243mopen shell...[0m ");const s=new k.hf(k.HK.remote_shell_open),o=new K.x;o.key=l.key,o.init_path=n.path,o.rows=e,o.cols=a,s.context=o,N.ws.send(s)}})}var C=a(47374),A=a(86090),F=a(99214),D=a(47022),L=a(88815),M=a(6960),B=a(79240),I=a(18538),P=a(12730);function E(e){const{t}=(0,h.B)();(0,A.zy)();(0,A.Zp)();const{check_user_auth:a}=(0,y.MH)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[i,l]=(0,f.fp)(m.AG.uploadFiles),[c,d]=(0,f.fp)(m.AG.showPrompt),[u,p]=(0,f.fp)(m.AG.selectedFileList),[_,w]=(0,f.fp)(m.AG.enterKey),[j,k]=(0,f.fp)(m.AG.copyedFileList),[N,K]=(0,f.fp)(m.AG.cutedFileList),[b,S]=(0,f.fp)(m.AG.selectedFileList),[C,L]=(0,f.fp)(m.AG.clickFileList),[M,B]=(0,f.fp)(m.AG.remoteShellShow),[E,R]=(0,f.fp)(m.AG.sshInfo),$=(0,F.Vs)();function G(e){(0,v.SK)(e)}return(0,x.jsxs)(s.Fragment,{children:[u.length>0&&(0,x.jsx)(r.rA,{icon:"delete",title:t("删除"),onClick:()=>{d({show:!0,type:I.PromptEnum.SshDelete,overlay:!0,data:{}})}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,F.ib)(n,u);k(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),K([]),G("已复制")}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,F.ib)(n,u);K(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),k([]),G("已剪切")}}),(j.length>0||N.length>0)&&(0,x.jsx)(r.rA,{onClick:function(){d({show:!0,type:I.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:j.length+N.length}),1===u.length&&n.files.length>=1&&(0,F.ib)(n,u)[0].type!==D.Iw.folder&&(0,x.jsx)(r.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,F.ib)(n,u),t=`/api/ssh/download?file=${`/${(0,g.GG)("remoteShell",(0,g.vX)())}${decodeURIComponent(e[0].name)}`}&key=${E.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===u.length&&(0,x.jsx)(r.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){d({show:!0,type:I.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"terminal",title:"shell",onClick:function(){M.show?B({show:!1,path:""}):B({show:!0,path:`/${(0,g.GG)("remoteShell",(0,g.vX)())}`})}}),(0,x.jsx)(r.rA,{icon:"grid_view",title:t("切换样式"),onClick:$}),(0,x.jsx)(r.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"upload_file",title:"上传",onClick:()=>{d({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const s=[],n=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&n.add((0,P.S)(i)),s.push(o)}const o=[];if(a)for(const e of Array.from(n))o.push({isDir:!0,fullPath:e,name:e});o.push(...s),l(o),d({show:!0,type:I.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,x.jsx)(r.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var R=a(60096),$=a(21499);let G;function O(e){const{t}=(0,h.B)(),a=(0,A.zy)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[r,d]=(0,f.fp)(m.AG.selectedFileList),[p,y]=(0,f.fp)(m.AG.clickFileList),[w,j]=(0,f.fp)(m.AG.sshInfo),[k,N]=(0,s.useState)(""),b=(0,A.Zp)(),[D,I]=(0,f.fp)(m.AG.user_base_info),P=async e=>{const t=new K.x;t.key=w.key,t.dir=e||`/${(0,g.GG)("remoteShell",(0,g.vX)())}`;const a=await c.Fg.post("get/dir",t);if(a.code!==u.m.Success)return void(0,v.zN)("连接失败");const{folders:s,files:n}=a.data||{};for(const e of n??[])e.origin_size=e.size,e.size=(0,L.v7)(e.size),D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";for(const e of s??[])D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";const i={folders:s||[],files:n||[]};(0,F.yC)(i,D.user_data.dir_show_type),o(i),G=i};function O(){d([]),y([])}(0,s.useEffect)(()=>{O(),(async()=>{await P()})()},[a]);return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(l.A,{left_children:(0,x.jsx)(i.$Z,{handleEnterPress:()=>{if(!G)return;d([]),y([]);const e=[],t=[];for(const t of G.files??[])t.name.includes(k)&&e.push(t);for(const e of G.folders??[])e.name.includes(k)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{N(e)},max_width:"25em"}),children:(0,x.jsx)(E,{close:e.close})}),(0,x.jsx)(C.e,{baseRoute:"remoteShell",clickFun:O,input_path_enter:e=>{(0,B.Z1)(e)?P(e):b((0,B.Jn)((0,g.vX)(),e)),d([]),y([]),o({files:[],folders:[]})}}),(0,x.jsx)(R.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&d([])},file_list:n.files,folder_list:n.folders,fileHandler:P}),(0,x.jsx)(S,{})]})}function H(e){const{t}=(0,h.B)(),a=(0,A.Zp)(),[n,o]=(0,s.useState)(""),[d,w]=(0,s.useState)(""),[g,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[b,S]=(0,s.useState)(void 0),[C,F]=(0,s.useState)(""),[D,L]=(0,f.fp)(m.AG.shellNowDir),[M,I]=(0,f.fp)(m.AG.sshInfo),{check_user_auth:P}=(0,y.MH)(),E=async e=>{const t=new K.x;if(t.password=e?e.password:d,t.domain=e?e.domain:k,t.port=e?e.port:b,t.username=e?e.username:n,t.private_path=e?e.private_path:g,t.dir=e?e.dir:C,!t.dir)return void(0,v.zN)("dir not found");if(!t.username)return void(0,v.zN)("username not found");if(!t.domain)return void(0,v.zN)("domain not found");if(!t.port)return void(0,v.zN)("port not found");if(!t.private_path&&!t.password)return void(0,v.zN)("private_path password not found");const s=await c.Fg.post("start",t);s&&s.code===u.m.Success&&(a((0,B.Jn)("/proxy/remoteShell",t.dir)),L([t.dir]),I(s.data))};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:C,handleInputChange:e=>F(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:n,handleInputChange:e=>o(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:d,handleInputChange:e=>w(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:g,handleInputChange:e=>j(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:k,handleInputChange:e=>{N(e)},max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:b,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,v.zN)("不是数字"),S(parseInt(e))},max_width:"7rem"}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{E()}})]}),M.key?(0,x.jsx)(O,{close:async()=>{const e=new K.x;e.key=M.key;await c.Fg.post("close",e);I({})},data:{port:b,password:d,username:n,domain:k,dir:C}}):(0,x.jsx)(p.N,{have_auth_edit:P(_.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await c.Fg.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{await c.Fg.post("tag/save",e)},clickItem:async e=>{N(e.domain),F(e.dir),S(e.port),o(e.username),w(e.password),j(e.private_path),await E(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function U(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class z{constructor(e){this.canvas=e,this.render=new Y.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,s=Math.round(15*Math.abs(a)/8),n=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-n.left,y:t.clientY-n.top,step:s,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),s=a?t.deltaX:t.deltaY,n=Math.round(15*Math.abs(s)/8),o=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:n,isNegative:s>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,s,n,o){var i=this;N.ws.addMsg(k.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),N.ws.addMsg(k.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),N.ws.addMsg(k.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),N.ws.addMsg(k.HK.rdp_error,e=>{i.activeSession=!1});const r=new k.hf;r.cmdType=k.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:s,password:n,locale:Y.locale()},N.ws.send(r)}}class T{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),s=Module._malloc(a.length),n=new Uint8Array(Module.HEAPU8.buffer,s,a.length);n.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),c=new Uint8Array(Module.HEAPU8.buffer,l,r),d=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,o,i,e.width,e.height,n.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(s),Module._free(l),{width:o,height:i,data:d}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var V={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},J={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},Z={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J}};function X(){}X.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new z(e)}},Canvas:{create:function(e){return new T(e)}},scancode(e){var t=X.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",V[e.code||Z[X.prototype.browser()||"firefox"][t][e.keyCode]]}};let Y=new X;var q=a(38240);let W;function Q(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.header_min),{check_user_auth:n}=(0,y.MH)(),[d,w]=(0,s.useState)(void 0),[g,j]=(0,s.useState)(3389),[K,b]=(0,s.useState)(void 0),[S,C]=(0,s.useState)(void 0),[A,F]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1);var M=null;(0,s.useEffect)(()=>(W||(async()=>{try{await(0,q.J)("rle.js"),W=!0}catch(e){return void(0,v.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const B=t=>{L(!0),function(s,n,o,i){if(s=s||t.address,o=o||t.username,i=i||t.password,!s||!o)return(0,v.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Y.client.create(Y.$(e)))}("rdpwebview");var r=Y.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(s,"",n,o,i,function(e){Y.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(d,g,K,S)};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:d,max_width:"15rem",handleInputChange:e=>w(e)}),(0,x.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:g,max_width:"10rem",handleInputChange:e=>{e&&j(parseInt(e))}}),(0,x.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:K,max_width:"15rem",handleInputChange:e=>b(e)}),(0,x.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:S,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,x.jsx)(r.rA,{icon:"play_arrow",title:e("连接"),onClick:B}),D&&(0,x.jsx)(r.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await N.ws.sendData(k.HK.rdp_disconnect,"");var e=Y.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Y.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,x.jsxs)(o.jW,{isFull:A,children:[!D&&(0,x.jsx)(p.N,{have_auth_edit:n(_.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await c.J0.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c.J0.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{C(e.password),b(e.username),w(e.address),j(e.port),B(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,x.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ee=a(77481),te=a(40505),ae=a(99380);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(5880),a.e(4091)]).then(()=>a(84091)));let re,le,ce,de;function ue(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.confirm),[w,g]=(0,f.fp)(m.AG.showPrompt),{check_user_auth:j}=(0,y.MH)(),[K,b]=(0,s.useState)(""),[S,C]=(0,f.fp)(m.AG.router_jump),[A,F]=(0,s.useState)("get"),[D,M]=(0,s.useState)(""),[B,P]=(0,s.useState)(void 0),[E,R]=(0,s.useState)([]),[G,O]=(0,s.useState)([]),[H,U]=(0,s.useState)("headers"),[z,T]=(0,s.useState)(String(d.RB.row)),[V,J]=(0,s.useState)("body"),[Z,X]=(0,s.useState)(),[Y,q]=(0,f.fp)(m.AG.nav_index_add_item_by_now_list),[W,Q]=(0,f.fp)(m.AG.prompt_card);y.xK.set_value_temp("{}",0),y.xK.set_value_temp("",1),(0,s.useEffect)(()=>(re={},le="",ce="",de="",y.xK.get_editor(0).session.setMode("ace/mode/json"),S.http_download_map_path&&(P(S.http_download_map_path),C({})),N.ws.sendData(k.HK.http_download_water,void 0).then(()=>{N.ws.addMsg(k.HK.http_download_water,e=>{const t=e.context;O(t)})}),()=>{N.ws&&"function"==typeof N.ws.removeMsg&&N.ws.removeMsg(k.HK.http_download_water)}),[]);const se=e=>{const t=new d.vr;t.url=D,t.method=A,t.header_type="headers"===H?1:2,"headers"===H&&(re=JSON.parse(y.xK.get_editor_value(0))),t.headers=re;const a=Number(z);if(t.body_type=a,a===d.RB.row)le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.json)re["Content-Type"]="application/json",le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.form){re["Content-Type"]="multipart/form-data",t.form_data_list=E;for(const t of E)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,x.jsx)("div",{children:(0,x.jsxs)(o.xh,{children:[(0,x.jsx)(l.A,{}),(0,x.jsxs)(o.fI,{children:[(0,x.jsxs)(o.VP,{children:[0!==G.length&&(0,x.jsx)(n.Zp,{title:"正在下载",children:(0,x.jsx)("div",{children:G.map((t,a)=>(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"div-row",children:[(0,x.jsx)(r.rA,{icon:"cancel",title:e("取消"),onClick:()=>{N.ws.sendData(k.HK.http_download_cancel,t.local_download_path)}}),(0,x.jsx)(n.xP,{context:t.filename,tip_context:t.local_download_path}),(0,x.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,L.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,x.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,x.jsxs)(n.Zp,{title:"",rightBottomCom:Number(z)===d.RB.form&&"body"===H&&(0,x.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...E])}}),children:[(0,x.jsxs)("div",{className:"http_url",children:[(0,x.jsx)(i.l6,{width:"10rem",value:A,onChange:e=>{F(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,x.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:D,handleInputChange:e=>{M(e)}}),(0,x.jsx)(r.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!c._U.have_http_method(A))return void(0,v.zN)("不存在的http method");if(!D)return void(0,v.zN)("url is empty");X(void 0),b("");const e=new FormData;e.append("data",JSON.stringify(se(e)));let t="http/send";B&&(t+=`?local_download_path=${B}`),ae.A.post(c._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,v.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),de=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);X(200===t||201===t?(0,x.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){de=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ce="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const s=y.xK.get_editor(2),n="body"===V?ce:de;if(s){if(a.includes("application/json")||a.includes("+json")){s.session.setMode("ace/mode/json");try{const e=JSON.parse(ce);ce=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?s.session.setMode("ace/mode/html"):a.includes("xml")?s.session.setMode("ace/mode/xml"):a.includes("javascript")?s.session.setMode("ace/mode/javascript"):s.session.setMode("ace/mode/text");s.setValue("body"===V?ce:de,-1)}b(n)})}}),j(_.oV.http_proxy_tag_update)&&(0,x.jsx)(r.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!j(_.oV.http_proxy_tag_update))return void(0,v.zN)("no permission");for(const t of E)if(t.is_file)return void(0,v.zN)(e("表单中含有文件,浏览器限制不能添加"));let t;Q({open:!0,title:e("信息"),context_div:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"card-content",children:(0,x.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,x.jsx)("div",{className:"card-action",children:(0,x.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await se();e.local_download_path=B,e.form_data_list=JSON.stringify(E),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,q(e),Q({open:!1})},children:e("确定")})})]})})}})]}),(0,x.jsxs)(ne,{activeKey:H,onChange:e=>U(e),children:[(0,x.jsx)(oe,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(0)?.formatCode?.()}})}),(0,x.jsx)("div",{className:"http_ace",children:(0,x.jsx)(ie,{name:"",editor_id:0})})]})}),(0,x.jsx)(oe,{itemKey:"body",tab:e("请求体"),children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,x.jsxs)(ne,{activeKey:z,onChange:e=>{T(e);const t=Number(e);t===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):t===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,x.jsx)(oe,{itemKey:String(d.RB.row),tab:e("row")}),(0,x.jsx)(oe,{itemKey:String(d.RB.json),tab:e("json")}),(0,x.jsx)(oe,{itemKey:String(d.RB.form),tab:e("form")})]}),Number(z)!==d.RB.form&&(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(1)?.formatCode?.()}})]}),Number(z)===d.RB.form&&(0,x.jsx)("div",{style:{marginTop:"10px"},children:(0,x.jsx)(ee.X,{headers:["key",e("值")],rows:E.map((t,a)=>[(0,x.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...E])},no_border:!0}),(0,x.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...E])},no_border:!0}),(0,x.jsxs)("div",{children:[(0,x.jsx)(r.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{g({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const s=a[0];s.fullPath=(0,$.hU)()+Date.now().toString(),E[e].value=`${s}(${s.name})`,E[e].is_file=!0,E[e].fileName=s.name,E[e].fullPath=s.fullPath,R([...E]),E[e].file_object=s,g({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,x.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{E.splice(e,1),R([...E])})(a)})]})]),width:"10rem"})}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(z)!==d.RB.form?"block":"none"},children:(0,x.jsx)(ie,{name:"",editor_id:1})})]})})]}),(0,x.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===B?(0,x.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{P("")},children:e("下载到本地目录")}):(0,x.jsx)(i.Sm,{placeholder:e("本地地址"),value:B,handleInputChange:e=>{P(e)},handlerEnter:()=>{B||P(void 0)}})})]})]}),(0,x.jsx)(o.VP,{children:(0,x.jsxs)(n.Zp,{title:Z,titleCom:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{y.xK.get_editor(2)?.formatCode?.()}}),(0,x.jsx)(r.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=y.xK.get_editor_value(2);e&&((0,te.lW)(e),(0,v.SK)("完成"))}})]}),children:[(0,x.jsxs)(ne,{activeKey:V,onChange:e=>{J(e);const t="body"===e?ce:de;b(t);const a=y.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,x.jsx)(oe,{itemKey:"body",tab:e("响应体")}),(0,x.jsx)(oe,{itemKey:"headers",tab:e("响应头")})]}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,x.jsx)(ie,{name:"",editor_id:2})})]})})]}),(0,x.jsx)(o.fI,{children:(0,x.jsx)(o.VP,{children:(0,x.jsx)(p.N,{getItems:async()=>{const e=await c._U.get("http/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("http/tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},have_auth_edit:j(_.oV.http_proxy_tag_update),clickItem:async e=>{M(e.url),F(e.method),P(e.local_download_path),e.header_type&&U(1===e.header_type?"headers":"body"),e.headers&&(re=JSON.parse(e.headers),1===e.header_type&&(y.xK.get_editor(0).setValue(e.headers,-1),y.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(le=e.data),e.body_type&&(T(String(e.body_type)),e.body_type===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json"),y.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var pe=a(87361);const he=s.lazy(()=>Promise.all([a.e(3215),a.e(8257),a.e(7759)]).then(()=>a(45601)));function me({}){const{check_user_auth:e}=(0,y.MH)(),{t}=(0,h.B)(),a=[];return e(_.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,x.jsx)(ue,{})}),e(_.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,x.jsx)(H,{})}),e(_.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,x.jsx)(w,{})}),e(_.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,x.jsx)(Q,{})}),e(_.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,x.jsx)(he,{})}),(0,x.jsx)(o.W1,{optionList:a,father_route:pe.o.proxy})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6247],{77481(e,t,n){n.d(t,{S:()=>o,X:()=>l});var i=n(96540),s=n(74848);function l(e){const[t,n]=i.useState([]);return(0,i.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:e.headers?.map((e,t)=>(0,s.jsx)("th",{children:e},t))})}),(0,s.jsx)("tbody",{children:t.map((t,n)=>(0,s.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,i)=>(0,s.jsx)("td",{style:{width:e.width??"auto"},className:i===t.length-1?"small":"",children:n},i))},n))})]})}function o(e){return(0,s.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,s.jsx)("div",{children:e},t))})}},66247(e,t,n){n.r(t),n.d(t,{default:()=>k});var i=n(96540),s=n(75725),l=n(70447),o=n(85997),r=n(77481),c=n(61443),a=n(86149),d=n(14284),h=n(53459),u=n(62042),x=n(87361),j=n(40505),_=n(57952),p=n(86090),f=n(34843),m=n(82893),w=n(21469),v=n(21499),C=n(74848);function k(){const{t:e,i18n:t}=(0,a.B)(),n=(0,p.Zp)(),k=[e("编号"),e("路径"),e("过期小时"),e("token"),e("备注"),e("剩余时间(h)"),e("下载次数")],[b,y]=(0,i.useState)([]),[A,S]=(0,f.fp)(m.AG.prompt_card),g=async()=>{const e=await d.XO.get("get_share_file_list");if(e.code===h.m.Success){const t=e.data??[],n=Date.now();for(const e of t)try{if(null!=e.left_hour&&e.left_hour>0){const t=n-e.time_stamp,i=36e5*e.left_hour-t;e.show_left_hour=parseFloat((i/36e5).toFixed(2))}else e.show_left_hour=e.left_hour}catch(e){}y(t)}};(0,i.useEffect)(()=>{g()},[]);return(0,C.jsxs)("div",{className:"common-box ",style:{overflowY:"auto"},children:[(0,C.jsx)(_.A,{children:(0,C.jsx)(o.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{n(-1)}})}),(0,C.jsx)(s.J,{widthPer:100,children:(0,C.jsx)(l.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("文件分享列表")}),(0,C.jsx)(o.rA,{icon:"info",title:e("提示"),onClick:()=>{let e=(0,C.jsx)("div",{children:"小时设置为-1或者不设置就没有过期时间"});S({open:!0,title:"信息",context_div:(0,C.jsx)("div",{children:e})})}})]}),titleCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{y([...b,{note:"",path:""}])}}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("set_share_file_list",b)).code===h.m.Success&&((0,u.SK)("保存成功"),g())}})]}),children:(0,C.jsx)(r.X,{headers:k,rows:b.map((t,n)=>{const i=[(0,C.jsx)("div",{children:n}),(0,C.jsx)(c.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.left_hour,handleInputChange:e=>{t.left_hour=parseFloat(e),t.time_stamp=Date.now()},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.token,handleInputChange:e=>{t.token=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsx)("p",{children:t.show_left_hour}),(0,C.jsx)("p",{children:t.download_num}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),y([...b])})(n)}),t.id&&(0,C.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${t.id}`);(0,j.lW)(e),(0,u.SK)(e)}}),t.id&&(0,C.jsx)(o.rA,{icon:"open_in_new",title:e("打开新页面"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${t.id}`);window.open(e)}})]})];return i}),width:"10rem"})})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6505],{26505(t,s,e){e.r(s),e.d(s,{default:()=>m});var a=e(96540),i=(e(82893),e(14284)),l=e(62042),c=e(86149),o=e(85997),n=e(57952),r=e(86090),d=e(34289),h=e(87361),u=e(2543),p=e(74848);const x={modified:"#f9ab00",added:"var(--secondary, #34a853)",deleted:"var(--accent, #ea4335)",untracked:"var(--textSecondary, #5f6368)",renamed:"var(--primary, #1a73e8)",conflict:"var(--accent, #ea4335)"},g={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",conflict:"!"};function m(){const{t}=(0,c.B)(),s=(0,r.Zp)();let e=decodeURIComponent((0,d.GG)(h.o.git_page,(0,d.vX)()));e=e.replace(/\/+$/,"");const[m,y]=(0,a.useState)([]),[j,v]=(0,a.useState)([]),[N,b]=(0,a.useState)({current:"",branches:[]}),[f,S]=(0,a.useState)(""),[w,C]=(0,a.useState)(new Set),[z,k]=(0,a.useState)("status"),[U,T]=(0,a.useState)(!1),[_,P]=(0,a.useState)(16),[K,W]=(0,a.useState)(!1),F=(0,a.useRef)(null),A=(0,a.useRef)(null),[R,L]=(0,a.useState)({name:"",email:""}),[D,E]=(0,a.useState)(""),[I,B]=(0,a.useState)(""),[G,X]=(0,a.useState)(!1),[H,M]=(0,a.useState)(null),[Z,$]=(0,a.useState)(!1),[q,J]=(0,a.useState)(""),[O,Q]=(0,a.useState)(""),[V,Y]=(0,a.useState)(""),[tt,st]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(et(),at(),it(),lt(),ct())},[e]);const et=async()=>{try{T(!0);const t=await i.TU.post("status",{path:e});0===t.code&&y(t.data||[])}catch(t){}finally{T(!1)}},at=async()=>{try{const t=await i.TU.post("log",{path:e,maxCount:50});0===t.code&&v(t.data||[])}catch(t){}},it=async()=>{try{const t=await i.TU.post("branches",{path:e});0===t.code&&b(t.data||{current:"",branches:[]})}catch(t){}},lt=async()=>{try{const t=await i.TU.post("get_user_config",{path:e});0===t.code&&(L(t.data),E(t.data.name||""),B(t.data.email||""))}catch(t){}},ct=async()=>{try{const t=await i.TU.post("get_proxy",{path:e});0===t.code&&(M(t.data),J(t.data.global?.http||""),Q(t.data.global?.https||""),Y(t.data.local?.http||""),st(t.data.local?.https||""))}catch(t){}},ot=()=>{w.size===m.length?C(new Set):C(new Set(m.map(t=>t.path)))},nt=async(s=!1)=>{try{T(!0);const a=await i.TU.post("push",{path:e,force:s});0===a.code?(0,l.SK)(t("推送成功")):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}},rt=(0,a.useCallback)(u.throttle(t=>{const s=parseFloat(getComputedStyle(A.current).fontSize),e=window.innerWidth/s-4,a=t.clientX/s,i=2.25+F.current.offsetWidth/s;a<=e&&a>=i&&P(parseFloat(a.toFixed(2)))},32),[]),dt=()=>{W(!1),A.current.removeEventListener("pointermove",rt)},ht=e.split("/").filter(Boolean).pop()||e;return(0,p.jsxs)("div",{className:"studio",children:[(0,p.jsx)(n.A,{ignore_tags:!0,left_children:[(0,p.jsx)(o.rA,{title:t("取消"),icon:"close",onClick:()=>s(-1)},1),(0,p.jsx)("span",{children:decodeURIComponent(ht)})],children:(0,p.jsx)(o.rA,{icon:"refresh",title:t("刷新"),onClick:()=>{et(),at(),it(),lt(),ct()}})}),(0,p.jsxs)("div",{className:"studio-body",ref:A,children:[(0,p.jsxs)("div",{className:"studio-nav",style:{width:_-1+"em"},children:[(0,p.jsxs)("div",{className:"git-studio-tab-bar",children:[(0,p.jsxs)("button",{className:"git-studio-tab "+("status"===z?"git-studio-tab--active":""),onClick:()=>k("status"),children:["📝 ",t("变更")," (",m.length,")"]}),(0,p.jsxs)("button",{className:"git-studio-tab "+("log"===z?"git-studio-tab--active":""),onClick:()=>k("log"),children:["📜 ",t("提交记录")," (",j.length,")"]})]}),"status"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[m.length>0&&(0,p.jsxs)("div",{className:"git-studio-select-all",onClick:ot,children:[(0,p.jsx)("input",{type:"checkbox",checked:w.size===m.length&&m.length>0,onChange:ot}),(0,p.jsxs)("span",{children:[t("全选")," (",w.size,"/",m.length,")"]})]}),m.map(t=>(0,p.jsxs)("div",{className:"git-studio-file-item "+(w.has(t.path)?"git-studio-file-item--selected":""),onClick:()=>(t=>{const s=new Set(w);s.has(t)?s.delete(t):s.add(t),C(s)})(t.path),children:[(0,p.jsx)("input",{type:"checkbox",checked:w.has(t.path),onChange:()=>{}}),(0,p.jsx)("span",{className:"git-studio-status-badge",style:{background:x[t.status]||x.untracked},children:g[t.status]||t.status}),(0,p.jsxs)("span",{className:"git-studio-filename",children:[t.path,t.oldPath&&(0,p.jsxs)("span",{style:{color:"var(--textSecondary)",fontSize:11},children:[" (← ",t.oldPath,")"]})]})]},t.path)),0===m.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("没有变更")})]}),"log"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[j.map((t,s)=>(0,p.jsxs)("div",{className:"git-studio-log-entry",children:[(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,p.jsx)("span",{className:"git-studio-log-hash",children:t.hash}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)",flex:1},children:t.message})]}),(0,p.jsxs)("div",{style:{fontSize:11,color:"var(--textSecondary)",paddingLeft:4},children:[t.author," · ",t.date]})]},s)),0===j.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("暂无提交记录")})]})]}),(0,p.jsx)("div",{className:"studio__divider",ref:F,onPointerDown:()=>{W(!0),A.current.addEventListener("pointermove",rt)},onPointerUp:dt}),K&&(0,p.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),(0,p.jsx)("div",{className:"studio-editor",children:(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"16px",gap:12,overflow:"auto"},children:[(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌿 ",t("分支"),": ",(0,p.jsx)("span",{style:{color:"var(--secondary, #34a853)"},children:N.current})]}),(0,p.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:N.branches.map(s=>(0,p.jsx)("button",{className:"git-studio-branch-chip "+(s===N.current?"git-studio-branch-chip--current":""),onClick:()=>(async s=>{try{T(!0);const a=await i.TU.post("checkout",{path:e,branch:s});0===a.code?((0,l.SK)(t("切换分支成功")),et(),at(),it()):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}})(s),disabled:s===N.current||s.startsWith("*"),children:s.replace("remotes/origin/","")},s))})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsx)("textarea",{className:"git-studio-textarea",placeholder:t("输入提交信息..."),value:f,onChange:t=>S(t.target.value),rows:2}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(f.trim())try{T(!0);const s=await i.TU.post("commit",{path:e,message:f.trim(),allChanged:!0});0===s.code?((0,l.SK)(t("提交成功")),S(""),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}else(0,l.zN)(t("请输入提交信息"))},disabled:U||!f.trim(),style:{borderColor:"var(--secondary, #34a853)",color:"var(--secondary, #34a853)"},children:["✅ ",t("提交")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("add_all",{path:e});0===s.code?((0,l.SK)(t("已暂存全部")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["➕ ",t("暂存全部")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("add",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},children:["📥 ",t("暂存选中")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("reset",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已取消暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},style:{borderColor:"#f9ab00",color:"#f9ab00"},children:["↩ ",t("取消暂存")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["☁️ ",t("远程操作")]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{T(!0);const s=await i.TU.post("pull",{path:e});0===s.code?((0,l.SK)(t("拉取成功")),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}},disabled:U,children:["⬇ ",t("拉取")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!1),disabled:U,children:["⬆ ",t("推送")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!0),disabled:U,style:{borderColor:"var(--accent, #ea4335)",color:"var(--accent, #ea4335)"},children:["⚠ ",t("强制推送")]})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash",{path:e});0===s.code?((0,l.SK)(t("暂存工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📦 ",t("暂存工作区")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash_pop",{path:e});0===s.code?((0,l.SK)(t("恢复工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📤 ",t("恢复工作区")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["👤 ",t("用户配置")]}),G?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:D,onChange:t=>E(t.target.value),placeholder:"user.name"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:I,onChange:t=>B(t.target.value),placeholder:"user.email"})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("set_user_config",{path:e,name:D,email:I});0===s.code?((0,l.SK)(t("用户配置已保存")),X(!1),lt()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{X(!1),E(R.name),B(R.email)},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.name||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.email||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>X(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌐 ",t("代理设置")]}),Z?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:q,onChange:t=>J(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:O,onChange:t=>Q(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:V,onChange:t=>Y(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:tt,onChange:t=>st(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:11,color:"var(--textSecondary)"},children:t("留空清除该代理设置")}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=[{scope:"global",type:"http",value:q},{scope:"global",type:"https",value:O},{scope:"local",type:"http",value:V},{scope:"local",type:"https",value:tt}];for(const t of s)await i.TU.post("set_proxy",{path:e,...t});(0,l.SK)(t("代理配置已保存")),$(!1),ct()}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{$(!1),ct()},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.https||"-"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.https||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>$(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:"1px solid var(--divider, rgba(0,0,0,0.08))",background:"var(--surfaceSecondary, #f1f3f4)",fontSize:11,color:"var(--textSecondary)",lineHeight:1.6},children:["💡 ",t("提示:"),(0,p.jsxs)("ul",{style:{margin:"4px 0",paddingLeft:16},children:[(0,p.jsx)("li",{children:t("左侧勾选文件后,使用「暂存选中」将其加入暂存区")}),(0,p.jsx)("li",{children:t("输入提交信息后点击「提交」")}),(0,p.jsx)("li",{children:t("如有冲突,请自行在shell中解决冲突后再提交")}),(0,p.jsx)("li",{children:t("「强制推送」会覆盖远程分支,请谨慎使用")}),(0,p.jsx)("li",{children:t("用户配置和全局代理修改后对所有仓库生效")})]})]})]})})]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,4091,8319],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(74848);function i(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,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:e.headers?.map((e,t)=>(0,r.jsx)("th",{children:e},t))})}),(0,r.jsx)("tbody",{children:t.map((t,s)=>(0,r.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,r.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function l(e){return(0,r.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,r.jsx)("div",{children:e},t))})}},84091(e,t,s){s.r(t),s.d(t,{default:()=>d});var n=s(96540),r=s(80952),i=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(24522)),l=s(34843),a=s(82893),c=s(78247),o=s(74848);function d(e){const t=(0,n.useRef)(null),[s,d]=(0,l.fp)(a.AG.user_base_info),u=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??i.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){e.on_change&&e.on_change()}),t.current=s,s.formatCode=()=>{const e=r.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},c.xK.set_editor_temp(s,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}r.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("modePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("themePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("workerPath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`)},60676(e,t,s){s.r(t),s.d(t,{default:()=>w});var n=s(96540),r=s(57952),i=s(85997),l=s(14284),a=s(86090),c=s(77481),o=s(70447),d=s(34843),u=s(82893),h=s(84091),p=s(78247),x=s(61443),m=s(23496),_=s(62042),f=s(86149),j=s(53459),v=s(7523),g=s(74848);function b(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function S(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:i="",onTick:l,className:a}=e,[c,o]=(0,n.useState)(0),d=(0,n.useRef)(0),u=(0,n.useRef)(null),h=(0,n.useRef)(t);h.current=t;const p=(0,n.useCallback)(()=>{null!==u.current&&(cancelAnimationFrame(u.current),u.current=null)},[]),x=(0,n.useCallback)(()=>{p();const e=()=>{const t=performance.now()-d.current;o(t),l?.(t),h.current&&(u.current=requestAnimationFrame(e))};e()},[l,p]);return(0,n.useEffect)(()=>{d.current=performance.now(),o(0),l?.(0),h.current&&x()},[s]),(0,n.useEffect)(()=>{t?x():p()},[t,x,p]),(0,n.useEffect)(()=>()=>p(),[p]),(0,g.jsxs)("span",{className:a,children:[i,b(c,r)]})}var q=s(87361),y=s(28319);function C(e){const[t,s]=(0,n.useState)("");return(0,g.jsxs)("div",{className:"db-query-preset-input",children:[(0,g.jsx)(x.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,g.jsx)("div",{className:"db-query-preset-input__actions",children:(0,g.jsx)(i.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function w(){const e=(0,a.Zp)(),{t}=(0,f.B)(),{initUserInfo:s}=(0,n.useContext)(v.F),[b]=(0,d.fp)(u.AG.sqlite_query_context),[w]=(0,d.fp)(u.AG.user_base_info),[,k]=(0,d.fp)(u.AG.prompt_card),N=(0,n.useMemo)(()=>b?.path??"",[b?.path]),A=(0,n.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),E=97,[K,L]=(0,n.useState)(""),[F,$]=(0,n.useState)("table"),[M,Q]=(0,n.useState)(!1),[P,O]=(0,n.useState)(""),[R,G]=(0,n.useState)(null),[I,T]=(0,n.useState)(!1),[J,W]=(0,n.useState)(0),[Z,B]=(0,n.useState)(!1),[D,H]=(0,n.useState)([]),[V,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=w?.user_data?.sql_preset_list;e&&e.length?H([...e]):H([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[w?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await l.wm.post(m.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===j.m.Success&&(await s(),H(t),!0)},z=async(e,s)=>{const n=[...D,{note:s||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,_.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{p.xK.set_value_temp(K,E)},[K]),(0,n.useEffect)(()=>{L(""),O(""),G(null),$("table"),T(!1),B(!1),W(0),te(""),ne(""),p.xK.set_value_temp("",E),N||O("请先从文件右键打开一个数据库")},[N,b?.open]);const re=async()=>{const e=(p.xK.get_editor_value(E)??K).trim();if(!N)return O("请先从文件右键打开一个数据库"),void G(null);if(!e)return O("请输入 SQL 语句"),void G(null);Q(!0),O(""),B(!0),W(e=>e+1),T(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await l.$M.post("sqlite/query",{path:N,sql:s});G(n.data),$("table")}catch(e){O(e?.message??`${e}`),G(null)}finally{T(!1),Q(!1)}var t},ie=R?.columns?.length?R.columns:Object.keys(R?.rows?.[0]??{}),le=(R?.rows??[]).map(e=>ie.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,g.jsxs)("div",{className:"db-query-page",children:[(0,g.jsx)(r.A,{ignore_tags:!0,left_children:[(0,g.jsx)(i.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,g.jsx)(i.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,g.jsx)(i.rA,{icon:"table_chart",title:"表格视图",onClick:()=>$("table")},"table"),(0,g.jsx)(i.rA,{icon:"data_object",title:"原 JSON",onClick:()=>$("json")},"json"),(0,g.jsx)(i.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,g.jsx)(o.xP,{context:A,tip_context:"点击复制数据库信息"})}),(0,g.jsxs)("div",{className:"db-query-page__content",children:[(0,g.jsxs)(o.Zp,{title:"SQL 查询",titleCom:(0,g.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,g.jsx)(x.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),D.length>0&&(0,g.jsx)(x.l6,{width:"16rem",tip:t("SQL预设"),value:V,onChange:e=>{const t=D[e];t&&(X(e),(e=>{p.xK.set_value_temp(e,E);const t=p.xK.get_editor(E);t&&t.setValue(e,-1),L(e)})(t.sql),te(Y(t.env??"","find")),ne(""),O(""))},options:D.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,g.jsx)(i.C3,{text:t(V>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(p.xK.get_editor_value(E)??K).trim();if(!e)return void O(t("请输入 SQL 语句"));const s=[...D];if(V>=0&&s[V]){s[V].sql=e,s[V].note||(s[V].note=t("SQL 预设"));await U(s)&&(0,_.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,g.jsx)(C,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,g.jsxs)("div",{className:"db-query-page__actions",children:[(0,g.jsx)(i.C3,{text:M?"查询中...":"执行查询",clickFun:re}),(0,g.jsx)(i.C3,{text:"清空",clickFun:()=>{p.xK.set_value_temp("",E);const e=p.xK.get_editor(E);e&&e.setValue("",-1),L("")}}),(0,g.jsx)(i.C3,{text:"table"===F?"表格视图":"切换到表格",clickFun:()=>$("table")}),(0,g.jsx)(i.C3,{text:"json"===F?"原 JSON":"切换到 JSON",clickFun:()=>$("json")})]}),children:[(0,g.jsx)("div",{className:"db-query-page__editor",children:(0,g.jsx)(h.default,{name:"sqlite.sql",editor_id:E,model:"ace/mode/sql",on_change:()=>{const e=p.xK.get_editor_value(E)??"";L(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),P&&(0,g.jsx)("div",{className:"db-query-page__error",children:P})]}),(0,g.jsxs)(o.Zp,{title:"查询结果",titleCom:(0,g.jsxs)("span",{className:"db-query-page__result-meta",children:[R?`${R.row_count} 行`:"暂无结果",Z&&(0,g.jsx)("span",{className:"db-query-page__elapsed",children:(0,g.jsx)(S,{running:I,resetKey:J,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[R&&"table"===F&&(0,g.jsx)(c.X,{headers:ie,rows:le}),R&&"json"===F&&(0,g.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(R.rows,null,2)}),!R&&!P&&(0,g.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!R&&P&&(0,g.jsx)("div",{className:"db-query-page__hint",children:P})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>q,defaultSqlPreset:()=>b});var n=s(96540),r=s(86149),i=s(57952),l=s(85997),a=s(75725),c=s(77481),o=s(70447),d=s(61443),u=s(34843),h=s(82893),p=s(14284),x=s(23496),m=s(53459),_=s(62042),f=s(7523),j=s(78247),v=s(86090),g=s(74848);function b(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,r.B)(),{initUserInfo:t}=(0,n.useContext)(f.F),[,s]=(0,u.fp)(h.AG.editorSetting),[q]=(0,u.fp)(h.AG.user_base_info),y=(0,v.Zp)(),C=n.useRef(-1),[w,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=q?.user_data?.sql_preset_list;k(t?.length?[...t]:[b(e)])},[e,q?.user_data?.sql_preset_list]);const N=async()=>{const s=w.map((e,t)=>({...e,index:t})),n=await p.wm.post(x.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:s});n?.code===m.m.Success&&(await t(),(0,_.SK)(e("保存成功")))},A=(e,t)=>{C.current=e;const n=w[e][t]??"";j.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{w[C.current][t]=e,k([...w]),j.xK.set_value_temp(""),N()}})},E=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(i.A,{children:(0,g.jsx)(l.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>y(-1)})}),(0,g.jsx)(a.jW,{isFull:!0,more:!0,children:(0,g.jsx)(a.NN,{children:(0,g.jsx)(a.xh,{children:(0,g.jsx)(a.fI,{children:(0,g.jsx)(a.VP,{widthPer:60,children:(0,g.jsx)(o.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(l.rA,{icon:"add",title:e("添加"),onClick:()=>k([...w,{note:"",sql:"",env:S}])}),(0,g.jsx)(l.rA,{icon:"save",title:e("保存"),onClick:()=>N()})]}),children:(0,g.jsx)(c.X,{headers:E,rows:w.map((t,s)=>[(0,g.jsx)("div",{children:s+1}),(0,g.jsx)(d.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...w])}}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>A(s,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"settings",title:e("env编辑"),onClick:()=>A(s,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"delete",title:e("删除"),onClick:()=>{w.splice(s,1),k([...w])}})})]),width:"8rem"})})})})})})})]})}s.d(t,["sqlEnvDefault",0,S])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6919],{86919(e,l,t){t.r(l),t.d(l,{default:()=>_});var r=t(96540),a=t(86149),i=t(86090),s=t(34843),n=t(57952),o=t(85997),h=t(75725),c=t(70447),d=t(61443),u=t(82893),m=t(14284),p=t(53459),x=t(62042),j=t(74848);function _(){const{t:e}=(0,a.B)(),l=(0,i.Zp)(),[t,_]=(0,s.fp)(u.AG.confirm),[,v]=(0,s.fp)(u.AG.prompt_card),[b,C]=(0,r.useState)(""),[S,g]=(0,r.useState)(""),[w,f]=(0,r.useState)(""),[k,y]=(0,r.useState)(""),[B,I]=(0,r.useState)(""),[W,A]=(0,r.useState)(""),[N,D]=(0,r.useState)(""),[P,T]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!0),[z,F]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{const e=await m.Yu.get("docker/config");if(e?.code!==p.m.Success)return;const l=e.data??{};C(l.http_proxy??""),g(l.https_proxy??""),f(l.no_proxy??""),y((l.registry_mirrors||[]).join(",")),I((l.insecure_registries||[]).join(",")),A(l.data_root??""),D(l.storage_driver??""),T(l.log_driver??""),Y(l.iptables??!0),F(!!l.live_restore)})()},[]);return(0,j.jsxs)("div",{children:[(0,j.jsx)(n.A,{children:(0,j.jsx)(o.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>l(-1)})}),(0,j.jsx)(h.jW,{isFull:!0,more:!0,children:(0,j.jsx)(h.NN,{children:(0,j.jsx)(h.xh,{children:(0,j.jsx)(h.fI,{children:(0,j.jsx)(h.VP,{widthPer:35,children:(0,j.jsxs)(c.uF,{self_title:(0,j.jsxs)("span",{className:"div-row",children:[(0,j.jsx)("h2",{children:e("Docker 代理配置")}),(0,j.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{v({open:!0,title:e("信息"),context_div:(0,j.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("代理写入 systemd 服务环境变量,其余写入 daemon.json;修改后需重启 Docker 生效,请谨慎操作(尤其数据存储目录变更)。")})})}})]}),titleCom:(0,j.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async()=>{const l=e=>e.split(/[\n,,]/).map(e=>e.trim()).filter(Boolean),t=await m.Yu.post("docker/config/save",{http_proxy:b,https_proxy:S,no_proxy:w,registry_mirrors:l(k),insecure_registries:l(B),data_root:W,storage_driver:N,log_driver:P,iptables:H,live_restore:z});t?.code===p.m.Success?_({open:!0,title:e("是否重启 Docker 服务以生效?"),sub_title:e("重启 Docker 会短暂中断容器服务,请确认当前没有关键任务在执行"),handle:async()=>{const l=await m.Yu.post("docker/restart");_({open:!1,handle:null}),l?.code===p.m.Success?(0,x.SK)(e("已重启 Docker,代理配置已生效")):(0,x.zN)(e("重启失败"))}}):(0,x.zN)(e("保存失败"))})()}),children:[(0,j.jsx)(d.BC,{label:e("HTTP 代理"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"http://127.0.0.1:3067",value:b,handleInputChange:e=>C(e)})}),(0,j.jsx)(d.BC,{label:e("HTTPS 代理"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"https://127.0.0.1:3067",value:S,handleInputChange:e=>g(e)})}),(0,j.jsx)(d.BC,{label:e("No Proxy"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"localhost,127.0.0.1",value:w,handleInputChange:e=>f(e)})}),(0,j.jsx)(d.BC,{label:e("镜像加速"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"https://docker.mirrors.ustc.edu.cn,https://hub-mirror.c.163.com",value:k,handleInputChange:e=>y(e)})}),(0,j.jsx)(d.BC,{label:e("不安全仓库"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"127.0.0.1:5000,registry.example.com",value:B,handleInputChange:e=>I(e)})}),(0,j.jsx)(d.BC,{label:e("数据存储目录"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"/var/lib/docker",value:W,handleInputChange:e=>A(e)})}),(0,j.jsx)(d.BC,{label:e("存储驱动"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"overlay2",value:N,handleInputChange:e=>D(e)})}),(0,j.jsx)(d.BC,{label:e("日志驱动"),label_width:"4rem",children:(0,j.jsx)(d.Sm,{maxWidth:"24rem",placeholder:"json-file",value:P,handleInputChange:e=>T(e)})}),(0,j.jsx)(d.BC,{label:e("启用 iptables"),label_width:"4rem",input_max_width:"8rem",children:(0,j.jsx)(d.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:H,onChange:e=>Y(!!e)})}),(0,j.jsx)(d.BC,{label:e("Live Restore"),label_width:"4rem",input_max_width:"8rem",children:(0,j.jsx)(d.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:z,onChange:e=>F(!!e)})})]})})})})})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010,8302],{83277(e,t,n){n.d(t,{$j:()=>i,Lv:()=>s});class s{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}}const o=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function i(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\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n\n# ===== 模型类型(request_type)=====\n# 必填项,不同类型的 model 接口格式不同,默认 completions。\n# 可选值:\n# completions 标准对话/聊天补全 (chat/completions)\n# images 图片生成 (images/generations)\n# audio_speech 文本转语音 (audio/speech)\n# audio_transcription 语音转文字 (audio/transcriptions)\n# audio_translation 语音翻译 (audio/translations)\n# embeddings 向量嵌入 (embeddings)\n#request_type=completions\n\n# ===== 成为 tool(tool_mode)=====\n# 开启后该模型会作为一个工具被加载,可实现不同模型担任不同角色/能力,供 AI agent 在对话中动态调用。\n# 注意:不能与「是否开启」(open) 同时为 true。\n#tool_mode=false\n',"cL",0,o])},77481(e,t,n){n.d(t,{S:()=>a,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 a(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},29591(e,t,n){n.r(t),n.d(t,{default:()=>L});var s=n(86149),o=n(96540),i=n(85997),a=n(57952),l=n(34843),r=n(82893),c=n(75725),d=n(77481),p=n(61443),m=n(70447),u=n(34299),h=n(74848);var _=n(14284),x=n(53459),v=n(62042),g=n(7523),j=n(78247),f=n(23430),y=n(86090),w=n(14944),b=n(92275),C=n(88815),k=n(45907),A=n(12721),S=n(24659),I=n(83277);function L(){const{t:e}=(0,s.B)(),{initUserInfo:t}=(0,o.useContext)(g.F),n=[e("编号"),e("url"),e("是否开启"),e("key"),"model",e("更多属性"),e("备注")],L=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[$,K]=(0,o.useState)([]),[N,M]=(0,o.useState)([]),[P,O]=(0,o.useState)([]),[X,F]=(0,o.useState)(null),V=(0,o.useRef)(),H=(0,o.useRef)(!1),Y=(0,o.useRef)(!1),[T,q]=(0,o.useState)([]),[D,G]=(0,o.useState)(!1),[B,E]=(0,l.fp)(r.AG.prompt_card),[J,R]=(0,l.fp)(r.AG.user_base_info),[z,W]=(0,o.useState)(!1),U=P.filter(e=>"http"!==(e.transport??"stdio")),Z=P.filter(e=>"http"===e.transport),Q=[e("编号"),e("名称"),e("是否开启"),"command","args","cwd",e("tools|env"),e("备注")],ee=[e("编号"),e("名称"),e("是否开启"),e("endpoint"),e("tools|headers"),e("备注")],te=[e("编号"),e("提示词"),e("LLM编辑开关"),e("LLM编辑提示词"),e("编辑规则"),e("备注")],[ne,se]=(0,o.useState)([]),[oe,ie]=(0,o.useState)(!1),ae=function(){const[e,t]=(0,l.fp)(r.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,h.jsx)("div",{children:(0,h.jsx)(u.default,{context:e})})})}}(),{check_user_auth:le}=(0,j.MH)(),[re,ce]=(0,l.fp)(r.AG.editorSetting),de=(0,y.Zp)(),pe=(0,k.y)(),me=(0,S.K)(),ue=async()=>{const e=await _.jV.get("docs_on_get");e.code===x.m.Success&&W(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await _.XO.get("ai_agent_setting");e.code===x.m.Success&&K(e.data.models),await w.ws.addMsg(b.HK.ai_load_info,e=>{F(e.context)});const t=await w.ws.sendData(b.HK.ai_load_info,{});t?.context&&F(t.context);const n=await _.XO.get("ai_docs_setting");n.code===x.m.Success&&(V.current=n.data.param,n.data.list?.length&&M(n.data.list));const s=await _.XO.get("ai_mcp_setting");s.code===x.m.Success&&O(s.data.list??[]),await je(),ue();const o=await _.XO.get("ai_system_prompts");o.code===x.m.Success&&se(o.data??[]);const i=await _.XO.get("ai_long_term_memory_setting");i.code===x.m.Success&&ie(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};O([...P,t]),H.current=!0},_e=e=>{const t=P.indexOf(e);t<0||(P.splice(t,1),O([...P]),H.current=!0)},xe=e=>{O([...P,{...e,open:!1}]),H.current=!0},ve=async e=>{for(let e=0;e<$.length;e++)$[e].index=e;(await _.XO.post("ai_agent_setting/save",{models:e??$})).code===x.m.Success&&(0,v.SK)("保存成功")},ge=async e=>{for(let e=0;e<P.length;e++)P[e].index=e;(await _.XO.post("ai_mcp_setting/save",{list:e??P})).code===x.m.Success&&((0,v.SK)("保存成功"),H.current=!1,await je())},je=async()=>{const e=await _.XO.get("ai_mcp_tools");return e.code===x.m.Success?(q(e.data??[]),e.data??[]):[]},fe=async e=>{G(!0);try{const t=await _.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await je(),(0,v.SK)("MCP工具加载成功"),t.data??null}finally{G(!1)}return null},ye=async(t,n,s,o)=>{const i=o??T.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:[]},a=(i.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));E({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,h.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:a,initialPageId:s,onRefresh:async()=>{const e=await fe(n);e&&await ye(t,n,s,e)},renderPage:t=>{if(!t)return(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=i.tools?.find(e=>e.runtime_name===t.id);return n?(0,h.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,h.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,h.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,h.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,h.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("strong",{children:"schema:"}),(0,h.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>E({open:!1})})},we=async e=>{for(let e=0;e<$.length;e++)$[e].index=e;let t={list:N,docs_update_tag:Y.current};null!=e&&(t={param:e}),Y.current=!1;(await _.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,v.SK)("保存成功")},be=async()=>{for(let e=0;e<ne.length;e++)ne[e].index=e;(await _.XO.post("ai_system_prompts/save",{list:ne})).code===x.m.Success&&(0,v.SK)("保存成功")};return(0,h.jsxs)("div",{children:[(0,h.jsx)(a.A,{children:le(f.oV.ai_agent_setting)&&(0,h.jsx)(i.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{de(-1)}})}),(0,h.jsx)(c.jW,{isFull:!0,more:!0,children:(0,h.jsx)(c.NN,{children:(0,h.jsxs)(c.xh,{children:[(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:100,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,h.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. Only OpenAI-style AI APIs are supported. Fill in the FULL endpoint path (not just the domain), e.g. https://ark.cn-beijing.volces.com/api/v3/chat/completions\n2. The longer the conversation history, the more expensive the LLM token cost. Currently, there is no long-term memory simplification capability. You can set the system prompt to make the AI answer more concisely to save tokens\n3. When writing the model request parameter JSON, you can only write JSON in it, to configure the attributes supported by OpenAI-style AI, such as temperature, thinking (Doubao\'s deep thinking toggle), etc.\n4. You can enable "stream": true in the model request parameters to improve response speed.\n5. Deep thinking currently affects output speed. It is recommended to set { "thinking" : { "type":"disabled" } } to disable it (Doubao example).\n6. To use the AI feature to query server information, the AI needs to be able to know some commands. You need to first set command permissions for the user in user settings. It is recommended to set * to allow all commands, and then set the dangerous commands that are not allowed to be executed in the settings\n7. The model type and Become Tool are now both configured in "More Attributes → Extra Parameter Settings" using request_type / tool_mode (comments are already provided in the editor).\n8. After becoming a tool, the model will be loaded as a tool, enabling different models to serve as different roles; please do not set both it and "Enabled" to true at the same time.\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{K([...$,{note:"",open:!1,path:"",dotenv:I.CP,json_params:I.cL}])}}),(0,h.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:async()=>{await ve()}})]}),children:(0,h.jsx)(d.X,{headers:n,rows:$.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:I.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<$.length;e++)$[e].open=e===n&&t,s.push($[e]);K(s)})(0,e,n)},options:me,no_border:!0}),(0,h.jsx)(p.Sm,{type:I.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:I.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,h.jsx)(p.Sm,{value:I.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"short_text",title:"prompt",onClick:()=>{j.xK.set_value_temp($[n].sys_prompt??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{$[n].sys_prompt=e,K($),j.xK.set_value_temp(""),ve($)}})}}),(0,h.jsx)(i.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{j.xK.set_value_temp($[n].json_params),ce({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{$[n].json_params=e,K($),j.xK.set_value_temp(""),ve($)},can_format:!0})}}),(0,h.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{j.xK.set_value_temp($[n].dotenv),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{$[n].dotenv=e,K($),j.xK.set_value_temp(""),ve($)}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{$.splice(e,1),K([...$])})(n)}),(0,h.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{K([...$,{...$[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:70,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,h.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,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("stdio")}),(0,h.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,h.jsx)(d.X,{headers:Q,rows:U.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,H.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,O([...P]),H.current=!0},options:me,no_border:!0}),(0,h.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,H.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,H.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,H.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{ye(t,s)}}),(0,h.jsx)(i.rA,{icon:"settings",title:"env",onClick:()=>{j.xK.set_value_temp(t.env??""),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,O([...P]),j.xK.set_value_temp(""),H.current=!0,ge()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,H.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>_e(t)}),(0,h.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>xe(t)})]})]}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsxs)(c.VP,{widthPer:70,children:[(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>he("http")}),(0,h.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{ge()}})]}),children:(0,h.jsx)(d.X,{headers:ee,rows:Z.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,H.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,O([...P]),H.current=!0},options:me,no_border:!0}),(0,h.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,H.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"visibility",title:"查看工具",onClick:()=>{ye(t,s)}}),(0,h.jsx)(i.rA,{icon:"settings",title:"headers",onClick:()=>{j.xK.set_value_temp(t.headers??""),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,O([...P]),j.xK.set_value_temp(""),H.current=!0,ge()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,H.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>_e(t)}),(0,h.jsx)(i.rA,{icon:"copy_all",title:e("复制"),onClick:()=>xe(t)})]})]}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("系统会话提示词")})," ",(0,h.jsx)(i.rA,{icon:"info",onClick:()=>{ae('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n3. "LLM编辑开关":开启后,当用户选择了该系统提示词发起对话时,AI 将会获得一个"更新会话提示词"工具,允许 AI 在对话中对当前会话进行总结,并写入到本提示词的"LLM编辑提示词"字段(全局保存,供之后的新会话沿用),使 AI 能自我维护长期上下文。\n4. "LLM编辑提示词":可选。AI 编辑后写回的内容(可预填初始方向)。仅在"LLM编辑开关"开启时生效。\n5. "编辑规则":可选。给 LLM 的编辑要求,例如"总结时不要超过 300 token"、"用简洁的项目要点记录"等。仅在"LLM编辑开关"开启时生效。\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{se([...ne,{prompt:"",note:"",llm_prompt_enable:!1}])}}),(0,h.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{be()}})]}),children:(0,h.jsx)(d.X,{headers:te,rows:ne.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)("div",{children:(0,h.jsx)(i.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{j.xK.set_value_temp(t.prompt??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,se([...ne]),j.xK.set_value_temp(""),be()}})}})}),(0,h.jsx)(i.Ay,{checked:!!t.llm_prompt_enable,onChange:e=>{t.llm_prompt_enable=e,se([...ne])},title:e("LLM编辑开关")}),(0,h.jsx)("div",{children:(0,h.jsx)(i.rA,{icon:"edit_note",title:e("LLM编辑提示词"),onClick:()=>{j.xK.set_value_temp(t.llm_prompt??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt=e,se([...ne]),j.xK.set_value_temp(""),be()}})}})}),(0,h.jsx)("div",{children:(0,h.jsx)(i.rA,{icon:"rule",title:e("编辑规则"),onClick:()=>{j.xK.set_value_temp(t.llm_prompt_tip??""),ce({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt_tip=e,se([...ne]),j.xK.set_value_temp(""),be()}})}})}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsx)("div",{children:(0,h.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{ne.splice(e,1),se([...ne])})(n)})})];return s}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("长期记忆")})," ",(0,h.jsx)(i.rA,{icon:"info",onClick:()=>{ae(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),titleCom:(0,h.jsx)("div",{children:(0,h.jsx)(i.Ay,{checked:oe,onChange:async t=>{ie(t),await _.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,v.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,h.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,h.jsx)(i.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const s=await _.XO.get(`ai_long_term_memory_bucket/${t}`),o=s.code===x.m.Success?s.data??"":"";j.xK.set_value_temp(o),ce({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async s=>{await _.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:s}),j.xK.set_value_temp(""),(0,v.SK)(`${n} ${e("已保存")}`)}})}},t))})})]})}),(0,h.jsxs)(c.fI,{children:[(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("本地知识库")})," ",(0,h.jsx)(i.rA,{icon:"info",onClick:()=>{ae("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(i.Ay,{checked:z,onChange:async e=>{await _.jV.post("docs_on_set",{status:e}),ue(),t()},title:e("知识库开关")}),(0,h.jsx)(i.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{j.xK.set_value_temp(V.current),ce({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{V.current=e,j.xK.set_value_temp(""),we(V.current)}})}}),(0,h.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...N,{note:"",auto_load:!1,dir:""}]),Y.current=!0}}),(0,h.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>{we()}})]}),children:(0,h.jsx)(d.X,{headers:L,rows:N.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,Y.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,M([...N]),Y.current=!0},options:me,no_border:!0}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(i.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{N.splice(e,1),M([...N]),Y.current=!0})(n)}),(0,h.jsx)(i.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{pe({sub_title:"手动加载",confirm_fun:()=>{_.jV.post("ai_load_one_file",{param_path:t.dir}),(0,v.SK)("ok")}})}}),(0,h.jsx)(i.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{pe({sub_title:"从索引删除",confirm_fun:()=>{_.jV.post("ai_del",{param_path:t.dir}),(0,v.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),X&&(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsxs)(m.Zp,{title:e("知识库加载信息"),children:[(0,h.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:X?.progress}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:X?.num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:X?.char_num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,C.v7)(X?.size)}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,C.a3)(X?.consume_time_ms_len)}),(0,h.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:X?.total_num})]})})]})]})})})]})}},34299(e,t,n){n.r(t),n.d(t,{default:()=>_});n(96540);var s=n(22091),o=n(53995),i=n(18569),a=n(77979),l=n(8263),r=n(69428),c=n.n(r),d=(n(3775),n(21499)),p=n(99214),m=n(19878),u=(n(72411),n(74848));const h=new s.A({html:!0,highlight:function(e,t){if(t&&m.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${m.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${m.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${h.utils.escapeHtml(e)}</code></pre>`}});function _(e){return(0,p.VD)(),(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:h.render(e.context)}})}h.use(o.A).use(i.A).use(a.A).use(l.A).use(c()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,i)=>{const a=t[n],l=a.content.trim(),r=a.info.trim();let c="";if(r&&m.A.getLanguage(r))try{c=m.A.highlight(l,{language:r}).value}catch(t){c=e.utils.escapeHtml(l)}else try{c=m.A.highlightAuto(l).value}catch(t){c=e.utils.escapeHtml(l)}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(l)}">复制</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 a=e[n],l=a.attrIndex("href");if(l>=0){const e=a.attrs[l][1];a.attrs[l][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(86149);n.d(t,["K",0,()=>{const{t:e}=(0,s.B)();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>"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8319],{77481(e,s,t){t.d(s,{S:()=>r,X:()=>l});var n=t(96540),i=t(74848);function l(e){const[s,t]=n.useState([]);return(0,n.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,s)=>(0,i.jsx)("th",{children:e},s))})}),(0,i.jsx)("tbody",{children:s.map((s,t)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(s)},children:s.map((t,n)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:n===s.length-1?"small":"",children:t},n))},t))})]})}function r(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,s)=>(0,i.jsx)("div",{children:e},s))})}},28319(e,s,t){t.r(s),t.d(s,{default:()=>q,defaultSqlPreset:()=>S});var n=t(96540),i=t(86149),l=t(57952),r=t(85997),c=t(75725),d=t(77481),a=t(70447),o=t(61443),h=t(34843),x=t(82893),u=t(14284),j=t(23496),p=t(53459),f=t(62042),_=t(7523),m=t(78247),v=t(86090),C=t(74848);function S(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const w='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,i.B)(),{initUserInfo:s}=(0,n.useContext)(_.F),[,t]=(0,h.fp)(x.AG.editorSetting),[q]=(0,h.fp)(x.AG.user_base_info),k=(0,v.Zp)(),b=n.useRef(-1),[y,A]=(0,n.useState)([]);(0,n.useEffect)(()=>{const s=q?.user_data?.sql_preset_list;A(s?.length?[...s]:[S(e)])},[e,q?.user_data?.sql_preset_list]);const E=async()=>{const t=y.map((e,s)=>({...e,index:s})),n=await u.wm.post(j.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});n?.code===p.m.Success&&(await s(),(0,f.SK)(e("保存成功")))},L=(e,s)=>{b.current=e;const n=y[e][s]??"";m.xK.set_value_temp(n),t({model:"sql"===s?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{y[b.current][s]=e,A([...y]),m.xK.set_value_temp(""),E()}})},g=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,C.jsxs)("div",{children:[(0,C.jsx)(l.A,{children:(0,C.jsx)(r.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>k(-1)})}),(0,C.jsx)(c.jW,{isFull:!0,more:!0,children:(0,C.jsx)(c.NN,{children:(0,C.jsx)(c.xh,{children:(0,C.jsx)(c.fI,{children:(0,C.jsx)(c.VP,{widthPer:60,children:(0,C.jsx)(a.uF,{self_title:(0,C.jsx)("span",{className:"div-row",children:(0,C.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,C.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,C.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>A([...y,{note:"",sql:"",env:w}])}),(0,C.jsx)(r.rA,{icon:"save",title:e("保存"),onClick:()=>E()})]}),children:(0,C.jsx)(d.X,{headers:g,rows:y.map((s,t)=>[(0,C.jsx)("div",{children:t+1}),(0,C.jsx)(o.Sm,{value:s.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{s.note=e,A([...y])}}),(0,C.jsx)("div",{children:(0,C.jsx)(r.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>L(t,"sql")})}),(0,C.jsx)("div",{children:(0,C.jsx)(r.rA,{icon:"settings",title:e("env编辑"),onClick:()=>L(t,"env")})}),(0,C.jsx)("div",{children:(0,C.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>{y.splice(t,1),A([...y])}})})]),width:"8rem"})})})})})})})]})}t.d(s,["sqlEnvDefault",0,w])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8603],{58603(e,t,i){i.r(t),i.d(t,{default:()=>$});var n=i(96540),s=i(75725),r=i(70447),a=i(34843),l=i(82893),o=i(60096),c=i(85997),d=i(34251),m=i(34289),h=i(87361),_=i(14284),u=i(53459),x=i(61443),f=i(86149),p=i(62042),j=(i(47022),i(57952)),k=i(99214),w=i(6960),g=i(88815),v=i(78247),z=i(40505),F=i(23430),b=i(64694),C=i(86090),N=i(74848);function $(){const[e,t]=(0,n.useState)(null),i=(0,n.useRef)(""),$=(0,n.useRef)(""),[y,S]=(0,a.fp)(l.AG.prompt_card),[A,M]=(0,a.fp)(l.AG.share_sort_type),{t:G}=(0,f.B)(),[I,U]=(0,a.fp)(l.AG.selectedFileList),[V,W]=(0,a.fp)(l.AG.clickFileList),{click_file:D}=(0,v.kZ)(),[L]=(0,C.ok)(),R=(0,k.oT)(),B=(0,k.xp)(),H=(0,k.Vs)(!0),T=(0,n.useMemo)(()=>{const t=[...e?.items??[]],i=e=>Number(e.mtime??0);return A===F.t8.time_minx_max?t.sort((e,t)=>i(e)-i(t)):A===F.t8.time_max_min&&t.sort((e,t)=>i(t)-i(e)),t},[e?.items,A]),E=async()=>{const e=await _.$M.post("share",{id:i.current,token:$.current});if(e.code===u.m.Success){const n={is_dir:e.data.is_dir};n.items=e.data.files??[];for(const e of n.items)e.origin_size=e.size,e.show_mtime=e.mtime?(0,w.s)(e.mtime):"",e.size=(0,g.v7)(e.size);if(!n.is_dir){const t=e.data.files[0];n.name=t.name,n.size=t.size,n.show_mtime=t.show_mtime}localStorage.setItem(`file_share_token_${i.current}`,$.current);const s=L.get("share_preview_file_name");if(s)try{const t=e.data.files.find(e=>e.name===s);D({file_path:t.path,file_url:_.$M.getDownloadUrlV2(t.path,"share_download",{share_id:i.current,share_token:$.current}),name:t.name,size:t.origin_size,opt_shell:!0,mtime:t.mtime,not_type_tip:G("未知类型,请下载查看"),close:()=>{R("share_preview_file_name",null)}})}catch(e){(0,p.zN)(e?.message||e)}else t(n)}else e.code===u.m.need_token_share&&(localStorage.removeItem(`file_share_token_${i.current}`),(0,p.zN)("需要正确的访问token"),S({open:!0,title:"share file",confirm:()=>{S({open:!1}),E()},context_div:(0,N.jsx)("div",{className:"card-content",children:(0,N.jsx)(x.Sm,{placeholderOut:G("请输入访问token"),value:"",handleInputChange:e=>{$.current=e}})})}))};if((0,n.useEffect)(()=>{const e=(0,m.oW)(`${(0,m.GG)(h.o.share,(0,m.vX)())}`);i.current=e,$.current=localStorage.getItem(`file_share_token_${e}`),E()},[L]),!e)return(0,N.jsx)(s.jW,{isFull:!0,children:(0,N.jsx)("div",{className:"common-box common-box-center",children:"Loading..."})});return(0,N.jsxs)(n.Fragment,{children:[(0,N.jsxs)(j.A,{left_children:(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("h2",{children:["Share ",e.is_dir?"Folder":"File"]})}),children:[I.length>0&&(0,N.jsx)(c.rA,{icon:"download",title:G("下载"),onClick:function(){const e=[];for(let t=0;t<I.length;t++){const i=T[I[t]];e.push(encodeURIComponent(i.path))}const t=_.$M.getDownloadUrlV2(e,"share_download",{share_id:i.current,share_token:$.current});window.open(t)}}),e.is_dir&&(0,N.jsx)(c.rA,{icon:"grid_view",title:G("切换样式"),onClick:H}),e.is_dir&&(0,N.jsx)(c.rA,{icon:"schedule",title:A===F.t8.time_minx_max?G("时间逆序"):G("时间顺序"),onClick:()=>{const e=(0,b.jH)([F.t8.time_max_min,F.t8.time_minx_max,F.t8.defualt],A);M(e),U([]),W([])}})]}),(0,N.jsx)(s.xh,{children:(0,N.jsx)(s.jW,{isFull:!0,children:(0,N.jsx)("div",{className:"common-box ",children:e.is_dir?(0,N.jsx)(o.QW,{share:{share_id:i.current,share_token:$.current},handleContextMenu:()=>{},file_list:T,clickBlank:e=>{e.target===e.currentTarget&&(U([]),W([]))}}):(0,N.jsx)(r.uF,{children:(0,N.jsxs)("div",{style:{height:"25rem"},className:"common-box common-box-center",children:[(0,N.jsx)("div",{className:"file-icons",children:(0,N.jsx)("div",{"data-type":(0,d.uL)(e.name),"data-dir":e.is_dir,"aria-label":e.name,children:(0,N.jsx)(c.In,{icon:"",style:{fontSize:"10rem",display:"inline-block",lineHeight:1},aria_label:e.name})})}),(0,N.jsx)("div",{className:"",children:e.name}),(0,N.jsx)("div",{className:"",children:e.size}),(0,N.jsx)("div",{className:"",children:e.show_mtime}),(0,N.jsx)(c.C3,{text:"download",clickFun:()=>{const e=T[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:$.current});window.open(t)}}),(0,N.jsx)(c.C3,{text:"copy url",clickFun:()=>{const e=T[0],t=_.$M.getDownloadUrlV2(e.path,"share_download",{share_id:i.current,share_token:$.current}),n=_.$M.get_full_url(t);(0,z.lW)(n),(0,p.SK)(n)}}),(0,N.jsx)(c.C3,{text:"preview",clickFun:()=>{const e=T[0];B(e.name)}})]})})})})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8714],{47374(e,t,i){i.d(t,{e:()=>d});var o=i(96540),n=i(86090),s=i(64694),a=i(34289),l=i(61443),r=i(75725),_=i(86149),c=i(85997),f=i(74848);function d(e){let t=(0,n.zy)();const[i,d]=(0,o.useState)([]),[p,m]=(0,o.useState)("/"),[h,u]=(0,o.useState)(void 0),{t:w,i18n:y}=(0,_.B)();o.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const o=i.indexOf(e.baseRoute),n=[];if(-1!=o){t=(0,s.IO)(i.slice(0,o),e.baseRoute);const a=i.slice(o+1);for(let e=0;e<a.length;e++){const i=a[e];n.push({value:i,href:0===e?`${t}${i}/`:(0,s.IO)(n[e-1].href,i)})}m(t),d(n)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,f.jsx)("div",{className:"breadcrumbs",onClick:e=>{u(void 0!==h?void 0:"")},children:(0,f.jsx)(o.Fragment,{children:void 0===h?(0,f.jsxs)(o.Fragment,{children:[(0,f.jsx)("span",{className:"chevron",children:(0,f.jsx)(n.N_,{to:p,onClick:g,children:(0,f.jsx)(c.In,{icon:"home"})})}),i.map((e,t)=>(0,f.jsxs)("span",{className:"chevron",children:[(0,f.jsx)(c.In,{icon:"keyboard_arrow_right"}),(0,f.jsx)(n.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,f.jsx)(r.QM,{click:()=>{u(void 0)},children:(0,f.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),u(void 0)}})})})})}},78714(e,t,i){i.r(t),i.d(t,{default:()=>U});var o=i(96540),n=i(47374),s=i(34843),a=i(82893),l=i(14284),r=i(86090),_=i(57952),c=i(18538),f=i(34289),d=i(53459),p=i(99214),m=i(61443),h=i(47022),u=i(62042),w=i(86149),y=i(7523),g=i(78247),v=i(88815),x=i(6960),k=i(47071),j=i(14944),G=i(92275),A=i(23430);var C=i(34251),b=i(60096),z=i(85997),P=i(23496),F=i(12730),M=i(75725),$=i(70447),S=i(87361),D=i(40505),I=i(74848);let X={};function E(){const{t:e}=(0,w.B)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:n}=(0,g.MH)(),[_,d]=(0,s.fp)(a.AG.nowFileList),[m,v]=(0,s.fp)(a.AG.uploadFiles),[x,k]=(0,s.fp)(a.AG.showPrompt),[b,P]=(0,s.fp)(a.AG.selectedFileList),[D,E]=(0,s.fp)(a.AG.copyedFileList),[K,Y]=(0,s.fp)(a.AG.cutedFileList),[L,R]=(0,s.fp)(a.AG.selectedFileList),[H,N]=(0,s.fp)(a.AG.clickFileList),[B,U]=(0,s.fp)(a.AG.fileShellShow),[W,O]=(0,s.fp)(a.AG.file_root_list),[Z,q]=(0,s.fp)(a.AG.file_root_index),[V,T]=(0,o.useState)(void 0),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(y.F),[le,re]=(0,s.fp)(a.AG.user_base_info),{click_file:_e}=(0,g.kZ)(),[ce,fe]=(0,s.fp)(a.AG.prompt_card),de=(0,o.useMemo)(()=>_.files.reduce((e,t)=>e+(t.type!==h.Iw.folder?1:0),0),[_]),pe=(0,o.useMemo)(()=>_.files.reduce((e,t)=>e+(t.type===h.Iw.folder?1:0),0)+(_.folders?.length??0),[_]);function me(e){(0,u.SK)(e)}(0,o.useEffect)(()=>{X={}},[t]),(0,o.useEffect)(()=>()=>{U({show:!1,path:""})},[]);const he=(0,p.Vs)(),ue=t=>{fe({open:!0,title:e("信息"),context_div:(0,I.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,I.jsx)(M.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,I.jsx)(M.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,I.jsx)(M.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,I.jsx)(M.Yh,{left:`${e("文件夹数")}`,right:pe}),(0,I.jsx)(M.Yh,{left:`${e("文件数")}`,right:de}),(0,I.jsx)(M.Yh,{left:`${e("当前位置")}`,right:(0,I.jsx)($.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{j.ws.removeMsg(G.HK.file_info)}})};return(0,I.jsxs)(o.Fragment,{children:[b.length>0&&(0,I.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{k({show:!0,type:c.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),b.length>0&&(0,I.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(_,b);E(e.map(e=>(0,p.Ok)(e.name))),Y([]),me("已复制")}}),b.length>0&&(0,I.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(_,b);Y(e.map(e=>(0,p.Ok)(e.name))),E([]),me("已剪切")}}),(D.length>0||K.length>0)&&(0,I.jsx)(z.rA,{onClick:function(){k({show:!0,type:c.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:D.length+K.length}),b.length>0&&(0,I.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(_,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),b.length>0&&(0,I.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(_,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?k({show:!0,type:c.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,u.zN)("没有选中")}}),1===b.length&&(0,I.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){k({show:!0,type:c.PromptEnum.FileRename,overlay:!0,data:{}})}}),ne&&(0,I.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{te(!ee)}}),(0,I.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){B.show?U({show:!1,path:""}):U({show:!0,path:(0,f.GG)("file",(0,f.vX)())})}}),n(A.oV.share_file)&&(0,I.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${S.o.share_list_setting_page}`)}}),(0,I.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:he}),(0,I.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){k({show:!0,type:c.PromptEnum.DirNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,I.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){k({show:!0,type:c.PromptEnum.FileNew,overlay:!0,data:{dir:(0,f.GG)("file",(0,f.vX)())}})}}),(0,I.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{k({show:!0,type:c.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const o=[],n=new Set;for(let e=0;e<t.length;e++){const s=t[e],a=i?s.webkitRelativePath:`${s.webkitRelativePath}${s.name}`;s.fullPath=a,i&&n.add((0,F.S)(a)),o.push(s)}const s=[];if(i)for(const e of n)s.push({isDir:!0,fullPath:e,name:e});s.push(...o),v(s),k({show:!0,type:c.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,I.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!X.now_absolute_path){j.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(X={...X,...i},j.ws.removeMsg(G.HK.file_info),ue(X))});const t=await j.ws.sendData(G.HK.file_info,{type:h.Iw.folder,path:(0,f.GG)("file",(0,f.vX)())});e=t.context,X=e,ue(X)}ue(X)}}),(0,I.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory,o.items=W,o.item_pre_value=Z,o.textClick=async t=>{if(-1===t)return i(`${S.o.setting_private_env_setting}`),k({data:void 0,overlay:!1,type:"",show:!1}),void(0,u.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await l.$M.post("base_switch",{root_index:e}),await ae(),i("/file/"),R([]),N([])})(t),k({data:void 0,overlay:!1,type:"",show:!1})},k({show:!0,type:c.PromptEnum.FileMenu,overlay:!1,data:o})}})]})}var K=i(2543),Y=i(21499),L=i(64694);const R=o.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(()=>i(63659))),H=o.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(()=>i(81636)));let N,B="";function U(){const[e,t]=(0,s.fp)(a.AG.editorSetting),[i,u]=(0,s.fp)(a.AG.file_preview),{t:F}=(0,w.B)();let M=(0,r.zy)();const $=(0,r.Zp)(),[X,U]=(0,s.fp)(a.AG.nowFileList),[W,O]=(0,s.fp)(a.AG.showPrompt),[Z,q]=(0,s.fp)(a.AG.selectedFileList),[V,T]=(0,s.fp)(a.AG.clickFileList),[J,Q]=(0,s.fp)(a.AG.fileShellShow),[ee,te]=(0,o.useState)(""),[ie,oe]=(0,s.fp)(a.AG.workflow_show),[ne,se]=(0,s.fp)(a.AG.workflow_realtime_show),[ae,le]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:re}=(0,o.useContext)(y.F),[_e,ce]=(0,s.fp)(a.AG.user_base_info),{click_file:fe}=(0,g.kZ)(),[de,pe]=(0,s.fp)(a.AG.to_running_files),[me,he]=(0,s.fp)(a.AG.file_page),[ue]=(0,s.fp)(a.AG.blank_search_mode),[we,ye]=(0,s.fp)(a.AG.blank_search_mode_for_temp),ge=function(){const[e,t]=(0,s.fp)(a.AG.user_base_info),{t:i}=(0,w.B)(),{check_user_auth:n}=(0,g.MH)(),[_,d]=(0,s.fp)(a.AG.router_jump),m=(0,r.Zp)(),{initUserInfo:u}=(0,o.useContext)(y.F),[v,x]=(0,s.fp)(a.AG.nowFileList),[k,b]=(0,s.fp)(a.AG.showPrompt),[z,F]=(0,s.fp)(a.AG.fileShellShow),[M,$]=(0,s.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory;const s=[{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,I.jsx)("span",{style:(0,D.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("分页滚动加载文件")}),v:A.yM.pagination}],_=[{r:(0,I.jsx)("span",{style:(0,D.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,I.jsx)("span",{style:(0,D.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:s},{r:(0,I.jsx)("span",{style:(0,D.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:_},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,I.jsx)("span",{style:(0,D.ok)(M),children:i("以空白搜索模式打开目录")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];v?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),n(A.oV.code_resource)&&w.push({r:i("添加http资源根目录"),v:"code_resource"}),n(A.oV.http_proxy)&&w.push({r:i("在此目录下载http资源"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),o.items=w,o.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,f.GG)("file",(0,f.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,f.GG)("file",(0,f.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return d({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/setting/customer_router/")}if("http_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,f.GG)("file",(0,f.vX)())});return d({http_download_map_path:e.context.now_absolute_path}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/proxy/http/")}if("zoom_adjust"===e)return b({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{b({show:!0,type:c.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",F({show:!0,path:(0,f.GG)("file",(0,f.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return $(!M),void b({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(P.s.user_save_private_attr,{type:e,...t}),await u(),b({data:void 0,overlay:!1,type:"",show:!1}),m((0,f.vX)())},b({show:!0,type:c.PromptEnum.FileMenu,overlay:!1,data:o})}}(),ve=async()=>{const e=new k.Nd;e.dir_path=`${(0,f.GG)("file",(0,f.vX)())}`,j.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);pe(new Set(t.running_file_list))}}),await j.ws.sendData(G.HK.workflow_realtime,e)},xe=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,v.v7)(i.size),_e.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,Y.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{ve()})),i.name===k.SB&&(t=!0);for(const i of e.folders??[])_e.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,Y.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",i.name===k.SB&&(t=!0);le(t)};(0,o.useEffect)(()=>async()=>{pe(new Set)},[]);const ke=()=>{(async()=>{const e=(0,f.GG)("file",(0,f.vX)());if(ue||we)return;let t;if(_e.user_data.file_list_pagination_mode===A.yM.pagination){if(B!==e){if(B=e,1!==me.page_num)return void he({page_size:me.page_size,page_num:1})}else if(me.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:me.page_num,page_size:me.page_size}),t.code!==d.m.Success)return;const i=t.data;return xe(i),i.files?.length?(U(e=>{const t=(0,K.cloneDeep)(1===me.page_num?i.files:[...e?.files??[],...i.files]),o={...e,files:t};return(0,p.yC)(o,_e.user_data.dir_show_type),o}),void(N=t.data)):void he({page_size:me.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==d.m.Success)return;const i=t.data;(0,p.yC)(i,_e.user_data.dir_show_type),xe(t.data),U(t.data),N=t.data})(),t({open:!1}),u({open:!1}),le(!1)};(0,o.useEffect)(()=>{ke()},[M,me]);const je=e=>{e.target===e.currentTarget&&(q([]),T([]))};return(0,I.jsxs)(o.Fragment,{children:[(0,I.jsxs)(_.A,{left_children:(0,I.jsx)(m.$Z,{handleEnterPress:async()=>{if(ue||we){if(q([]),T([]),!ee||!ee.trim())return void U({files:[],folders:[]});const e=(0,f.GG)("file",(0,f.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ee.trim()});if(t.code!==d.m.Success)return;const i=t.data;return(0,p.yC)(i,_e.user_data.dir_show_type),xe(i),U(i),void(N=i)}if(!N)return;q([]),T([]);const e=[],t=[];for(const t of N.files??[])t.name.includes(ee)&&e.push(t);for(const e of N.folders??[])e.name.includes(ee)&&t.push(e);U({files:e,folders:t})},placeholder:F("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleInputChange:e=>{te(e)},max_width:"25em"}),children:[(0,I.jsx)("div",{className:"mobile-context-btn",children:(0,I.jsx)(z.rA,{icon:"more_horiz",title:F("右键"),onClick:()=>{const e=Z[Z.length-1];if(void 0!==e){const t=[...X.folders??[],...X.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],o=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},n={preventDefault:()=>{},stopPropagation:()=>{},clientX:o.left+10,clientY:o.bottom??100},s=new C.ik;s.path=(0,L.IO)((0,f.vX)(),t.name),s.filename=t.name,s.x=n.clientX,s.y=n.clientY,s.type=t.type===h.Iw.folder?h.Iw.folder:(0,C.uL)(t.name),s.size=t.origin_size,O({show:!0,type:c.PromptEnum.FileMenu,overlay:!1,data:s})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};ge(e)}}})}),(0,I.jsx)(E,{})]}),(0,I.jsx)(n.e,{baseRoute:"file",clickFun:function(){if(q([]),T([]),_e.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),he({page_size:me.page_size,page_num:1})}},input_path_enter:e=>{var t;q([]),T([]),U({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?$(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let o=e.length-1-t;o>=0;o--)if(e[o]===i)return e.substring(0,o+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,f.vX)(),e)):(e=e.replace(0===(t=_e.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),$(e))}}),_e.user_data.file_list_pagination_mode===A.yM.pagination?(0,I.jsx)(b.$J,{handleContextMenu:ge,clickBlank:je,list:X.files}):(0,I.jsx)(b.t$,{handleContextMenu:ge,file_list:X.files,folder_list:X.folders,clickBlank:je}),ie&&(0,I.jsx)(R,{}),ne.open&&(0,I.jsx)(H,{})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8765],{60096(e,i,t){t.d(i,{QW:()=>z,Ic:()=>b,t$:()=>F,$J:()=>$});var n=t(96540),s=t(47022),l=t(34843),a=t(82893),o=t(86090),r=t(64694),d=t(14284),c=t(34289),f=t(23430),m=t(62042),h=t(99214),p=t(85997),u=t(86149),_=t(74848);function x(e){const[i,t]=(0,l.fp)(a.AG.selectedFileList),[n,o]=(0,l.fp)(a.AG.nowFileList),[c,x]=(0,l.fp)(a.AG.confirm),[g,w]=(0,l.fp)(a.AG.user_base_info),{t:y}=(0,u.B)();return(0,_.jsxs)("div",{...e.extraAttr,onClick:()=>{!async function(i){e.click&&e.click(i,e.name)}(e.index)},className:"item",role:"button","data-type":e.isLink?"invalid_link":e.type,"data-dir":!e.type||e.type===s.Iw.folder,"aria-selected":null!==(0,r.kW)(i,e.index),"aria-label":e.name,style:{"--filewidth":e.itemWidth??"33%"},onDragStart:n=>{return s=e.index,void(i.find(e=>e===s)||t([...i,s]));var s},onDrop:t=>((t,l)=>{const a=t.dataTransfer;let o,r=!1;for(let e=0;e<a.items.length;e++)if("file"===a.items[e].kind){r=!0;break}if(r)return;if(g?.user_data?.file_list_pagination_mode===f.yM.pagination){if(o=n.files[l],n.files[l]?.type!==s.Iw.folder)return}else if(o=n.folders[l],n.folders.length<=l)return;(0,h.ib)(n,i).some(e=>e?.name===o?.name)?(0,m.zN)(y("不能将文件夹移动到自己里面")):x({open:!0,title:`确定将文件移动并覆盖到${o?.name}吗?`,handle:async()=>{await e.draggable_handle(o?.name)}})})(t,e.index),draggable:void 0!==e.draggable_handle,children:[void 0===e.icon&&(0,_.jsx)("div",{children:e.type!==s.Iw.image||null==e.path||g?.user_data?.not_pre_show_image?(0,_.jsx)(p.In,{icon:""}):(0,_.jsx)("img",{loading:"lazy",src:d.$M.getDownloadUrl(e.path,{mtime:e.mtime,cache:1}),alt:e.name})}),void 0!==e.icon&&(0,_.jsx)("div",{className:"rotating-div",children:(0,_.jsx)("span",{className:"material-icons",children:e.icon})}),(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{className:"name",children:e.name}),e.size?(0,_.jsx)("p",{children:e.size}):(0,_.jsx)("p",{children:"—"}),(0,_.jsx)("p",{children:e.show_mtime})]}),e.children]})}var g=t(18538),w=t(34251),y=t(78247);function k(e){const[i,t]=(0,l.fp)(a.AG.selectedFileList),[n,f]=(0,l.fp)(a.AG.nowFileList),[m,p]=(0,l.fp)(a.AG.confirm),[k,v]=(0,l.fp)(a.AG.file_page),[A,j]=(0,l.fp)(a.AG.enterKey),{click_file:G}=(0,y.kZ)(),{t:z}=(0,u.B)(),b=(0,o.Zp)();(0,o.zy)();const F=(0,h.A9)(),{clickDouble:$}=(0,h.xI)(),[C,I]=(0,l.fp)(a.AG.showPrompt);return(0,_.jsx)(x,{extraAttr:{onContextMenu:t=>{((t,n,l,a)=>{t.preventDefault(),t.stopPropagation();const o=new w.ik;o.path=(0,r.IO)((0,c.vX)(),n),o.filename=n,o.x=t.clientX,o.y=t.clientY,o.type=l?s.Iw.folder:(0,w.uL)(n),o.size=a,o.useSelectedList=i.includes(e.index),I({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:o})})(t,e.name,e.type===s.Iw.folder,e.origin_size)}},draggable_handle:async e=>{const s=(0,h.ib)(n,i).map(e=>(0,h.Ok)(e.name));await d.$M.post("cut",{files:s,to:`${(0,c.GG)("file",(0,c.vX)())}/${e}`});t([]),p({open:!1,handle:null}),b((0,c.vX)())},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,isLink:e.isLink,path:e.path,icon:e.icon,show_mtime:e.show_mtime,click:(n,l)=>{if($(n,()=>{e.type===s.Iw.folder?F(l):G({name:l,size:e.origin_size,opt_shell:!0,mtime:e.mtime})}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===A)t([...i,n]);else if("shift"===A){const{max:e,min:s}=(0,r.a7)(i),l=[];if(n>=e)for(let i=e;i<=n;i++)l.push(i);else for(let e=s;e>=n;e--)l.push(e);t(l)}else t([n])},itemWidth:e.itemWidth})}t(38240);var v=t(64405),A=t(88815);function j(e){const[i,t]=(0,l.fp)(a.AG.selectedFileList),[n,f]=(0,l.fp)(a.AG.editorSetting),[p,g]=(0,l.fp)(a.AG.shellNowDir),[w,k]=(0,l.fp)(a.AG.sshInfo),[j,G]=(0,l.fp)(a.AG.nowFileList),[z,b]=(0,l.fp)(a.AG.enterKey),[F,$]=(0,l.fp)(a.AG.confirm),C=(0,o.Zp)(),{t:I}=(0,u.B)(),{clickDouble:W}=(0,h.xI)();return(0,_.jsx)(x,{draggable_handle:async n=>{const s=new v.x;Object.assign(s,w),s.target=(0,r.HS)(...p,n);const l=(0,h.ib)(j,i).map(e=>(0,r.HS)(...p,e.name));for(const e of l)if(s.source=e,!await d.Fg.post("move",s))return!1;t([]),$({open:!1,handle:null}),await e.fileHandler()},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(n,l)=>{if(W(n,()=>{if(e.type===s.Iw.folder){const e=new v.x;return e.key=w.key,e.dir=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${l}`,C((0,r.IO)((0,c.vX)(),l)),t([]),void G({files:[],folders:[]})}const i=async()=>{const i=new v.x;i.key=w.key,i.file=`/${(0,c.GG)("remoteShell",(0,c.vX)())}${l}`;const t=await d.Fg.post("get/file/text",i);let n;l.endsWith(s.Iw.workflow_act)?n="ace/mode/yaml":(l.endsWith(s.Iw.draw)||l.endsWith(s.Iw.excalidraw))&&(n="ace/mode/json"),f({model:n,open:!0,fileName:e.name,save:async e=>{i.context=e;0===(await d.Fg.post("update/file/text",i)).code&&(y.xK.set_value_temp(""),(0,m.SK)("success"))}}),y.xK.set_value_temp(t.data)};"number"==typeof e.origin_size&&e.origin_size>A.o5?$({open:!0,title:I("提示"),sub_title:"文件超过20MB了确定要打开吗?",handle:async()=>{$({open:!1,handle:null}),await i()}}):i()}))return;if(null!==(0,r.kW)(i,n))t((0,r.P1)(i,n));else if("ctrl"===z)t([...i,n]);else if("shift"===z){const{max:e,min:s}=(0,r.a7)(i),l=[];if(n>=e)for(let i=e;i<=n;i++)l.push(i);else for(let e=s;e>=n;e--)l.push(e);t(l)}else t([n])}})}function G(e){const[i,t]=(0,l.fp)(a.AG.selectedFileList),[n,o]=(0,l.fp)(a.AG.enterKey),{click_file:c}=(0,y.kZ)(),[f,m]=(0,l.fp)(a.AG.nowFileList),{t:p}=(0,u.B)(),[k,v]=(0,l.fp)(a.AG.showPrompt),A=((0,h.oT)(),(0,h.xp)()),{clickDouble:j}=(0,h.xI)();return(0,_.jsx)(x,{extraAttr:{onContextMenu:i=>{((i,t,n,l)=>{i.preventDefault(),i.stopPropagation();const a=new w.ik,o=e.item_list;for(const e of o)if(e.name===t){a.path=e.path;break}a.is_share=!0,a.filename=t,a.x=i.clientX,a.y=i.clientY,a.type=n?s.Iw.folder:(0,w.uL)(t),a.size=l,a.share_token=e.share.share_token,a.share_id=e.share.share_id,v({show:!0,type:g.PromptEnum.FileMenu,overlay:!1,data:a})})(i,e.name,e.type===s.Iw.folder,e.origin_size)}},name:e.name,index:e.index,mtime:e.mtime,size:e.size,type:e.type,itemWidth:e.itemWidth,show_mtime:e.show_mtime,click:(l,a)=>{if(j(l,()=>{e.type!==s.Iw.folder&&(A(a)||c({file_path:e.item_list[l].path,file_url:d.$M.getDownloadUrlV2(e.item_list[l].path,"share_download",{share_id:e.share.share_id,share_token:e.share.share_token}),name:a,size:e.origin_size,opt_shell:!0,mtime:e.mtime,not_type_tip:p("未知类型,请下载查看")}))}))return;if(null!==(0,r.kW)(i,l))t((0,r.P1)(i,l));else if("ctrl"===n)t([...i,l]);else if("shift"===n){const{max:e,min:n}=(0,r.a7)(i),s=[];if(l>=e)for(let i=e;i<=l;i++)s.push(i);else for(let e=n;e>=l;e--)s.push(e);t(s)}else t([l])}})}function z({handleContextMenu:e,file_list:i,clickBlank:t,share:s}){const[o,r]=(0,l.fp)(a.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.B)(),f=(0,h.OJ)(),{file_is_running:m}=(0,y.hg)();return(0,h.UK)(i,[],d),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${o?.user_data?.file_list_show_type??""}`,ref:d,children:(0,_.jsx)("div",{onClick:t,children:i.map((e,t)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(G,{share:s,item_list:i,icon:m(e.name)?"refresh":void 0,itemWidth:f,index:t+0,...e})},t+0))})})}function b({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:s,fileHandler:o}){const[r,d]=(0,l.fp)(a.AG.user_base_info),c=(0,n.useRef)(null),{t:f}=(0,u.B)(),m=(0,h.OJ)(),{file_is_running:p}=(0,y.hg)(),[x,w]=(0,l.fp)(a.AG.fileShellShow),k=(0,n.useMemo)(()=>t?.length??0,[t]);return(0,h.ei)(c,g.PromptEnum.SshUpload),(0,h.UK)(i,t,c),(0,n.useEffect)(()=>()=>{x.show&&w({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem"},className:`mosaic file-icons ${r?.user_data?.file_list_show_type??""}`,ref:c,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:f("文件夹")}),t&&(0,_.jsx)("div",{onClick:s,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(j,{fileHandler:o,itemWidth:m,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:s,children:f("文件")}),i&&(0,_.jsx)("div",{onClick:s,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(j,{fileHandler:o,icon:p(e.name)?"refresh":void 0,itemWidth:m,index:i+k,...e})},i+k))})]})}function F({handleContextMenu:e,file_list:i,folder_list:t,clickBlank:s}){const[o,r]=(0,l.fp)(a.AG.user_base_info),d=(0,n.useRef)(null),{t:c}=(0,u.B)(),[f]=(0,l.fp)(a.AG.zoom_style_by_percent),m=(0,h.OJ)(),{file_is_running:p}=(0,y.hg)(),[x,w]=(0,l.fp)(a.AG.fileShellShow),v=(0,n.useMemo)(()=>t?.length??0,[t]),A=(0,h.pi)(f);return(0,h.ei)(d,g.PromptEnum.FilesUpload),(0,h.UK)(i,t,d),(0,n.useEffect)(()=>()=>{x.show&&w({show:!1,path:""})},[]),(0,_.jsxs)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:A.fontSize},className:`mosaic file-icons ${o?.user_data?.file_list_show_type??""}`,ref:d,children:[t&&t.length>0&&(0,_.jsx)("h2",{children:c("文件夹")}),t&&(0,_.jsx)("div",{onClick:s,children:t.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{itemWidth:m,index:i,...e})},i))}),i&&i.length>0&&(0,_.jsx)("h2",{onClick:s,children:c("文件")}),i&&(0,_.jsx)("div",{onClick:s,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{icon:p(e.name)?"refresh":void 0,itemWidth:m,index:i+v,...e})},i+v))})]})}function $({handleContextMenu:e,list:i,clickBlank:t}){const[s,o]=(0,l.fp)(a.AG.user_base_info),r=(0,n.useRef)(null),{t:d}=(0,u.B)(),[c]=(0,l.fp)(a.AG.zoom_style_by_percent),f=(0,h.OJ)(),{file_is_running:m}=(0,y.hg)(),[p,x]=(0,l.fp)(a.AG.fileShellShow),[w,v]=(0,l.fp)(a.AG.enterKey),[A,j]=(0,l.fp)(a.AG.selectedFileList),[G,z]=(0,l.fp)(a.AG.file_page),b=(0,h.pi)(c);return(0,h.UK)(i,[],r),(0,h.ei)(r,g.PromptEnum.FilesUpload),(0,h.SQ)(r,()=>{z(e=>e.page_num<0?e:{page_size:e.page_size,page_num:e.page_num+1})},()=>{}),(0,n.useEffect)(()=>()=>{p.show&&x({show:!1,path:""})},[]),(0,_.jsx)("div",{onContextMenu:e,id:"listing",style:{paddingBottom:"10rem",fontSize:b.fontSize},className:`mosaic file-icons ${s?.user_data?.file_list_show_type??""}`,ref:r,children:i&&(0,_.jsx)("div",{onClick:t,children:i.map((e,i)=>(0,_.jsx)(n.Fragment,{children:(0,_.jsx)(k,{icon:m(e.name)?"refresh":void 0,itemWidth:f,index:i,...e})},i))})})}},6960(e,i,t){t.d(i,{s:()=>a});var n=t(72635);const s=1440,l=525600;function a(e){e=e>1e12?e:1e3*e;const i=Date.now(),t=Math.abs(i-e)/6e4;return t<1?n.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${n.Ay.t("分钟前")}`:t<s?`${(t/60).toFixed(0)} ${n.Ay.t("小时前")}`:t<43200?`${(t/s).toFixed(0)} ${n.Ay.t("天前")}`:t<l?`${(t/43200).toFixed(0)} ${n.Ay.t("月前")}`:`${(t/l).toFixed(0)} ${n.Ay.t("年前")}`}}}]);
|