filecat 6.14.1 → 6.15.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.c54dfb4f0ace2c6f84cb.js → 1448.cb0b816ecce11857fbc4.js} +1 -1
- package/build/dist/{2542.d6a50122f60efba32a30.js → 2542.26cb302b60de23166227.js} +1 -1
- package/build/dist/{2674.4fc554b04a11a3a3151d.js → 2674.570467c7d8e3378316cc.js} +1 -1
- package/build/dist/{4488.8a2727ce013104c4cfb4.js → 4488.72cda485aa8175ce03bd.js} +1 -1
- package/build/dist/{5308.93a513c4d2025f65e546.js → 5308.cc7a2e88ea22f247ec76.js} +1 -1
- package/build/dist/{5516.679dadeb7510275a7616.js → 5516.f442aef7efd919af92cd.js} +1 -1
- package/build/dist/{5937.d865e6e197bc253c59c2.js → 5937.820d7e5fcf608c346964.js} +1 -1
- package/build/dist/{6247.1b04f0b4739846af26ce.js → 6247.8116d7df0a5040d144c2.js} +1 -1
- package/build/dist/{6413.1fd049f6d4f791f72e1e.js → 6413.59cc305392ab00ff29c8.js} +1 -1
- package/build/dist/{6505.c1a0b35e1c2a0c66e837.js → 6505.f730960378f6e4b7bc24.js} +1 -1
- package/build/dist/{6892.bc3f13ff4689ffab1237.js → 6892.fac5b622852f0aad613d.js} +1 -1
- package/build/dist/{7181.984cdb2ff1a58762c55b.js → 7181.9f22415130200367cfda.js} +1 -1
- package/build/dist/{7209.9672e5474b99d79ee570.js → 7209.de0fc874821ef1cb0684.js} +1 -1
- package/build/dist/{8302.3d668f33b2a6c22b50d6.js → 8302.19a72820071ef3c3e981.js} +1 -1
- package/build/dist/{8603.cb2ce741aa06a7b51f41.js → 8603.8b4a272c8bbe4d5fd4c4.js} +1 -1
- package/build/dist/{8714.fe6d795fe2147cf0a86a.js → 8714.0609ed38a42421e9eb02.js} +1 -1
- package/build/dist/{8765.9b2daf5a74be623229d3.js → 8765.e8c4f80fb9afd6730bd3.js} +1 -1
- package/build/dist/9782.aa6ff8c23f30cc548007.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.df876feabe161c949cc9.js +2 -0
- package/build/dist/{main.27ca5409b10e4b78791e.js.LICENSE.txt → main.df876feabe161c949cc9.js.LICENSE.txt} +1 -1
- package/build/main.js +1 -1
- package/build/threads.work.filecat.js +1 -1
- package/package.json +1 -1
- package/build/dist/9782.913585e0ff779ece45b5.js +0 -1
- package/build/dist/main.27ca5409b10e4b78791e.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1448],{83277(e,t,s){s.d(t,{$j:()=>r,Lv:()=>i,qq:()=>n});class l{options_agent_url_list;options_agent_key_list;options_agent_model_list}class i{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const s of t)if(s.value===e)return s.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const s of t)if(s.value===e)return!0;return!1}}class n extends l{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url}const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function r(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}s.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n',"cL",0,a])},11448(e,t,s){s.r(t),s.d(t,{RebotCardContainer:()=>f,default:()=>y});var l=s(22022),i=s(96540),n=s(85997),a=s(57952),r=s(75725),o=s(61443),c=s(70447),d=s(14284),_=s(53459),h=s(62042),x=s(78247),p=s(23430),m=s(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1448],{83277(e,t,s){s.d(t,{$j:()=>r,Lv:()=>i,qq:()=>n});class l{options_agent_url_list;options_agent_key_list;options_agent_model_list}class i{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const s of t)if(s.value===e)return s.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const s of t)if(s.value===e)return!0;return!1}}class n extends l{tool_error_max=50;tool_call_max=300;allow_exec_cmd_directly=!1;proxy_url}const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function r(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}s.d(t,["CP",0,'\n\n# 工具报错最大尝试次数\ntool_error_max=50\n# 聊天循环最大次数\ntool_call_max=300\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n',"cL",0,a])},11448(e,t,s){s.r(t),s.d(t,{RebotCardContainer:()=>f,default:()=>y});var l=s(22022),i=s(96540),n=s(85997),a=s(57952),r=s(75725),o=s(61443),c=s(70447),d=s(14284),_=s(53459),h=s(62042),x=s(78247),p=s(23430),m=s(61973),j=(s(83277),s(92350)),u=s(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}]}},g=Object.entries(b).map(([e,t])=>({value:e,title:t.label,color:t.color}));function f(e){const{t}=(0,l.Bd)(),[s,a]=(0,i.useState)(!1),[r,c]=(0,i.useState)(!1),d=(t,s)=>{const l=[...e.items];l[t]={...l[t],...s},e.setItems(l)},_=t=>{const s=[...e.items];s.splice(t,1),e.setItems(s)},h=t=>{e.setItems([...e.items,{...e.items[t],open:!1,name:(e.items[t].name||"")+" (副本)"}])};return(0,u.jsxs)(i.Fragment,{children:[(0,u.jsx)("div",{className:"airebot-setting__toolbar",children:!1!==e.have_auth_edit&&(0,u.jsxs)(u.Fragment,{children:[s?(0,u.jsxs)("div",{className:"airebot-setting__add-select",children:[(0,u.jsx)(o.l6,{options:g,defaultValue:"qq",onChange:t=>{return s=t,e.setItems([...e.items,{platform:s,name:"",open:!1,appId:"",clientSecret:"",note:""}]),void a(!1);var s},width:"180px"}),(0,u.jsx)(n.rA,{icon:"cancel",title:t("取消"),onClick:()=>a(!1)})]}):(0,u.jsx)(n.rA,{icon:"add",title:t("添加机器人"),onClick:()=>a(!0)}),(0,u.jsx)(n.rA,{icon:"save",title:t(r?"保存中...":"保存"),onClick:()=>{r||(async()=>{c(!0),await e.save(),c(!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:d,onDelete:_,onCopy:h},t))})]})}const v=({item:e,index:t,onChange:s,onDelete:i,onCopy:a})=>{const{t:r}=(0,l.Bd)(),d=b[e.platform]??b.qq,_=e._status||"disconnected";e.open;return(0,u.jsx)(c.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:d.color},children:d.icon})}),titleCom:(0,u.jsxs)("div",{className:"airebot-setting__card-actions",children:[(0,u.jsx)(n.Ay,{checked:!!e.open,onChange:e=>s(t,{open:e})}),(0,u.jsx)(n.rA,{icon:"content_copy",title:r("复制"),onClick:()=>a(t)}),(0,u.jsx)(n.rA,{icon:"delete",title:r("删除"),onClick:()=>i(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)(o.l6,{options:g,value:e.platform,onChange:e=>s(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)(o.Sm,{value:e.name||"",handleInputChange:e=>s(t,{name:e}),placeholder:r("给机器人起个名字")})]}),d.fields.map(l=>{const i=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)(o.Sm,{type:l.type,value:i,handleInputChange:e=>s(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)(o.Sm,{value:e.model_index,handleInputChange:e=>s(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)(o.Sm,{value:e.user_id||"",handleInputChange:e=>s(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)(o.Sm,{value:e.note||"",handleInputChange:e=>s(t,{note:e}),placeholder:r("备注信息(可选)")})]})]})})};function y(){const{t:e}=(0,l.Bd)(),t=(0,m.Zp)(),{check_user_auth:s}=(0,x.MH)(),[o,c]=(0,i.useState)([]),b=(0,j.Q)(),g=async()=>{const e=await d.XO.get("ai_rebot_setting");e.code===_.m.Success&&c(e.data?.list??[])};(0,i.useEffect)(()=>{g()},[]);return(0,u.jsxs)("div",{className:"airebot-setting",children:[(0,u.jsx)(a.A,{children:s(p.oV.ai_agent_setting)&&(0,u.jsx)(n.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)(n.rA,{icon:"info",onClick:()=>{b("机器人配置")},title:"信息"})]}),(0,u.jsx)(f,{items:o,setItems:c,save:async()=>{const t={list:o.map((e,t)=>({...e,index:t}))};(await d.XO.post("ai_rebot_setting/save",t)).code===_.m.Success&&((0,h.SK)(e("保存成功")),await g())},have_auth_edit:s(p.oV.ai_agent_setting)})]})})]})}s.d(t,["PLATFORM_META",0,b,"RebotCard",0,v])},92350(e,t,s){s.d(t,{Q:()=>_,o:()=>x});var l=s(34843),i=s(82893),n=s(74777),a=s(96540),r=s(22022),o=s(23430),c=s(14284),d=s(74848);function _(){const[e,t]=(0,l.fp)(i.AG.prompt_card),{t:s,i18n:a}=(0,r.Bd)();return e=>{let l;e===n.jk.ffmpeg?l=(0,d.jsx)("div",{children:"视频转换,rtsp播放器等媒体功能都需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置"}):e===n.jk.smartmontools?l=(0,d.jsx)("div",{children:"磁盘检查需要这个软件。linux下你可以使用apt或者yum来安装,或者直接输入软件的位置。"}):"保护目录"===e?l=(0,d.jsxs)("div",{children:["在删除的时候保护目录会拒绝删除。",(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"可以使用 /* 来表达该目录下所有文件都禁止删除"}),(0,d.jsx)("li",{children:"可以使用 /** 来表达该目录下所有子目录文件都禁止删除"})]})]}):"文件夹路径"===e?l=(0,d.jsx)("div",{children:"用于在文件夹下切换根目录"}):"环境路径"===e?l=(0,d.jsx)("div",{children:"当在不同用户环境下运行的时候由于没有执行终端去加载PATH,这里可以添加额外的PATH路径,点击这里的保存还会更新系统上的path路径"}):"pty"===e?l=(0,d.jsx)("div",{children:"一些需要Pty环境的命令"}):"文件上传"===e?l=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"对于不同的目录(包括所有子目录),可能是机械或者固态硬盘,机械硬盘在处理多个小文件的时候会做随机i/o,由于一般只有一个盘头所以会影响整体效率,特别是写操作,这里提供了上传时候的最大数量限制,对于下载数量目前不做限制."}),(0,d.jsx)("li",{children:"大文件支持断点和分块并发传输,建议并发数量设置为2,分块大小设置为10MB,大文件判断为500MB,设置过大的话会上传的时候会占据较大内存"})]})}):"目录快捷命令"===e?l=(0,d.jsx)("div",{children:"右键文件夹空白处用于,打开终端快捷执行命令"}):"文件快捷命令"===e?l=(0,d.jsx)("div",{children:"用于右键特定后缀的文件,执行一些快捷命令,文件后缀可以是多个,用空格分割"}):"Workflow"===e?l=(0,d.jsx)("div",{children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:"在特定的时间启动系统中的workflow任务"}),(0,d.jsx)("li",{children:"cron表达式是定时器 格式为: 秒 分 时 日 月 星期"}),(0,d.jsxs)("li",{children:[(0,d.jsx)("li",{children:'1. "*"(通配符,所有值)'}),(0,d.jsx)("li",{children:'2. "," 是枚举: 0 0 1,15 * * *'}),(0,d.jsx)("li",{children:'3. "-" 是范围: 0 0 1-5 * * *'}),(0,d.jsx)("li",{children:'4. "/" 是步长,标识每隔n执行 */3 * * * * * 每隔三秒,必须配合 * 使用 ,/ 只能写一次 ,有了/就成了定时器,而不是指定时间执行'})]})]})}):"插件配置"===e?l=(0,d.jsx)("div",{children:s("路径可以是一个 js 文件也可以是一个node 项目目录")}):"机器人配置"===e&&(l=(0,d.jsxs)("div",{children:[(0,d.jsx)("dv",{children:"机器人功能用于开通各种第三方支持的机器人,让第三方机器人接入本地的 AI 模型。"}),(0,d.jsx)("ul",{children:(0,d.jsx)("li",{children:" 1. qq 机器人需要先在手机 app 中添加,然后在https://q.qq.com/qqbot/ 登录机器人配置页面,在开发管理中复制机器人的 appId,appSecret 到这里就完成了配置了。"})})]})),t({open:!0,title:"信息",context_div:(0,d.jsx)("div",{children:l})})}}let h=o.Ky;function x(){const[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{try{const e=await c.XO.get("themes");if(0===e.code){const s=e.data||[];h=[...o.Ky,...s],t(h)}else console.warn("获取主题列表失败,使用默认列表"),t(h)}catch(e){t(h)}})()},[]),e}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(61973),u=n(14284),d=(n(23430),n(82893)),r=n(75725),f=n(22022),h=n(7523),p=n(62042),_=n(21469),m=n(74848);_.m.init();const x=function(){const e=(0,o.Zp)(),[t,n]=(0,c.useState)(""),[x,w]=(0,c.useState)(""),{initUserInfo:k}=(0,c.useContext)(h.F),[g,j]=(0,a.fp)(d.AG.custom_fun_opt),{t:C}=(0,f.Bd)();async function I(){const n={username:t,password:x},s=await u.wm.post("login",n,!1);0===s.code?(localStorage.setItem("token",s.data),k(),j(""),e("/file")):(0,p.zN)(s.message)}return(0,c.useEffect)(()=>{localStorage.getItem("token")&&e("/file")},[]),(0,m.jsxs)(r.Y5,{children:[(0,m.jsx)("h1",{children:_.m.web_site_title??"FileCat"}),(0,m.jsxs)("div",{className:"self_win_center_content",children:[(0,m.jsx)(l.Sm,{placeholder:C("账号"),handleInputChange:e=>{n(e)}}),(0,m.jsx)(l.cA,{placeholder:C("密码"),handleInputChange:e=>{w(e)},handleEnterPress:I}),(0,m.jsx)(i.$n,{text:C("登录"),clickFun:I}),s.A.has("tcp_client_num_id")&&(0,m.jsx)(i.$n,{text:C("代理退出"),clickFun:()=>{s.A.delete("tcp_client_num_id"),window.location.reload()}})]})]})};n.d(t,["default",0,x])}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>j});var a=n(96540),o=n(82893),i=n(34843),s=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function p(e){{const[t,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)([]),l=e=>{i(e)},h=async()=>{"folder"===e.type?(t||!e.click||o||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},m=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{i(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:h,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,m)},className:"studio-item-title",children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(s.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&o&&(0,d.jsx)("div",{style:{marginLeft:20},children:o.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(p,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:m},n)},n))})]})}}n(61443);function h(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(p,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,children:t.children,click:e.click,size:t.size},n))})}var m=n(14284),u=n(34289),f=n(53459),x=n(78247),w=(n(62042),n(2543)),y=n(27690),v=n(22022),_=n(88815),k=n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>j});var a=n(96540),o=n(82893),i=n(34843),s=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function p(e){{const[t,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)([]),l=e=>{i(e)},h=async()=>{"folder"===e.type?(t||!e.click||o||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},m=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{i(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:h,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,m)},className:"studio-item-title",children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(s.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&o&&(0,d.jsx)("div",{style:{marginLeft:20},children:o.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(p,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:m},n)},n))})]})}}n(61443);function h(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(p,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,children:t.children,click:e.click,size:t.size},n))})}var m=n(14284),u=n(34289),f=n(53459),x=n(78247),w=(n(62042),n(2543)),y=n(27690),v=n(22022),_=n(88815),k=n(61973);const g=a.lazy(()=>Promise.all([n.e(9988),n.e(4091)]).then(n.bind(n,84091)));function j(e){const[t,n]=(0,a.useState)([]),[p,j]=(0,a.useState)(""),[C,E]=(0,a.useState)(""),[N,S]=(0,a.useState)(!1),[M,P]=(0,a.useState)({path:"",name:""}),[$,b]=(0,a.useState)(""),[G,I]=(0,i.fp)(o.AG.confirm),[z,A]=(0,a.useState)(!1),[F,D]=(0,i.fp)(o.AG.fileShellShow),[L,R]=(0,i.fp)(o.AG.file_shell_hidden),T=(0,a.useRef)(null),K=(0,a.useRef)(null),[U,B]=(0,a.useState)(!1),[W,X]=(0,a.useState)(16),[Y,Z]=(0,i.fp)(o.AG.showPrompt),{t:q}=(0,v.Bd)(),H=(0,k.Zp)();let J=(0,k.zy)().pathname.split("/").filter(Boolean).pop();J=decodeURIComponent(J);const O=async()=>{const e=(0,u.GG)("file",J);j(e);const t=await m.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{E(""),P({}),A(!1),O()},[]);const Q=async(e,t)=>{const n=await m.$M.get(`${encodeURIComponent(t)}`);E(n.data),x.xK.set_value_temp(n.data),P({path:t,name:e}),b(t)},V=(e,t)=>{e.size>_.o5?I({open:!0,handle:()=>{Q(e.name,t),I({open:!1,handle:null}),A(!1)},title:"超过20MB了还要打开吗?"}):Q(e.name,t)};async function ee(){if(!z)return;const e={context:x.xK.get_editor_value()};0===(await m.$M.post(`save/${encodeURIComponent($)}`,e)).code&&A(!1)}const te=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),z&&ee())};(0,a.useEffect)(()=>(document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}),[z]);const ne=(0,a.useCallback)(w.throttle(e=>{const t=parseFloat(getComputedStyle(K.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,o=2.25+T.current.offsetWidth/t;a<=n&&a>=o&&X(parseFloat(a.toFixed(2)))},32),[]),ae=()=>{B(!1),K.current.removeEventListener("pointermove",ne)},oe=[{r:q("创建文件"),v:"创建文件"},{r:q("创建目录"),v:"创建目录"},{r:q("重命名"),v:"重命名"},{r:q("删除"),v:"删除"}],ie=[{r:q("重命名"),v:"重命名"},{r:q("删除"),v:"删除"}],se=(e,t,n,a,o)=>{e.preventDefault();const i=new c.ik;i.path=n,i.filename=t,i.x=e.clientX,i.y=e.clientY,i.items=a?oe:ie,o===O&&(i.items=i.items.slice(0,2)),i.type=a?r.Iw.studio_folder:r.Iw.studio_file;const s=e=>{o(e)};i.textClick=e=>{switch(e){case"创建文件":Z({show:!0,type:y.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:s}});break;case"创建目录":Z({show:!0,type:y.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:s}});break;case"删除":if(z&&(M.path===n||M.path.includes(n))){const e=()=>{s(a),A(!1),P({}),E(""),x.xK.set_value_temp("")};Z({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}Z({show:!0,type:y.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{s(!0)}:s}});break;case"重命名":Z({show:!0,type:y.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,u.Yp)(n),call:()=>{s(!0)},filename:t}})}},Z({show:!0,type:y.PromptEnum.FileMenu,overlay:!1,data:i})};return(0,d.jsxs)("div",{className:"studio",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:"取消",icon:"close",onClick:()=>{D({show:!1,path:""}),R(void 0),H(-1)}},1),(0,d.jsx)("title",{children:M.name},2)],children:[(0,c.zr)(M.name)&&(0,d.jsx)(s.rA,{title:"格式化",icon:"data_object",onClick:function(){x.xK.get_editor()?.formatCode()}}),(0,d.jsx)(s.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===L?F.show?D({show:!1,path:""}):(D({show:!0,path:(0,u.GG)("file",J)}),R(!1)):R(!L)}}),z&&(0,d.jsx)(s.rA,{title:"保存",icon:"save",onClick:ee})]}),(0,d.jsxs)("div",{className:"studio-body",ref:K,children:[(0,d.jsx)("div",{className:"studio-nav",style:{width:W-1+"em"},onContextMenu:e=>{se(e,M.name,(0,u.GG)("file",J),!0,O)},children:(0,d.jsx)(h,{pre_path:p,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await m.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(z)return void I({open:!0,handle:()=>{I({open:!1,handle:null}),A(!1),V(e,n)},title:"确定不保存就切换吗?"});V(e,n)}},handleContextMenu:se,fatherNowToggleExpansion:O})}),(0,d.jsx)("div",{className:"studio__divider",ref:T,onPointerDown:()=>{B(!0),K.current.addEventListener("pointermove",ne)},onPointerUp:ae}),U&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:ae}),(0,d.jsx)("div",{className:"studio-editor",children:M.name&&(0,d.jsx)(g,{name:M.name,on_change:()=>{z||A(!0)}})},M.path)]})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091,4488],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>r});var s=n(96540),i=n(74848);function r(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,n)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},84091(e,t,n){n.r(t),n.d(t,{default:()=>d});var s=n(96540),i=n(80952),r=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(1234),n(47507),n(87268),n(24522)),l=n(34843),a=n(82893),c=n(78247),o=n(74848);function d(e){const t=(0,s.useRef)(null),[n,d]=(0,l.fp)(a.AG.user_base_info),u=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,s.useEffect)(()=>{const n=i.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??r.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return n.setOptions({}),n.container.addEventListener("wheel",function(e){e.preventDefault()}),n.focus(),n.on("change",function(t){e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=i.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},c.xK.set_editor_temp(n,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("modePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("themePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("workerPath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`)},84488(e,t,n){n.r(t),n.d(t,{default:()=>x});var s=n(96540),i=n(57952),r=n(85997),l=n(14284),a=n(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091,4488],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>r});var s=n(96540),i=n(74848);function r(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,n)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},84091(e,t,n){n.r(t),n.d(t,{default:()=>d});var s=n(96540),i=n(80952),r=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(1234),n(47507),n(87268),n(24522)),l=n(34843),a=n(82893),c=n(78247),o=n(74848);function d(e){const t=(0,s.useRef)(null),[n,d]=(0,l.fp)(a.AG.user_base_info),u=n.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,s.useEffect)(()=>{const n=i.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??r.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return n.setOptions({}),n.container.addEventListener("wheel",function(e){e.preventDefault()}),n.focus(),n.on("change",function(t){e.on_change&&e.on_change()}),t.current=n,n.formatCode=()=>{const e=i.require("ace/ext/beautify"),n=t.current;n&&e.beautify(n.session)},c.xK.set_editor_temp(n,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),n.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("modePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("themePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("workerPath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`),i.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`)},84488(e,t,n){n.r(t),n.d(t,{default:()=>x});var s=n(96540),i=n(57952),r=n(85997),l=n(14284),a=n(61973),c=n(77481),o=n(70447),d=n(34843),u=n(82893),h=n(84091),p=n(78247),m=n(74848);function x(){const e=(0,a.Zp)(),[t]=(0,d.fp)(u.AG.sqlite_query_context),n=(0,s.useMemo)(()=>t?.path??"",[t?.path]),x=(0,s.useMemo)(()=>t?.path?`${t?.name||"数据库"} | ${t.path}`:"未选择数据库",[t?.name,t?.path]),_=97,[f,j]=(0,s.useState)(""),[g,b]=(0,s.useState)("table"),[v,y]=(0,s.useState)(!1),[w,k]=(0,s.useState)(""),[q,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{p.xK.set_value_temp(f,_)},[f]),(0,s.useEffect)(()=>{j(""),k(""),C(null),b("table"),p.xK.set_value_temp("",_),n||k("请先从文件右键打开一个数据库")},[n,t?.open]);const S=async()=>{const e=(p.xK.get_editor_value(_)??f).trim();if(!n)return k("请先从文件右键打开一个数据库"),void C(null);if(!e)return k("请输入 SQL 语句"),void C(null);y(!0),k("");try{const t=await l.$M.post("sqlite/query",{path:n,sql:e});C(t.data),b("table")}catch(e){k(e?.message??`${e}`),C(null)}finally{y(!1)}},N=q?.columns?.length?q.columns:Object.keys(q?.rows?.[0]??{}),$=(q?.rows??[]).map(e=>N.map(t=>{return null==(n=e[t])?"":"object"==typeof n?JSON.stringify(n):`${n}`;var n}));return(0,m.jsxs)("div",{className:"db-query-page",children:[(0,m.jsx)(i.A,{ignore_tags:!0,left_children:[(0,m.jsx)(r.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,m.jsx)(r.rA,{icon:"play_arrow",title:"执行",onClick:S},"run"),(0,m.jsx)(r.rA,{icon:"table_chart",title:"表格视图",onClick:()=>b("table")},"table"),(0,m.jsx)(r.rA,{icon:"data_object",title:"原 JSON",onClick:()=>b("json")},"json")],children:(0,m.jsx)(o.xP,{context:x,tip_context:"点击复制数据库信息"})}),(0,m.jsxs)("div",{className:"db-query-page__content",children:[(0,m.jsxs)(o.Zp,{title:"SQL 查询",rightBottomCom:(0,m.jsxs)("div",{className:"db-query-page__actions",children:[(0,m.jsx)(r.C3,{text:v?"查询中...":"执行查询",clickFun:S}),(0,m.jsx)(r.C3,{text:"清空",clickFun:()=>{p.xK.set_value_temp("",_);const e=p.xK.get_editor(_);e&&e.setValue("",-1),j("")}}),(0,m.jsx)(r.C3,{text:"table"===g?"表格视图":"切换到表格",clickFun:()=>b("table")}),(0,m.jsx)(r.C3,{text:"json"===g?"原 JSON":"切换到 JSON",clickFun:()=>b("json")})]}),children:[(0,m.jsx)("div",{className:"db-query-page__editor",children:(0,m.jsx)(h.default,{name:"sqlite.sql",editor_id:_,model:"ace/mode/sql",on_change:()=>{const e=p.xK.get_editor_value(_)??"";j(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),w&&(0,m.jsx)("div",{className:"db-query-page__error",children:w})]}),(0,m.jsxs)(o.Zp,{title:"查询结果",titleCom:(0,m.jsx)("span",{children:q?`${q.row_count} 行`:"暂无结果"}),children:[q&&"table"===g&&(0,m.jsx)(c.X,{headers:N,rows:$}),q&&"json"===g&&(0,m.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(q.rows,null,2)}),!q&&!w&&(0,m.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!q&&w&&(0,m.jsx)("div",{className:"db-query-page__hint",children:w})]})]})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5308],{65308(e,t,a){a.r(t),a.d(t,{default:()=>w});var o=a(96540),n=a(34843),i=a(82893),s=a(34289),r=a(14284),c=a(38240),l=a(62042),d=a(47022),m=a(78247),p=a(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5308],{65308(e,t,a){a.r(t),a.d(t,{default:()=>w});var o=a(96540),n=a(34843),i=a(82893),s=a(34289),r=a(14284),c=a(38240),l=a(62042),d=a(47022),m=a(78247),p=a(61973),f=a(74848);let u,g=!1;const b=1024e3;function w(){const[e,t]=(0,n.fp)(i.AG.image_editor),a=(0,p.Zp)();(0,p.zy)();return(0,o.useEffect)(()=>((async()=>{if(!g)try{await(0,c.J)("filerobot-image-editor.min.js"),g=!0}catch(e){return void(0,l.zN)("加载资源失败")}const o=(0,s.GG)("file",e.path),n=window.FilerobotImageEditor,{TABS:i,TOOLS:p}=n,f={defaultSavedImageName:e.name,source:r.$M.getDownloadUrl(o),onSave:async(t,a)=>{const n=t.imageBase64.split(",")[1],i=(t.mimeType,t.extension),c=t.name??e.name,p=`base64/save/${encodeURIComponent(`${(0,s.Yp)(o)}${c}.${i}`)}`;if(n.length<=b){const e={base64_context:n,type:d.t7.all};await r.$M.post(p,e)}else{const e=(0,m.L6)(n,b),t={base64_context:e[0],type:d.t7.start};t.type=d.t7.part,await r.$M.post(p+`?type${d.t7.start}`,t);for(let a=1;a<e.length;a++)t.base64_context=e[a],await r.$M.post(p,t)}(0,l.SK)("保存成功")},annotationsCommon:{fill:"#151717",stroke:"#ec0f42",shadowColor:"#151717"},Text:{text:""},Rotate:{angle:90,componentType:"slider"},tabsIds:[Object.values(i)],defaultTabId:i.ANNOTATE,defaultToolId:p.ANNOTATE};u=new n(document.querySelector("#editor_container"),f),u.render({onClose:e=>{u.terminate(),t({}),a((0,s.vX)())}})})(),()=>{u&&u.terminate()}),[]),(0,f.jsx)("div",{id:"image-editor-container",children:(0,f.jsx)("div",{className:"image-editor-context",children:(0,f.jsx)("div",{id:"editor_container",className:"image-editor-context"})})})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5516],{52811(e,t,a){a.r(t),a.d(t,{default:()=>h});var s=a(96540),l=a(60882),i=a(34843),n=a(82893),r=a(14284),c=a(34289),o=a(62042),d=a(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5516],{52811(e,t,a){a.r(t),a.d(t,{default:()=>h});var s=a(96540),l=a(60882),i=a(34843),n=a(82893),r=a(14284),c=a(34289),o=a(62042),d=a(61973),g=a(57889),u=a(22022),A=a(53459),x=(a(3561),a(74848));function h(){const[e,t]=(0,i.fp)(n.AG.excalidraw_editor),[a,h]=(0,s.useState)(null),[f,m]=(0,s.useState)(null),[w,p]=(0,s.useState)(!1),v=(0,d.Zp)(),{t:S}=(0,u.Bd)();(0,s.useEffect)(()=>{let t=!1;return(async()=>{if(e?.url){p(!0);try{const a=await g.l.get(e.url);if(t)return;const s=function(e){if(!e)return null;const t="string"==typeof e?e:e.context??e.data??e;if(!t)return null;try{return"string"==typeof t?JSON.parse(t):t}catch{return null}}(a);if(!s)throw new Error("invalid excalidraw scene");m(s)}catch{t||(m(null),(0,o.zN)("Load Excalidraw file failed"))}finally{t||p(!1)}}else m(null)})(),()=>{t=!0}},[e?.url]);return(0,x.jsx)("div",{id:"excalidraw-container",children:(0,x.jsxs)("div",{className:"excalidraw-context",children:[w&&(0,x.jsx)("div",{className:"common-box common-box-center",children:"Loading..."}),!w&&f&&(0,x.jsx)(l.Td,{langCode:"zh-CN",initialData:f,excalidrawAPI:e=>h(e),UIOptions:{dockedSidebarBreakpoint:0},children:(0,x.jsxs)(l.zU,{children:[(0,x.jsx)(l.zU.Item,{onSelect:()=>{t({}),v((0,c.vX)()),e?.close?.()},children:S("关闭")}),(0,x.jsx)(l.zU.Item,{onSelect:async()=>{if(!a)return void(0,o.zN)("Editor is not ready");const t=a.getSceneElements(),s=a.getAppState(),i=a.getFiles(),n=(0,l.nu)(t,s,i,"local"),d=JSON.parse(n);d.appState={...d.appState??{},zoom:s.zoom,scrollX:s.scrollX,scrollY:s.scrollY,viewBackgroundColor:s.viewBackgroundColor,gridSize:s.gridSize};(await r.$M.post(`save/${encodeURIComponent((0,c.GG)("file",(0,c.vX)()))}${e.name}`,{context:JSON.stringify(d)})).code===A.m.Success&&(0,o.SK)("保存成功")},children:S("保存到服务器")}),(0,x.jsxs)(l.zU.Group,{title:"Excalidraw items",children:[(0,x.jsx)(l.zU.DefaultItems.LoadScene,{}),(0,x.jsx)(l.zU.DefaultItems.Export,{}),(0,x.jsx)(l.zU.DefaultItems.SaveToActiveFile,{}),(0,x.jsx)(l.zU.DefaultItems.SaveAsImage,{}),(0,x.jsx)(l.zU.DefaultItems.ClearCanvas,{}),(0,x.jsx)(l.zU.DefaultItems.ToggleTheme,{}),(0,x.jsx)(l.zU.DefaultItems.ChangeCanvasBackground,{})]})]})},e.url??"excalidraw")]})})}},51953(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},17834(e){e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},56933(e){e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5937],{8694(e,t,a){a.d(t,{$K:()=>o,RB:()=>r,l5:()=>c,qB:()=>s,vo:()=>i,vr:()=>l});class s{targetProxyUrl;proxyPort;sysProxyPort}let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class i{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class c{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var s=a(85997),n=a(74848);function o(e){return(0,n.jsxs)("h2",{className:"message",children:[(0,n.jsx)(s.In,{icon:"sentiment_dissatisfied"}),(0,n.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>p});var s=a(96540),n=a(52671),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(22022),d=a(85997),u=a(74848);function p(e){let t=(0,n.zy)();const[a,p]=(0,s.useState)([]),[h,m]=(0,s.useState)("/"),[f,y]=(0,s.useState)(void 0),{t:_,i18n:v}=(0,c.Bd)();s.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const s=a.indexOf(e.baseRoute),n=[];if(-1!=s){t=(0,o.IO)(a.slice(0,s),e.baseRoute);const i=a.slice(s+1);for(let e=0;e<i.length;e++){const a=i[e];n.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(n[e-1].href,a)})}m(t),p(n)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)};return(0,u.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,u.jsx)(s.Fragment,{children:void 0===f?(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("span",{className:"chevron",children:(0,u.jsx)(n.N_,{to:h,onClick:x,children:(0,u.jsx)(d.In,{icon:"home"})})}),a.map((e,t)=>(0,u.jsxs)("span",{className:"chevron",children:[(0,u.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,u.jsx)(n.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t))]}):(0,u.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,u.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>i,X:()=>o});var s=a(96540),n=a(74848);function o(e){const[t,a]=s.useState([]);return(0,s.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]),(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{children:e.headers?.map((e,t)=>(0,n.jsx)("th",{children:e},t))})}),(0,n.jsx)("tbody",{children:t.map((t,a)=>(0,n.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((a,s)=>(0,n.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:a},s))},a))})]})}function i(e){return(0,n.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,n.jsx)("div",{children:e},t))})}},83029(e,t,a){a.d(t,{N:()=>v});var s=a(96540),n=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,n.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),c=a(61443),d=a(85997),u=a(52671),p=a(22022);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function v(e){const[t,a]=(0,s.useState)([]),[v,x]=(0,s.useState)(-1),w=(0,u.zy)(),[g,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(!1),{t:K}=(0,p.Bd)(),[b,S]=(0,s.useState)([]),[C,A]=(0,n.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==v?_[v]._children=e:y=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[w]);(0,s.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{x(v+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===v?y:_[v-1]._children),x(v-1),_.pop()}}),t.map((n,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,s)=>{e.preventDefault();const n=t[m],o=t[s];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(n),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(s,0,r),F(i),a(i)})(e,o),style:{cursor:g?"move":"pointer"},children:[(0,i.jsx)(r,{name:n.name,item:n,...n,div:g,target:"_blank",click_dir:D,clickItem:e.clickItem}),g&&(void 0!==b.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===n._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(c.Sm,{value:n.name,handleInputChange:e=>{n.name=e},placeholder:K("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:n.color,handleInputChange:e=>{n.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:n[e.key],handleInputChange:t=>{n[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:K("折叠"),clickFun:()=>{S((0,l.P1)(b,o))}})]}),g&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:K("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),F(s),a(s)})(o)}}),(0,i.jsx)(d.C3,{text:K("编辑"),clickFun:()=>{void 0===b.find(e=>e===o)&&S([...b,o])}})]})})]},o)),g&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:K("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),N(!1)}}),(0,i.jsx)(d.rA,{title:K("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(s),a(s)}}),(0,i.jsx)(d.rA,{title:K("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:K("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{N(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:g?"save":"edit",title:K(g?"保存":"编辑"),onClick:async()=>{g?e.save&&await e.save(y):f=t,j(!g)}})]})}},15937(e,t,a){a.r(t),a.d(t,{default:()=>me});var s=a(96540),n=a(70447),o=a(75725),i=a(61443),r=a(85997),l=a(57952),c=a(14284),d=a(8694),u=a(53459),p=a(83029),h=a(22022),m=a(82893),f=a(34843),y=a(78247),_=a(23430),v=a(62042),x=a(74848);function w(e){const{t}=(0,h.Bd)(),[a,n]=(0,f.fp)(m.AG.header_min),[w,g]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,K]=(0,s.useState)(void 0),[b,S]=(0,s.useState)(!1),{check_user_auth:C}=(0,y.MH)(),A=async()=>{const e=new d.qB;e.targetProxyUrl="string"==typeof w?w:j;(await c._U.post("close",e)).code===u.m.Success&&(k(""),n(!1))},F=async e=>{const t=new d.qB;if(t.targetProxyUrl="string"==typeof e?e:w,!t.targetProxyUrl.startsWith("http"))return void(0,v.zN)("must start with http[s]://");const a=await c._U.post("start",t);if(a.code!==u.m.Success)return;const s=`${window.location.protocol}//${window.location.hostname}:${a.data}`;k(s)};(0,s.useEffect)(()=>()=>{A()},[]);return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("要代理的url"),icon:"link",value:w,handleInputChange:e=>{g(e)}}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("开始代理"),onClick:F}),(0,x.jsx)(r.rA,{icon:"fullscreen",title:t("全屏"),onClick:()=>{S(!b),n(!b)}}),(0,x.jsx)(r.rA,{icon:"close",title:t(t("关闭")),onClick:()=>{A(),S(!1),g("")}})]}),(0,x.jsx)(o.jW,{isFull:b,children:(0,x.jsxs)("div",{id:"browser",children:[!j&&(0,x.jsx)(p.N,{have_auth_edit:C(_.oV.browser_proxy_tag_update),getItems:async()=>{const e=await c._U.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{g(e.url),F(e.url)},items:[{key:"name",preName:t("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]}),(0,x.jsx)("iframe",{id:"webview",src:j})]})})]})}var g=a(34289),j=(a(75007),a(97856)),k=a(92275),N=a(14944),K=a(64405);const b=s.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(a.bind(a,85614)));function S(e){const[t,a]=(0,s.useState)(null),[n,o]=(0,f.fp)(m.AG.remoteShellShow),[i,r]=(0,s.useState)(!1),[l,c]=(0,f.fp)(m.AG.sshInfo),[d,u]=(0,f.fp)(m.AG.shellNowDir),[p,h]=(0,f.fp)(m.AG.user_base_info),y=p.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,s.useEffect)(()=>()=>{_()},[]),(0,s.useEffect)(()=>{n.show?t||((async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const s=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=s},N.ws.addMsg(k.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new K.x;t.key=l.key,t.cmd=e;const a=new k.hf(k.HK.remote_shell_send);a.context=t,await N.ws.send(a)}),a(e)})(),r(!0)):_()},[n]);return(0,x.jsx)(b,{show:n.show,terminal:t,init:(e,a)=>{t.writeln("[38;2;29;153;243mopen shell...[0m ");const s=new k.hf(k.HK.remote_shell_open),o=new K.x;o.key=l.key,o.init_path=n.path,o.rows=e,o.cols=a,s.context=o,N.ws.send(s)}})}var C=a(47374),A=a(52671),F=a(99214),D=a(47022),L=a(88815),M=a(6960),B=a(79240),I=a(27690),P=a(12730);function E(e){const{t}=(0,h.Bd)();(0,A.zy)();(0,A.Zp)();const{check_user_auth:a}=(0,y.MH)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[i,l]=(0,f.fp)(m.AG.uploadFiles),[c,d]=(0,f.fp)(m.AG.showPrompt),[u,p]=(0,f.fp)(m.AG.selectedFileList),[_,w]=(0,f.fp)(m.AG.enterKey),[j,k]=(0,f.fp)(m.AG.copyedFileList),[N,K]=(0,f.fp)(m.AG.cutedFileList),[b,S]=(0,f.fp)(m.AG.selectedFileList),[C,L]=(0,f.fp)(m.AG.clickFileList),[M,B]=(0,f.fp)(m.AG.remoteShellShow),[E,R]=(0,f.fp)(m.AG.sshInfo),$=(0,F.Vs)();function G(e){(0,v.SK)(e)}return(0,x.jsxs)(s.Fragment,{children:[u.length>0&&(0,x.jsx)(r.rA,{icon:"delete",title:t("删除"),onClick:()=>{d({show:!0,type:I.PromptEnum.SshDelete,overlay:!0,data:{}})}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,F.ib)(n,u);k(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),K([]),G("已复制")}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,F.ib)(n,u);K(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),k([]),G("已剪切")}}),(j.length>0||N.length>0)&&(0,x.jsx)(r.rA,{onClick:function(){d({show:!0,type:I.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:j.length+N.length}),1===u.length&&n.files.length>=1&&(0,F.ib)(n,u)[0].type!==D.Iw.folder&&(0,x.jsx)(r.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,F.ib)(n,u),t=`/api/ssh/download?file=${`/${(0,g.GG)("remoteShell",(0,g.vX)())}${decodeURIComponent(e[0].name)}`}&key=${E.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===u.length&&(0,x.jsx)(r.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){d({show:!0,type:I.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"terminal",title:"shell",onClick:function(){M.show?B({show:!1,path:""}):B({show:!0,path:`/${(0,g.GG)("remoteShell",(0,g.vX)())}`})}}),(0,x.jsx)(r.rA,{icon:"grid_view",title:t("切换样式"),onClick:$}),(0,x.jsx)(r.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"upload_file",title:"上传",onClick:()=>{d({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const s=[],n=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&n.add((0,P.S)(i)),s.push(o)}const o=[];if(a)for(const e of Array.from(n))o.push({isDir:!0,fullPath:e,name:e});o.push(...s),l(o),d({show:!0,type:I.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,x.jsx)(r.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var R=a(60096),$=a(21499);let G;function O(e){const{t}=(0,h.Bd)(),a=(0,A.zy)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[r,d]=(0,f.fp)(m.AG.selectedFileList),[p,y]=(0,f.fp)(m.AG.clickFileList),[w,j]=(0,f.fp)(m.AG.sshInfo),[k,N]=(0,s.useState)(""),b=(0,A.Zp)(),[D,I]=(0,f.fp)(m.AG.user_base_info),P=async e=>{const t=new K.x;t.key=w.key,t.dir=e||`/${(0,g.GG)("remoteShell",(0,g.vX)())}`;const a=await c.Fg.post("get/dir",t);if(a.code!==u.m.Success)return void(0,v.zN)("连接失败");const{folders:s,files:n}=a.data||{};for(const e of n??[])e.origin_size=e.size,e.size=(0,L.v7)(e.size),D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";for(const e of s??[])D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";const i={folders:s||[],files:n||[]};(0,F.yC)(i,D.user_data.dir_show_type),o(i),G=i};function O(){d([]),y([])}(0,s.useEffect)(()=>{O(),(async()=>{await P()})()},[a]);return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(l.A,{left_children:(0,x.jsx)(i.$Z,{handleEnterPress:()=>{if(!G)return;d([]),y([]);const e=[],t=[];for(const t of G.files??[])t.name.includes(k)&&e.push(t);for(const e of G.folders??[])e.name.includes(k)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{N(e)},max_width:"25em"}),children:(0,x.jsx)(E,{close:e.close})}),(0,x.jsx)(C.e,{baseRoute:"remoteShell",clickFun:O,input_path_enter:e=>{(0,B.Z1)(e)?P(e):b((0,B.Jn)((0,g.vX)(),e)),d([]),y([]),o({files:[],folders:[]})}}),(0,x.jsx)(R.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&d([])},file_list:n.files,folder_list:n.folders,fileHandler:P}),(0,x.jsx)(S,{})]})}function H(e){const{t}=(0,h.Bd)(),a=(0,A.Zp)(),[n,o]=(0,s.useState)(""),[d,w]=(0,s.useState)(""),[g,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[b,S]=(0,s.useState)(void 0),[C,F]=(0,s.useState)(""),[D,L]=(0,f.fp)(m.AG.shellNowDir),[M,I]=(0,f.fp)(m.AG.sshInfo),{check_user_auth:P}=(0,y.MH)(),E=async e=>{const t=new K.x;if(t.password=e?e.password:d,t.domain=e?e.domain:k,t.port=e?e.port:b,t.username=e?e.username:n,t.private_path=e?e.private_path:g,t.dir=e?e.dir:C,!t.dir)return void(0,v.zN)("dir not found");if(!t.username)return void(0,v.zN)("username not found");if(!t.domain)return void(0,v.zN)("domain not found");if(!t.port)return void(0,v.zN)("port not found");if(!t.private_path&&!t.password)return void(0,v.zN)("private_path password not found");const s=await c.Fg.post("start",t);s&&s.code===u.m.Success&&(a((0,B.Jn)("/proxy/remoteShell",t.dir)),L([t.dir]),I(s.data))};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:C,handleInputChange:e=>F(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:n,handleInputChange:e=>o(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:d,handleInputChange:e=>w(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:g,handleInputChange:e=>j(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:k,handleInputChange:e=>{N(e)},max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:b,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,v.zN)("不是数字"),S(parseInt(e))},max_width:"7rem"}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{E()}})]}),M.key?(0,x.jsx)(O,{close:async()=>{const e=new K.x;e.key=M.key;await c.Fg.post("close",e);I({})},data:{port:b,password:d,username:n,domain:k,dir:C}}):(0,x.jsx)(p.N,{have_auth_edit:P(_.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await c.Fg.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{await c.Fg.post("tag/save",e)},clickItem:async e=>{N(e.domain),F(e.dir),S(e.port),o(e.username),w(e.password),j(e.private_path),await E(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function U(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class z{constructor(e){this.canvas=e,this.render=new Y.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,s=Math.round(15*Math.abs(a)/8),n=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-n.left,y:t.clientY-n.top,step:s,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),s=a?t.deltaX:t.deltaY,n=Math.round(15*Math.abs(s)/8),o=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:n,isNegative:s>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,s,n,o){var i=this;N.ws.addMsg(k.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),N.ws.addMsg(k.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),N.ws.addMsg(k.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),N.ws.addMsg(k.HK.rdp_error,e=>{i.activeSession=!1});const r=new k.hf;r.cmdType=k.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:s,password:n,locale:Y.locale()},N.ws.send(r)}}class T{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),s=Module._malloc(a.length),n=new Uint8Array(Module.HEAPU8.buffer,s,a.length);n.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),c=new Uint8Array(Module.HEAPU8.buffer,l,r),d=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,o,i,e.width,e.height,n.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(s),Module._free(l),{width:o,height:i,data:d}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var V={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},J={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},Z={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J}};function X(){}X.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new z(e)}},Canvas:{create:function(e){return new T(e)}},scancode(e){var t=X.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",V[e.code||Z[X.prototype.browser()||"firefox"][t][e.keyCode]]}};let Y=new X;var q=a(38240);let W;function Q(){const{t:e}=(0,h.Bd)(),[t,a]=(0,f.fp)(m.AG.header_min),{check_user_auth:n}=(0,y.MH)(),[d,w]=(0,s.useState)(void 0),[g,j]=(0,s.useState)(3389),[K,b]=(0,s.useState)(void 0),[S,C]=(0,s.useState)(void 0),[A,F]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1);var M=null;(0,s.useEffect)(()=>(W||(async()=>{try{await(0,q.J)("rle.js"),W=!0}catch(e){return void(0,v.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const B=t=>{L(!0),function(s,n,o,i){if(s=s||t.address,o=o||t.username,i=i||t.password,!s||!o)return(0,v.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Y.client.create(Y.$(e)))}("rdpwebview");var r=Y.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(s,"",n,o,i,function(e){Y.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(d,g,K,S)};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:d,max_width:"15rem",handleInputChange:e=>w(e)}),(0,x.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:g,max_width:"10rem",handleInputChange:e=>{e&&j(parseInt(e))}}),(0,x.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:K,max_width:"15rem",handleInputChange:e=>b(e)}),(0,x.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:S,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,x.jsx)(r.rA,{icon:"play_arrow",title:e("连接"),onClick:B}),D&&(0,x.jsx)(r.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await N.ws.sendData(k.HK.rdp_disconnect,"");var e=Y.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Y.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,x.jsxs)(o.jW,{isFull:A,children:[!D&&(0,x.jsx)(p.N,{have_auth_edit:n(_.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await c.J0.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c.J0.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{C(e.password),b(e.username),w(e.address),j(e.port),B(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,x.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ee=a(77481),te=a(40505),ae=a(32024);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(9988),a.e(4091)]).then(a.bind(a,84091)));let re,le,ce,de;function ue(){const{t:e}=(0,h.Bd)(),[t,a]=(0,f.fp)(m.AG.confirm),[w,g]=(0,f.fp)(m.AG.showPrompt),{check_user_auth:j}=(0,y.MH)(),[K,b]=(0,s.useState)(""),[S,C]=(0,f.fp)(m.AG.router_jump),[A,F]=(0,s.useState)("get"),[D,M]=(0,s.useState)(""),[B,P]=(0,s.useState)(void 0),[E,R]=(0,s.useState)([]),[G,O]=(0,s.useState)([]),[H,U]=(0,s.useState)("headers"),[z,T]=(0,s.useState)(String(d.RB.row)),[V,J]=(0,s.useState)("body"),[Z,X]=(0,s.useState)(),[Y,q]=(0,f.fp)(m.AG.nav_index_add_item_by_now_list),[W,Q]=(0,f.fp)(m.AG.prompt_card);y.xK.set_value_temp("{}",0),y.xK.set_value_temp("",1),(0,s.useEffect)(()=>(re={},le="",ce="",de="",y.xK.get_editor(0).session.setMode("ace/mode/json"),S.http_download_map_path&&(P(S.http_download_map_path),C({})),N.ws.sendData(k.HK.http_download_water,void 0).then(()=>{N.ws.addMsg(k.HK.http_download_water,e=>{const t=e.context;O(t)})}),()=>{N.ws&&"function"==typeof N.ws.removeMsg&&N.ws.removeMsg(k.HK.http_download_water)}),[]);const se=e=>{const t=new d.vr;t.url=D,t.method=A,t.header_type="headers"===H?1:2,"headers"===H&&(re=JSON.parse(y.xK.get_editor_value(0))),t.headers=re;const a=Number(z);if(t.body_type=a,a===d.RB.row)le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.json)re["Content-Type"]="application/json",le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.form){re["Content-Type"]="multipart/form-data",t.form_data_list=E;for(const t of E)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,x.jsx)("div",{children:(0,x.jsxs)(o.xh,{children:[(0,x.jsx)(l.A,{}),(0,x.jsxs)(o.fI,{children:[(0,x.jsxs)(o.VP,{children:[0!==G.length&&(0,x.jsx)(n.Zp,{title:"正在下载",children:(0,x.jsx)("div",{children:G.map((t,a)=>(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"div-row",children:[(0,x.jsx)(r.rA,{icon:"cancel",title:e("取消"),onClick:()=>{N.ws.sendData(k.HK.http_download_cancel,t.local_download_path)}}),(0,x.jsx)(n.xP,{context:t.filename,tip_context:t.local_download_path}),(0,x.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,L.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,x.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,x.jsxs)(n.Zp,{title:"",rightBottomCom:Number(z)===d.RB.form&&"body"===H&&(0,x.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...E])}}),children:[(0,x.jsxs)("div",{className:"http_url",children:[(0,x.jsx)(i.l6,{width:"10rem",value:A,onChange:e=>{F(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,x.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:D,handleInputChange:e=>{M(e)}}),(0,x.jsx)(r.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!c._U.have_http_method(A))return void(0,v.zN)("不存在的http method");if(!D)return void(0,v.zN)("url is empty");X(void 0),b("");const e=new FormData;e.append("data",JSON.stringify(se(e)));let t="http/send";B&&(t+=`?local_download_path=${B}`),ae.A.post(c._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,v.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),de=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);X(200===t||201===t?(0,x.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){de=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ce="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const s=y.xK.get_editor(2),n="body"===V?ce:de;if(s){if(a.includes("application/json")||a.includes("+json")){s.session.setMode("ace/mode/json");try{const e=JSON.parse(ce);ce=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?s.session.setMode("ace/mode/html"):a.includes("xml")?s.session.setMode("ace/mode/xml"):a.includes("javascript")?s.session.setMode("ace/mode/javascript"):s.session.setMode("ace/mode/text");s.setValue("body"===V?ce:de,-1)}b(n)})}}),j(_.oV.http_proxy_tag_update)&&(0,x.jsx)(r.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!j(_.oV.http_proxy_tag_update))return void(0,v.zN)("no permission");for(const t of E)if(t.is_file)return void(0,v.zN)(e("表单中含有文件,浏览器限制不能添加"));let t;Q({open:!0,title:e("信息"),context_div:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"card-content",children:(0,x.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,x.jsx)("div",{className:"card-action",children:(0,x.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await se();e.local_download_path=B,e.form_data_list=JSON.stringify(E),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,q(e),Q({open:!1})},children:e("确定")})})]})})}})]}),(0,x.jsxs)(ne,{activeKey:H,onChange:e=>U(e),children:[(0,x.jsx)(oe,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(0)?.formatCode?.()}})}),(0,x.jsx)("div",{className:"http_ace",children:(0,x.jsx)(ie,{name:"",editor_id:0})})]})}),(0,x.jsx)(oe,{itemKey:"body",tab:e("请求体"),children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,x.jsxs)(ne,{activeKey:z,onChange:e=>{T(e);const t=Number(e);t===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):t===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,x.jsx)(oe,{itemKey:String(d.RB.row),tab:e("row")}),(0,x.jsx)(oe,{itemKey:String(d.RB.json),tab:e("json")}),(0,x.jsx)(oe,{itemKey:String(d.RB.form),tab:e("form")})]}),Number(z)!==d.RB.form&&(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(1)?.formatCode?.()}})]}),Number(z)===d.RB.form&&(0,x.jsx)("div",{style:{marginTop:"10px"},children:(0,x.jsx)(ee.X,{headers:["key",e("值")],rows:E.map((t,a)=>[(0,x.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...E])},no_border:!0}),(0,x.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...E])},no_border:!0}),(0,x.jsxs)("div",{children:[(0,x.jsx)(r.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{g({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const s=a[0];s.fullPath=(0,$.hU)()+Date.now().toString(),E[e].value=`${s}(${s.name})`,E[e].is_file=!0,E[e].fileName=s.name,E[e].fullPath=s.fullPath,R([...E]),E[e].file_object=s,g({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,x.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{E.splice(e,1),R([...E])})(a)})]})]),width:"10rem"})}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(z)!==d.RB.form?"block":"none"},children:(0,x.jsx)(ie,{name:"",editor_id:1})})]})})]}),(0,x.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===B?(0,x.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{P("")},children:e("下载到本地目录")}):(0,x.jsx)(i.Sm,{placeholder:e("本地地址"),value:B,handleInputChange:e=>{P(e)},handlerEnter:()=>{B||P(void 0)}})})]})]}),(0,x.jsx)(o.VP,{children:(0,x.jsxs)(n.Zp,{title:Z,titleCom:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{y.xK.get_editor(2)?.formatCode?.()}}),(0,x.jsx)(r.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=y.xK.get_editor_value(2);e&&((0,te.lW)(e),(0,v.SK)("完成"))}})]}),children:[(0,x.jsxs)(ne,{activeKey:V,onChange:e=>{J(e);const t="body"===e?ce:de;b(t);const a=y.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,x.jsx)(oe,{itemKey:"body",tab:e("响应体")}),(0,x.jsx)(oe,{itemKey:"headers",tab:e("响应头")})]}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,x.jsx)(ie,{name:"",editor_id:2})})]})})]}),(0,x.jsx)(o.fI,{children:(0,x.jsx)(o.VP,{children:(0,x.jsx)(p.N,{getItems:async()=>{const e=await c._U.get("http/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("http/tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},have_auth_edit:j(_.oV.http_proxy_tag_update),clickItem:async e=>{M(e.url),F(e.method),P(e.local_download_path),e.header_type&&U(1===e.header_type?"headers":"body"),e.headers&&(re=JSON.parse(e.headers),1===e.header_type&&(y.xK.get_editor(0).setValue(e.headers,-1),y.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(le=e.data),e.body_type&&(T(String(e.body_type)),e.body_type===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json"),y.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var pe=a(87361);const he=s.lazy(()=>Promise.all([a.e(8772),a.e(8257),a.e(7759)]).then(a.bind(a,45601)));function me({}){const{check_user_auth:e}=(0,y.MH)(),{t}=(0,h.Bd)(),a=[];return e(_.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,x.jsx)(ue,{})}),e(_.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,x.jsx)(H,{})}),e(_.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,x.jsx)(w,{})}),e(_.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,x.jsx)(Q,{})}),e(_.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,x.jsx)(he,{})}),(0,x.jsx)(o.W1,{optionList:a,father_route:pe.o.proxy})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5937],{8694(e,t,a){a.d(t,{$K:()=>o,RB:()=>r,l5:()=>c,qB:()=>s,vo:()=>i,vr:()=>l});class s{targetProxyUrl;proxyPort;sysProxyPort}let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class i{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class c{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var s=a(85997),n=a(74848);function o(e){return(0,n.jsxs)("h2",{className:"message",children:[(0,n.jsx)(s.In,{icon:"sentiment_dissatisfied"}),(0,n.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>p});var s=a(96540),n=a(61973),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(22022),d=a(85997),u=a(74848);function p(e){let t=(0,n.zy)();const[a,p]=(0,s.useState)([]),[h,m]=(0,s.useState)("/"),[f,y]=(0,s.useState)(void 0),{t:_,i18n:v}=(0,c.Bd)();s.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const s=a.indexOf(e.baseRoute),n=[];if(-1!=s){t=(0,o.IO)(a.slice(0,s),e.baseRoute);const i=a.slice(s+1);for(let e=0;e<i.length;e++){const a=i[e];n.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(n[e-1].href,a)})}m(t),p(n)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)};return(0,u.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,u.jsx)(s.Fragment,{children:void 0===f?(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("span",{className:"chevron",children:(0,u.jsx)(n.N_,{to:h,onClick:x,children:(0,u.jsx)(d.In,{icon:"home"})})}),a.map((e,t)=>(0,u.jsxs)("span",{className:"chevron",children:[(0,u.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,u.jsx)(n.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t))]}):(0,u.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,u.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>i,X:()=>o});var s=a(96540),n=a(74848);function o(e){const[t,a]=s.useState([]);return(0,s.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]),(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{children:e.headers?.map((e,t)=>(0,n.jsx)("th",{children:e},t))})}),(0,n.jsx)("tbody",{children:t.map((t,a)=>(0,n.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((a,s)=>(0,n.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:a},s))},a))})]})}function i(e){return(0,n.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,n.jsx)("div",{children:e},t))})}},83029(e,t,a){a.d(t,{N:()=>v});var s=a(96540),n=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,n.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),c=a(61443),d=a(85997),u=a(61973),p=a(22022);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function v(e){const[t,a]=(0,s.useState)([]),[v,x]=(0,s.useState)(-1),w=(0,u.zy)(),[g,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(!1),{t:K}=(0,p.Bd)(),[b,S]=(0,s.useState)([]),[C,A]=(0,n.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==v?_[v]._children=e:y=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[w]);(0,s.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{x(v+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===v?y:_[v-1]._children),x(v-1),_.pop()}}),t.map((n,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,s)=>{e.preventDefault();const n=t[m],o=t[s];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(n),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(s,0,r),F(i),a(i)})(e,o),style:{cursor:g?"move":"pointer"},children:[(0,i.jsx)(r,{name:n.name,item:n,...n,div:g,target:"_blank",click_dir:D,clickItem:e.clickItem}),g&&(void 0!==b.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===n._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(c.Sm,{value:n.name,handleInputChange:e=>{n.name=e},placeholder:K("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:n.color,handleInputChange:e=>{n.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:n[e.key],handleInputChange:t=>{n[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:K("折叠"),clickFun:()=>{S((0,l.P1)(b,o))}})]}),g&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:K("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),F(s),a(s)})(o)}}),(0,i.jsx)(d.C3,{text:K("编辑"),clickFun:()=>{void 0===b.find(e=>e===o)&&S([...b,o])}})]})})]},o)),g&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:K("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),N(!1)}}),(0,i.jsx)(d.rA,{title:K("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(s),a(s)}}),(0,i.jsx)(d.rA,{title:K("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:K("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{N(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:g?"save":"edit",title:K(g?"保存":"编辑"),onClick:async()=>{g?e.save&&await e.save(y):f=t,j(!g)}})]})}},15937(e,t,a){a.r(t),a.d(t,{default:()=>me});var s=a(96540),n=a(70447),o=a(75725),i=a(61443),r=a(85997),l=a(57952),c=a(14284),d=a(8694),u=a(53459),p=a(83029),h=a(22022),m=a(82893),f=a(34843),y=a(78247),_=a(23430),v=a(62042),x=a(74848);function w(e){const{t}=(0,h.Bd)(),[a,n]=(0,f.fp)(m.AG.header_min),[w,g]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,K]=(0,s.useState)(void 0),[b,S]=(0,s.useState)(!1),{check_user_auth:C}=(0,y.MH)(),A=async()=>{const e=new d.qB;e.targetProxyUrl="string"==typeof w?w:j;(await c._U.post("close",e)).code===u.m.Success&&(k(""),n(!1))},F=async e=>{const t=new d.qB;if(t.targetProxyUrl="string"==typeof e?e:w,!t.targetProxyUrl.startsWith("http"))return void(0,v.zN)("must start with http[s]://");const a=await c._U.post("start",t);if(a.code!==u.m.Success)return;const s=`${window.location.protocol}//${window.location.hostname}:${a.data}`;k(s)};(0,s.useEffect)(()=>()=>{A()},[]);return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("要代理的url"),icon:"link",value:w,handleInputChange:e=>{g(e)}}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("开始代理"),onClick:F}),(0,x.jsx)(r.rA,{icon:"fullscreen",title:t("全屏"),onClick:()=>{S(!b),n(!b)}}),(0,x.jsx)(r.rA,{icon:"close",title:t(t("关闭")),onClick:()=>{A(),S(!1),g("")}})]}),(0,x.jsx)(o.jW,{isFull:b,children:(0,x.jsxs)("div",{id:"browser",children:[!j&&(0,x.jsx)(p.N,{have_auth_edit:C(_.oV.browser_proxy_tag_update),getItems:async()=>{const e=await c._U.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{g(e.url),F(e.url)},items:[{key:"name",preName:t("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]}),(0,x.jsx)("iframe",{id:"webview",src:j})]})})]})}var g=a(34289),j=(a(75007),a(97856)),k=a(92275),N=a(14944),K=a(64405);const b=s.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(a.bind(a,85614)));function S(e){const[t,a]=(0,s.useState)(null),[n,o]=(0,f.fp)(m.AG.remoteShellShow),[i,r]=(0,s.useState)(!1),[l,c]=(0,f.fp)(m.AG.sshInfo),[d,u]=(0,f.fp)(m.AG.shellNowDir),[p,h]=(0,f.fp)(m.AG.user_base_info),y=p.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,s.useEffect)(()=>()=>{_()},[]),(0,s.useEffect)(()=>{n.show?t||((async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const s=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=s},N.ws.addMsg(k.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new K.x;t.key=l.key,t.cmd=e;const a=new k.hf(k.HK.remote_shell_send);a.context=t,await N.ws.send(a)}),a(e)})(),r(!0)):_()},[n]);return(0,x.jsx)(b,{show:n.show,terminal:t,init:(e,a)=>{t.writeln("[38;2;29;153;243mopen shell...[0m ");const s=new k.hf(k.HK.remote_shell_open),o=new K.x;o.key=l.key,o.init_path=n.path,o.rows=e,o.cols=a,s.context=o,N.ws.send(s)}})}var C=a(47374),A=a(61973),F=a(99214),D=a(47022),L=a(88815),M=a(6960),B=a(79240),I=a(27690),P=a(12730);function E(e){const{t}=(0,h.Bd)();(0,A.zy)();(0,A.Zp)();const{check_user_auth:a}=(0,y.MH)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[i,l]=(0,f.fp)(m.AG.uploadFiles),[c,d]=(0,f.fp)(m.AG.showPrompt),[u,p]=(0,f.fp)(m.AG.selectedFileList),[_,w]=(0,f.fp)(m.AG.enterKey),[j,k]=(0,f.fp)(m.AG.copyedFileList),[N,K]=(0,f.fp)(m.AG.cutedFileList),[b,S]=(0,f.fp)(m.AG.selectedFileList),[C,L]=(0,f.fp)(m.AG.clickFileList),[M,B]=(0,f.fp)(m.AG.remoteShellShow),[E,R]=(0,f.fp)(m.AG.sshInfo),$=(0,F.Vs)();function G(e){(0,v.SK)(e)}return(0,x.jsxs)(s.Fragment,{children:[u.length>0&&(0,x.jsx)(r.rA,{icon:"delete",title:t("删除"),onClick:()=>{d({show:!0,type:I.PromptEnum.SshDelete,overlay:!0,data:{}})}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,F.ib)(n,u);k(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),K([]),G("已复制")}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,F.ib)(n,u);K(e.map(e=>`/${(0,g.GG)("remoteShell",(0,g.vX)())}${e.name}`)),k([]),G("已剪切")}}),(j.length>0||N.length>0)&&(0,x.jsx)(r.rA,{onClick:function(){d({show:!0,type:I.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:j.length+N.length}),1===u.length&&n.files.length>=1&&(0,F.ib)(n,u)[0].type!==D.Iw.folder&&(0,x.jsx)(r.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,F.ib)(n,u),t=`/api/ssh/download?file=${`/${(0,g.GG)("remoteShell",(0,g.vX)())}${decodeURIComponent(e[0].name)}`}&key=${E.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===u.length&&(0,x.jsx)(r.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){d({show:!0,type:I.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"terminal",title:"shell",onClick:function(){M.show?B({show:!1,path:""}):B({show:!0,path:`/${(0,g.GG)("remoteShell",(0,g.vX)())}`})}}),(0,x.jsx)(r.rA,{icon:"grid_view",title:t("切换样式"),onClick:$}),(0,x.jsx)(r.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"upload_file",title:"上传",onClick:()=>{d({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const s=[],n=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&n.add((0,P.S)(i)),s.push(o)}const o=[];if(a)for(const e of Array.from(n))o.push({isDir:!0,fullPath:e,name:e});o.push(...s),l(o),d({show:!0,type:I.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,x.jsx)(r.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var R=a(60096),$=a(21499);let G;function O(e){const{t}=(0,h.Bd)(),a=(0,A.zy)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[r,d]=(0,f.fp)(m.AG.selectedFileList),[p,y]=(0,f.fp)(m.AG.clickFileList),[w,j]=(0,f.fp)(m.AG.sshInfo),[k,N]=(0,s.useState)(""),b=(0,A.Zp)(),[D,I]=(0,f.fp)(m.AG.user_base_info),P=async e=>{const t=new K.x;t.key=w.key,t.dir=e||`/${(0,g.GG)("remoteShell",(0,g.vX)())}`;const a=await c.Fg.post("get/dir",t);if(a.code!==u.m.Success)return void(0,v.zN)("连接失败");const{folders:s,files:n}=a.data||{};for(const e of n??[])e.origin_size=e.size,e.size=(0,L.v7)(e.size),D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";for(const e of s??[])D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";const i={folders:s||[],files:n||[]};(0,F.yC)(i,D.user_data.dir_show_type),o(i),G=i};function O(){d([]),y([])}(0,s.useEffect)(()=>{O(),(async()=>{await P()})()},[a]);return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(l.A,{left_children:(0,x.jsx)(i.$Z,{handleEnterPress:()=>{if(!G)return;d([]),y([]);const e=[],t=[];for(const t of G.files??[])t.name.includes(k)&&e.push(t);for(const e of G.folders??[])e.name.includes(k)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{N(e)},max_width:"25em"}),children:(0,x.jsx)(E,{close:e.close})}),(0,x.jsx)(C.e,{baseRoute:"remoteShell",clickFun:O,input_path_enter:e=>{(0,B.Z1)(e)?P(e):b((0,B.Jn)((0,g.vX)(),e)),d([]),y([]),o({files:[],folders:[]})}}),(0,x.jsx)(R.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&d([])},file_list:n.files,folder_list:n.folders,fileHandler:P}),(0,x.jsx)(S,{})]})}function H(e){const{t}=(0,h.Bd)(),a=(0,A.Zp)(),[n,o]=(0,s.useState)(""),[d,w]=(0,s.useState)(""),[g,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[b,S]=(0,s.useState)(void 0),[C,F]=(0,s.useState)(""),[D,L]=(0,f.fp)(m.AG.shellNowDir),[M,I]=(0,f.fp)(m.AG.sshInfo),{check_user_auth:P}=(0,y.MH)(),E=async e=>{const t=new K.x;if(t.password=e?e.password:d,t.domain=e?e.domain:k,t.port=e?e.port:b,t.username=e?e.username:n,t.private_path=e?e.private_path:g,t.dir=e?e.dir:C,!t.dir)return void(0,v.zN)("dir not found");if(!t.username)return void(0,v.zN)("username not found");if(!t.domain)return void(0,v.zN)("domain not found");if(!t.port)return void(0,v.zN)("port not found");if(!t.private_path&&!t.password)return void(0,v.zN)("private_path password not found");const s=await c.Fg.post("start",t);s&&s.code===u.m.Success&&(a((0,B.Jn)("/proxy/remoteShell",t.dir)),L([t.dir]),I(s.data))};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:C,handleInputChange:e=>F(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:n,handleInputChange:e=>o(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:d,handleInputChange:e=>w(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:g,handleInputChange:e=>j(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:k,handleInputChange:e=>{N(e)},max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:b,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,v.zN)("不是数字"),S(parseInt(e))},max_width:"7rem"}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{E()}})]}),M.key?(0,x.jsx)(O,{close:async()=>{const e=new K.x;e.key=M.key;await c.Fg.post("close",e);I({})},data:{port:b,password:d,username:n,domain:k,dir:C}}):(0,x.jsx)(p.N,{have_auth_edit:P(_.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await c.Fg.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{await c.Fg.post("tag/save",e)},clickItem:async e=>{N(e.domain),F(e.dir),S(e.port),o(e.username),w(e.password),j(e.private_path),await E(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function U(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class z{constructor(e){this.canvas=e,this.render=new Y.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,s=Math.round(15*Math.abs(a)/8),n=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-n.left,y:t.clientY-n.top,step:s,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),s=a?t.deltaX:t.deltaY,n=Math.round(15*Math.abs(s)/8),o=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:n,isNegative:s>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,s,n,o){var i=this;N.ws.addMsg(k.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),N.ws.addMsg(k.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),N.ws.addMsg(k.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),N.ws.addMsg(k.HK.rdp_error,e=>{i.activeSession=!1});const r=new k.hf;r.cmdType=k.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:s,password:n,locale:Y.locale()},N.ws.send(r)}}class T{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),s=Module._malloc(a.length),n=new Uint8Array(Module.HEAPU8.buffer,s,a.length);n.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),c=new Uint8Array(Module.HEAPU8.buffer,l,r),d=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,o,i,e.width,e.height,n.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(s),Module._free(l),{width:o,height:i,data:d}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var V={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},J={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},Z={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:J}};function X(){}X.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new z(e)}},Canvas:{create:function(e){return new T(e)}},scancode(e){var t=X.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",V[e.code||Z[X.prototype.browser()||"firefox"][t][e.keyCode]]}};let Y=new X;var q=a(38240);let W;function Q(){const{t:e}=(0,h.Bd)(),[t,a]=(0,f.fp)(m.AG.header_min),{check_user_auth:n}=(0,y.MH)(),[d,w]=(0,s.useState)(void 0),[g,j]=(0,s.useState)(3389),[K,b]=(0,s.useState)(void 0),[S,C]=(0,s.useState)(void 0),[A,F]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1);var M=null;(0,s.useEffect)(()=>(W||(async()=>{try{await(0,q.J)("rle.js"),W=!0}catch(e){return void(0,v.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const B=t=>{L(!0),function(s,n,o,i){if(s=s||t.address,o=o||t.username,i=i||t.password,!s||!o)return(0,v.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Y.client.create(Y.$(e)))}("rdpwebview");var r=Y.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(s,"",n,o,i,function(e){Y.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(d,g,K,S)};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.A,{children:[(0,x.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:d,max_width:"15rem",handleInputChange:e=>w(e)}),(0,x.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:g,max_width:"10rem",handleInputChange:e=>{e&&j(parseInt(e))}}),(0,x.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:K,max_width:"15rem",handleInputChange:e=>b(e)}),(0,x.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:S,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,x.jsx)(r.rA,{icon:"play_arrow",title:e("连接"),onClick:B}),D&&(0,x.jsx)(r.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await N.ws.sendData(k.HK.rdp_disconnect,"");var e=Y.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Y.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,x.jsxs)(o.jW,{isFull:A,children:[!D&&(0,x.jsx)(p.N,{have_auth_edit:n(_.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await c.J0.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c.J0.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{C(e.password),b(e.username),w(e.address),j(e.port),B(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,x.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ee=a(77481),te=a(40505),ae=a(32024);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(9988),a.e(4091)]).then(a.bind(a,84091)));let re,le,ce,de;function ue(){const{t:e}=(0,h.Bd)(),[t,a]=(0,f.fp)(m.AG.confirm),[w,g]=(0,f.fp)(m.AG.showPrompt),{check_user_auth:j}=(0,y.MH)(),[K,b]=(0,s.useState)(""),[S,C]=(0,f.fp)(m.AG.router_jump),[A,F]=(0,s.useState)("get"),[D,M]=(0,s.useState)(""),[B,P]=(0,s.useState)(void 0),[E,R]=(0,s.useState)([]),[G,O]=(0,s.useState)([]),[H,U]=(0,s.useState)("headers"),[z,T]=(0,s.useState)(String(d.RB.row)),[V,J]=(0,s.useState)("body"),[Z,X]=(0,s.useState)(),[Y,q]=(0,f.fp)(m.AG.nav_index_add_item_by_now_list),[W,Q]=(0,f.fp)(m.AG.prompt_card);y.xK.set_value_temp("{}",0),y.xK.set_value_temp("",1),(0,s.useEffect)(()=>(re={},le="",ce="",de="",y.xK.get_editor(0).session.setMode("ace/mode/json"),S.http_download_map_path&&(P(S.http_download_map_path),C({})),N.ws.sendData(k.HK.http_download_water,void 0).then(()=>{N.ws.addMsg(k.HK.http_download_water,e=>{const t=e.context;O(t)})}),()=>{N.ws&&"function"==typeof N.ws.removeMsg&&N.ws.removeMsg(k.HK.http_download_water)}),[]);const se=e=>{const t=new d.vr;t.url=D,t.method=A,t.header_type="headers"===H?1:2,"headers"===H&&(re=JSON.parse(y.xK.get_editor_value(0))),t.headers=re;const a=Number(z);if(t.body_type=a,a===d.RB.row)le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.json)re["Content-Type"]="application/json",le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.form){re["Content-Type"]="multipart/form-data",t.form_data_list=E;for(const t of E)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,x.jsx)("div",{children:(0,x.jsxs)(o.xh,{children:[(0,x.jsx)(l.A,{}),(0,x.jsxs)(o.fI,{children:[(0,x.jsxs)(o.VP,{children:[0!==G.length&&(0,x.jsx)(n.Zp,{title:"正在下载",children:(0,x.jsx)("div",{children:G.map((t,a)=>(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"div-row",children:[(0,x.jsx)(r.rA,{icon:"cancel",title:e("取消"),onClick:()=>{N.ws.sendData(k.HK.http_download_cancel,t.local_download_path)}}),(0,x.jsx)(n.xP,{context:t.filename,tip_context:t.local_download_path}),(0,x.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,L.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,x.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,x.jsxs)(n.Zp,{title:"",rightBottomCom:Number(z)===d.RB.form&&"body"===H&&(0,x.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...E])}}),children:[(0,x.jsxs)("div",{className:"http_url",children:[(0,x.jsx)(i.l6,{width:"10rem",value:A,onChange:e=>{F(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,x.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:D,handleInputChange:e=>{M(e)}}),(0,x.jsx)(r.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!c._U.have_http_method(A))return void(0,v.zN)("不存在的http method");if(!D)return void(0,v.zN)("url is empty");X(void 0),b("");const e=new FormData;e.append("data",JSON.stringify(se(e)));let t="http/send";B&&(t+=`?local_download_path=${B}`),ae.A.post(c._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,v.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),de=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);X(200===t||201===t?(0,x.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){de=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ce="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const s=y.xK.get_editor(2),n="body"===V?ce:de;if(s){if(a.includes("application/json")||a.includes("+json")){s.session.setMode("ace/mode/json");try{const e=JSON.parse(ce);ce=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?s.session.setMode("ace/mode/html"):a.includes("xml")?s.session.setMode("ace/mode/xml"):a.includes("javascript")?s.session.setMode("ace/mode/javascript"):s.session.setMode("ace/mode/text");s.setValue("body"===V?ce:de,-1)}b(n)})}}),j(_.oV.http_proxy_tag_update)&&(0,x.jsx)(r.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!j(_.oV.http_proxy_tag_update))return void(0,v.zN)("no permission");for(const t of E)if(t.is_file)return void(0,v.zN)(e("表单中含有文件,浏览器限制不能添加"));let t;Q({open:!0,title:e("信息"),context_div:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"card-content",children:(0,x.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,x.jsx)("div",{className:"card-action",children:(0,x.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await se();e.local_download_path=B,e.form_data_list=JSON.stringify(E),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,q(e),Q({open:!1})},children:e("确定")})})]})})}})]}),(0,x.jsxs)(ne,{activeKey:H,onChange:e=>U(e),children:[(0,x.jsx)(oe,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(0)?.formatCode?.()}})}),(0,x.jsx)("div",{className:"http_ace",children:(0,x.jsx)(ie,{name:"",editor_id:0})})]})}),(0,x.jsx)(oe,{itemKey:"body",tab:e("请求体"),children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,x.jsxs)(ne,{activeKey:z,onChange:e=>{T(e);const t=Number(e);t===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):t===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,x.jsx)(oe,{itemKey:String(d.RB.row),tab:e("row")}),(0,x.jsx)(oe,{itemKey:String(d.RB.json),tab:e("json")}),(0,x.jsx)(oe,{itemKey:String(d.RB.form),tab:e("form")})]}),Number(z)!==d.RB.form&&(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(1)?.formatCode?.()}})]}),Number(z)===d.RB.form&&(0,x.jsx)("div",{style:{marginTop:"10px"},children:(0,x.jsx)(ee.X,{headers:["key",e("值")],rows:E.map((t,a)=>[(0,x.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...E])},no_border:!0}),(0,x.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...E])},no_border:!0}),(0,x.jsxs)("div",{children:[(0,x.jsx)(r.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{g({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const s=a[0];s.fullPath=(0,$.hU)()+Date.now().toString(),E[e].value=`${s}(${s.name})`,E[e].is_file=!0,E[e].fileName=s.name,E[e].fullPath=s.fullPath,R([...E]),E[e].file_object=s,g({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,x.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{E.splice(e,1),R([...E])})(a)})]})]),width:"10rem"})}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(z)!==d.RB.form?"block":"none"},children:(0,x.jsx)(ie,{name:"",editor_id:1})})]})})]}),(0,x.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===B?(0,x.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{P("")},children:e("下载到本地目录")}):(0,x.jsx)(i.Sm,{placeholder:e("本地地址"),value:B,handleInputChange:e=>{P(e)},handlerEnter:()=>{B||P(void 0)}})})]})]}),(0,x.jsx)(o.VP,{children:(0,x.jsxs)(n.Zp,{title:Z,titleCom:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{y.xK.get_editor(2)?.formatCode?.()}}),(0,x.jsx)(r.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=y.xK.get_editor_value(2);e&&((0,te.lW)(e),(0,v.SK)("完成"))}})]}),children:[(0,x.jsxs)(ne,{activeKey:V,onChange:e=>{J(e);const t="body"===e?ce:de;b(t);const a=y.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,x.jsx)(oe,{itemKey:"body",tab:e("响应体")}),(0,x.jsx)(oe,{itemKey:"headers",tab:e("响应头")})]}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,x.jsx)(ie,{name:"",editor_id:2})})]})})]}),(0,x.jsx)(o.fI,{children:(0,x.jsx)(o.VP,{children:(0,x.jsx)(p.N,{getItems:async()=>{const e=await c._U.get("http/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("http/tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},have_auth_edit:j(_.oV.http_proxy_tag_update),clickItem:async e=>{M(e.url),F(e.method),P(e.local_download_path),e.header_type&&U(1===e.header_type?"headers":"body"),e.headers&&(re=JSON.parse(e.headers),1===e.header_type&&(y.xK.get_editor(0).setValue(e.headers,-1),y.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(le=e.data),e.body_type&&(T(String(e.body_type)),e.body_type===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json"),y.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var pe=a(87361);const he=s.lazy(()=>Promise.all([a.e(8772),a.e(8257),a.e(7759)]).then(a.bind(a,45601)));function me({}){const{check_user_auth:e}=(0,y.MH)(),{t}=(0,h.Bd)(),a=[];return e(_.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,x.jsx)(ue,{})}),e(_.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,x.jsx)(H,{})}),e(_.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,x.jsx)(w,{})}),e(_.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,x.jsx)(Q,{})}),e(_.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,x.jsx)(he,{})}),(0,x.jsx)(o.W1,{optionList:a,father_route:pe.o.proxy})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6247],{77481(e,n,t){t.d(n,{S:()=>o,X:()=>l});var i=t(96540),s=t(74848);function l(e){const[n,t]=i.useState([]);return(0,i.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:e.headers?.map((e,n)=>(0,s.jsx)("th",{children:e},n))})}),(0,s.jsx)("tbody",{children:n.map((n,t)=>(0,s.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,i)=>(0,s.jsx)("td",{style:{width:e.width??"auto"},className:i===n.length-1?"small":"",children:t},i))},t))})]})}function o(e){return(0,s.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,s.jsx)("div",{children:e},n))})}},66247(e,n,t){t.r(n),t.d(n,{default:()=>k});var i=t(96540),s=t(75725),l=t(70447),o=t(85997),r=t(77481),c=t(61443),a=t(22022),d=t(14284),h=t(53459),u=t(62042),x=t(87361),j=t(40505),_=t(57952),p=t(
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6247],{77481(e,n,t){t.d(n,{S:()=>o,X:()=>l});var i=t(96540),s=t(74848);function l(e){const[n,t]=i.useState([]);return(0,i.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]),(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:e.headers?.map((e,n)=>(0,s.jsx)("th",{children:e},n))})}),(0,s.jsx)("tbody",{children:n.map((n,t)=>(0,s.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},children:n.map((t,i)=>(0,s.jsx)("td",{style:{width:e.width??"auto"},className:i===n.length-1?"small":"",children:t},i))},t))})]})}function o(e){return(0,s.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,s.jsx)("div",{children:e},n))})}},66247(e,n,t){t.r(n),t.d(n,{default:()=>k});var i=t(96540),s=t(75725),l=t(70447),o=t(85997),r=t(77481),c=t(61443),a=t(22022),d=t(14284),h=t(53459),u=t(62042),x=t(87361),j=t(40505),_=t(57952),p=t(61973),f=t(34843),m=t(82893),w=t(21469),v=t(21499),C=t(74848);function k(){const{t:e,i18n:n}=(0,a.Bd)(),t=(0,p.Zp)(),k=[e("编号"),e("路径"),e("过期小时"),e("token"),e("备注"),e("剩余时间(h)"),e("下载次数")],[b,A]=(0,i.useState)([]),[S,y]=(0,f.fp)(m.AG.prompt_card),g=async()=>{const e=await d.XO.get("get_share_file_list");if(e.code===h.m.Success){const n=e.data??[],t=Date.now();for(const e of n)try{if(null!=e.left_hour&&e.left_hour>0){const n=t-e.time_stamp,i=36e5*e.left_hour-n;e.show_left_hour=parseFloat((i/36e5).toFixed(2))}else e.show_left_hour=e.left_hour}catch(e){}A(n)}};(0,i.useEffect)(()=>{g()},[]);return(0,C.jsxs)("div",{className:"common-box ",children:[(0,C.jsx)(_.A,{children:(0,C.jsx)(o.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{t(-1)}})}),(0,C.jsx)(s.J,{widthPer:100,children:(0,C.jsx)(l.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("文件分享列表")}),(0,C.jsx)(o.rA,{icon:"info",title:e("提示"),onClick:()=>{let e=(0,C.jsx)("div",{children:"小时设置为-1或者不设置就没有过期时间"});y({open:!0,title:"信息",context_div:(0,C.jsx)("div",{children:e})})}})]}),titleCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{A([...b,{note:"",path:""}])}}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("set_share_file_list",b)).code===h.m.Success&&((0,u.SK)("保存成功"),g())}})]}),children:(0,C.jsx)(r.X,{headers:k,rows:b.map((n,t)=>{const i=[(0,C.jsx)("div",{children:t}),(0,C.jsx)(c.Sm,{value:n.path,handleInputChange:e=>{n.path=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:n.left_hour,handleInputChange:e=>{n.left_hour=parseFloat(e),n.time_stamp=Date.now()},no_border:!0}),(0,C.jsx)(c.Sm,{value:n.token,handleInputChange:e=>{n.token=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,C.jsx)("p",{children:n.show_left_hour}),(0,C.jsx)("p",{children:n.download_num}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),A([...b])})(t)}),n.id&&(0,C.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${n.id}`);(0,j.lW)(e),(0,u.SK)(e)}}),n.id&&(0,C.jsx)(o.rA,{icon:"open_in_new",title:e("打开新页面"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${n.id}`);window.open(e)}})]})];return i}),width:"10rem"})})})]})}}}]);
|