filecat 7.29.0 → 7.30.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.82d4f4b923f523981b07.js +1 -0
- package/build/dist/1636.990a3f2ff89900dded98.js +1 -0
- package/build/dist/2136.19a34f9f77082df382ea.js +1 -0
- package/build/dist/2502.0e9f512987f1214644ce.js +1 -0
- package/build/dist/259.f8c17a36a328425c15fa.js +1 -0
- package/build/dist/{3355.3ed43013cd202cde76e1.js → 3355.fde87101c5a125b8b35f.js} +1 -1
- package/build/dist/3551.704e2e9b4f6cbdf10d19.js +1 -0
- package/build/dist/3659.0789a31dfe6ca2d1e240.js +1 -0
- package/build/dist/{4598.b050a29f3e335bf45c16.js → 4598.0a8c8a04d718951d6692.js} +1 -1
- package/build/dist/{47.a9fd7eb25bf4b15f4cf3.js → 47.1990e4d7ad6e60650aa0.js} +1 -1
- package/build/dist/{5272.611514ef844840dccbb3.js → 5272.a1a75285ad5fe14a4df6.js} +1 -1
- package/build/dist/{6097.4ae3aedf0654494e026d.js → 6097.9ec647296d88d8025198.js} +1 -1
- package/build/dist/6247.f67824d7abd4170c0fbc.js +1 -0
- package/build/dist/6439.638b2b0a12e63ab6ee5b.js +1 -0
- package/build/dist/676.61682e838264c84dacab.js +1 -0
- package/build/dist/6805.06129b472890b825abfe.js +1 -0
- package/build/dist/6919.d048de2bcdec75a3c6d9.js +1 -0
- package/build/dist/7066.2ac2242ba86d6466bc2f.js +1 -0
- package/build/dist/{7678.b8bdcab698ebfd6ab8a5.js → 7678.7ad7da19e968caed935a.js} +1 -1
- package/build/dist/{7873.0938199b862e0a30c168.js → 7873.e9f56d6e875e2cec5512.js} +1 -1
- package/build/dist/8319.93ec1e6ae15d07b98704.js +1 -0
- package/build/dist/8603.70880ac558dcfe09f9e0.js +1 -0
- package/build/dist/8649.fc41337cba5ec4e0c513.js +1 -0
- package/build/dist/{9260.88b1349d93119c70c4bc.js → 9260.da294480ffc3c674bde0.js} +1 -1
- package/build/dist/9546.48d1545833924e3c1bc0.js +1 -0
- package/build/dist/{9765.da4ef6f16c56d5c13510.js → 9765.7f8eaa343038f1f21810.js} +1 -1
- package/build/dist/index.html +1 -1
- package/build/dist/main.95960d62d7d713b49e0d.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/1448.374f0fb8ecab79f1b6a8.js +0 -1
- package/build/dist/1636.72a76243c352d7b14b86.js +0 -1
- package/build/dist/2136.49957ff61f304afad25f.js +0 -1
- package/build/dist/2502.c8f9f2c98369af4a1a3c.js +0 -1
- package/build/dist/2547.33fc8794c01a9a98acb8.js +0 -1
- package/build/dist/259.73d375f52940d831b517.js +0 -1
- package/build/dist/3551.f0ec20719cd49ad767de.js +0 -1
- package/build/dist/3659.6d636b2698d3b12a31b9.js +0 -1
- package/build/dist/6247.3fcb34a00b0a6e794a64.js +0 -1
- package/build/dist/6439.6ad9e05effce620ca735.js +0 -1
- package/build/dist/676.591751625c1b7f959f6b.js +0 -1
- package/build/dist/6805.3a1b6695ba63b17d39b5.js +0 -1
- package/build/dist/6919.a43ce76cadcdc5759ced.js +0 -1
- package/build/dist/8319.78e87b11f05a2d8f9d18.js +0 -1
- package/build/dist/8603.8fd3023b066ebaf71bfc.js +0 -1
- package/build/dist/8649.72e48164e0d4db52953e.js +0 -1
- package/build/dist/9546.f1c334f1614f2cdcc91b.js +0 -1
- package/build/dist/main.7f86da4174fe9b6d032b.js +0 -2
- /package/build/dist/{main.7f86da4174fe9b6d032b.js.LICENSE.txt → main.95960d62d7d713b49e0d.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1448],{11448(e,t,i){i.r(t),i.d(t,{RebotCardContainer:()=>f,default:()=>y});var l=i(22022),s=i(96540),a=i(85997),n=i(4412),r=i(75725),c=i(61443),d=i(7572),o=i(14284),p=i(53459),h=i(62042),x=i(78247),j=i(23430),m=i(61973),_=i(92350),u=i(74848);const b={qq:{key:"qq",label:"QQ 机器人",icon:"QQ",color:"#12B7F5",fields:[{key:"appId",label:"AppId",type:"text",placeholder:"请输入机器人 AppId",required:!0},{key:"clientSecret",label:"密钥",type:"password",placeholder:"请输入机器人密钥",required:!0}]},dingtalk:{key:"dingtalk",label:"钉钉机器人",icon:"钉钉",color:"#0089FF",fields:[{key:"appId",label:"ClientId (AppKey)",type:"text",placeholder:"请输入应用 ClientId",required:!0},{key:"clientSecret",label:"ClientSecret (AppSecret)",type:"password",placeholder:"请输入应用 ClientSecret",required:!0}]},wecom:{key:"wecom",label:"企业微信机器人",icon:"企业微信",color:"#07C160",fields:[{key:"appId",label:"botId",type:"text",placeholder:"请输入机器人 botId",required:!0},{key:"clientSecret",label:"Secret",type:"password",placeholder:"请输入机器人 Secret",required:!0}]},lark:{key:"lark",label:"飞书机器人",icon:"飞书",color:"#3370FF",fields:[{key:"appId",label:"App ID",type:"text",placeholder:"请输入应用 App ID",required:!0},{key:"clientSecret",label:"App Secret",type:"password",placeholder:"请输入应用 App Secret",required:!0}]}},g=Object.entries(b).map(([e,t])=>({value:e,title:t.label,color:t.color}));function f(e){const{t}=(0,l.Bd)(),[i,n]=(0,s.useState)(!1),[r,d]=(0,s.useState)(!1),o=(t,i)=>{const l=[...e.items];l[t]={...l[t],...i},e.setItems(l)},p=t=>{const i=[...e.items];i.splice(t,1),e.setItems(i)},h=t=>{e.setItems([...e.items,{...e.items[t],open:!1,name:(e.items[t].name||"")+" (副本)"}])};return(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("div",{className:"airebot-setting__toolbar",children:!1!==e.have_auth_edit&&(0,u.jsxs)(u.Fragment,{children:[i?(0,u.jsxs)("div",{className:"airebot-setting__add-select",children:[(0,u.jsx)(c.l6,{options:g,defaultValue:"qq",onChange:t=>{return i=t,e.setItems([...e.items,{platform:i,name:"",open:!1,appId:"",clientSecret:"",note:""}]),void n(!1);var i},width:"180px"}),(0,u.jsx)(a.rA,{icon:"cancel",title:t("取消"),onClick:()=>n(!1)})]}):(0,u.jsx)(a.rA,{icon:"add",title:t("添加机器人"),onClick:()=>n(!0)}),(0,u.jsx)(a.rA,{icon:"save",title:t(r?"保存中...":"保存"),onClick:()=>{r||(async()=>{d(!0),await e.save(),d(!1)})()}})]})}),0===e.items.length?(0,u.jsxs)("div",{className:"airebot-setting__empty",children:[(0,u.jsx)("span",{className:"material-symbols-outlined airebot-setting__empty-icon",children:"smart_toy"}),(0,u.jsx)("p",{children:t("还没有配置任何机器人")}),(0,u.jsx)("p",{className:"airebot-setting__empty-hint",children:t("点击上方「添加机器人」按钮来开始配置")})]}):(0,u.jsx)("div",{className:"airebot-setting__grid",children:e.items.map((e,t)=>(0,u.jsx)(v,{item:e,index:t,onChange:o,onDelete:p,onCopy:h},t))})]})}const v=({item:e,index:t,onChange:i,onDelete:s,onCopy:n})=>{const{t:r}=(0,l.Bd)(),o=b[e.platform]??b.qq,p=e._status||"disconnected";e.open;return(0,u.jsx)(d.Zp,{self_title:(0,u.jsx)("div",{className:"airebot-setting__card-header",children:(0,u.jsx)("span",{className:"material-symbols-outlined airebot-setting__card-icon",style:{color:o.color},children:o.icon})}),rightTopCom:(0,u.jsxs)("div",{className:"airebot-setting__card-actions",children:[(0,u.jsx)(a.Ay,{checked:!!e.open,onChange:e=>i(t,{open:e})}),(0,u.jsx)(a.rA,{icon:"content_copy",title:r("复制"),onClick:()=>n(t)}),(0,u.jsx)(a.rA,{icon:"delete",title:r("删除"),onClick:()=>s(t)})]}),children:(0,u.jsxs)("div",{className:"airebot-setting__card-fields",children:[(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("平台")}),(0,u.jsx)(c.l6,{options:g,value:e.platform,onChange:e=>i(t,{platform:e}),width:"100%"})]}),(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("名称")}),(0,u.jsx)(c.Sm,{value:e.name||"",handleInputChange:e=>i(t,{name:e}),placeholder:r("给机器人起个名字")})]}),o.fields.map(l=>{const s=e[l.key]??"";return(0,u.jsxs)("div",{className:"airebot-setting__field",children:[(0,u.jsxs)("label",{className:"airebot-setting__field-label",children:[l.label,l.required&&(0,u.jsx)("span",{className:"airebot-setting__field-required",children:"*"})]}),(0,u.jsx)(c.Sm,{type:l.type,value:s,handleInputChange:e=>i(t,{[l.key]:e}),placeholder:l.placeholder})]},l.key)}),(0,u.jsxs)("div",{className:"airebot-setting__field ",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("模型编号")}),(0,u.jsx)(c.Sm,{value:e.model_index,handleInputChange:e=>i(t,{model_index:e}),placeholder:r("使用指定模型(可选)")})]}),(0,u.jsxs)("div",{className:"airebot-setting__field ",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("用户id")}),(0,u.jsx)(c.Sm,{value:e.user_id||"",handleInputChange:e=>i(t,{user_id:e}),placeholder:r("默认使用root账户(继承权限,可选)")})]}),(0,u.jsxs)("div",{className:"airebot-setting__field airebot-setting__field-full",children:[(0,u.jsx)("label",{className:"airebot-setting__field-label",children:r("备注")}),(0,u.jsx)(c.Sm,{value:e.note||"",handleInputChange:e=>i(t,{note:e}),placeholder:r("备注信息(可选)")})]})]})})};function y(){const{t:e}=(0,l.Bd)(),t=(0,m.Zp)(),{check_user_auth:i}=(0,x.MH)(),[c,d]=(0,s.useState)([]),b=(0,_.Q)(),g=async()=>{const e=await o.XO.get("ai_rebot_setting");e.code===p.m.Success&&d(e.data?.list??[])};(0,s.useEffect)(()=>{g()},[]);return(0,u.jsxs)("div",{className:"airebot-setting",children:[(0,u.jsx)(n.aZ,{position:"right",children:i(j.oV.ai_agent_setting)&&(0,u.jsx)(a.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>t(-1)})}),(0,u.jsx)(r.fI,{children:(0,u.jsxs)(r.VP,{widthPer:100,children:[(0,u.jsxs)("div",{className:"airebot-setting__page-title",children:[(0,u.jsx)("h2",{children:e("机器人配置")}),(0,u.jsx)(a.rA,{icon:"info",onClick:()=>{b("机器人配置")},title:"信息"})]}),(0,u.jsx)(f,{items:c,setItems:d,save:async()=>{const t={list:c.map((e,t)=>({...e,index:t}))};(await o.XO.post("ai_rebot_setting/save",t)).code===p.m.Success&&((0,h.SK)(e("保存成功")),await g())},have_auth_edit:i(j.oV.ai_agent_setting)})]})})]})}i.d(t,["PLATFORM_META",0,b,"RebotCard",0,v])},92350(e,t,i){i.d(t,{Q:()=>p,o:()=>x});var l=i(34843),s=i(82893),a=i(74777),n=i(96540),r=i(22022),c=i(23430),d=i(14284),o=i(74848);function p(){const[e,t]=(0,l.fp)(s.AG.prompt_card),{t:i,i18n:n}=(0,r.Bd)();return e=>{let l;e===a.jk.ffmpeg?l=(0,o.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===a.jk.smartmontools?l=(0,o.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?l=(0,o.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,o.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?l=(0,o.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?l=(0,o.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?l=(0,o.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?l=(0,o.jsx)("div",{children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,o.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?l=(0,o.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?l=(0,o.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?l=(0,o.jsx)("div",{children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,o.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,o.jsxs)("li",{children:[(0,o.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,o.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,o.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,o.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?l=(0,o.jsx)("div",{children:i("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(l=(0,o.jsxs)("div",{children:[(0,o.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。目前 qq 机器人不稳定,且创建后无法删除(2026.07.05)"}),(0,o.jsx)("li",{children:" 2. https://opensource.dingtalk.com/developerpedia/docs/explore/tutorials/stream/bot/nodejs/create-bot 这个是钉钉机器人开通教程,注意复制钉钉的 clientId 的是时候不要复制成appId 了。"}),(0,o.jsx)("li",{children:" 3. 企业微信机器人的开通甚至不需要 pc 操作,在通讯录中点击智能机器人,选择 api 模式,就创建完成了,手机上直接复制 id 和密钥。"}),(0,o.jsx)("li",{children:" 4. 飞书https://open.feishu.cn/document/develop-an-echo-bot/introduction?from=banner 登录这个开发者后台,按照这个地址教程创建机器人,使用的时候这个机器人是作为一个应用,可以在工作台内搜索你的这个机器人的名字。"})]})]})),t({open:!0,title:"信息",context_div:(0,o.jsx)("div",{children:l})})}}let h=c.Ky;function x(){const[e,t]=(0,n.useState)([]);return(0,n.useEffect)(()=>{(async()=>{try{const e=await d.XO.get("themes");if(0===e.code){const i=e.data||[];h=[...c.Ky,...i],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),e}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1636],{88062(e,n,o){o(96540),o(32768);var s=o(74848);function t(e){return(0,s.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:n=>{n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)},children:e.name})}const i=e=>(0,s.jsxs)("li",{children:[e.click?(0,s.jsx)(t,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,s.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,s.jsx)("ul",{children:e.node.children.map((n,o)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},o))})]}),c=e=>(0,s.jsx)("div",{className:"card-tree-view",children:(0,s.jsx)("ul",{children:e.list&&e.list.map((n,o)=>(0,s.jsx)(i,{node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render},o))})});o.d(n,["A",0,c])},81636(e,n,o){o.r(n),o.d(n,{default:()=>g});var s=o(22022),t=o(96540),i=o(34843),c=o(82893),r=o(92275),l=o(14944),d=o(7572),a=o(85997),u=o(4412),x=o(75725),f=o(47071),h=o(34289),m=o(88062),j=o(97856),v=(o(62042),o(15629),o(99214)),p=o(74848);const k=t.lazy(()=>o.e(3233).then(o.bind(o,85614)));let _,w;function g(e){const{t:n}=(0,s.Bd)(),[o,g]=(0,i.fp)(c.AG.workflow_realtime_show),[C]=(0,i.fp)(c.AG.current_mount),[y,M]=(0,t.useState)([]),[b,q]=(0,t.useState)([]),[S,F]=(0,t.useState)(!1),[A,N]=(0,t.useState)(void 0),[$,B]=(0,t.useState)([]),G=e=>{for(const n of e){if(null==n.code&&n?.extra_data?.running_type===f.rl.running)n.name=(0,p.jsxs)("div",{children:[(0,p.jsx)(d.fq,{running:!0}),n.name]});else if(0===n.code)n.name=(0,p.jsxs)("div",{children:[(0,p.jsx)(d.fq,{success:!0}),n.name]});else{if(!(n.code<1)){delete n.children;continue}n.name=(0,p.jsxs)("div",{children:[(0,p.jsx)(d.fq,{success:!1}),n.name]})}n.children&&G(n.children)}};(0,t.useEffect)(()=>(F(!1),_=void 0,w=void 0,(async()=>{const e=new f.v3;e.filename_path=`${(0,v.Zl)((0,h.GG)("file",(0,h.vX)()),C)}${o.filename}`,l.ws.addMsg(r.HK.workflow_realtime_one_rsq,e=>{if(e.context.list&&e.context.list.length>0){const n=e.context.list;G(n),B(n)}e.context.new_log&&E(e.context.new_log)}),l.ws.sendData(r.HK.workflow_realtime_one_req,e)})(),async()=>{l.ws.removeMsg(r.HK.workflow_realtime_one_rsq),w&&(w.dispose(),w=null)}),[]);const E=async e=>{w||await new Promise(e=>{_=e,F(!0),(async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});w=e,N(e)})()}),e&&w.write(e)};return(0,p.jsxs)("div",{children:[(0,p.jsxs)(u.aZ,{position:"right",children:[A&&(0,p.jsx)(a.rA,{icon:"print",title:"打印日志",onClick:()=>{F(!S)}}),(0,p.jsx)(a.rA,{icon:"close",title:n("关闭"),onClick:()=>{g({open:!1})}})]}),(0,p.jsx)(x.jW,{isFull:!0,more:!0,children:(0,p.jsx)(x.NN,{children:(0,p.jsx)(m.A,{list:$,click:e=>{}})})}),(0,p.jsx)("div",{style:{display:S?"":"none"},children:(0,p.jsx)(k,{show:!0,terminal:A,init:()=>{_&&(_(1),_=void 0)}})})]})}},15629(e,n,o){o.d(n,{W:()=>r});o(96540);var s=o(7572),t=o(47071),i=o(22022),c=o(74848);function r({item:e}){const{t:n}=(0,i.Bd)();let o,r;return null!=e.code?o=0===e.code:e.extra_data?.running_type===t.rl.running&&(r=!0),(0,c.jsxs)("div",{children:[(0,c.jsx)(s.fq,{success:o,running:r}),n(o?"成功":"失败")]})}const l=(e,n,o)=>{if(n)for(const o of n??[]){let n;const t=[];o["use-yml"]?(l(t,void 0,o.use_job_children_list),n=`${o["use-yml"]} ;${o.duration??-1}`):o.runs?n=JSON.stringify(o.runs):o.run?n=o.run:o["run-js"]?n=o["run-js"]:o.sleep&&(n=`sleep ${o.sleep}`),n=(0,c.jsxs)("div",{children:[(0,c.jsx)(s.fq,{success:void 0===o.code?void 0:0===o.code})," ",n+" ;"+(o.duration??"")]}),e.push({name:n,children:t,extra_data:{code:o.code,context:o.message}})}else if(o)for(const n of o??[]){const o=(0,c.jsxs)("div",{children:[(0,c.jsx)(s.fq,{success:void 0===n.code?void 0:0===n.code}),"$",n.name]});e.push({name:o,extra_data:{code:n.code,is_job:!0,job_data:n}})}};o.d(n,["Y",0,l])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2136],{47374(e,t,s){s.d(t,{e:()=>h});var n=s(96540),i=s(61973),a=s(64694),l=s(34289),o=s(61443),r=s(75725),c=s(22022),d=s(85997),_=s(74848);function h(e){let t=(0,i.zy)();const s=(0,i.Zp)(),[h,p]=(0,n.useState)([]),[m,f]=(0,n.useState)("/"),[u,x]=(0,n.useState)(void 0),{t:g,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",s=(0,l.vX)().split("/");s=s.filter(e=>e);const n=s.indexOf(e.baseRoute),i=[];if(-1!=n){t=(0,a.IO)(s.slice(0,n),e.baseRoute);const l=s.slice(n+1);for(let e=0;e<l.length;e++){const s=l[e];i.push({value:s,href:0===e?`${t}${s}/`:(0,a.IO)(i[e-1].href,s)})}f(t),p(i)}},[t]);const w=t=>{t.stopPropagation(),e.clickFun(t)},[j,y]=(0,n.useState)(0),k=(0,n.useRef)(null),b=(0,n.useRef)(null),A=()=>{const e=k.current,t=b.current;if(!e||!t)return;const s=[];for(const e of Array.from(t.children))s.push(e.getBoundingClientRect().width);const n=e.clientWidth;if(s.reduce((e,t)=>e+t,0)<=n||s.length<=2)return void y(e=>0===e?e:0);let i=s[0]+48,a=0;for(let e=s.length-1;e>=1&&!(i+s[e]>n);e--)i+=s[e],a++;const l=Math.max(s.length-1-a,0);y(e=>e===l?e:l)};(0,n.useEffect)(()=>{A();const e=new ResizeObserver(A);return k.current&&e.observe(k.current),()=>e.disconnect()},[h,m,t]),(0,n.useEffect)(()=>{const e=k.current;e&&0!==j&&e.scrollWidth>e.clientWidth&&j<h.length-1&&y(e=>e+1)});const N=j>0?1+j:1,C=j>0?h.slice(1,N):[],[G,S]=(0,n.useState)(null);return(0,n.useEffect)(()=>{S(null)},[t,j]),(0,_.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{x(void 0!==u?void 0:"")},children:[(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,onClick:w,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>j>0&&t>=1&&t<N?1!==t?null:(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();S({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,onClick:w,children:decodeURIComponent(e.value)})]},t)),(0,_.jsxs)("div",{className:"breadcrumbs-measure",ref:b,"aria-hidden":!0,children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(i.N_,{to:m,children:(0,_.jsx)(d.In,{icon:"home"})})}),h.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(i.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,_.jsx)(r.QM,{click:()=>{x(void 0)},children:(0,_.jsx)(o.Sm,{width:"100%",placeholder:g("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),x(void 0)}})})}),G&&(0,_.jsx)(r.rY,{click:()=>S(null),children:(0,_.jsx)(r.sw,{x:G.x,y:G.y,items:C.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{S(null),s(e)}})})]})}},22136(e,t,s){s.r(t),s.d(t,{default:()=>ee});var n=s(96540),i=s(47374),a=s(34843),l=s(52035),o=s(82893),r=s(14284),c=s(61973),d=s(4412),_=s(78150),h=s(34289),p=s(53459),m=s(99214),f=s(61443),u=s(32768),x=s(62042),g=s(22022),v=s(7523),w=s(78247),j=s(88815),y=s(6960),k=s(47071),b=s(14944),A=s(92275),N=s(23430),C=s(72458),G=s(34251),S=s(60096),I=s(87361),M=s(99647),z=s(85997),E=s(23496),$=s(74848);function P(e){const{t}=(0,g.Bd)(),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(""),h=t=>{const s=e.base_path.endsWith("/")?e.base_path:e.base_path+"/",n=t.type===u.Iw.folder?s+t.name:t.path??s+t.name;return n.startsWith("/")?n:"/"+n};(0,n.useEffect)(()=>{(async()=>{if(a)return;l(!0);const t=await r.$M.post("file_get_page",{param_path:e.base_path,page_num:1,page_size:1e4});if(t?.code!==p.m.Success)return;const s=t.data.files??[],n=s.filter(e=>e.type===u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name)),o=s.filter(e=>e.type!==u.Iw.folder).sort((e,t)=>e.name.localeCompare(t.name));i([...n,...o])})()},[]);const m=(0,n.useMemo)(()=>{const e=o.trim().toLowerCase();return e?s.filter(t=>t.name.toLowerCase().includes(e)):s},[s,o]),x=()=>{const t=d.trim();t&&!e.ignore_names.includes(t)&&(e.on_change_names([...e.ignore_names,t]),_(""))};return(0,$.jsxs)("div",{className:"search-exclude",children:[(0,$.jsxs)("div",{className:"search-exclude__section",children:[(0,$.jsx)("div",{className:"search-exclude__title",children:t("排除当前目录下的项")}),(0,$.jsx)(f.$Z,{icon:"search",value:o,placeholder:t("过滤列表"),handleInputChange:e=>c(e),handleEnterPress:()=>{}}),(0,$.jsxs)("div",{className:"search-exclude__list",children:[0===m.length&&(0,$.jsx)("div",{className:"search-exclude__empty",children:t(a?"无匹配":"加载中")}),m.map(t=>{const s=h(t),n=e.exclude_paths.includes(s),i=t.type===u.Iw.folder;return(0,$.jsxs)("label",{className:"search-exclude__item",children:[(0,$.jsx)("input",{type:"checkbox",checked:n,onChange:()=>(t=>{const s=h(t),n=e.exclude_paths.includes(s);e.on_change_paths(n?e.exclude_paths.filter(e=>e!==s):[...e.exclude_paths,s])})(t)}),(0,$.jsx)("span",{className:"material-symbols-outlined"+(i?" search-exclude__icon--dir":""),children:i?"folder":"draft"}),(0,$.jsx)("span",{className:"search-exclude__item-name",title:t.name,children:t.name})]},s)})]}),e.exclude_paths.length>0&&(0,$.jsx)("div",{className:"search-exclude__chosen",children:e.exclude_paths.map(t=>(0,$.jsxs)("span",{className:"search-exclude__tag",children:[t.split("/").filter(Boolean).pop(),(0,$.jsx)("span",{className:"material-symbols-outlined",onClick:()=>e.on_change_paths(e.exclude_paths.filter(e=>e!==t)),children:"close"})]},t))})]}),(0,$.jsxs)("div",{className:"search-exclude__section search-exclude__section--ignore",children:[(0,$.jsx)("div",{className:"search-exclude__title",children:t("忽略名字")}),(0,$.jsx)("div",{className:"search-exclude__hint",children:t("按名字忽略")}),(0,$.jsxs)("div",{className:"search-exclude__chosen",children:[0===e.ignore_names.length&&(0,$.jsx)("span",{className:"search-exclude__hint",children:t("暂无")}),e.ignore_names.map(t=>(0,$.jsxs)("span",{className:"search-exclude__tag",children:[t,(0,$.jsx)("span",{className:"material-symbols-outlined",onClick:()=>(t=>{e.on_change_names(e.ignore_names.filter(e=>e!==t))})(t),children:"close"})]},t))]}),(0,$.jsxs)("div",{className:"search-exclude__add",children:[(0,$.jsx)(f.Sm,{value:d,placeholder:t("如 node_modules"),handleInputChange:e=>_(e),handlerEnter:x,width:"12em"}),(0,$.jsx)(z.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,$.jsxs)("div",{className:"div-row",children:[(0,$.jsx)(z.rA,{icon:"save",title:t("保存忽略名字"),onClick:async()=>{await r.wm.post(E.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:e.ignore_names})}}),(0,$.jsx)(z.rA,{icon:"settings",title:t("忽略名字设置"),onClick:e.on_open_setting})]})]})]})}function F(e){const{t}=(0,g.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[i]=(0,a.fp)(o.AG.user_base_info),l=i?.user_data?.search_exclude_names,[c,d]=(0,n.useState)(Array.isArray(l)?[...l]:[]),[_,h]=(0,n.useState)(""),[m,u]=(0,n.useState)(!1),x=()=>{const e=_.trim();e&&!c.includes(e)&&(d([...c,e]),h(""))};return(0,$.jsxs)("div",{className:"search-ignore-setting",children:[(0,$.jsx)("div",{className:"search-ignore-setting__desc",children:t("按名字忽略说明")}),(0,$.jsxs)("div",{className:"search-ignore-setting__add",children:[(0,$.jsx)(f.Sm,{value:_,placeholder:t("如 node_modules"),handleInputChange:e=>h(e),handlerEnter:x,width:"20em"}),(0,$.jsx)(z.rA,{icon:"add",title:t("添加"),onClick:x})]}),(0,$.jsxs)("div",{className:"search-ignore-setting__list",children:[0===c.length&&(0,$.jsx)("div",{className:"search-ignore-setting__empty",children:t("暂无")}),c.map(e=>(0,$.jsxs)("div",{className:"search-ignore-setting__item",children:[(0,$.jsx)("span",{className:"material-symbols-outlined",children:"block"}),(0,$.jsx)("span",{className:"search-ignore-setting__item-name",children:e}),(0,$.jsx)(z.rA,{icon:"delete",title:t("删除"),onClick:()=>(e=>d(c.filter(t=>t!==e)))(e)})]},e))]}),(0,$.jsxs)("div",{className:"div-row div-row--end search-ignore-setting__footer",children:[(0,$.jsx)(z.rA,{icon:"arrow_back",title:t("返回"),onClick:e.on_back}),(0,$.jsx)(z.rA,{icon:"save",title:t("保存"),onClick:async()=>{if(m)return;u(!0);const t=await r.wm.post(E.s.user_save_private_attr,{is_search_exclude:!0,search_exclude_names:c});u(!1),t?.code===p.m.Success&&(await s(),e.on_back())}})]})]})}const R=500;function K(e){const{t}=(0,g.Bd)(),s=(0,c.Zp)(),[,i]=(0,a.fp)(o.AG.prompt_card),[l]=(0,a.fp)(o.AG.user_base_info),{click_file:r}=(0,m.kZ)(),[d,_]=(0,n.useState)(""),[h,p]=(0,n.useState)("name"),[u,x]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[j,y]=(0,n.useState)(!0),[k,N]=(0,n.useState)([]),[C,G]=(0,n.useState)([]),[S,E]=(0,n.useState)(!1),[K,L]=(0,n.useState)(!1),[X,D]=(0,n.useState)(!1),[U,H]=(0,n.useState)([]),[B,Z]=(0,n.useState)(0),[Y,O]=(0,n.useState)(!1),W=(0,n.useRef)(!1),T=(0,n.useMemo)(()=>new M.I((0,b.s)(),"file_deep_search"),[]),q=(0,n.useRef)(!1),V=(0,n.useRef)(!1),J=decodeURIComponent(e.base_path),Q=()=>i({open:!1}),ee=()=>{const e=l?.user_data?.search_exclude_names;return Array.isArray(e)?e:[]};(0,n.useEffect)(()=>{G(ee())},[l?.user_data?.search_exclude_names]),(0,n.useEffect)(()=>{let e=[],t=null;const s=()=>{if(t=null,q.current||V.current||!e.length)return;const s=e;e=[],Z(e=>e+s.length),H(e=>e.length>=R?e:[...e,...s].slice(0,R))},n=()=>{q.current||D(!1)};return T.addMsg(A.HK.file_deep_search_data,n=>{q.current||V.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(s,100)))}),T.addMsg(A.HK.file_deep_search_end,()=>{q.current||V.current||(s(),D(!1))}),T.on_message("close",n),()=>{q.current=!0,clearTimeout(t),W.current&&T.sendNotify(A.HK.file_deep_search_cancel,{}).catch(()=>{}).finally(()=>T.close()),T.removeMsg(A.HK.file_deep_search_data),T.removeMsg(A.HK.file_deep_search_end),T.off_message("close",n)}},[]);const te=()=>{const t=d.trim();if(!t||X)return;V.current=!1,H([]),Z(0),O(!0),W.current=!0,D(!0);const s={param_path:e.base_path,keyword:t,search_type:h,is_regex:u,ignore_case:v};"content"===h&&(s.show_match_line=j),k.length&&(s.exclude_paths=k),C.length&&(s.exclude_names=C),T.sendData(A.HK.file_deep_search,s).catch(()=>{})},se=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/"))},ne=async e=>{if(e.is_dir)return se(e);const t=e.path.slice(0,e.path.lastIndexOf("/")+1)||"/";Q(),s(I.o.file+t.split("/").map(encodeURIComponent).join("/")),await new Promise(e=>setTimeout(e,300)),await r({name:e.name,opt_shell:!0})},ie="content"===h;return K?(0,$.jsx)(F,{on_back:()=>{L(!1),G(ee())}}):(0,$.jsxs)("div",{className:"file-deep-search",children:[(0,$.jsxs)("div",{className:"file-deep-search__bar",children:[(0,$.jsx)(f.$Z,{icon:"search",value:d,placeholder:t(ie?"搜文件内容":"搜文件名"),handleInputChange:e=>_(e),handleEnterPress:te}),(0,$.jsx)("button",{className:"button button--flat",onClick:X?()=>{V.current=!0,T.sendNotify(A.HK.file_deep_search_cancel,{}).catch(()=>{}),D(!1)}:te,children:t(X?"取消":"搜索")}),(0,$.jsx)(z.rA,{icon:"close",title:t("关闭"),onClick:Q})]}),(0,$.jsxs)("div",{className:"file-deep-search__tabs",children:[(0,$.jsx)("button",{className:"file-deep-search__tab"+(ie?"":" file-deep-search__tab--active"),onClick:()=>p("name"),children:t("文件名")}),(0,$.jsx)("button",{className:"file-deep-search__tab"+(ie?" file-deep-search__tab--active":""),onClick:()=>p("content"),children:t("文件内容")})]}),(0,$.jsxs)("div",{className:"file-deep-search__options",children:[(0,$.jsx)(f.GL,{context:t("正则"),selected:u,onchange:()=>x(!u)}),(0,$.jsx)(f.GL,{context:t("忽略大小写"),selected:v,onchange:()=>w(!v)}),ie&&(0,$.jsx)(f.GL,{context:t("显示匹配行"),selected:j,onchange:()=>y(!j)})]}),(0,$.jsxs)("div",{className:"file-deep-search__hint",children:[(0,$.jsxs)("span",{children:[t("范围"),":",J]}),(0,$.jsxs)("span",{className:"file-deep-search__hint-right",children:[(k.length>0||C.length>0)&&(0,$.jsxs)("span",{className:"file-deep-search__excluded",children:[t("已排除")," ",k.length+C.length]}),(0,$.jsxs)("button",{className:"file-deep-search__filter"+(S?" file-deep-search__filter--active":""),onClick:()=>E(!S),children:[(0,$.jsx)("span",{className:"material-symbols-outlined",children:"filter_alt"}),t("过滤")]}),B>0&&(0,$.jsx)("span",{className:"file-deep-search__count",children:B>R?`${t("已显示")} 500 / ${B}`:`${B}`})]})]}),S&&(0,$.jsx)(P,{base_path:e.base_path,exclude_paths:k,ignore_names:C,on_change_paths:N,on_change_names:G,on_open_setting:()=>L(!0)}),(0,$.jsxs)("div",{className:"file-deep-search__body"+(ie&&j?" file-deep-search__body--line":""),children:[U.length>0&&(0,$.jsx)("div",{className:"file-deep-search__results",children:U.map(e=>{const s=e.path.slice(0,e.path.lastIndexOf("/")+1);return(0,$.jsxs)("div",{className:"file-deep-search__row",children:[(0,$.jsxs)("div",{className:"file-deep-search__name",children:[e.is_dir?(0,$.jsx)("span",{className:"file-deep-search__dir",children:e.name}):(0,$.jsx)("span",{className:"file-deep-search__file",title:e.name,children:e.name}),(0,$.jsx)("span",{className:"file-deep-search__path",children:s}),e.lines&&e.lines.length>0&&(0,$.jsx)("div",{className:"file-deep-search__lines",children:e.lines.map(t=>(0,$.jsxs)("div",{className:"file-deep-search__line",onClick:()=>ne(e),children:[(0,$.jsx)("span",{className:"file-deep-search__line-no",children:t.line}),(0,$.jsx)("span",{className:"file-deep-search__line-text",children:t.text})]},t.line))})]}),(0,$.jsxs)("div",{className:"file-deep-search__actions",children:[(0,$.jsx)(z.rA,{icon:"open_in_new",title:e.is_dir?t("打开"):t("打开文件"),onClick:()=>ne(e)}),(0,$.jsx)(z.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>se(e)})]})]},e.path)})}),X&&(0,$.jsxs)("div",{className:"file-deep-search__empty",children:[(0,$.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!X&&B>R&&(0,$.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!X&&0===U.length&&(0,$.jsx)("div",{className:"file-deep-search__empty",children:t(Y?"无匹配":ie?"输入内容后搜":"输入后搜")})]})]})}var L=s(64694),X=s(12730),D=s(75725),U=s(7572),H=s(40505);let B={};function Z(){const{t:e}=(0,g.Bd)();let t=(0,c.zy)();const s=(0,c.Zp)(),{check_user_auth:i}=(0,w.MH)(),[l,d]=(0,a.fp)(o.AG.nowFileList),[p,f]=(0,a.fp)(o.AG.uploadFiles),[j,y]=(0,a.fp)(o.AG.showPrompt),[k,C]=(0,a.fp)(o.AG.selectedFileList),[S,M]=(0,a.fp)(o.AG.copyedFileList),[E,P]=(0,a.fp)(o.AG.cutedFileList),[F,R]=(0,a.fp)(o.AG.selectedFileList),[K,H]=(0,a.fp)(o.AG.clickFileList),[Z,Y]=(0,a.fp)(o.AG.fileShellShow),O=(0,m.Cf)(),[W,T]=(0,a.fp)(o.AG.file_root_list),[q,V]=(0,a.fp)(o.AG.file_root_index),[J,Q]=(0,n.useState)(void 0),[ee,te]=(0,n.useState)(""),[se,ne]=(0,a.fp)(o.AG.workflow_show),[ie,ae]=(0,a.fp)(o.AG.workflow_realtime_show),[le,oe]=(0,a.fp)(o.AG.work_flow_show),{initUserInfo:re}=(0,n.useContext)(v.F),[ce,de]=(0,a.fp)(o.AG.user_base_info),{click_file:_e}=(0,m.kZ)(),[he,pe]=(0,a.fp)(o.AG.prompt_card),me=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[l]),fe=(0,n.useMemo)(()=>l.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(l.folders?.length??0),[l]);function ue(e){(0,x.SK)(e)}(0,n.useEffect)(()=>{B={}},[t]),(0,n.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const xe=(0,m.Vs)(),ge=t=>{pe({open:!0,title:e("信息"),context_div:(0,$.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,$.jsx)(D.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,$.jsx)(D.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,$.jsx)(D.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,$.jsx)(D.Yh,{left:`${e("文件夹数")}`,right:fe}),(0,$.jsx)(D.Yh,{left:`${e("文件数")}`,right:me}),(0,$.jsx)(D.Yh,{left:`${e("当前位置")}`,right:(0,$.jsx)(U.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{b.ws.removeMsg(A.HK.file_info)}})};return(0,$.jsxs)(n.Fragment,{children:[k.length>0&&(0,$.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{y({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,m.ib)(l,k);M(e.map(e=>(0,m.Ok)(e.name))),P([]),ue("已复制")}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,m.ib)(l,k);P(e.map(e=>(0,m.Ok)(e.name))),M([]),ue("已剪切")}}),(S.length>0||E.length>0)&&(0,$.jsx)(z.rA,{onClick:function(){y({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:S.length+E.length}),k.length>0&&(0,$.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,m.ib)(l,k);for(let t=0;t<e.length;t++){const s=e[t];e[t]=encodeURIComponent((0,m.Ok)(s.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),k.length>0&&(0,$.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const t=(0,m.ib)(l,k);for(let e=0;e<t.length;e++){const s=t[e];t[e]=(0,m.Ok)(s.name)}t&&0!==t.length?y({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,x.zN)(e("没有选中"))}}),1===k.length&&(0,$.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){y({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),le&&(0,$.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!se)}}),O.can_terminal&&(0,$.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){Z.show?Y({show:!1,path:""}):Y({show:!0,path:(0,h.GG)("file",(0,h.vX)())})}}),i(N.oV.share_file)&&(0,$.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{s(`${I.o.share_list_setting_page}`)}}),(0,$.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:xe}),(0,$.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){y({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,$.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){y({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,h.GG)("file",(0,h.vX)())}})}}),(0,$.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{y({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let s=!!t[0].webkitRelativePath;const n=[],i=new Set;for(let e=0;e<t.length;e++){const a=t[e],l=s?a.webkitRelativePath:`${a.webkitRelativePath}${a.name}`;a.fullPath=l,s&&i.add((0,X.S)(l)),n.push(a)}const a=[];if(s)for(const e of i)a.push({isDir:!0,fullPath:e,name:e});a.push(...n),f(a),y({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,$.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!B.now_absolute_path){b.ws.addMsg(A.HK.file_info,t=>{const s=t.context;e&&(B={...B,...s},b.ws.removeMsg(A.HK.file_info),ge(B))});const t=await b.ws.sendData(A.HK.file_info,{type:u.Iw.folder,path:(0,h.GG)("file",(0,h.vX)())});e=t.context,B=e,ge(B)}ge(B)}}),(0,$.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new G.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=W,n.item_pre_value=q,n.textClick=async t=>{if(t.type===G.LU.add)return s(`${I.o.setting_private_env_setting}`),y({data:void 0,overlay:!1,type:"",show:!1}),void(0,x.N9)(e("请配置 文件夹路径"));y({data:void 0,overlay:!1,type:"",show:!1}),t.type!==G.LU.child?(async e=>{V(e),await r.$M.post("base_switch",{root_index:e}),await re(),s("/file/"),R([]),H([])})(t.index):s((0,L.IO)(I.o.file,t.rel))},y({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var Y=s(32918),O=s(2543),W=s(21499);const T=n.lazy(()=>Promise.all([s.e(7856),s.e(6349),s.e(3659)]).then(s.bind(s,63659))),q=n.lazy(()=>Promise.all([s.e(7856),s.e(1636)]).then(s.bind(s,81636))),V=n.lazy(()=>Promise.all([s.e(3277),s.e(9345)]).then(s.bind(s,49345)));let J,Q="";function ee(){const[e,t]=(0,a.fp)(o.AG.editorSetting),[,s]=(0,a.fp)(o.AG.md_editor),[,x]=(0,a.fp)(o.AG.log_viewer),[,M]=(0,a.fp)(o.AG.image_editor),[,P]=(0,a.fp)(o.AG.markdown),[,F]=(0,a.fp)(o.AG.excalidraw_editor),[,R]=(0,a.fp)(o.AG.mind_editor),[,X]=(0,a.fp)(o.AG.timeline_editor),[,D]=(0,a.fp)(o.AG.excel_editor),[U,B]=(0,a.fp)(o.AG.file_preview),{t:ee}=(0,g.Bd)();let te=(0,c.zy)();const se=(0,c.Zp)(),[ne,ie]=(0,a.fp)(o.AG.nowFileList),[ae]=(0,a.fp)(o.AG.file_list_refresh),[le,oe]=(0,a.fp)(o.AG.current_mount),[re,ce]=(0,a.fp)(o.AG.showPrompt),[de,_e]=(0,a.fp)(o.AG.selectedFileList),[he,pe]=(0,a.fp)(o.AG.clickFileList),[me,fe]=(0,a.fp)(o.AG.fileShellShow),[ue,xe]=(0,n.useState)(""),[ge,ve]=(0,a.fp)(o.AG.workflow_show),[we,je]=(0,a.fp)(o.AG.workflow_realtime_show),[ye,ke]=(0,a.fp)(o.AG.work_flow_show),[be,Ae]=(0,n.useState)(!1),{initUserInfo:Ne}=(0,n.useContext)(v.F),[Ce,Ge]=(0,a.fp)(o.AG.user_base_info),{check_user_auth:Se}=(0,w.MH)(),{click_file:Ie}=(0,m.kZ)(),[Me]=(0,c.ok)(),ze=(0,m._A)(),Ee=n.useRef(null),[$e,Pe]=(0,a.fp)(o.AG.to_running_files),[Fe,Re]=(0,a.fp)(o.AG.file_page),[Ke]=(0,a.fp)(o.AG.blank_search_mode),[,Le]=(0,a.fp)(o.AG.prompt_card),[Xe,De]=(0,a.fp)(o.AG.blank_search_mode_for_temp),Ue=(0,m.oT)(),He="1"===Me.get("chat_open"),Be=Se(N.oV.ai_agent_page),Ze=(0,m.Cf)();(0,n.useEffect)(()=>{Ce?.user_data&&He&&!Be&&Ue("chat_open",null)},[He,Be,Ce]);const[Ye,Oe]=(0,a.fp)(o.AG.studio_chat_width),We=n.useRef(null),[Te,qe]=(0,n.useState)(!1),[Ve,Je]=(0,n.useState)(void 0),Qe=(0,m.dN)();(0,m.rJ)(Qe());const[et,tt]=(0,a.fp)(o.AG.ai_chat_session_by_cwd),st=function(){const e=(0,m.Cf)(),[t,s]=(0,a.fp)(o.AG.user_base_info),{t:i}=(0,g.Bd)(),{check_user_auth:l}=(0,w.MH)(),[d,p]=(0,a.fp)(o.AG.router_jump),f=(0,c.Zp)(),{initUserInfo:x}=(0,n.useContext)(v.F),[j,y]=(0,a.fp)(o.AG.nowFileList),[k,C]=(0,a.fp)(o.AG.showPrompt),[S,M]=(0,a.fp)(o.AG.fileShellShow),[z,P]=(0,a.fp)(o.AG.blank_search_mode);return s=>{s.preventDefault(),s.stopPropagation();const n=new G.ik;n.x=s.clientX,n.y=s.clientY,n.type=u.Iw.directory;const a=[{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_minx_max),children:i("时间逆序")}),v:N.t8.time_minx_max},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_max_min),children:i("时间顺序")}),v:N.t8.time_max_min}],o=[{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_min_max),children:i("大小顺序")}),v:N.t8.size_min_max},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_max_min),children:i("大小逆序")}),v:N.t8.size_max_min}],c=[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.file_list_pagination_mode||t.user_data.file_list_pagination_mode===N.yM.all),children:i("全部加载文件")}),v:N.yM.all},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.file_list_pagination_mode===N.yM.pagination),children:i("scrll_l")}),v:N.yM.pagination}],d=[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.file_time_show_type||t.user_data.file_time_show_type===N.KD.current),children:i("最近时间")}),v:N.KD.current},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.file_time_show_type===N.KD.time),children:i("准确时间")}),v:N.KD.time}],g=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,$.jsx)("span",{style:(0,H.ok)(!t.user_data.dir_show_type),children:i("系统默认")}),v:N.t8.defualt},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.name),children:i("名字")}),v:N.t8.name},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.time_minx_max||t.user_data.dir_show_type===N.t8.time_max_min),children:i("修改时间")}),v:!1,items:a},{r:(0,$.jsx)("span",{style:(0,H.ok)(t.user_data.dir_show_type===N.t8.size_min_max||t.user_data.dir_show_type===N.t8.size_max_min),children:i("文件大小")}),v:!1,items:o}]},{r:i("文件加载方式"),v:"",items:c},{r:i("时间展示"),v:"",items:d},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,$.jsx)("span",{style:(0,H.ok)(z),children:i("srchbln")}),v:"blank_search_mode"}]}];e.git_available&&j?.folders?.find(e=>".git"===e.name)&&g.push({r:i("查看Git提交"),v:"git_page"}),l(N.oV.http_proxy)&&g.push({r:i("dl_here"),v:"http_resource"}),t?.user_data?.quick_cmd&&(0,m.LL)([...t.user_data.quick_cmd],g),n.items=g,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,h.GG)("file",(0,h.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,h.GG)("file",(0,h.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void f(`${I.o.git_page}/${encodeURIComponent(e)}`)}if("http_resource"===e){const e=await b.ws.sendData(A.HK.file_info,{path:(0,h.GG)("file",(0,h.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void f("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",M({show:!0,path:(0,h.GG)("file",(0,h.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return P(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===N.yM.all||e===N.yM.pagination)t.is_pagination_mode=!0;else if(e===N.KD.current||e===N.KD.time)t.is_file_show_type=!0;else{if(e!==N.t8.defualt&&e!==N.t8.name&&e!==N.t8.size_max_min&&e!==N.t8.size_min_max&&e!==N.t8.time_max_min&&e!==N.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(E.s.user_save_private_attr,{type:e,...t}),await x(),C({data:void 0,overlay:!1,type:"",show:!1}),f((0,h.vX)())},C({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:n})}}(),nt=async e=>{let t=!1;for(const s of e.files??[])s.origin_size=s.size,s.size=(0,j.v7)(s.size),Ce.user_data.file_time_show_type===N.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",t||!s.name.endsWith(".workflow.yml")&&!s.name.endsWith(".act")||Ae(!0),s.name===k.SB&&(t=!0);for(const s of e.folders??[])Ce.user_data.file_time_show_type===N.KD.time?s.show_mtime=s.mtime?(0,W.Yq)(s.mtime):"":s.show_mtime=s.mtime?(0,y.s)(s.mtime):"",s.name===k.SB&&(t=!0);ke(t)},it=async e=>{oe(e??null)};(0,n.useEffect)(()=>{be&&(async()=>{const e=new k.Nd,t=(0,l.zp)().get(o.AG.current_mount);e.dir_path=(0,m.Zl)((0,h.GG)("file",(0,h.vX)()),t),b.ws.removeMsg(A.HK.workflow_realtime),b.ws.addMsg(A.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,m.Ys)(e);for(const e of t.failed_file_list)(0,m.V$)(e);Pe(new Set(t.running_file_list))}}),await b.ws.sendData(A.HK.workflow_realtime,e)})()},[ye,be,le,te]);const at=async()=>{const e=(0,h.GG)("file",(0,h.vX)());if(Ke||Xe)return;let t;if(Ce.user_data.file_list_pagination_mode===N.yM.pagination){if(Q!==e){if(Q=e,1!==Fe.page_num)return void Re({page_size:Fe.page_size,page_num:1})}else if(Fe.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:Fe.page_num,page_size:Fe.page_size}),t.code!==p.m.Success)return;const s=t.data;return nt(s),it(s.mount_info),s.files?.length?(ie(e=>{const t=(0,O.cloneDeep)(1===Fe.page_num?s.files:[...e?.files??[],...s.files]),n={...e,files:t};return(0,m.yC)(n,Ce.user_data.dir_show_type),n}),void(J=t.data)):void Re({page_size:Fe.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==p.m.Success)return;const s=t.data;(0,m.yC)(s,Ce.user_data.dir_show_type),nt(t.data),it(s.mount_info),ie(t.data),J=t.data};(0,n.useEffect)(()=>async()=>{Pe(new Set),le&&await b.ws.close()},[]);const lt=()=>{ke(!1),(()=>{const e=Me.get("preview_file_name"),t=Me.get("preview_mode");if(!e||!t)return!1;const n=(0,h.GG)("file",(0,h.vX)());if(Ee.current===n+e)return!0;Ee.current=n+e;const i=()=>ze(null);return"md"===t?(s({url:r.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:i}),!0):"log"===t?(x({show:!0,fileName:e,encoding:Me.get("preview_log_enc")??"utf8",wrap:Me.get("preview_log_wrap")??"wrap",close:i}),!0):"image_edit"===t?(M({path:(0,L.IO)((0,h.vX)(),e),name:e,close:i}),!0):(Ie({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:i}),!0)})()||(t({open:!1}),B({open:!1}),s({}),x({show:!1}),M({}),P({}),F({}),R({}),X({}),D({}),at())};(0,n.useEffect)(()=>{lt()},[te,Fe]),(0,n.useEffect)(()=>{ae>0&&at()},[ae]);n.useRef(!1);const ot=()=>{const e=(0,h.GG)("file",(0,h.vX)());Le({open:!0,title:ee("深搜"),context_div:(0,$.jsx)(K,{base_path:e})})},rt=e=>{e.target===e.currentTarget&&(_e([]),pe([]))},ct=n.useCallback((0,O.throttle)(e=>{const t=We.current;if(!t||!t.parentElement)return;const s=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),i=n.right-e.clientX,a=Math.min(Math.max(i,320),.7*n.width);Oe(parseFloat((a/s).toFixed(2)))},32),[]),dt=()=>{qe(!1),document.removeEventListener("pointermove",ct)},_t=(0,$.jsxs)("div",{className:"file-list-main",children:[(0,$.jsx)(i.e,{baseRoute:"file",clickFun:function(){if(_e([]),pe([]),Ce.user_data.file_list_pagination_mode===N.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Re({page_size:Fe.page_size,page_num:1})}},input_path_enter:e=>{_e([]),pe([]),ie({files:[],folders:[]}),(0,C.Z1)(e)?(e=e.replace((0,Y.m)(Ce.user_data),""),se(e)):se((0,C.Jn)((0,h.vX)(),e))}}),le&&(0,$.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:le.color},children:[(0,$.jsx)("span",{className:"material-icons",style:{color:le.color},children:"cloud"}),(0,$.jsx)("span",{children:[{v:le.driver,t:ee("驱动")},{v:le.credential_note,t:ee("凭据")},{v:le.account_note,t:ee("账号")}].filter(e=>Boolean(e.v)).map(e=>`${e.v}(${e.t})`).join(" - ")}),le.readonly&&(0,$.jsx)("span",{className:"mount-readonly-tag",children:ee("只读")})]}),Ce.user_data.file_list_pagination_mode===N.yM.pagination?(0,$.jsx)(S.$J,{handleContextMenu:st,clickBlank:rt,list:ne.files}):(0,$.jsx)(S.t$,{handleContextMenu:st,file_list:ne.files,folder_list:ne.folders,clickBlank:rt})]});return(0,$.jsxs)(n.Fragment,{children:[(0,$.jsxs)(d.aZ,{children:[(0,$.jsx)("div",{className:"mobile-deep-search-btn",children:(0,$.jsx)(z.rA,{icon:"search",title:ee("搜索"),onClick:ot})}),(0,$.jsx)(f.$Z,{handleEnterPress:async()=>{if(Ke||Xe){if(_e([]),pe([]),!ue||!ue.trim())return void ie({files:[],folders:[]});const e=(0,h.GG)("file",(0,h.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ue.trim()});if(t.code!==p.m.Success)return;const s=t.data;return(0,m.yC)(s,Ce.user_data.dir_show_type),nt(s),ie(s),void(J=s)}if(!J)return;_e([]),pe([]);const e=[],t=[];for(const t of J.files??[])t.name.includes(ue)&&e.push(t);for(const e of J.folders??[])e.name.includes(ue)&&t.push(e);ie({files:e,folders:t})},placeholder:ee("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:ot,handleInputChange:e=>{xe(e)},max_width:"25em"})]}),(0,$.jsxs)(d.aZ,{position:"right",children:[Se(N.oV.ai_agent_page)&&Ze.ai_chat_available&&(0,$.jsx)(z.rA,{icon:"smart_toy",title:ee("AI 聊天"),selected:He,onClick:()=>Ue("chat_open",!He?"1":null)}),(0,$.jsx)("div",{className:"mobile-context-btn",children:(0,$.jsx)(z.rA,{icon:"more_horiz",title:ee("右键"),onClick:()=>{const e=de[de.length-1];if(void 0!==e){const t=[...ne.folders??[],...ne.files??[]][e];if(t){const s=document.querySelectorAll(".item")[e],n=s?s.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},i={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},a=new G.ik;a.path=(0,L.IO)((0,h.vX)(),t.name),a.filename=t.name,a.x=i.clientX,a.y=i.clientY,a.type=t.type===u.Iw.folder?u.Iw.folder:(0,G.uL)(t.name),a.size=t.origin_size,ce({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:a})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};st(e)}}})}),(0,$.jsx)(Z,{})]}),(0,$.jsxs)("div",{className:"file-list-split"+(He?" file-list-split--chat":""),children:[_t,He&&(0,$.jsxs)(n.Fragment,{children:[(0,$.jsx)("div",{className:"studio__divider studio__divider--chat",ref:We,onPointerDown:e=>{e.preventDefault(),qe(!0),document.addEventListener("pointermove",ct),document.addEventListener("pointerup",dt,{once:!0})}}),(0,$.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ye}em`},children:(0,$.jsx)(n.Suspense,{fallback:null,children:(0,$.jsx)(V,{inline_header:!0,sync_url:!1,file_cwd_path:Qe(),session_id:Ve??(ht=Qe(),o.AG.get_ai_chat_session(et,ht)),on_session_change:e=>{Je(e),((e,t)=>{tt({...et,[e]:t})})(Qe(),e)}})})})]})]}),Te&&(0,$.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),ge&&(0,$.jsx)(T,{}),we.open&&(0,$.jsx)(q,{})]});var ht}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2502],{2502(t,e,n){n.r(e),n.d(e,{default:()=>A});var i=n(96540),o=n(92275),s=n(14944),r=n(34843),l=n(82893),c=n(57952),a=n(85997),_=n(32768),h=n(34289),p=n(62042),x=n(61443),d=n(22022),f=n(64694),g=n(7572),u=n(74848);const w=300;let v=!1,m=0,y=!0;var k,b=[],j=-1,C=[];function A(t){const[e,n]=(0,r.fp)(l.AG.log_viewer),A=(0,i.useRef)(null),[H,T]=(0,i.useState)(0),[S,z]=(0,i.useState)(100),[I,K]=(0,i.useState)(!1),[M,$]=(0,i.useState)(""),[E,L]=(0,i.useState)(0),[N,D]=(0,i.useState)(0),[q,G]=(0,i.useState)(0),{t:R}=(0,d.Bd)(),B=(t,n,i,o=!1,s)=>{const r=document.createElement("div");return-1===j?r.textContent=t:r.innerHTML=t,"wrap"===e.wrap?(r.style.whiteSpace="pre-wrap",r.style.overflowWrap="break-word"):r.style.whiteSpace="nowrap",r.setAttribute("position",`${n}`),r.setAttribute("start_position",`${i}`),o?(A.current.insertBefore(r,s),b.unshift(r)):(A.current.appendChild(r),b.push(r)),r},F=t=>{const e=(0,f.I)(b,e=>e===t);e&&A.current.removeChild(e)},W=(t,e,n,i=!1)=>{if(!t)return;const o=Array.isArray(t)?t:t.split("\n");if(i){let t;for(let i=0;i<o.length;i++)t=B(o[i],e[i],n[i],!0,0===i?A.current.firstChild:t);if(b.length>w){let t=b.length-1;for(;t>=w;)F(b[b.length-1]),t--}}else{for(let t=0;t<o.length;t++)B(o[t],e[t],n[t]);if(b.length>w){let t=b.length-w;for(;t>0;)F(b[0]),t--}}},X=async()=>{k.encoding=e.encoding,k.context="";const t=await s.ws.sendData(o.HK.log_viewer,k);if(t){const e=t.context;if(k=e,e.find_back_enter_index&&e.context_list.length>0)for(let t=0;t<e.context_list.length;t++){const n=new RegExp(e.query_text,"g");e.context_list[t]=e.context_list[t].replace(n,`<span style="color: blue;">${e.query_text}</span>`)}k.find_back_enter_index=!1,W(e.context_list,e.context_position_list,e.context_start_position_list,k.back),k.context_list.length>0&&(k.back&&b.length>0?(k.context_list.length>b.length?T(Math.floor(100*parseInt(b[k.context_list.length-b.length].getAttribute("position"))/k.max_size)):T(Math.floor(100*parseInt(b[b.length-k.context_list.length].getAttribute("position"))/k.max_size)),y=!1):T(Math.floor(100*(k.context_position_list[k.context_position_list.length-1]??0)/k.max_size)))}},Y=t=>{v||(v=!0,T(100),s.ws.addMsg(o.HK.log_viewer_watch,t=>{const e=t.context;e&&(k=e,W(e.context_list,e.context_position_list,e.context_start_position_list,!1),A.current.scrollTop=A.current.scrollHeight)}),k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.position=t,s.ws.sendData(o.HK.log_viewer_watch,k),K(!0))},Z=async()=>{A.current&&A.current.remove(),b=[]};if((0,i.useEffect)(()=>{e.show?(async()=>{A.current.addEventListener("scroll",async()=>{const t=A.current;if(t){if(v)return void(m=t.scrollTop);if(m<t.scrollTop&&b.length>0&&t.scrollTop+t.clientHeight+500>=t.scrollHeight){const t=parseInt(b[b.length-1].getAttribute("position"));if(t>=k.max_size)return void Y(t);k.line=20,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!1,k.position=t,await X()}else if(m>t.scrollTop&&b.length>0&&t.scrollTop-300<=0){const e=parseInt(b[0].getAttribute("start_position"));if(e<=0)return y||(y=!0,(0,p.N9)(R("到达顶部"))),void(m=t.scrollTop);k.line=10,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!0,k.position=e,await X()}m=t.scrollTop}}),A.current.addEventListener("wheel",t=>{const e=A.current;if(e){t.preventDefault();const n=20;t.deltaY>0?e.scrollTop+=n:e.scrollTop-=n}},{passive:!1}),K(!1),L(0),D(0),$(""),v=!1,G(0),m=0,C=[],j=-1,b=[],(k=new _.d2).line=w,k.path=`${(0,h.GG)("file",(0,h.vX)())}${e.fileName}`,k.token=localStorage.getItem("token"),await X(),s.ws.addMsg(o.HK.search_file_progress,t=>{try{L(parseInt(t.context))}catch(t){(0,p.zN)(t.message)}}),s.ws.addMsg(o.HK.search_file_index,t=>{try{C.push(...t.context),G(t.context.length)}catch(t){(0,p.zN)(t.message)}})})():Z()},[e]),(0,i.useEffect)(()=>()=>{Z()},[]),!e.show)return;return(0,u.jsxs)("div",{id:"editor-container",children:[(0,u.jsxs)(c.A,{ignore_tags:!0,left_children:[(0,u.jsx)(a.rA,{title:R("取消"),icon:"close",onClick:()=>{const t=e.close;n({show:!1}),t?.()}},1),(0,u.jsx)("div",{style:{width:"4rem"},children:(0,u.jsx)(g.WA,{context:e.fileName})},2),(0,u.jsxs)(i.Fragment,{children:[" ",(0,u.jsx)(x.$Z,{handleEnterPress:async()=>{M&&(L(.1),D(0),G(0),j=-1,C=[],k.query_text=M,k.encoding=e.encoding,s.ws.sendData(o.HK.search_file,k))},placeholder:R("回车搜索整个文件"),icon:"search",value:M,handleInputChange:t=>{$(t)},max_width:"25em"})]},3),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j+1>=C.length?0:j+1;D(t+1),j=t,k.find_back_enter_index=!0,k.back=!1,k.position=C[j],await X()},children:"↓"},5),M&&(0,u.jsx)("div",{style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:async()=>{if(0===C.length)return;k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[];const t=j-1<0?C.length-1:j-1;D(t+1),j=t,k.back=!1,k.find_back_enter_index=!0,k.position=C[j],await X()},children:"↑"},6),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:[N,"/",C.length]},7),M&&(0,u.jsxs)("div",{style:{paddingLeft:"1.5rem"},children:["搜索进度$",E,"%"]},8),0!==E&&100!==E&&(0,u.jsx)(a.rA,{title:R("取消"),icon:"cancel",onClick:()=>{s.ws.sendData(o.HK.search_file_cancel,{}),$(""),L(0)}},4)],children:[(0,u.jsx)("span",{style:{paddingRight:".5rem"},children:e.encoding}),I&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"},children:"正在实时监听 "}),(0,u.jsx)(a.rA,{icon:"close",title:R("关闭实时"),onClick:()=>{v&&(v=!1,K(!1),s.ws.sendData(o.HK.log_viewer_watch_cancel,k))}})]}),(0,u.jsxs)("span",{children:["当前加载进度",H]}),(0,u.jsx)(x.$Z,{max_width:"10rem",placeholder:R("跳转进度"),icon:"percent",value:S,handleInputChange:t=>{z(t)}}),(0,u.jsx)(a.rA,{icon:"play_arrow",title:R("跳转进度"),onClick:async()=>{k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];let t=0;try{if(t=parseInt(S),t>100||t<0)throw(0,p.zN)(R("范围在0-100")),"超过最大范围";for(const t of b)A.current.removeChild(t);b=[]}catch(t){return void(0,p.N9)(t)}k.back=t>=100,k.position=Math.floor(k.max_size*(t/100)),await X()}}),(0,u.jsx)(a.rA,{icon:"text_rotate_vertical",title:R("滑动到文件最底部,实时输出"),onClick:async()=>{if(!v){k.line=w,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[];for(const t of b)A.current.removeChild(t);b=[],k.back=!0,k.position=k.max_size,await X(),A.current.scrollTop=A.current.scrollHeight,Y(k.max_size)}}})]}),(0,u.jsx)("div",{style:{height:"100%"},children:(0,u.jsx)("div",{ref:A,style:{overflowY:"auto",overflowX:"auto",height:"100%"}})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[259],{8694(e,t,a){a.d(t,{$K:()=>s,RB:()=>i,l5:()=>l,vo:()=>o,vr:()=>r});let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class s{open=!1;port;key="";async_ips=[]}class o{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let i=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class r{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class l{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var n=a(85997),s=a(74848);function o(e){return(0,s.jsxs)("h2",{className:"message",children:[(0,s.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,s.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>u});var n=a(96540),s=a(61973),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(22022),d=a(85997),p=a(74848);function u(e){let t=(0,s.zy)();const a=(0,s.Zp)(),[u,h]=(0,n.useState)([]),[m,f]=(0,n.useState)("/"),[y,x]=(0,n.useState)(void 0),{t:_,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const n=a.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(a.slice(0,n),e.baseRoute);const i=a.slice(n+1);for(let e=0;e<i.length;e++){const a=i[e];s.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(s[e-1].href,a)})}f(t),h(s)}},[t]);const w=t=>{t.stopPropagation(),e.clickFun(t)},[g,j]=(0,n.useState)(0),k=(0,n.useRef)(null),b=(0,n.useRef)(null),N=()=>{const e=k.current,t=b.current;if(!e||!t)return;const a=[];for(const e of Array.from(t.children))a.push(e.getBoundingClientRect().width);const n=e.clientWidth;if(a.reduce((e,t)=>e+t,0)<=n||a.length<=2)return void j(e=>0===e?e:0);let s=a[0]+48,o=0;for(let e=a.length-1;e>=1&&!(s+a[e]>n);e--)s+=a[e],o++;const i=Math.max(a.length-1-o,0);j(e=>e===i?e:i)};(0,n.useEffect)(()=>{N();const e=new ResizeObserver(N);return k.current&&e.observe(k.current),()=>e.disconnect()},[u,m,t]),(0,n.useEffect)(()=>{const e=k.current;e&&0!==g&&e.scrollWidth>e.clientWidth&&g<u.length-1&&j(e=>e+1)});const K=g>0?1+g:1,S=g>0?u.slice(1,K):[],[C,A]=(0,n.useState)(null);return(0,n.useEffect)(()=>{A(null)},[t,g]),(0,p.jsxs)("div",{className:"breadcrumbs",ref:k,onClick:e=>{x(void 0!==y?void 0:"")},children:[(0,p.jsx)(n.Fragment,{children:void 0===y?(0,p.jsxs)(n.Fragment,{children:[(0,p.jsx)("span",{className:"chevron",children:(0,p.jsx)(s.N_,{to:m,onClick:w,children:(0,p.jsx)(d.In,{icon:"home"})})}),u.map((e,t)=>g>0&&t>=1&&t<K?1!==t?null:(0,p.jsxs)("span",{className:"chevron",children:[(0,p.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,p.jsx)("span",{className:"breadcrumbs-fold-dot",onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();A({x:t.left,y:t.bottom})},children:"..."})]},"fold"):(0,p.jsxs)("span",{className:"chevron",children:[(0,p.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,p.jsx)(s.N_,{to:e.href,onClick:w,children:decodeURIComponent(e.value)})]},t)),(0,p.jsxs)("div",{className:"breadcrumbs-measure",ref:b,"aria-hidden":!0,children:[(0,p.jsx)("span",{className:"chevron",children:(0,p.jsx)(s.N_,{to:m,children:(0,p.jsx)(d.In,{icon:"home"})})}),u.map((e,t)=>(0,p.jsxs)("span",{className:"chevron",children:[(0,p.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,p.jsx)(s.N_,{to:e.href,children:decodeURIComponent(e.value)})]},t))]})]}):(0,p.jsx)(l.QM,{click:()=>{x(void 0)},children:(0,p.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),x(void 0)}})})}),C&&(0,p.jsx)(l.rY,{click:()=>A(null),children:(0,p.jsx)(l.sw,{x:C.x,y:C.y,items:S.map(e=>({r:decodeURIComponent(e.value),v:e.href})),click:e=>{A(null),a(e)}})})]})}},77481(e,t,a){a.d(t,{S:()=>r,X:()=>i});var n=a(96540),s=a(61443),o=a(74848);function i(e){const[t,a]=n.useState([]),i=(0,n.useRef)(-1),[r,l]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]);const p=()=>{i.current=-1,l(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,a)=>{const n=!!e.filter&&(e.filter.column??0)===a;let i=t;if(n){const a=e.filter,n=a.options.find(e=>e.value===a.value);null!=a.value&&n&&(i=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},a)})})}),(0,o.jsx)("tbody",{children:t.map((t,a)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(r===a?"row-dragging":"")+(c===a?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=a,l(a),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(a))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,a=c;p(),t<0||a<0||t===a||e.onRowDrag?.(t,a)})())},onDragEnd:p,children:t.map((a,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:a},n)})},a)})})]})}function r(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))})}},83029(e,t,a){a.d(t,{N:()=>_});var n=a(96540),s=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,s.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),p=a(61973),u=a(22022);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const x=[];function _(e){const[t,a]=(0,n.useState)([]),[_,v]=(0,n.useState)(-1),w=(0,p.zy)(),[g,j]=(0,n.useState)(!1),[k,b]=(0,n.useState)(!1),{t:N}=(0,u.Bd)(),[K,S]=(0,n.useState)([]),[C,A]=(0,s.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==_?x[_]._children=e:y=e};(0,n.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[w]);(0,n.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=>{v(_+1),a(e._children),x.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==_&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===_?y:x[_-1]._children),v(_-1),x.pop()}}),t.map((s,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,n)=>{e.preventDefault();const s=t[m],o=t[n];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(s),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(n,0,r),F(i),a(i)})(e,o),style:{cursor:g?"move":"pointer"},children:[(0,i.jsx)(r,{name:s.name,item:s,...s,div:g,target:"_blank",click_dir:D,clickItem:e.clickItem}),g&&(void 0!==K.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===s._type?(0,i.jsxs)(n.Fragment,{children:[(0,i.jsx)(c.Sm,{value:s.name,handleInputChange:e=>{s.name=e},placeholder:N("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:s.color,type:"color",handleInputChange:e=>{s.color=e},no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:s[e.key],type:"color"===e.key?"color":void 0,handleInputChange:t=>{s[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:N("折叠"),clickFun:()=>{S((0,l.P1)(K,o))}})]}),g&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:N("删除"),clickFun:()=>{(e=>{const n=[...t];n.splice(e,1),F(n),a(n)})(o)}}),(0,i.jsx)(d.C3,{text:N("编辑"),clickFun:()=>{void 0===K.find(e=>e===o)&&S([...K,o])}})]})})]},o)),g&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:N("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),b(!1)}}),(0,i.jsx)(d.rA,{title:N("添加"),icon:"add",onClick:async()=>{const n=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(n),a(n)}}),(0,i.jsx)(d.rA,{title:N("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:N("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{b(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:g?"save":"edit",title:N(g?"保存":"编辑"),onClick:async()=>{g?e.save&&await e.save(y):f=t,j(!g)}})]})}},259(e,t,a){a.r(t),a.d(t,{default:()=>xe});var n=a(96540),s=a(7572),o=a(75725),i=a(61443),r=a(22022),l=a(34843),c=a(82893),d=a(85997),p=a(77481),u=a(14284),h=a(62042),m=a(40505),f=a(45907),y=a(23496),x=a(53459),_=a(78247),v=a(23430),w=a(74848);function g(){const{t:e}=(0,r.Bd)(),t=(0,f.y)(),{check_user_auth:a}=(0,_.MH)(),g=a(v.oV.browser_proxy_edit),[,j]=(0,l.fp)(c.AG.prompt_card),[k,b]=(0,n.useState)([]),[N,K]=(0,n.useState)(!1),[S,C]=(0,n.useState)(!1),[A,F]=(0,n.useState)(""),[D,L]=(0,n.useState)(""),[I,M]=(0,n.useState)(""),B=[e("状态"),e("备注"),e("目标"),e("端口"),e("访问地址"),e("操作")],P=async()=>{try{const e=await u.s2.get(y.s.browser_proxy_port_list);e.code===x.m.Success&&b(Array.isArray(e.data)?e.data:[])}catch(e){}};(0,n.useEffect)(()=>{P()},[]);const R=e=>{F(e?.id??""),L(e?`${e.proto}://${e.host}${e.root_path&&"/"!==e.root_path?e.root_path:""}`:""),M(e?.note??"")},E=()=>{K(!1),C(!1),R(void 0)},$=e=>`http://${window.location.hostname||"127.0.0.1"}:${e.port}/`,O=e=>{const t=localStorage.getItem("token")||"";return`${$(e)}${t?`?_t=${encodeURIComponent(t)}`:""}`};return(0,w.jsxs)(o.fI,{children:[(0,w.jsx)(o.VP,{widthPer:g?55:100,maxWidth:g?"90rem":void 0,children:(0,w.jsx)(o.xh,{children:(0,w.jsx)(s.uF,{self_title:(0,w.jsxs)("span",{className:" div-row ",children:[(0,w.jsx)("h2",{children:e("网页代理目标")}),(0,w.jsx)(d.rA,{icon:"info",title:e("信息"),onClick:()=>{j({open:!0,title:e("信息"),context_div:(0,w.jsx)("div",{children:(0,w.jsxs)("ul",{children:[(0,w.jsx)("li",{children:e("wbvpn_port_tip")}),(0,w.jsx)("li",{children:e("wbvpn_port_tip2")}),(0,w.jsx)("li",{children:e("wbvpn_port_tip3")})]})})})}})]}),rightTopCom:(0,w.jsx)("div",{children:g&&!S&&(0,w.jsx)(d.rA,{icon:"add",title:e("添加"),onClick:()=>{K(!0),C(!0),R(void 0)}})}),children:(0,w.jsx)(p.X,{headers:B,rows:k.map(a=>{const n=[(0,w.jsx)(d.Ay,{checked:!1!==a.enabled,disabled:!g,title:e("启用"),onChange:t=>(async(t,a)=>{try{await u.s2.post(y.s.browser_proxy_port_set_enabled,{id:t.id,enabled:a}),(0,h.SK)(e(a?"已启用":"已禁用")),await P()}catch(e){}})(a,t)}),(0,w.jsx)(s.xP,{children:a.note||"-"}),(0,w.jsx)(s.xP,{children:`${a.proto}://${a.host}`}),(0,w.jsx)(s.xP,{children:String(a.port)}),(0,w.jsx)(s.xP,{children:$(a)}),(0,w.jsxs)("div",{children:[(0,w.jsx)(d.rA,{icon:"open_in_new",title:e("新窗口打开"),onClick:()=>(e=>{window.open(O(e),"_blank","noopener,noreferrer")})(a)}),(0,w.jsx)(d.rA,{icon:"tab",title:e("当前窗口打开"),onClick:()=>(e=>{window.location.href=O(e)})(a)}),(0,w.jsx)(d.rA,{icon:"content_copy",title:e("复制"),onClick:()=>(async t=>{const a=$(t);(0,m.lW)(a)?(0,h.SK)(e("已复制")):(0,h.zN)(e("复制失败"))})(a)}),g&&(0,w.jsx)(d.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{K(!1),C(!0),R(e)})(a)}),g&&(0,w.jsx)(d.rA,{icon:"delete",title:e("删除"),onClick:()=>(a=>{t({title:e("确认删除"),sub_title:a.host,confirm_fun:async()=>{try{await u.s2.post(y.s.browser_proxy_port_remove,{id:a.id}),(0,h.SK)(e("已删除")),await P()}catch(e){}}})})(a)})]})];return n}),width:"10rem"})})})}),g&&S&&(0,w.jsx)(o.VP,{widthPer:45,maxWidth:"40rem",children:(0,w.jsx)(o.xh,{children:(0,w.jsxs)(s.Zp,{self_title:(0,w.jsx)("span",{className:" div-row ",children:(0,w.jsx)("h2",{children:e(""+(N?"添加":"编辑"))})}),rightBottomCom:(0,w.jsxs)("div",{children:[(0,w.jsx)(d.rA,{icon:"cancel",title:e("取消"),onClick:E}),(0,w.jsx)(d.rA,{icon:N?"add_circle":"save",title:e(N?"添加":"保存"),onClick:async()=>{if(D.trim())try{N?(await u.s2.post(y.s.browser_proxy_port_add,{address:D.trim(),note:I}),(0,h.SK)(e("添加成功"))):(await u.s2.post(y.s.browser_proxy_port_update,{id:A,address:D.trim(),note:I}),(0,h.SK)(e("修改成功"))),E(),await P()}catch(e){}else(0,h.zN)(e("目标地址不能为空"))}})]}),children:[(0,w.jsx)("label",{children:e("目标地址")}),(0,w.jsx)(i.Sm,{value:D,placeholder:e("目标地址例如"),handleInputChange:e=>L(e)}),(0,w.jsx)("label",{children:e("备注")}),(0,w.jsx)(i.Sm,{value:I,handleInputChange:e=>M(e)})]})})})]})}function j(e){return(0,w.jsx)(g,{})}var k=a(34289),b=a(4412),N=(a(75007),a(83029)),K=a(97856),S=a(92275),C=a(14944),A=a(64405);const F=n.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(a.bind(a,85614)));function D(e){const[t,a]=(0,n.useState)(null),[s,o]=(0,l.fp)(c.AG.remoteShellShow),[i,r]=(0,n.useState)(!1),[d,p]=(0,l.fp)(c.AG.sshInfo),[u,h]=(0,l.fp)(c.AG.shellNowDir),[m,f]=(0,l.fp)(c.AG.user_base_info),y=m.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",x=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,n.useEffect)(()=>()=>{x()},[]),(0,n.useEffect)(()=>{s.show?t||((async()=>{const e=new K.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 n=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=n},C.ws.addMsg(S.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new A.x;t.key=d.key,t.cmd=e;const a=new S.hf(S.HK.remote_shell_send);a.context=t,await C.ws.send(a)}),a(e)})(),r(!0)):x()},[s]);return(0,w.jsx)(F,{show:s.show,terminal:t,init:(e,a)=>{t.writeln("[38;2;29;153;243mopen shell...[0m ");const n=new S.hf(S.HK.remote_shell_open),o=new A.x;o.key=d.key,o.init_path=s.path,o.rows=e,o.cols=a,n.context=o,C.ws.send(n)}})}var L=a(47374),I=a(61973),M=a(99214),B=a(32768),P=a(88815),R=a(6960),E=a(79240),$=a(78150),O=a(12730);function G(e){const{t}=(0,r.Bd)();(0,I.zy)();(0,I.Zp)();const{check_user_auth:a}=(0,_.MH)(),[s,o]=(0,l.fp)(c.AG.nowFileList),[i,p]=(0,l.fp)(c.AG.uploadFiles),[u,m]=(0,l.fp)(c.AG.showPrompt),[f,y]=(0,l.fp)(c.AG.selectedFileList),[x,v]=(0,l.fp)(c.AG.enterKey),[g,j]=(0,l.fp)(c.AG.copyedFileList),[b,N]=(0,l.fp)(c.AG.cutedFileList),[K,S]=(0,l.fp)(c.AG.selectedFileList),[C,A]=(0,l.fp)(c.AG.clickFileList),[F,D]=(0,l.fp)(c.AG.remoteShellShow),[L,P]=(0,l.fp)(c.AG.sshInfo),R=(0,M.Vs)();function E(e){(0,h.SK)(e)}return(0,w.jsxs)(n.Fragment,{children:[f.length>0&&(0,w.jsx)(d.rA,{icon:"delete",title:t("删除"),onClick:()=>{m({show:!0,type:$.PromptEnum.SshDelete,overlay:!0,data:{}})}}),f.length>0&&(0,w.jsx)(d.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,M.ib)(s,f);j(e.map(e=>`/${(0,k.GG)("remoteShell",(0,k.vX)())}${e.name}`)),N([]),E("已复制")}}),f.length>0&&(0,w.jsx)(d.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,M.ib)(s,f);N(e.map(e=>`/${(0,k.GG)("remoteShell",(0,k.vX)())}${e.name}`)),j([]),E("已剪切")}}),(g.length>0||b.length>0)&&(0,w.jsx)(d.rA,{onClick:function(){m({show:!0,type:$.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:g.length+b.length}),1===f.length&&s.files.length>=1&&(0,M.ib)(s,f)[0].type!==B.Iw.folder&&(0,w.jsx)(d.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,M.ib)(s,f),t=`/api/ssh/download?file=${`/${(0,k.GG)("remoteShell",(0,k.vX)())}${decodeURIComponent(e[0].name)}`}&key=${L.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===f.length&&(0,w.jsx)(d.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){m({show:!0,type:$.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,w.jsx)(d.rA,{icon:"terminal",title:"shell",onClick:function(){F.show?D({show:!1,path:""}):D({show:!0,path:`/${(0,k.GG)("remoteShell",(0,k.vX)())}`})}}),(0,w.jsx)(d.rA,{icon:"grid_view",title:t("切换样式"),onClick:R}),(0,w.jsx)(d.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){m({show:!0,type:$.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,w.jsx)(d.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){m({show:!0,type:$.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,w.jsx)(d.rA,{icon:"upload_file",title:"上传",onClick:()=>{m({show:!0,type:$.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const n=[],s=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&&s.add((0,O.S)(i)),n.push(o)}const o=[];if(a)for(const e of Array.from(s))o.push({isDir:!0,fullPath:e,name:e});o.push(...n),p(o),m({show:!0,type:$.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,w.jsx)(d.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var H=a(60096),T=a(21499);let z;function U(e){const{t}=(0,r.Bd)(),a=(0,I.zy)(),[s,o]=(0,l.fp)(c.AG.nowFileList),[d,p]=(0,l.fp)(c.AG.selectedFileList),[m,f]=(0,l.fp)(c.AG.clickFileList),[y,_]=(0,l.fp)(c.AG.sshInfo),[g,j]=(0,n.useState)(""),N=(0,I.Zp)(),[K,S]=(0,l.fp)(c.AG.user_base_info),C=async e=>{const a=new A.x;a.key=y.key,a.dir=e||`/${(0,k.GG)("remoteShell",(0,k.vX)())}`;const n=await u.Fg.post("get/dir",a);if(n.code!==x.m.Success)return void(0,h.zN)(t("连接失败"));const{folders:s,files:i}=n.data||{};for(const e of i??[])e.origin_size=e.size,e.size=(0,P.v7)(e.size),K.user_data.file_time_show_type===v.KD.time?e.show_mtime=e.mtime?(0,T.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,R.s)(e.mtime):"";for(const e of s??[])K.user_data.file_time_show_type===v.KD.time?e.show_mtime=e.mtime?(0,T.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,R.s)(e.mtime):"";const r={folders:s||[],files:i||[]};(0,M.yC)(r,K.user_data.dir_show_type),o(r),z=r};function F(){p([]),f([])}(0,n.useEffect)(()=>{F(),(async()=>{await C()})()},[a]);return(0,w.jsxs)(n.Fragment,{children:[(0,w.jsx)(b.aZ,{children:(0,w.jsx)(i.$Z,{handleEnterPress:()=>{if(!z)return;p([]),f([]);const e=[],t=[];for(const t of z.files??[])t.name.includes(g)&&e.push(t);for(const e of z.folders??[])e.name.includes(g)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{j(e)},max_width:"25em"})}),(0,w.jsx)(b.aZ,{position:"right",children:(0,w.jsx)(G,{close:e.close})}),(0,w.jsx)(L.e,{baseRoute:"remoteShell",clickFun:F,input_path_enter:e=>{(0,E.Z1)(e)?C(e):N((0,E.Jn)((0,k.vX)(),e)),p([]),f([]),o({files:[],folders:[]})}}),(0,w.jsx)(H.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&p([])},file_list:s.files,folder_list:s.folders,fileHandler:C}),(0,w.jsx)(D,{})]})}function V(e){const{t}=(0,r.Bd)(),a=(0,I.Zp)(),[s,o]=(0,n.useState)(""),[p,m]=(0,n.useState)(""),[f,y]=(0,n.useState)(""),[g,j]=(0,n.useState)(""),[k,K]=(0,n.useState)(void 0),[S,C]=(0,n.useState)(""),[F,D]=(0,l.fp)(c.AG.shellNowDir),[L,M]=(0,l.fp)(c.AG.sshInfo),{check_user_auth:B}=(0,_.MH)(),P=async e=>{const t=new A.x;if(t.password=e?e.password:p,t.domain=e?e.domain:g,t.port=e?e.port:k,t.username=e?e.username:s,t.private_path=e?e.private_path:f,t.dir=e?e.dir:S,!t.dir)return void(0,h.zN)("dir not found");if(!t.username)return void(0,h.zN)("username not found");if(!t.domain)return void(0,h.zN)("domain not found");if(!t.port)return void(0,h.zN)("port not found");if(!t.private_path&&!t.password)return void(0,h.zN)("private_path password not found");const n=await u.Fg.post("start",t);n&&n.code===x.m.Success&&(a((0,E.Jn)("/proxy/remoteShell",t.dir)),D([t.dir]),M(n.data))};return(0,w.jsxs)(n.Fragment,{children:[!L.key&&(0,w.jsxs)(b.aZ,{position:"right",children:[(0,w.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:S,handleInputChange:e=>C(e),max_width:"15rem"}),(0,w.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:s,handleInputChange:e=>o(e),max_width:"15rem"}),(0,w.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:p,handleInputChange:e=>m(e),max_width:"15rem"}),(0,w.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:f,handleInputChange:e=>y(e),max_width:"15rem"}),(0,w.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:g,handleInputChange:e=>{j(e)},max_width:"15rem"}),(0,w.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:k,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,h.zN)(t("不是数字")),K(parseInt(e))},max_width:"7rem"}),(0,w.jsx)(d.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{P()}})]}),L.key?(0,w.jsx)(U,{close:async()=>{const e=new A.x;e.key=L.key;await u.Fg.post("close",e);M({})},data:{port:k,password:p,username:s,domain:g,dir:S}}):(0,w.jsx)(N.N,{have_auth_edit:B(v.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await u.Fg.get("tag");return e.code===x.m.Success?e.data:[]},save:async e=>{await u.Fg.post("tag/save",e)},clickItem:async e=>{j(e.domain),C(e.dir),K(e.port),o(e.username),m(e.password),y(e.private_path),await P(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 Z(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class J{constructor(e){this.canvas=e,this.render=new ee.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=ee.elementOffset(e.canvas);return C.ws.sendData(S.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=ee.elementOffset(e.canvas);return C.ws.sendData(S.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:Z(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=ee.elementOffset(e.canvas);return C.ws.sendData(S.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:Z(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=ee.elementOffset(e.canvas);return C.ws.sendData(S.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:Z(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,n=Math.round(15*Math.abs(a)/8),s=ee.elementOffset(e.canvas);return C.ws.sendData(S.HK.wheel,{x:t.clientX-s.left,y:t.clientY-s.top,step:n,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),n=a?t.deltaX:t.deltaY,s=Math.round(15*Math.abs(n)/8),o=ee.elementOffset(e.canvas);return C.ws.sendData(S.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:s,isNegative:n>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return C.ws.sendData(S.HK.scancode,{code:ee.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return C.ws.sendData(S.HK.scancode,{code:ee.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,n,s,o){var i=this;C.ws.addMsg(S.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),C.ws.addMsg(S.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),C.ws.addMsg(S.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),C.ws.addMsg(S.HK.rdp_error,e=>{i.activeSession=!1});const r=new S.hf;r.cmdType=S.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:n,password:s,locale:ee.locale()},C.ws.send(r)}}class X{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),n=Module._malloc(a.length),s=new Uint8Array(Module.HEAPU8.buffer,n,a.length);s.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,s.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(n),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 Y={"":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},W={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"},q={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:W},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:W}};function Q(){}Q.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 J(e)}},Canvas:{create:function(e){return new X(e)}},scancode(e){var t=Q.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",Y[e.code||q[Q.prototype.browser()||"firefox"][t][e.keyCode]]}};let ee=new Q;var te=a(38240);let ae;function ne(){const{t:e}=(0,r.Bd)(),[t,a]=(0,l.fp)(c.AG.header_min),{check_user_auth:s}=(0,_.MH)(),[p,m]=(0,n.useState)(void 0),[f,y]=(0,n.useState)(3389),[g,j]=(0,n.useState)(void 0),[k,K]=(0,n.useState)(void 0),[A,F]=(0,n.useState)(!1),[D,L]=(0,n.useState)(!1);var I=null;(0,n.useEffect)(()=>(ae||(async()=>{try{await(0,te.J)("rle.js"),ae=!0}catch(t){return void(0,h.zN)(e("加载资源失败"))}})(),()=>{I&&(I.close(),I=null)}),[]);const M=t=>{L(!0),function(n,s,o,i){if(n=n||t.address,o=o||t.username,i=i||t.password,!n||!o)return(0,h.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){I||(I=ee.client.create(ee.$(e)))}("rdpwebview");var r=ee.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),I.connect(n,"",s,o,i,function(e){ee.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(p,f,g,k)};return(0,w.jsxs)("div",{children:[(0,w.jsxs)(b.aZ,{position:"right",children:[(0,w.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:p,max_width:"15rem",handleInputChange:e=>m(e)}),(0,w.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:f,max_width:"10rem",handleInputChange:e=>{e&&y(parseInt(e))}}),(0,w.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:g,max_width:"15rem",handleInputChange:e=>j(e)}),(0,w.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:k,max_width:"15rem",handleInputChange:e=>K(e)}),!D&&(0,w.jsx)(d.rA,{icon:"play_arrow",title:e("连接"),onClick:M}),D&&(0,w.jsx)(d.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await C.ws.sendData(S.HK.rdp_disconnect,"");var e=ee.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),ee.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,w.jsxs)(o.jW,{isFull:A,children:[!D&&(0,w.jsx)(N.N,{have_auth_edit:s(v.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await u.J0.get("tag");return e.code===x.m.Success?e.data:[]},save:async t=>{(await u.J0.post("tag/save",t)).code!==x.m.Success&&(0,h.zN)(e("网络错误"))},clickItem:async e=>{K(e.password),j(e.username),m(e.address),y(e.port),M(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,w.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var se=a(8694),oe=a(19324);const ie=(0,n.createContext)({activeKey:"",setActiveKey:()=>{}});function re(e){const{children:t,activeKey:a,defaultActiveKey:s,onChange:o,width:i}=e,[r,l]=(0,n.useState)(()=>a??s??"");(0,n.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return n.Children.forEach(t,e=>{n.isValidElement(e)&&e.type===le&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,n.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,w.jsx)(ie.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,w.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,w.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,w.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,w.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function le(e){const{itemKey:t,children:a}=e,{activeKey:s}=(0,n.useContext)(ie),o=s===t;return(0,w.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ce=n.lazy(()=>Promise.all([a.e(122),a.e(4091)]).then(a.bind(a,84091)));let de,pe,ue,he;function me(){const{t:e}=(0,r.Bd)(),[t,a]=(0,l.fp)(c.AG.confirm),[f,y]=(0,l.fp)(c.AG.showPrompt),{check_user_auth:g}=(0,_.MH)(),[j,k]=(0,n.useState)(""),[b,K]=(0,l.fp)(c.AG.router_jump),[A,F]=(0,n.useState)("get"),[D,L]=(0,n.useState)(""),[I,M]=(0,n.useState)(void 0),[B,R]=(0,n.useState)([]),[E,O]=(0,n.useState)([]),[G,H]=(0,n.useState)("headers"),[z,U]=(0,n.useState)(String(se.RB.row)),[V,Z]=(0,n.useState)("body"),[J,X]=(0,n.useState)(),[Y,W]=(0,l.fp)(c.AG.nav_index_add_item_by_now_list),[q,Q]=(0,l.fp)(c.AG.prompt_card);_.xK.set_value_temp("{}",0),_.xK.set_value_temp("",1),(0,n.useEffect)(()=>(de={},pe="",ue="",he="",_.xK.get_editor(0).session.setMode("ace/mode/json"),b.http_download_map_path&&(M(b.http_download_map_path),K({})),C.ws.sendData(S.HK.http_download_water,void 0).then(()=>{C.ws.addMsg(S.HK.http_download_water,e=>{const t=e.context;O(t)})}),()=>{C.ws&&"function"==typeof C.ws.removeMsg&&C.ws.removeMsg(S.HK.http_download_water)}),[]);const ee=e=>{const t=new se.vr;t.url=D,t.method=A,t.header_type="headers"===G?1:2,"headers"===G&&(de=JSON.parse(_.xK.get_editor_value(0))),t.headers=de;const a=Number(z);if(t.body_type=a,a===se.RB.row)pe=_.xK.get_editor_value(1),t.data=pe;else if(a===se.RB.json)de["Content-Type"]="application/json",pe=_.xK.get_editor_value(1),t.data=pe;else if(a===se.RB.form){de["Content-Type"]="multipart/form-data",t.form_data_list=B;for(const t of B)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,w.jsx)("div",{children:(0,w.jsxs)(o.xh,{children:[(0,w.jsxs)(o.fI,{children:[(0,w.jsxs)(o.VP,{children:[0!==E.length&&(0,w.jsx)(s.Zp,{title:"正在下载",children:(0,w.jsx)("div",{children:E.map((t,a)=>(0,w.jsxs)("div",{children:[(0,w.jsxs)("div",{className:"div-row",children:[(0,w.jsx)(d.rA,{icon:"cancel",title:e("取消"),onClick:()=>{C.ws.sendData(S.HK.http_download_cancel,t.local_download_path)}}),(0,w.jsx)(s.xP,{context:t.filename,tip_context:t.local_download_path}),(0,w.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,P.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,w.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,w.jsxs)(s.Zp,{title:"",rightBottomCom:Number(z)===se.RB.form&&"body"===G&&(0,w.jsx)(d.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...B])}}),children:[(0,w.jsxs)("div",{className:"http_url",children:[(0,w.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,w.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:D,handleInputChange:e=>{L(e)}}),(0,w.jsx)(d.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!u._U.have_http_method(A))return void(0,h.zN)(e("不存在的http method"));if(!D)return void(0,h.zN)("url is empty");X(void 0),k("");const t=new FormData;t.append("data",JSON.stringify(ee(t)));let a="http/send";I&&(a+=`?local_download_path=${I}`),oe.A.post(u._U.getUrl(a),t,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,h.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),he=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,w.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){he=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ue="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const n=_.xK.get_editor(2),s="body"===V?ue:he;if(n){if(a.includes("application/json")||a.includes("+json")){n.session.setMode("ace/mode/json");try{const e=JSON.parse(ue);ue=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?n.session.setMode("ace/mode/html"):a.includes("xml")?n.session.setMode("ace/mode/xml"):a.includes("javascript")?n.session.setMode("ace/mode/javascript"):n.session.setMode("ace/mode/text");n.setValue("body"===V?ue:he,-1)}k(s)})}}),g(v.oV.http_proxy_tag_update)&&(0,w.jsx)(d.rA,{title:e("添加"),icon:"save_as",onClick:()=>{for(const t of B)if(t.is_file)return void(0,h.zN)(e("frm_lm"));let t;Q({open:!0,title:e("信息"),context_div:(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"card-content",children:(0,w.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,w.jsx)("div",{className:"card-action",children:(0,w.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await ee();e.local_download_path=I,e.form_data_list=JSON.stringify(B),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,W(e),Q({open:!1})},children:e("确定")})})]})})}})]}),(0,w.jsxs)(re,{activeKey:G,onChange:e=>H(e),children:[(0,w.jsx)(le,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,w.jsxs)("div",{style:{marginTop:"10px"},children:[(0,w.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,w.jsx)(d.rA,{title:e("格式化"),icon:"data_object",onClick:function(){_.xK.get_editor(0)?.formatCode?.()}})}),(0,w.jsx)("div",{className:"http_ace",children:(0,w.jsx)(ce,{name:"",editor_id:0})})]})}),(0,w.jsx)(le,{itemKey:"body",tab:e("请求体"),children:(0,w.jsxs)("div",{style:{marginTop:"10px"},children:[(0,w.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,w.jsxs)(re,{activeKey:z,onChange:e=>{U(e);const t=Number(e);t===se.RB.row?_.xK.get_editor(1).session.setMode("ace/mode/text"):t===se.RB.json&&_.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,w.jsx)(le,{itemKey:String(se.RB.row),tab:e("row")}),(0,w.jsx)(le,{itemKey:String(se.RB.json),tab:e("json")}),(0,w.jsx)(le,{itemKey:String(se.RB.form),tab:e("form")})]}),Number(z)!==se.RB.form&&(0,w.jsx)(d.rA,{title:e("格式化"),icon:"data_object",onClick:function(){_.xK.get_editor(1)?.formatCode?.()}})]}),Number(z)===se.RB.form&&(0,w.jsx)("div",{style:{marginTop:"10px"},children:(0,w.jsx)(p.X,{headers:["key",e("值")],rows:B.map((t,a)=>[(0,w.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...B])},no_border:!0}),(0,w.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...B])},no_border:!0}),(0,w.jsxs)("div",{children:[(0,w.jsx)(d.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{y({show:!0,type:$.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const n=a[0];n.fullPath=(0,T.hU)()+Date.now().toString(),B[e].value=`${n}(${n.name})`,B[e].is_file=!0,B[e].fileName=n.name,B[e].fullPath=n.fullPath,R([...B]),B[e].file_object=n,y({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,w.jsx)(d.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{B.splice(e,1),R([...B])})(a)})]})]),width:"10rem"})}),(0,w.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(z)!==se.RB.form?"block":"none"},children:(0,w.jsx)(ce,{name:"",editor_id:1})})]})})]}),(0,w.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===I?(0,w.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{M("")},children:e("下载到本地目录")}):(0,w.jsx)(i.Sm,{placeholder:e("本地地址"),value:I,handleInputChange:e=>{M(e)},handlerEnter:()=>{I||M(void 0)}})})]})]}),(0,w.jsx)(o.VP,{children:(0,w.jsxs)(s.Zp,{title:J,rightTopCom:(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,w.jsx)(d.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{_.xK.get_editor(2)?.formatCode?.()}}),(0,w.jsx)(d.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const t=_.xK.get_editor_value(2);t&&((0,m.lW)(t),(0,h.SK)(e("完成")))}})]}),children:[(0,w.jsxs)(re,{activeKey:V,onChange:e=>{Z(e);const t="body"===e?ue:he;k(t);const a=_.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,w.jsx)(le,{itemKey:"body",tab:e("响应体")}),(0,w.jsx)(le,{itemKey:"headers",tab:e("响应头")})]}),(0,w.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,w.jsx)(ce,{name:"",editor_id:2})})]})})]}),(0,w.jsx)(o.fI,{children:(0,w.jsx)(o.VP,{children:(0,w.jsx)(N.N,{getItems:async()=>{const e=await u._U.get("http/tag");return e.code===x.m.Success?e.data:[]},save:async t=>{(await u._U.post("http/tag/save",t)).code!==x.m.Success&&(0,h.zN)(e("网络错误"))},have_auth_edit:g(v.oV.http_proxy_tag_update),clickItem:async e=>{L(e.url),F(e.method),M(e.local_download_path),e.header_type&&H(1===e.header_type?"headers":"body"),e.headers&&(de=JSON.parse(e.headers),1===e.header_type&&(_.xK.get_editor(0).setValue(e.headers,-1),_.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(pe=e.data),e.body_type&&(U(String(e.body_type)),e.body_type===se.RB.row?_.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===se.RB.json&&_.xK.get_editor(1).session.setMode("ace/mode/json"),_.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 fe=a(87361);const ye=n.lazy(()=>Promise.all([a.e(8772),a.e(8257),a.e(7759)]).then(a.bind(a,45601)));function xe({}){const{check_user_auth:e}=(0,_.MH)(),{t}=(0,r.Bd)(),a=[];return e(v.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,w.jsx)(me,{})}),e(v.oV.ssh_proxy)&&a.push({index:1,name:`ssh ${t("代理")}`,tip:t("ssh_proxy_tip"),rto:"remoteShell/",component:(0,w.jsx)(V,{})}),e(v.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")} ${t("代理")}`,rto:"browserproxy/",component:(0,w.jsx)(j,{})}),e(v.oV.rdp_proxy)&&a.push({index:1,name:`rdp ${t("代理")}`,rto:"rdp/",component:(0,w.jsx)(ne,{})}),e(v.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,w.jsx)(ye,{})}),(0,w.jsx)(o.W1,{optionList:a,father_route:fe.o.proxy})}}}]);
|