filecat 6.61.1 → 6.62.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.
Files changed (86) hide show
  1. package/build/dist/1448.c17092866d8000fc162c.js +1 -0
  2. package/build/dist/1472.9a15a38ca60311c55865.js +1 -0
  3. package/build/dist/1636.d564c11eb75c71ba75e5.js +1 -0
  4. package/build/dist/2502.6a0501313a1fe1b8208a.js +1 -0
  5. package/build/dist/2542.78f4821c3f796775f225.js +1 -0
  6. package/build/dist/2674.42bc8edcb369615417fd.js +1 -0
  7. package/build/dist/2851.dc11a52ef2da1897efaf.js +1 -0
  8. package/build/dist/3215.aed023089c03fa4b3c40.js +2 -0
  9. package/build/dist/{8772.f569a899ae1f48eb7b90.js.LICENSE.txt → 3215.aed023089c03fa4b3c40.js.LICENSE.txt} +8 -0
  10. package/build/dist/3233.7be420d0a208fb097844.js +1 -0
  11. package/build/dist/3402.cb9eea2cd2080faf57f6.js +1 -0
  12. package/build/dist/354.1144df502d14a9b9c2c1.js +2 -0
  13. package/build/dist/{8090.4400dbf0a129ba8b152c.js.LICENSE.txt → 354.1144df502d14a9b9c2c1.js.LICENSE.txt} +0 -2
  14. package/build/dist/3659.42ebbfa853db66b4c3b3.js +1 -0
  15. package/build/dist/4273.1bad9a42bb34a1952dc4.js +1 -0
  16. package/build/dist/{4376.b022a792fb34fbe50398.js → 4376.54d747fb2fd9ed099e68.js} +1 -1
  17. package/build/dist/4903.5b155e7515c60da8e838.js +1 -0
  18. package/build/dist/5308.8059b2d04eb5de133d15.js +1 -0
  19. package/build/dist/5516.f96b5a3874804392788c.js +1 -0
  20. package/build/dist/{1595.dd1679681930c0894b85.js → 5525.de31026d71adb2710e2d.js} +1 -1
  21. package/build/dist/5614.7be420d0a208fb097844.js +1 -0
  22. package/build/dist/5761.aed863dd3ef56e0da7b7.js +1 -0
  23. package/build/dist/5877.a27f664e496b80e8cf13.js +1 -0
  24. package/build/dist/5937.8d7e5116bbc7d2b4e478.js +1 -0
  25. package/build/dist/{6010.34a5093f412c11b86c2f.js → 6010.7a688ca570a944677ad8.js} +1 -1
  26. package/build/dist/6100.d074c61e823d9b36c293.js +1 -0
  27. package/build/dist/6247.9bbd3852fd64eadebd20.js +1 -0
  28. package/build/dist/6505.ac89deebae8c008595a1.js +1 -0
  29. package/build/dist/676.2854877784f5c96f2f52.js +1 -0
  30. package/build/dist/678.6b39771efac19466a352.js +1 -0
  31. package/build/dist/6892.bd3adea0ce83f685bfa5.js +1 -0
  32. package/build/dist/6919.c7510e6ed23cff35cd52.js +1 -0
  33. package/build/dist/7133.7cd30c08c154a09693f1.js +1 -0
  34. package/build/dist/7759.7070cfce4ede684073a2.js +1 -0
  35. package/build/dist/{5709.81f43e3c021fafdfe36f.js → 8090.a6ad12a3a30434ea59f8.js} +1 -1
  36. package/build/dist/8319.fc897106bf47394f677c.js +1 -0
  37. package/build/dist/8435.67db557cac5405fa559d.js +1 -0
  38. package/build/dist/8603.8819e88398056f0e0562.js +1 -0
  39. package/build/dist/8714.33b322d07b675e53f5d7.js +1 -0
  40. package/build/dist/8765.01fa13220d95333e4034.js +1 -0
  41. package/build/dist/8947.0c83854521d16a092aa8.js +2 -0
  42. package/build/dist/9546.fa400fbfc3c4ae7850ad.js +1 -0
  43. package/build/dist/index.html +1 -1
  44. package/build/dist/main.28811d3c1bf84795744c.js +2 -0
  45. package/build/dist/{main.a32143b92c6c380d9142.js.LICENSE.txt → main.28811d3c1bf84795744c.js.LICENSE.txt} +1 -1
  46. package/build/main.js +1 -1
  47. package/build/threads.work.filecat.js +1 -1
  48. package/package.json +1 -1
  49. package/build/dist/1448.0cce6a2546d19400aa72.js +0 -1
  50. package/build/dist/1472.8bd697fda71d516f63d2.js +0 -1
  51. package/build/dist/1636.723781f88d68ed3657cb.js +0 -1
  52. package/build/dist/2502.76b0c12a516db7cd7045.js +0 -1
  53. package/build/dist/2542.107d541161551f162edb.js +0 -1
  54. package/build/dist/2674.29a3532f8d3839f1c180.js +0 -1
  55. package/build/dist/2851.e103817a73bd5bc2ad56.js +0 -1
  56. package/build/dist/3233.cacdc1869069914f4bc8.js +0 -1
  57. package/build/dist/3402.a72b6d7e2a0f49a66105.js +0 -1
  58. package/build/dist/3659.55a733505528331021e0.js +0 -1
  59. package/build/dist/4273.e074f600ee092de848a1.js +0 -1
  60. package/build/dist/4903.f8714937dbb91b37c119.js +0 -1
  61. package/build/dist/5308.52192ab9a2d34aafc1f2.js +0 -1
  62. package/build/dist/5516.867dcf973e3da3f469ed.js +0 -1
  63. package/build/dist/5614.cacdc1869069914f4bc8.js +0 -1
  64. package/build/dist/5761.dcbd2f72aefe89ed93bb.js +0 -1
  65. package/build/dist/5877.4e8f34819a3ae8da88b7.js +0 -1
  66. package/build/dist/5937.6896e2d5770bc5b1f528.js +0 -1
  67. package/build/dist/6100.84966ac3e36bcf6702ab.js +0 -1
  68. package/build/dist/6247.251b22d7770a37a87298.js +0 -1
  69. package/build/dist/6505.8ce4ae19c126468cdbf9.js +0 -1
  70. package/build/dist/676.39a5ffb9b489247e47b6.js +0 -1
  71. package/build/dist/678.d618a4cb674a201b2811.js +0 -1
  72. package/build/dist/6892.491e86318d079d70ced4.js +0 -1
  73. package/build/dist/6919.7846986c93eb0199f9a0.js +0 -1
  74. package/build/dist/7133.ae2c0ab24c0d2a3a5a1c.js +0 -1
  75. package/build/dist/7759.b58c5676b606e60d7aac.js +0 -1
  76. package/build/dist/8090.4400dbf0a129ba8b152c.js +0 -2
  77. package/build/dist/8319.c09052fb42d9c2a29990.js +0 -1
  78. package/build/dist/8435.1f63fa3aa621962786b1.js +0 -1
  79. package/build/dist/8603.bed222c279303c511397.js +0 -1
  80. package/build/dist/8714.b9678b25bf488d6e86e6.js +0 -1
  81. package/build/dist/8765.032dd636d881d61c16a1.js +0 -1
  82. package/build/dist/8772.f569a899ae1f48eb7b90.js +0 -2
  83. package/build/dist/8947.4a6c81c6c271e3ccd642.js +0 -2
  84. package/build/dist/9546.c9b4ed852636fab1c104.js +0 -1
  85. package/build/dist/main.a32143b92c6c380d9142.js +0 -2
  86. /package/build/dist/{8947.4a6c81c6c271e3ccd642.js.LICENSE.txt → 8947.0c83854521d16a092aa8.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5877],{77481(e,t,n){n.d(t,{S:()=>l,X:()=>r});var s=n(96540),a=n(74848);function r(e){const[t,n]=s.useState([]);return(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((e,t)=>(0,a.jsx)("th",{children:e},t))})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>(0,a.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,s)=>(0,a.jsx)("td",{style:{width:e.width??"auto"},className:s===t.length-1?"small":"",children:n},s))},n))})]})}function l(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},83029(e,t,n){n.d(t,{N:()=>v});var s=n(96540),a=n(34843),r=n(82893),l=n(74848);function c(e){const[t,n]=(0,a.fp)(r.AG.user_base_info);return(0,l.jsx)("div",{children:e.div?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,l.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var i=n(64694),o=n(61443),d=n(85997),u=n(76213),h=n(34899);const p=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let x,m,j=[];const _=[];function v(e){const[t,n]=(0,s.useState)([]),[v,f]=(0,s.useState)(-1),g=(0,u.zy)(),[y,S]=(0,s.useState)(!1),[C,k]=(0,s.useState)(!1),{t:w}=(0,h.Bd)(),[b,I]=(0,s.useState)([]),[N,A]=(0,a.fp)(r.AG.nav_index_add_item_by_now_list),D=e=>{-1!==v?_[v]._children=e:j=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();j=t,n(j)})()},[g]);(0,s.useEffect)(()=>{if(N){const e=[...t,{name:"",color:(0,i.Lr)(p),...N}];D(e),n(e),S(!0),A(void 0)}},[N]);const z=e=>{f(v+1),n(e._children),_.push(e)};return(0,l.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,l.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{n(0===v?j:_[v-1]._children),f(v-1),_.pop()}}),t.map((a,r)=>(0,l.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{x=t})(0,r),onDrop:e=>((e,s)=>{e.preventDefault();const a=t[x],r=t[s];if(r&&"dir"===r._type){const e=[...t];return e.splice(x,1),r._children||(r._children=[]),r._children.push(a),D(e),void n(e)}const l=[...t],c=l[x];l.splice(x,1),l.splice(s,0,c),D(l),n(l)})(e,r),style:{cursor:y?"move":"pointer"},children:[(0,l.jsx)(c,{name:a.name,item:a,...a,div:y,target:"_blank",click_dir:z,clickItem:e.clickItem}),y&&(void 0!==b.find(e=>e===r)||C)&&(0,l.jsxs)("div",{className:C?"":" site_edit ",children:["dir"===a._type?(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(o.Sm,{value:a.name,handleInputChange:e=>{a.name=e},placeholder:w("输入类目名"),no_border:!0}),(0,l.jsx)(o.Sm,{value:a.color,handleInputChange:e=>{a.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,l.jsx)("div",{children:(0,l.jsx)(o.Sm,{value:a[e.key],handleInputChange:t=>{a[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!C&&(0,l.jsx)(d.C3,{text:w("折叠"),clickFun:()=>{I((0,i.P1)(b,r))}})]}),y&&(0,l.jsx)("div",{style:{display:"block"},children:(0,l.jsxs)("span",{className:"div-row ",children:[(0,l.jsx)(d.C3,{text:w("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),D(s),n(s)})(r)}}),(0,l.jsx)(d.C3,{text:w("编辑"),clickFun:()=>{void 0===b.find(e=>e===r)&&I([...b,r])}})]})})]},r)),y&&(0,l.jsxs)("div",{style:{display:"block"},children:[(0,l.jsx)(d.rA,{title:w("取消"),icon:"cancel",onClick:()=>{I([]),S(!1),m&&(n(m),D(m)),k(!1)}}),(0,l.jsx)(d.rA,{title:w("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,i.Lr)(p),...e.get_pre_add_item&&await e.get_pre_add_item()}];D(s),n(s)}}),(0,l.jsx)(d.rA,{title:w("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];D(e),n(e)}}),(0,l.jsx)(d.rA,{title:w("全部编辑"),icon:C?"unfold_less":"unfold_more",onClick:()=>{k(!C)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,l.jsx)(d.rA,{icon:y?"save":"edit",title:w(y?"保存":"编辑"),onClick:async()=>{y?e.save&&await e.save(j):m=t,S(!y)}})]})}},65877(e,t,n){n.r(t),n.d(t,{default:()=>D});var s=n(96540),a=n(75725),r=n(61443),l=n(70447),c=n(85997),i=n(34289),o=n(34899),d=n(62042),u=n(14284),h=n(53459),p=n(74848);function x(e){const{t}=(0,o.Bd)(),[n,x]=(0,s.useState)(t("毫秒")),[m,j]=(0,s.useState)(""),[_,v]=(0,s.useState)(""),[f,g]=(0,s.useState)(null),[y,S]=(0,s.useState)(null),[C,k]=(0,s.useState)(Date.now());return(0,s.useEffect)(()=>{(async()=>{const e=await u.Yu.get("sys_time/get");if(e.code===h.m.Success){const t=await e.data;g(t.timestamp),S(t.timezone),k(t.timestamp)}})();const e=setInterval(()=>{k(e=>e+1e3)},1e3);return()=>clearInterval(e)},[]),(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{children:(0,p.jsxs)(l.Zp,{title:t("时间转换器"),rightBottomCom:(0,p.jsx)(c.C3,{text:t("确定"),clickFun:function(){if(!m&&!_)return void(0,d.zN)("不能都为空");let e=0;const t=""!==m&&0!==m;if(t){if(!(0,i.kf)(m))return void(0,d.zN)("must be number !");e=parseInt(m),"分秒"===n&&(e*=1e3)}const s=new Date(t?e:_),a=new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(s);if(v(a),!m){const e=s.getTime();j("毫秒"===n?e:e/1e3)}}}),children:[(0,p.jsx)(r.l6,{value:n,options:[{title:t("毫秒"),value:"毫秒"},{title:t("分秒"),value:"分秒"}],onChange:function(e){x(e)}}),(0,p.jsx)(r.Sm,{placeholder:n,value:m,handleInputChange:e=>{j(e)}}),(0,p.jsx)(r.Sm,{placeholder:t("格式化时间"),value:_,handleInputChange:e=>{v(e)}})]})}),(0,p.jsx)(a.VP,{children:null!==f&&null!==y&&(0,p.jsxs)(l.Zp,{title:t("服务器时间"),children:[(0,p.jsxs)("h1",{children:[t("时区"),": ",y]}),(0,p.jsxs)("h1",{children:[t("时间"),": ",new Date(C).toLocaleString(navigator.language,{timeZone:y})]})]})})]})}var m=n(57952),j=n(83029),_=n(78247),v=n(23430);function f(e){const{t}=(0,o.Bd)(),{check_user_auth:n}=(0,_.MH)(),[a,l]=(0,s.useState)(""),i=async e=>{const t=e||a;if(!t)return void(0,d.zN)("mac地址不能为空");(await u._U.post("wol/exec",{mac:t})).code===h.m.Success&&(0,d.SK)("发送唤醒命令成功")};return(0,p.jsxs)("div",{children:[(0,p.jsxs)(m.A,{children:[(0,p.jsx)(c.rA,{icon:"play_arrow",title:t("发送"),onClick:()=>{i()}}),(0,p.jsx)(r.$Z,{placeholder:t("目标设备mac地址"),icon:"laptop_mac",value:a,handleInputChange:e=>l(e)})]}),(0,p.jsx)(j.N,{have_auth_edit:n(v.oV.wol_proxy_tag_update),getItems:async()=>{const e=await u._U.get("wol/tag");return e.code===h.m.Success?e.data:[]},save:async e=>{(await u._U.post("wol/tag/save",e)).code!==h.m.Success&&(0,d.zN)("网络错误")},clickItem:async e=>{l(e.mac),i(e.mac)},items:[{key:"name",preName:t("名字")},{key:"mac",preName:"mac"+t("地址")},{key:"color",preName:"color"}]})]})}var g=n(77481),y=n(34843),S=n(82893),C=n(40505);let k;function w(){const[e,t]=(0,s.useState)("rsa"),[n,i]=(0,s.useState)("pem"),{t:x,i18n:j}=(0,o.Bd)(),[_,v]=(0,y.fp)(S.AG.confirm),[f,w]=(0,s.useState)(""),[b,I]=(0,s.useState)(""),N=async t=>{if(!b||!f)return void(0,d.zN)("密钥不能为空");let n="id_"+e;"pub"===t&&(n+=".pub"),v({open:!0,title:x("将覆盖密钥文件"),sub_title:`之前的密钥将作废。 将会作为 ${n} 文件保存到系统上的"${k}"目录下,此目录会作为openssh(git)所使用的默认目录。`,handle:async()=>{(await u.cD.post("save_openssh",{name:n,context:"pub"===t?f:b})).code===h.m.Success&&((0,d.SK)("完成"),v({open:!1,handle:null}))}})};return(0,p.jsxs)(s.Fragment,{children:[(0,p.jsx)(m.A,{children:(0,p.jsx)(g.S,{isFlex:!0,columns:[(0,p.jsx)(r.l6,{tip:x("加密算法"),value:e,width:"auto",onChange:e=>{t(e)},options:[{title:x("RSA"),value:"rsa"},{title:x("DSA"),value:"dsa"},{title:x("ECDSA"),value:"ecdsa"}]}),(0,p.jsx)(r.l6,{tip:x("输出格式"),value:n,width:"auto",onChange:e=>{i(e)},options:[{title:x("普通PEM"),value:"pem"},{title:x("opensshPEM"),value:"openssh_pem"}]}),(0,p.jsx)(c.rA,{icon:"play_arrow",title:x("生成"),onClick:()=>{(async()=>{const t=await u.cD.post("generate",{type:e,form:n});t.code===h.m.Success&&(w(t.data.public_key),I(t.data.private_key),k=t.data.home_path)})()}})]})}),(0,p.jsx)(a.xh,{children:(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:x("公钥"),titleCom:(0,p.jsx)(c.rA,{title:x("复制"),icon:"copy_all",onClick:()=>{f&&((0,C.lW)(f),(0,d.SK)("完成"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:x("保存到.ssh目录"),clickFun:()=>{N("pub")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},onChange:e=>{w(e.target.value)},value:f})})}),(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:x("私钥"),titleCom:(0,p.jsx)(c.rA,{title:x("复制"),icon:"copy_all",onClick:()=>{b&&((0,C.lW)(b),(0,d.SK)("成功"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:x("保存到.ssh目录"),clickFun:()=>{N("pri")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},value:b,onChange:e=>{I(e.target.value)}})})})]})})]})}var b=n(14944),I=n(92275);function N(){const{t:e}=(0,o.Bd)(),[t,n]=(0,s.useState)(""),[i,u]=(0,s.useState)("1"),[h,x]=(0,s.useState)("65535"),[m,j]=(0,s.useState)("100"),[_,v]=(0,s.useState)("2000"),[f,y]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[k,w]=(0,s.useState)([]),[N,A]=(0,s.useState)(null),D=(0,s.useRef)([]),z=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!z.current)return z.current=!0,b.ws.addMsg(I.HK.port_scan_progress,e=>{C(e.context)}),b.ws.addMsg(I.HK.port_scan_result,e=>{const t=e.context,n=[...D.current,t];D.current=n,w(n)}),b.ws.addMsg(I.HK.port_scan_end,t=>{A(t.context),y(!1),t.context.cancelled?(0,d.zN)(e("扫描已取消")):(0,d.SK)(e("扫描完成"))}),()=>{b.ws.sendData(I.HK.port_scan_cancel,{}),b.ws.removeMsg(I.HK.port_scan_progress),b.ws.removeMsg(I.HK.port_scan_result),b.ws.removeMsg(I.HK.port_scan_end),z.current=!1}},[]);return(0,p.jsx)(a.xh,{children:(0,p.jsx)(a.fI,{children:(0,p.jsx)(a.VP,{children:(0,p.jsxs)(l.Zp,{title:e("TCP ")+e("端口扫描"),titleCom:(0,p.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.85em",color:"var(--textSecondary)"},children:[S&&(0,p.jsxs)("span",{children:[e("已发现"),": ",S.openCount]}),N&&(0,p.jsxs)("span",{children:[e("总计扫描"),": ",N.totalScanned," | ",e("开放"),": ",N.totalOpen]})]}),children:[(0,p.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap",marginBottom:"1rem"},children:[(0,p.jsx)(r.$Z,{placeholder:e("目标主机"),icon:"dns",value:t,handleInputChange:e=>n(e)}),(0,p.jsx)(r.$Z,{placeholder:e("起始端口"),icon:"login",value:i,handleInputChange:e=>u(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("结束端口"),icon:"logout",value:h,handleInputChange:e=>x(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("并发数"),icon:"shuffle",value:m,handleInputChange:e=>j(e),type:"number"}),(0,p.jsx)(r.$Z,{placeholder:e("超时(ms)"),icon:"timer",value:_,handleInputChange:e=>v(e),type:"number"}),f?(0,p.jsx)(c.C3,{text:e("取消"),clickFun:()=>{b.ws.sendData(I.HK.port_scan_cancel,{}).catch(()=>{})}}):(0,p.jsx)(c.C3,{text:e("扫描"),clickFun:()=>(()=>{if(!t)return void(0,d.zN)(e("主机地址不能为空"));const n=parseInt(i),s=parseInt(h);isNaN(n)||isNaN(s)||n<1||s<1||n>65535||s>65535?(0,d.zN)(e("端口范围无效")):n>s?(0,d.zN)(e("起始端口不能大于结束端口")):(y(!0),C(null),w([]),D.current=[],A(null),b.ws.sendData(I.HK.port_scan_req,{host:t,startPort:n,endPort:s,concurrency:parseInt(m)||100,timeout:parseInt(_)||2e3}).catch(()=>{}))})()})]}),f&&S&&(0,p.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,p.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8em",color:"var(--textSecondary)",marginBottom:"0.3rem"},children:[(0,p.jsxs)("span",{children:[e("当前"),": ",S.currentPort]}),(0,p.jsxs)("span",{children:[S.scanned," / ",S.total]})]}),(0,p.jsx)(l.gz,{progress:S.percent})]}),k.length>0&&(0,p.jsx)(g.X,{headers:[e("端口"),e("状态")],rows:k.map(t=>[t.port,(0,p.jsx)("span",{style:{color:"var(--icon-green)"},children:e("开放")})])}),f&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("正在扫描...")}),!f&&N&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("未发现开放端口")}),!f&&!N&&0===k.length&&(0,p.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"var(--textSecondary)"},children:e("请输入参数后点击扫描")})]})})})})}var A=n(87361);function D(e){const{t}=(0,o.Bd)(),{check_user_auth:n}=(0,_.MH)(),s=[];return s.push({index:1,name:t("时间工具"),rto:"timeutil/",component:(0,p.jsx)(x,{})},{index:1,name:t("非对称密钥"),rto:"crypto/",component:(0,p.jsx)(w,{})}),n(v.oV.port_scan)&&s.push({index:1,name:t("端口扫描"),rto:"portscan/",component:(0,p.jsx)(N,{})}),n(v.oV.wol_proxy)&&s.push({index:1,name:t("网络唤醒"),rto:"netwol/",component:(0,p.jsx)(f,{})}),(0,p.jsx)(a.W1,{optionList:s,father_route:A.o.toolbox})}}}]);
@@ -1 +0,0 @@
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(76213),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(34899),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(76213),p=a(34899);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(34899),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("open shell... ");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(76213),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(99380);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(5880),a.e(4091)]).then(a.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 +0,0 @@
1
- (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6100],{69160(e,t,A){"use strict";A.r(t),A.d(t,{default:()=>c});var r=A(96540),o=(A(82341),A(91568)),n=(A(37092),A(74848));let l;function c(e){const t=(0,r.useRef)(null),A=async()=>{try{const A=(e=>{const t=e?e.split("?")[0].split(".").pop():"";return t?.toLowerCase(),"video/mp4"})(e.source),r={sources:{src:e.source,type:A}},n={playbackRates:[.5,1,1.5,2,2.5,3]};let c=((...e)=>o.default.obj.merge({controlBar:{skipButtons:{forward:5,backward:5}},html5:{nativeTextTracks:!1},plugins:{hotkeys:{volumeStep:.1,seekStep:10,enableModifiersForNumbers:!1}}},...e))(e.options,r,n);l=(0,o.default)(t.current,c,()=>{})}catch(e){console.error("Error initializing video player:",e)}};return(0,r.useEffect)(()=>(A(),()=>{l&&(l.dispose(),l=null)}),[]),(0,n.jsxs)("video",{ref:t,className:"video-js",style:{width:"100%",height:"100%"},controls:!0,preload:"auto",children:[(0,n.jsx)("source",{}),(0,n.jsx)("p",{className:"vjs-no-js",children:"浏览器不支持video.js"})]})}},37092(e,t,A){var r,o,n;n=function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.30"}),(e.registerPlugin||e.plugin)("hotkeys",function(t){var A=this,r=A.el(),o=document,n={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,captureDocumentHotkeys:!1,documentHotkeysFocusElementFilter:()=>!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},l=e.obj?.merge||e.mergeOptions||e.util.mergeOptions,c=(t=l(n,t||{})).volumeStep,u=t.seekStep,s=t.enableMute,a=t.enableVolumeScroll,i=t.enableHoverScroll,d=t.enableFullscreen,m=t.enableNumbers,y=t.enableJogStyle,p=t.alwaysCaptureHotkeys,v=t.captureDocumentHotkeys,f=t.documentHotkeysFocusElementFilter,h=t.enableModifiersForNumbers,Y=t.enableInactiveFocus,S=t.skipInitialFocus,w=e.VERSION;r.hasAttribute("tabIndex")||r.setAttribute("tabIndex","-1"),r.style.outline="none",!p&&A.autoplay()||S||A.one("play",()=>{r.focus()}),Y&&A.on("userinactive",()=>{var e=()=>{clearTimeout(t)},t=setTimeout(()=>{A.off("useractive",e);var t=o.activeElement,n=t.parentElement,l=r.querySelector(".vjs-control-bar");!t||l!=n&&l!=n.parentElement||r.focus()},10);A.one("useractive",e)}),A.on("play",()=>{var e=r.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var j=function(e){var n,l,u=e.which,a=e.preventDefault.bind(e),i=A.duration();if(A.controls()){var Y=o.activeElement;if(p||v&&f(Y)||Y==r||Y==r.querySelector(".vjs-tech")||Y==r.querySelector(".vjs-control-bar")||Y==r.querySelector(".iframeblocker"))switch(F(e,A)){case 1:a(),(p||v)&&e.stopPropagation(),A.paused()?K(A.play()):A.pause();break;case 2:n=!A.paused(),a(),n&&A.pause(),(l=A.currentTime()-x(e))<=0&&(l=0),A.currentTime(l),n&&K(A.play());break;case 3:n=!A.paused(),a(),n&&A.pause(),(l=A.currentTime()+x(e))>=i&&(l=n?i-.001:i),A.currentTime(l),n&&K(A.play());break;case 5:a(),y?(l=A.currentTime()-1,A.currentTime()<=1&&(l=0),A.currentTime(l)):A.volume(A.volume()-c);break;case 4:a(),y?((l=A.currentTime()+1)>=i&&(l=i),A.currentTime(l)):A.volume(A.volume()+c);break;case 6:s&&A.muted(!A.muted());break;case 7:d&&(A.isFullscreen()?A.exitFullscreen():A.requestFullscreen());break;default:if((u>47&&u<59||u>95&&u<106)&&(h||!(e.metaKey||e.ctrlKey||e.altKey))&&m){var S=48;u>95&&(S=96);var w=u-S;a(),A.currentTime(A.duration()*w*.1)}for(var j in t.customKeys){var b=t.customKeys[j];b&&b.key&&b.handler&&b.key(e)&&(a(),b.handler(A,t,e))}}}},b=!1,k=r.querySelector(".vjs-volume-menu-button")||r.querySelector(".vjs-volume-panel");null!=k&&(k.addEventListener("mouseover",()=>{b=!0}),k.addEventListener("mouseout",()=>{b=!1}));var B=function(e){if(i)var t=0;else t=o.activeElement;if(A.controls()&&(p||t==r||t==r.querySelector(".vjs-tech")||t==r.querySelector(".iframeblocker")||t==r.querySelector(".vjs-control-bar")||b)&&a){e=window.event||e;var n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==n?A.volume(A.volume()+c):-1==n&&A.volume(A.volume()-c)}},F=function(e,A){return t.playPauseKey(e,A)?1:t.rewindKey(e,A)?2:t.forwardKey(e,A)?3:t.volumeUpKey(e,A)?4:t.volumeDownKey(e,A)?5:t.muteKey(e,A)?6:t.fullscreenKey(e,A)?7:void 0};function x(e){return"function"==typeof u?u(e):u}function K(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}if(v){var z=function(e){j(e)};document.addEventListener("keydown",z),this.dispose=()=>{document.removeEventListener("keydown",z)}}else A.on("keydown",j);return A.on("dblclick",function(e){if(null!=w&&w<="7.1.0"&&A.controls()){var t=e.relatedTarget||e.toElement||o.activeElement;t!=r&&t!=r.querySelector(".vjs-tech")&&t!=r.querySelector(".iframeblocker")||d&&(A.isFullscreen()?A.exitFullscreen():A.requestFullscreen())}}),A.on("mousewheel",B),A.on("DOMMouseScroll",B),this})},"undefined"!=typeof window&&window.videojs?n(window.videojs):(r=[A(91568)],o=function(e){return n(e.default||e)}.apply(t,r),void 0===o||(e.exports=o))},17422(e){"use strict";e.exports="data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgY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Uaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA=="},80542(){}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6247],{77481(e,t,n){n.d(t,{S:()=>o,X:()=>l});var i=n(96540),s=n(74848);function l(e){const[t,n]=i.useState([]);return(0,i.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]),(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:e.headers?.map((e,t)=>(0,s.jsx)("th",{children:e},t))})}),(0,s.jsx)("tbody",{children:t.map((t,n)=>(0,s.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((n,i)=>(0,s.jsx)("td",{style:{width:e.width??"auto"},className:i===t.length-1?"small":"",children:n},i))},n))})]})}function o(e){return(0,s.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,s.jsx)("div",{children:e},t))})}},66247(e,t,n){n.r(t),n.d(t,{default:()=>k});var i=n(96540),s=n(75725),l=n(70447),o=n(85997),r=n(77481),c=n(61443),a=n(34899),d=n(14284),h=n(53459),u=n(62042),x=n(87361),j=n(40505),_=n(57952),p=n(76213),f=n(34843),m=n(82893),w=n(21469),v=n(21499),C=n(74848);function k(){const{t:e,i18n:t}=(0,a.Bd)(),n=(0,p.Zp)(),k=[e("编号"),e("路径"),e("过期小时"),e("token"),e("备注"),e("剩余时间(h)"),e("下载次数")],[b,y]=(0,i.useState)([]),[A,S]=(0,f.fp)(m.AG.prompt_card),g=async()=>{const e=await d.XO.get("get_share_file_list");if(e.code===h.m.Success){const t=e.data??[],n=Date.now();for(const e of t)try{if(null!=e.left_hour&&e.left_hour>0){const t=n-e.time_stamp,i=36e5*e.left_hour-t;e.show_left_hour=parseFloat((i/36e5).toFixed(2))}else e.show_left_hour=e.left_hour}catch(e){}y(t)}};(0,i.useEffect)(()=>{g()},[]);return(0,C.jsxs)("div",{className:"common-box ",style:{overflowY:"auto"},children:[(0,C.jsx)(_.A,{children:(0,C.jsx)(o.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{n(-1)}})}),(0,C.jsx)(s.J,{widthPer:100,children:(0,C.jsx)(l.uF,{self_title:(0,C.jsxs)("span",{className:" div-row ",children:[(0,C.jsx)("h2",{children:e("文件分享列表")}),(0,C.jsx)(o.rA,{icon:"info",title:e("提示"),onClick:()=>{let e=(0,C.jsx)("div",{children:"小时设置为-1或者不设置就没有过期时间"});S({open:!0,title:"信息",context_div:(0,C.jsx)("div",{children:e})})}})]}),titleCom:(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"add",title:e("添加"),onClick:()=>{y([...b,{note:"",path:""}])}}),(0,C.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.XO.post("set_share_file_list",b)).code===h.m.Success&&((0,u.SK)("保存成功"),g())}})]}),children:(0,C.jsx)(r.X,{headers:k,rows:b.map((t,n)=>{const i=[(0,C.jsx)("div",{children:n}),(0,C.jsx)(c.Sm,{value:t.path,handleInputChange:e=>{t.path=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.left_hour,handleInputChange:e=>{t.left_hour=parseFloat(e),t.time_stamp=Date.now()},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.token,handleInputChange:e=>{t.token=e},no_border:!0}),(0,C.jsx)(c.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,C.jsx)("p",{children:t.show_left_hour}),(0,C.jsx)("p",{children:t.download_num}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{b.splice(e,1),y([...b])})(n)}),t.id&&(0,C.jsx)(o.rA,{icon:"content_copy",title:e("复制地址"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${t.id}`);(0,j.lW)(e),(0,u.SK)(e)}}),t.id&&(0,C.jsx)(o.rA,{icon:"open_in_new",title:e("打开新页面"),onClick:()=>{const e=(0,v.bi)(`${window.location.origin}${w.m.base_url}`,`${x.o.share}/${t.id}`);window.open(e)}})]})];return i}),width:"10rem"})})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6505],{26505(t,s,e){e.r(s),e.d(s,{default:()=>m});var a=e(96540),i=(e(82893),e(14284)),l=e(62042),c=e(34899),o=e(85997),n=e(57952),r=e(76213),d=e(34289),h=e(87361),u=e(2543),p=e(74848);const x={modified:"#f9ab00",added:"var(--secondary, #34a853)",deleted:"var(--accent, #ea4335)",untracked:"var(--textSecondary, #5f6368)",renamed:"var(--primary, #1a73e8)",conflict:"var(--accent, #ea4335)"},g={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",conflict:"!"};function m(){const{t}=(0,c.Bd)(),s=(0,r.Zp)();let e=decodeURIComponent((0,d.GG)(h.o.git_page,(0,d.vX)()));e=e.replace(/\/+$/,"");const[m,y]=(0,a.useState)([]),[j,v]=(0,a.useState)([]),[N,b]=(0,a.useState)({current:"",branches:[]}),[f,S]=(0,a.useState)(""),[w,C]=(0,a.useState)(new Set),[z,k]=(0,a.useState)("status"),[U,T]=(0,a.useState)(!1),[_,P]=(0,a.useState)(16),[K,W]=(0,a.useState)(!1),F=(0,a.useRef)(null),A=(0,a.useRef)(null),[R,L]=(0,a.useState)({name:"",email:""}),[D,E]=(0,a.useState)(""),[I,B]=(0,a.useState)(""),[G,X]=(0,a.useState)(!1),[H,M]=(0,a.useState)(null),[Z,$]=(0,a.useState)(!1),[q,J]=(0,a.useState)(""),[O,Q]=(0,a.useState)(""),[V,Y]=(0,a.useState)(""),[tt,st]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(et(),at(),it(),lt(),ct())},[e]);const et=async()=>{try{T(!0);const t=await i.TU.post("status",{path:e});0===t.code&&y(t.data||[])}catch(t){}finally{T(!1)}},at=async()=>{try{const t=await i.TU.post("log",{path:e,maxCount:50});0===t.code&&v(t.data||[])}catch(t){}},it=async()=>{try{const t=await i.TU.post("branches",{path:e});0===t.code&&b(t.data||{current:"",branches:[]})}catch(t){}},lt=async()=>{try{const t=await i.TU.post("get_user_config",{path:e});0===t.code&&(L(t.data),E(t.data.name||""),B(t.data.email||""))}catch(t){}},ct=async()=>{try{const t=await i.TU.post("get_proxy",{path:e});0===t.code&&(M(t.data),J(t.data.global?.http||""),Q(t.data.global?.https||""),Y(t.data.local?.http||""),st(t.data.local?.https||""))}catch(t){}},ot=()=>{w.size===m.length?C(new Set):C(new Set(m.map(t=>t.path)))},nt=async(s=!1)=>{try{T(!0);const a=await i.TU.post("push",{path:e,force:s});0===a.code?(0,l.SK)(t("推送成功")):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}},rt=(0,a.useCallback)(u.throttle(t=>{const s=parseFloat(getComputedStyle(A.current).fontSize),e=window.innerWidth/s-4,a=t.clientX/s,i=2.25+F.current.offsetWidth/s;a<=e&&a>=i&&P(parseFloat(a.toFixed(2)))},32),[]),dt=()=>{W(!1),A.current.removeEventListener("pointermove",rt)},ht=e.split("/").filter(Boolean).pop()||e;return(0,p.jsxs)("div",{className:"studio",children:[(0,p.jsx)(n.A,{ignore_tags:!0,left_children:[(0,p.jsx)(o.rA,{title:t("取消"),icon:"close",onClick:()=>s(-1)},1),(0,p.jsx)("span",{children:decodeURIComponent(ht)})],children:(0,p.jsx)(o.rA,{icon:"refresh",title:t("刷新"),onClick:()=>{et(),at(),it(),lt(),ct()}})}),(0,p.jsxs)("div",{className:"studio-body",ref:A,children:[(0,p.jsxs)("div",{className:"studio-nav",style:{width:_-1+"em"},children:[(0,p.jsxs)("div",{className:"git-studio-tab-bar",children:[(0,p.jsxs)("button",{className:"git-studio-tab "+("status"===z?"git-studio-tab--active":""),onClick:()=>k("status"),children:["📝 ",t("变更")," (",m.length,")"]}),(0,p.jsxs)("button",{className:"git-studio-tab "+("log"===z?"git-studio-tab--active":""),onClick:()=>k("log"),children:["📜 ",t("提交记录")," (",j.length,")"]})]}),"status"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[m.length>0&&(0,p.jsxs)("div",{className:"git-studio-select-all",onClick:ot,children:[(0,p.jsx)("input",{type:"checkbox",checked:w.size===m.length&&m.length>0,onChange:ot}),(0,p.jsxs)("span",{children:[t("全选")," (",w.size,"/",m.length,")"]})]}),m.map(t=>(0,p.jsxs)("div",{className:"git-studio-file-item "+(w.has(t.path)?"git-studio-file-item--selected":""),onClick:()=>(t=>{const s=new Set(w);s.has(t)?s.delete(t):s.add(t),C(s)})(t.path),children:[(0,p.jsx)("input",{type:"checkbox",checked:w.has(t.path),onChange:()=>{}}),(0,p.jsx)("span",{className:"git-studio-status-badge",style:{background:x[t.status]||x.untracked},children:g[t.status]||t.status}),(0,p.jsxs)("span",{className:"git-studio-filename",children:[t.path,t.oldPath&&(0,p.jsxs)("span",{style:{color:"var(--textSecondary)",fontSize:11},children:[" (← ",t.oldPath,")"]})]})]},t.path)),0===m.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("没有变更")})]}),"log"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[j.map((t,s)=>(0,p.jsxs)("div",{className:"git-studio-log-entry",children:[(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,p.jsx)("span",{className:"git-studio-log-hash",children:t.hash}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)",flex:1},children:t.message})]}),(0,p.jsxs)("div",{style:{fontSize:11,color:"var(--textSecondary)",paddingLeft:4},children:[t.author," · ",t.date]})]},s)),0===j.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("暂无提交记录")})]})]}),(0,p.jsx)("div",{className:"studio__divider",ref:F,onPointerDown:()=>{W(!0),A.current.addEventListener("pointermove",rt)},onPointerUp:dt}),K&&(0,p.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),(0,p.jsx)("div",{className:"studio-editor",children:(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"16px",gap:12,overflow:"auto"},children:[(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌿 ",t("分支"),": ",(0,p.jsx)("span",{style:{color:"var(--secondary, #34a853)"},children:N.current})]}),(0,p.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:N.branches.map(s=>(0,p.jsx)("button",{className:"git-studio-branch-chip "+(s===N.current?"git-studio-branch-chip--current":""),onClick:()=>(async s=>{try{T(!0);const a=await i.TU.post("checkout",{path:e,branch:s});0===a.code?((0,l.SK)(t("切换分支成功")),et(),at(),it()):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}})(s),disabled:s===N.current||s.startsWith("*"),children:s.replace("remotes/origin/","")},s))})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsx)("textarea",{className:"git-studio-textarea",placeholder:t("输入提交信息..."),value:f,onChange:t=>S(t.target.value),rows:2}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(f.trim())try{T(!0);const s=await i.TU.post("commit",{path:e,message:f.trim(),allChanged:!0});0===s.code?((0,l.SK)(t("提交成功")),S(""),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}else(0,l.zN)(t("请输入提交信息"))},disabled:U||!f.trim(),style:{borderColor:"var(--secondary, #34a853)",color:"var(--secondary, #34a853)"},children:["✅ ",t("提交")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("add_all",{path:e});0===s.code?((0,l.SK)(t("已暂存全部")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["➕ ",t("暂存全部")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("add",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},children:["📥 ",t("暂存选中")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("reset",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已取消暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},style:{borderColor:"#f9ab00",color:"#f9ab00"},children:["↩ ",t("取消暂存")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["☁️ ",t("远程操作")]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{T(!0);const s=await i.TU.post("pull",{path:e});0===s.code?((0,l.SK)(t("拉取成功")),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{T(!1)}},disabled:U,children:["⬇ ",t("拉取")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!1),disabled:U,children:["⬆ ",t("推送")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!0),disabled:U,style:{borderColor:"var(--accent, #ea4335)",color:"var(--accent, #ea4335)"},children:["⚠ ",t("强制推送")]})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash",{path:e});0===s.code?((0,l.SK)(t("暂存工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📦 ",t("暂存工作区")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash_pop",{path:e});0===s.code?((0,l.SK)(t("恢复工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📤 ",t("恢复工作区")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["👤 ",t("用户配置")]}),G?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:D,onChange:t=>E(t.target.value),placeholder:"user.name"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:I,onChange:t=>B(t.target.value),placeholder:"user.email"})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("set_user_config",{path:e,name:D,email:I});0===s.code?((0,l.SK)(t("用户配置已保存")),X(!1),lt()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{X(!1),E(R.name),B(R.email)},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.name||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.email||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>X(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌐 ",t("代理设置")]}),Z?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:q,onChange:t=>J(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:O,onChange:t=>Q(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:V,onChange:t=>Y(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:tt,onChange:t=>st(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:11,color:"var(--textSecondary)"},children:t("留空清除该代理设置")}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=[{scope:"global",type:"http",value:q},{scope:"global",type:"https",value:O},{scope:"local",type:"http",value:V},{scope:"local",type:"https",value:tt}];for(const t of s)await i.TU.post("set_proxy",{path:e,...t});(0,l.SK)(t("代理配置已保存")),$(!1),ct()}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{$(!1),ct()},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.https||"-"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.https||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>$(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:"1px solid var(--divider, rgba(0,0,0,0.08))",background:"var(--surfaceSecondary, #f1f3f4)",fontSize:11,color:"var(--textSecondary)",lineHeight:1.6},children:["💡 ",t("提示:"),(0,p.jsxs)("ul",{style:{margin:"4px 0",paddingLeft:16},children:[(0,p.jsx)("li",{children:t("左侧勾选文件后,使用「暂存选中」将其加入暂存区")}),(0,p.jsx)("li",{children:t("输入提交信息后点击「提交」")}),(0,p.jsx)("li",{children:t("如有冲突,请自行在shell中解决冲突后再提交")}),(0,p.jsx)("li",{children:t("「强制推送」会覆盖远程分支,请谨慎使用")}),(0,p.jsx)("li",{children:t("用户配置和全局代理修改后对所有仓库生效")})]})]})]})})]})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,4091,8319],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(74848);function i(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:e.headers?.map((e,t)=>(0,r.jsx)("th",{children:e},t))})}),(0,r.jsx)("tbody",{children:t.map((t,s)=>(0,r.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,r.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function l(e){return(0,r.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,r.jsx)("div",{children:e},t))})}},84091(e,t,s){s.r(t),s.d(t,{default:()=>d});var n=s(96540),r=s(80952),i=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(24522)),l=s(34843),a=s(82893),c=s(78247),o=s(74848);function d(e){const t=(0,n.useRef)(null),[s,d]=(0,l.fp)(a.AG.user_base_info),u=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${u}`,mode:e.model??i.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){e.on_change&&e.on_change()}),t.current=s,s.formatCode=()=>{const e=r.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},c.xK.set_editor_temp(s,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,o.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}r.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("modePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("themePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("workerPath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`),r.config.set("basePath",`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`)},60676(e,t,s){s.r(t),s.d(t,{default:()=>w});var n=s(96540),r=s(57952),i=s(85997),l=s(14284),a=s(76213),c=s(77481),o=s(70447),d=s(34843),u=s(82893),h=s(84091),p=s(78247),x=s(61443),m=s(23496),_=s(62042),f=s(34899),j=s(53459),v=s(7523),g=s(74848);function b(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function S(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:i="",onTick:l,className:a}=e,[c,o]=(0,n.useState)(0),d=(0,n.useRef)(0),u=(0,n.useRef)(null),h=(0,n.useRef)(t);h.current=t;const p=(0,n.useCallback)(()=>{null!==u.current&&(cancelAnimationFrame(u.current),u.current=null)},[]),x=(0,n.useCallback)(()=>{p();const e=()=>{const t=performance.now()-d.current;o(t),l?.(t),h.current&&(u.current=requestAnimationFrame(e))};e()},[l,p]);return(0,n.useEffect)(()=>{d.current=performance.now(),o(0),l?.(0),h.current&&x()},[s]),(0,n.useEffect)(()=>{t?x():p()},[t,x,p]),(0,n.useEffect)(()=>()=>p(),[p]),(0,g.jsxs)("span",{className:a,children:[i,b(c,r)]})}var q=s(87361),y=s(28319);function C(e){const[t,s]=(0,n.useState)("");return(0,g.jsxs)("div",{className:"db-query-preset-input",children:[(0,g.jsx)(x.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,g.jsx)("div",{className:"db-query-preset-input__actions",children:(0,g.jsx)(i.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function w(){const e=(0,a.Zp)(),{t}=(0,f.Bd)(),{initUserInfo:s}=(0,n.useContext)(v.F),[b]=(0,d.fp)(u.AG.sqlite_query_context),[w]=(0,d.fp)(u.AG.user_base_info),[,k]=(0,d.fp)(u.AG.prompt_card),N=(0,n.useMemo)(()=>b?.path??"",[b?.path]),A=(0,n.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),E=97,[K,L]=(0,n.useState)(""),[F,$]=(0,n.useState)("table"),[M,Q]=(0,n.useState)(!1),[P,O]=(0,n.useState)(""),[R,G]=(0,n.useState)(null),[I,T]=(0,n.useState)(!1),[J,W]=(0,n.useState)(0),[Z,B]=(0,n.useState)(!1),[D,H]=(0,n.useState)([]),[V,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=w?.user_data?.sql_preset_list;e&&e.length?H([...e]):H([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[w?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await l.wm.post(m.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===j.m.Success&&(await s(),H(t),!0)},z=async(e,s)=>{const n=[...D,{note:s||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,_.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{p.xK.set_value_temp(K,E)},[K]),(0,n.useEffect)(()=>{L(""),O(""),G(null),$("table"),T(!1),B(!1),W(0),te(""),ne(""),p.xK.set_value_temp("",E),N||O("请先从文件右键打开一个数据库")},[N,b?.open]);const re=async()=>{const e=(p.xK.get_editor_value(E)??K).trim();if(!N)return O("请先从文件右键打开一个数据库"),void G(null);if(!e)return O("请输入 SQL 语句"),void G(null);Q(!0),O(""),B(!0),W(e=>e+1),T(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await l.$M.post("sqlite/query",{path:N,sql:s});G(n.data),$("table")}catch(e){O(e?.message??`${e}`),G(null)}finally{T(!1),Q(!1)}var t},ie=R?.columns?.length?R.columns:Object.keys(R?.rows?.[0]??{}),le=(R?.rows??[]).map(e=>ie.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,g.jsxs)("div",{className:"db-query-page",children:[(0,g.jsx)(r.A,{ignore_tags:!0,left_children:[(0,g.jsx)(i.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,g.jsx)(i.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,g.jsx)(i.rA,{icon:"table_chart",title:"表格视图",onClick:()=>$("table")},"table"),(0,g.jsx)(i.rA,{icon:"data_object",title:"原 JSON",onClick:()=>$("json")},"json"),(0,g.jsx)(i.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,g.jsx)(o.xP,{context:A,tip_context:"点击复制数据库信息"})}),(0,g.jsxs)("div",{className:"db-query-page__content",children:[(0,g.jsxs)(o.Zp,{title:"SQL 查询",titleCom:(0,g.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,g.jsx)(x.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),D.length>0&&(0,g.jsx)(x.l6,{width:"16rem",tip:t("SQL预设"),value:V,onChange:e=>{const t=D[e];t&&(X(e),(e=>{p.xK.set_value_temp(e,E);const t=p.xK.get_editor(E);t&&t.setValue(e,-1),L(e)})(t.sql),te(Y(t.env??"","find")),ne(""),O(""))},options:D.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,g.jsx)(i.C3,{text:t(V>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(p.xK.get_editor_value(E)??K).trim();if(!e)return void O(t("请输入 SQL 语句"));const s=[...D];if(V>=0&&s[V]){s[V].sql=e,s[V].note||(s[V].note=t("SQL 预设"));await U(s)&&(0,_.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,g.jsx)(C,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,g.jsxs)("div",{className:"db-query-page__actions",children:[(0,g.jsx)(i.C3,{text:M?"查询中...":"执行查询",clickFun:re}),(0,g.jsx)(i.C3,{text:"清空",clickFun:()=>{p.xK.set_value_temp("",E);const e=p.xK.get_editor(E);e&&e.setValue("",-1),L("")}}),(0,g.jsx)(i.C3,{text:"table"===F?"表格视图":"切换到表格",clickFun:()=>$("table")}),(0,g.jsx)(i.C3,{text:"json"===F?"原 JSON":"切换到 JSON",clickFun:()=>$("json")})]}),children:[(0,g.jsx)("div",{className:"db-query-page__editor",children:(0,g.jsx)(h.default,{name:"sqlite.sql",editor_id:E,model:"ace/mode/sql",on_change:()=>{const e=p.xK.get_editor_value(E)??"";L(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),P&&(0,g.jsx)("div",{className:"db-query-page__error",children:P})]}),(0,g.jsxs)(o.Zp,{title:"查询结果",titleCom:(0,g.jsxs)("span",{className:"db-query-page__result-meta",children:[R?`${R.row_count} 行`:"暂无结果",Z&&(0,g.jsx)("span",{className:"db-query-page__elapsed",children:(0,g.jsx)(S,{running:I,resetKey:J,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[R&&"table"===F&&(0,g.jsx)(c.X,{headers:ie,rows:le}),R&&"json"===F&&(0,g.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(R.rows,null,2)}),!R&&!P&&(0,g.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!R&&P&&(0,g.jsx)("div",{className:"db-query-page__hint",children:P})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>q,defaultSqlPreset:()=>b});var n=s(96540),r=s(34899),i=s(57952),l=s(85997),a=s(75725),c=s(77481),o=s(70447),d=s(61443),u=s(34843),h=s(82893),p=s(14284),x=s(23496),m=s(53459),_=s(62042),f=s(7523),j=s(78247),v=s(76213),g=s(74848);function b(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,n.useContext)(f.F),[,s]=(0,u.fp)(h.AG.editorSetting),[q]=(0,u.fp)(h.AG.user_base_info),y=(0,v.Zp)(),C=n.useRef(-1),[w,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=q?.user_data?.sql_preset_list;k(t?.length?[...t]:[b(e)])},[e,q?.user_data?.sql_preset_list]);const N=async()=>{const s=w.map((e,t)=>({...e,index:t})),n=await p.wm.post(x.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:s});n?.code===m.m.Success&&(await t(),(0,_.SK)(e("保存成功")))},A=(e,t)=>{C.current=e;const n=w[e][t]??"";j.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{w[C.current][t]=e,k([...w]),j.xK.set_value_temp(""),N()}})},E=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(i.A,{children:(0,g.jsx)(l.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>y(-1)})}),(0,g.jsx)(a.jW,{isFull:!0,more:!0,children:(0,g.jsx)(a.NN,{children:(0,g.jsx)(a.xh,{children:(0,g.jsx)(a.fI,{children:(0,g.jsx)(a.VP,{widthPer:60,children:(0,g.jsx)(o.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(l.rA,{icon:"add",title:e("添加"),onClick:()=>k([...w,{note:"",sql:"",env:S}])}),(0,g.jsx)(l.rA,{icon:"save",title:e("保存"),onClick:()=>N()})]}),children:(0,g.jsx)(c.X,{headers:E,rows:w.map((t,s)=>[(0,g.jsx)("div",{children:s+1}),(0,g.jsx)(d.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...w])}}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>A(s,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"settings",title:e("env编辑"),onClick:()=>A(s,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(l.rA,{icon:"delete",title:e("删除"),onClick:()=>{w.splice(s,1),k([...w])}})})]),width:"8rem"})})})})})})})]})}s.d(t,["sqlEnvDefault",0,S])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[678,6010],{83277(e,s,t){t.d(s,{$j:()=>o,Lv:()=>a,qq:()=>i});class n{options_agent_url_list;options_agent_key_list;options_agent_model_list;options_local_file_path_prompt_list}class a{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,s){if(!e||!s?.length)return e;for(const t of s)if(t.value===e)return t.label;return e}static have_label_by_v(e,s){if(!e||!s?.length)return!1;for(const t of s)if(t.value===e)return!0;return!1}}class i extends n{tool_call_max=500;allow_exec_cmd_directly=!1;proxy_url;open_pick_model;max_recent_messages=12;compress_message_count=16;max_tool_content_chars=200}const c=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function o(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}t.d(s,["CP",0,'\n\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n',"cL",0,c])},93583(e,s,t){t.r(s),t.d(s,{default:()=>se});var n=t(96540),a=t(34843),i=t(34899),c=t(76213),o=t(92275),l=t(14284),r=t(7463),d=t(78247),u=t(40505),m=t(62042),h=t(45907),g=t(53459),p=t(72693),_=t(82893),x=t(61443),f=t(83277);function j(e){return null==e||e<0?"0":e.toLocaleString()}function v(e){const s=(0,f.$j)(e.content);if(s)return s;const t=e.content_list??[];return t.length?t.map(e=>(0,f.$j)(e.content)).filter(Boolean).join("\n\n"):""}function b(e=[]){return e.filter(e=>"user"===e.role||"assistant"===e.role).map((e,s)=>({id:Date.now()+s,sender:"assistant"===e.role?"bot":"user",text:v(e),attachments:e.attachments??[],content_list:e.content_list,images:e.images,audio:e.audio,embeddings:e.embeddings}))}const y=/\.(md|txt|json|js|jsx|ts|tsx|css|html?|xml|ya?ml|py|java|go|rs|c|cpp|h|hpp|sh|bat|cmd|ini|toml|csv|log|sql|env|gitignore|dockerfile)$/i;function w(e){return e.type?.startsWith("image/")?"image":e.type?.startsWith("text/")||y.test(e.name)?"text":"binary"}function S(e){return e.text()}function N(e){return new Promise((s,t)=>{const n=new FileReader;n.onload=()=>s(n.result),n.onerror=t,n.readAsDataURL(e)})}async function k(e){const s=[];for(const t of e){const e=w(t);let n="";if("text"===e)try{const e=await S(t),s=12e4;n=e.length>s?`${e.slice(0,s)}\n\n[内容已截断,原始长度 ${e.length} 字符]`:e}catch{n="[文本读取失败]"}else if("image"===e)try{n=await N(t)}catch{n=`[图片文件: ${t.name}]`}else n=`[二进制文件: ${t.name}]`;s.push({name:t.name,mime_type:t.type,size:t.size,kind:e,content:n})}return s}var C=t(14944);var A=t(52035),$=t(85997),I=t(34299),M=t(74848);function D(e){const s=e.attachments&&e.attachments.length>0?(0,M.jsx)("div",{className:"chat-message-attachments",children:e.attachments.map((e,s)=>(0,M.jsxs)("div",{className:"chat-message-attachment",children:[(0,M.jsx)($.In,{icon:"attach_file"}),(0,M.jsx)("span",{children:e.name}),(0,M.jsxs)("small",{children:[e.size," B"]})]},`${e.name}_${s}`))}):null,t=[];e.images&&"bot"===e.sender&&t.push((0,M.jsx)(n.Fragment,{children:(0,M.jsx)(H,{images:e.images,text:e.text})},"images")),e.audio&&"bot"===e.sender&&t.push((0,M.jsx)(n.Fragment,{children:(0,M.jsx)(T,{audio:e.audio,text:e.text})},"audio")),e.embeddings&&"bot"===e.sender&&t.push((0,M.jsx)(n.Fragment,{children:(0,M.jsx)(K,{embeddings:e.embeddings,text:e.text})},"embeddings"));const a=function(e){if("bot"!==e.sender||!e.content_list?.length)return e.text?(0,M.jsx)(I.default,{context:e.text}):null;return(0,M.jsxs)(M.Fragment,{children:[e.content_list.map((e,s)=>{const t=[],a=(0,f.$j)(e.content);return a&&t.push((0,M.jsx)(n.Fragment,{children:(0,M.jsx)(I.default,{context:a})},`content-${s}`)),e.tool_call_ends?.length&&t.push((0,M.jsx)(n.Fragment,{children:(0,M.jsx)(R,{callList:e.tool_call_ends})},`tool-${s}`)),(0,M.jsx)(n.Fragment,{children:t},`part-${s}`)}),!e.content_list.some(e=>e.content)&&e.text?(0,M.jsx)(I.default,{context:e.text}):null]})}(e);return 0===t.length?(0,M.jsxs)(M.Fragment,{children:[s,a]}):(0,M.jsxs)(M.Fragment,{children:[t,s,a]})}function R({callList:e}){const[s,t]=n.useState(!1);if(!e?.length)return null;e.filter(e=>e.success).length;const a=e.filter(e=>!e.success).length;return(0,M.jsxs)("div",{className:"chat-message-call-list",children:[(0,M.jsxs)("div",{className:"call-list-header",onClick:()=>t(!s),children:[(0,M.jsx)($.In,{icon:s?"expand_less":"expand_more"}),(0,M.jsxs)("span",{className:"call-list-summary",children:["工具调用 (",e.length,")",a>0&&(0,M.jsx)("span",{className:"call-list-fail",children:" 失败 "})]})]}),s&&(0,M.jsx)("div",{className:"call-list-body",children:e.map((e,s)=>(0,M.jsxs)("div",{className:"call-list-item "+(e.success?"call-success":"call-fail"),children:[(0,M.jsxs)("div",{className:"call-list-item-header",children:[(0,M.jsx)($.In,{icon:e.success?"check_circle":"error"}),(0,M.jsx)("span",{className:"call-list-tool-name",children:e.tool_display_name||e.tool_name}),(0,M.jsxs)("span",{className:"call-list-duration",children:[e.duration_ms,"ms"]})]}),e.tool_args&&(0,M.jsxs)("details",{className:"call-list-details",children:[(0,M.jsx)("summary",{children:"参数"}),(0,M.jsx)("pre",{className:"call-list-pre",children:JSON.stringify(e.tool_args,null,2)})]}),!e.success&&e.error&&(0,M.jsxs)("details",{className:"call-list-details",children:[(0,M.jsx)("summary",{children:"错误"}),(0,M.jsx)("pre",{className:"call-list-pre call-list-error-text",children:e.error})]}),e.success&&e.tool_result&&(0,M.jsxs)("details",{className:"call-list-details",children:[(0,M.jsx)("summary",{children:"结果"}),(0,M.jsx)("pre",{className:"call-list-pre",children:e.tool_result.length>500?e.tool_result.slice(0,500)+"...":e.tool_result})]})]},s))})]})}function H({images:e,text:s}){let t=e||[];if(!t.length&&s)try{t=JSON.parse(s).data||[]}catch{}return t.length?(0,M.jsxs)("div",{className:"image-generation-result",children:[t.map((e,s)=>(0,M.jsxs)("div",{className:"image-generation-item",children:[e.url&&(0,M.jsx)("div",{className:"image-generation-image-wrapper",children:(0,M.jsx)("img",{src:e.url,alt:e.revised_prompt||`生成的图片 ${s+1}`,loading:"lazy"})}),e.b64_json&&(0,M.jsx)("div",{className:"image-generation-image-wrapper",children:(0,M.jsx)("img",{src:`data:image/png;base64,${e.b64_json}`,alt:`生成的图片 ${s+1}`})}),e.revised_prompt&&(0,M.jsx)("p",{className:"image-generation-prompt",children:(0,M.jsx)("small",{children:e.revised_prompt})})]},s)),s&&!e&&(0,M.jsx)(I.default,{context:s})]}):(0,M.jsx)(I.default,{context:s||""})}function T({audio:e,text:s}){if(e){if(e.url)return(0,M.jsx)("div",{className:"audio-result",children:(0,M.jsx)("audio",{controls:!0,src:e.url,children:"您的浏览器不支持音频播放"})});if(e.data){const s=e.mime_type||"audio/mpeg";return(0,M.jsx)("div",{className:"audio-result",children:(0,M.jsx)("audio",{controls:!0,src:`data:${s};base64,${e.data}`,children:"您的浏览器不支持音频播放"})})}}const t=s||"";if(t.startsWith("http://")||t.startsWith("https://"))return(0,M.jsx)("div",{className:"audio-result",children:(0,M.jsx)("audio",{controls:!0,src:t,children:"您的浏览器不支持音频播放"})});try{const e=JSON.parse(t);if(e?.data||e?.audio_data){const s=e.data||e.audio_data;return(0,M.jsx)("div",{className:"audio-result",children:(0,M.jsx)("audio",{controls:!0,src:`data:audio/mpeg;base64,${s}`,children:"您的浏览器不支持音频播放"})})}}catch{}return(0,M.jsx)(I.default,{context:t})}function E({content:e,label:s}){const[t,a]=n.useState(!1);return(0,M.jsxs)("button",{className:"embeddings-copy-btn",onClick:()=>{(0,u.lW)(e),a(!0),setTimeout(()=>a(!1),1500)},children:[(0,M.jsx)($.In,{icon:t?"check":"content_copy"}),t?"已复制":s||"复制"]})}function K({embeddings:e,text:s}){let t=e||null;if(!t&&s)try{t=JSON.parse(s)}catch{return(0,M.jsx)(I.default,{context:s})}if(!t)return(0,M.jsx)(I.default,{context:s||""});const n=t?.data||[],a=t?.usage,i=JSON.stringify(t,null,2);return(0,M.jsxs)("div",{className:"embeddings-result",children:[(0,M.jsxs)("div",{className:"embeddings-summary",children:[(0,M.jsx)("strong",{children:"向量嵌入结果"}),(0,M.jsxs)("span",{children:["维度: ",n[0]?.embedding?.length??"N/A"]}),(0,M.jsxs)("span",{children:["数量: ",n.length]}),a&&(0,M.jsxs)("span",{children:["使用 tokens: ",a.total_tokens??"N/A"]})]}),(0,M.jsxs)("div",{className:"embeddings-toolbar",children:[(0,M.jsx)(E,{content:i,label:"复制全部结果"}),n.length>0&&n[0]?.embedding&&(0,M.jsx)(E,{content:JSON.stringify(n[0].embedding,null,2),label:"复制第一条向量"}),n.length>0&&(0,M.jsx)(E,{content:JSON.stringify(n.map(e=>e.embedding),null,2),label:"复制所有向量数据"})]}),n.length>0&&n[0]?.embedding&&(0,M.jsx)("div",{className:"embeddings-preview",children:(0,M.jsxs)("span",{children:["向量预览: [",n[0].embedding.slice(0,5).join(", "),n[0].embedding.length>5?", ...":"","]"]})}),n.length>0&&(0,M.jsxs)("details",{children:[(0,M.jsx)("summary",{children:"查看详细数据"}),(0,M.jsx)("pre",{className:"embeddings-raw",children:i})]})]})}async function P(e,s){const t=function(){try{return(0,A.zp)().get(_.AG.ai_images_extra_params)||{}}catch{return{}}}(),n={prompt:e,n:t.n??1,size:t.size??"1024x1024",session_id:s};if(t.quality&&(n.quality=t.quality),t.style&&(n.style=t.style),t.extra_json)try{const e=JSON.parse(t.extra_json);Object.assign(n,e)}catch(e){console.warn("图片额外参数 JSON 解析失败:",e)}const a=await l.jV.post("images/generations",n);if(0!==a.code)throw new Error(a.message||"图片生成失败");const i=a.data||{},c=(i.data||[]).map(e=>({url:e.url,b64_json:e.b64_json,revised_prompt:e.revised_prompt})),o=c.map((e,s)=>`![生成图片${s+1}](${e.url||`data:image/png;base64,${e.b64_json}`})${e.revised_prompt?`\n> ${e.revised_prompt}`:""}`).join("\n\n");return{session_id:i.session_id||s,images:c,text:o||`生成了 ${c.length} 张图片`}}async function V(e,s,t,n){try{switch(e){case"images":{const e=await P(s,t);return e&&n(e.text,{images:e.images}),!0}case"audio_speech":{const e=await async function(e,s){const t={input:e,session_id:s};try{const e=localStorage.getItem("ai_audio_extra_params");if(e){const s=JSON.parse(e);s.voice&&(t.voice=s.voice),s.speed&&(t.speed=parseFloat(s.speed))}}catch{}const n=localStorage.getItem("token")||"",a=await fetch("/api/ai_agent/audio/speech",{method:"POST",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify(t)});if(!a.ok)throw new Error(`语音合成失败: ${a.statusText}`);const i=a.headers.get("X-Session-Id")||s,c=await a.arrayBuffer();return{session_id:i,audio:{data:btoa(String.fromCharCode(...Array.from(new Uint8Array(c)))),mime_type:a.headers.get("content-type")||"audio/mpeg"},text:`[音频文件: ${e.slice(0,50)}...]`}}(s,t);return e&&n(e.text,{audio:e.audio}),!0}case"embeddings":{const e=await async function(e,s){const t=await l.jV.post("embeddings",{input:e,session_id:s});if(0!==t.code)throw new Error(t.message||"Embeddings 请求失败");const n=t.data||{},a=n?.data??[],i=`向量维度: ${a[0]?.embedding?.length??0}, 数量: ${a.length}`;return{session_id:n.session_id||s,embeddings:n,text:`✅ Embeddings 结果 - ${i}\n\`\`\`json\n${JSON.stringify(n,null,2).slice(0,2e3)}\n\`\`\``}}(s,t);return e&&n(e.text,{embeddings:e.embeddings}),!0}default:return!1}}catch(e){return n(`请求失败: ${e?.message||JSON.stringify(e)}`),!0}}var B=t(57952),F=t(23430),q=t(87361);const L=({currentModelName:e,setCurrentModelName:s,envConfigRef:t,sysPromptList:n,batchMode:o,selectedMsgCount:r,onToggleSessionPanel:u,onCreateSession:h,onToggleBatchMode:p,onBatchDeleteMessages:f,bgProcessVisible:j,bgProcessCount:v,onToggleBgProcess:b,selectedSysPromptId:y,setSelectedSysPromptId:w})=>{const{t:S}=(0,i.Bd)(),N=(0,c.Zp)(),{check_user_auth:k}=(0,d.MH)(),[,C]=(0,a.fp)(_.AG.ai_session_collapsed);return(0,M.jsxs)(B.A,{children:[(0,M.jsx)($.rA,{icon:"menu",title:S("会话"),onClick:u}),(0,M.jsx)($.rA,{icon:"add",title:S("新会话"),onClick:()=>h()}),n.length>0&&(0,M.jsx)(x.l6,{value:y,options:[{title:S("选择系统提示词"),value:""},...n.map(e=>({title:e.note||e.prompt.slice(0,30),value:String(e.index)}))],onChange:e=>{w(e)},no_border:!0,width:"10rem"}),(t.current?.ai_config_env?.options_agent_model_list?.length??0)>0&&(0,M.jsx)(x.l6,{value:e,options:t.current.ai_config_env.options_agent_model_list?.map(e=>({title:e.label,value:e.value}))??[],onChange:e=>{s(e),l.jV.post("set_active_model",{model_name:e}).then(()=>{(0,m.SK)("success"),l.XO.get("ai_agent_setting/env").then(e=>{e.code===g.m.Success&&(t.current=e.data)})}).catch(console.error)},no_border:!0,width:"auto"}),o&&r>0&&(0,M.jsx)($.rA,{icon:"delete",title:S("删除选中消息"),onClick:f}),(0,M.jsx)($.rA,{icon:"terminal",title:S("后台进程"),onClick:b,selected:j,tip:v||null}),k(F.oV.ai_agent_setting)&&(0,M.jsx)($.rA,{icon:"smart_toy",title:"机器人配置",onClick:()=>{N(`/${q.o.ai_rebot_setting_page}`)}}),k(F.oV.ai_agent_setting)&&(0,M.jsx)($.rA,{icon:"settings",title:"ai setting",onClick:()=>{N(`/${q.o.ai_agent_setting_page}`)}})]})};var O=t(27690);function z({sessions:e,activeSessionId:s,onSelectSession:t,onRenameSession:c,onDeleteSession:o,onToggleCmdAuto:l,onShowUsageStats:r,batchMode:d,selectedSessionIds:u,onToggleSessionSelect:m,onToggleBatchMode:h,onBatchDeleteSessions:g,onClearAllSessions:p}){const{t:x}=(0,i.Bd)(),[f,j]=(0,a.fp)(_.AG.ai_session_collapsed),[v,b]=(0,n.useState)(""),y=v.trim()?e.filter(e=>(e.title||"").toLowerCase().includes(v.toLowerCase())||(e.summary||"").toLowerCase().includes(v.toLowerCase())||(e.long_term_memory||"").toLowerCase().includes(v.toLowerCase())):e;return(0,M.jsxs)("aside",{className:`chat-session-list ${f?"active":""} ${f?"collapsed":""}`,children:[(0,M.jsx)("div",{className:"chat-session-search",children:(0,M.jsx)("input",{type:"text",className:"chat-session-search-input",placeholder:x("搜索会话"),value:v,onChange:e=>b(e.target.value)})}),(0,M.jsx)("div",{className:"chat-session-items-wrap",children:y.map(e=>{return(0,M.jsx)("div",{children:(0,M.jsxs)("button",{className:`chat-session-item ${s===e.id?"active":""} ${d?"batch-mode":""} ${e.running?"is-running":""}`,onClick:()=>{d&&m?m(e.id):t(e.id)},title:e.summary||e.long_term_memory||e.title,children:[d&&(0,M.jsx)("input",{type:"checkbox",className:"chat-session-checkbox",checked:u?.has(e.id)??!1,onChange:()=>m?.(e.id),onClick:e=>e.stopPropagation()}),(0,M.jsx)("span",{children:(n=e.title,n||"新会话")}),e.running&&(0,M.jsx)("span",{className:"chat-session-running",title:x("正在执行中")}),(0,M.jsx)("small",{children:e.message_count}),"web"!==e.source&&(0,M.jsx)("em",{className:"chat-session-source",children:e.source}),!d&&(0,M.jsx)(O.MenuSelect,{list:[{name:x("重命名"),click:()=>c(e.id,e.title)},{name:e.cmd_auto_allow?x("命令检测关闭"):x("命令检测开启"),click:()=>l?.(e.id,!e.cmd_auto_allow)},{name:x("字符消耗统计"),click:()=>r(e.id)},{name:x("删除"),click:()=>o(e.id)}],children:(0,M.jsx)($.In,{icon:"more_horiz"})})]})},e.id);var n})}),(0,M.jsxs)("div",{className:"chat-session-actions",children:[(0,M.jsx)($.rA,{icon:d?"check_circle":"checklist",title:x(d?"取消批量选择":"批量选择"),onClick:h}),d&&(u?.size??0)>0&&(0,M.jsx)($.rA,{icon:"delete",title:x("删除选中会话"),onClick:g}),!d&&(0,M.jsx)($.rA,{icon:"delete_sweep",title:x("删除全部会话"),onClick:p})]})]})}function J(e){const s=(e.text||"").split("\n").map(e=>e.trim()).find(Boolean)||"";return s.length>80?s.slice(0,80)+"…":s}const G=({messages:e,batchMode:s,selectedMsgIds:t,sending:a,chatContainerRef:i,messagesEndRef:c,onToggleMsgSelect:o,onDelete:l,onCopy:r,onToggleBatchMode:d,t:u})=>{const[m,h]=(0,n.useState)(new Set),g=(0,n.useMemo)(()=>e.filter(e=>!e.is_loading).map(e=>e.id),[e]),p=e=>{h(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},_=()=>{h(e=>e.size>0&&g.every(s=>e.has(s))?new Set:new Set(g))};return(0,M.jsxs)("div",{className:"chat-messages",ref:i,"data-sending":a?"true":"false",children:[e.map(e=>{const n=m.has(e.id);return(0,M.jsxs)("div",{className:`chat-message ${e.sender} ${s?"batch-mode":""} ${e.is_loading?"is-loading":""} ${n?"collapsed":""}`,children:[s&&(0,M.jsx)("input",{type:"checkbox",className:"chat-message-checkbox",checked:t.has(e.id),onChange:()=>o(e.id)}),e.is_loading?(0,M.jsxs)("div",{className:"ai-loading-bubble",children:[(0,M.jsxs)("div",{className:"ai-loading-dots",children:[(0,M.jsx)("span",{className:"ai-loading-dot"}),(0,M.jsx)("span",{className:"ai-loading-dot"}),(0,M.jsx)("span",{className:"ai-loading-dot"})]}),(0,M.jsx)("span",{className:"ai-loading-text",children:e.text})]}):(0,M.jsxs)(M.Fragment,{children:[n?(0,M.jsxs)("div",{className:"chat-message-summary",title:e.text,onClick:()=>p(e.id),children:[(0,M.jsx)("span",{className:"chat-message-summary-icon",children:"▸"}),(0,M.jsx)("span",{className:"chat-message-summary-text",children:J(e)||u("(无内容)")})]}):(0,M.jsx)("div",{className:"chat-message-body",children:D(e)}),(0,M.jsxs)("div",{className:"message-collapse-bar",children:[(0,M.jsx)("button",{onClick:()=>p(e.id),children:u(n?"展开":"折叠")}),(0,M.jsx)("button",{onClick:_,children:u("全部折叠")})]}),(0,M.jsx)("div",{className:"message-actions",children:s?(0,M.jsx)("button",{onClick:()=>o(e.id),children:t.has(e.id)?u("取消选择"):u("选择")}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{onClick:()=>l(e.id),children:u("删除")}),(0,M.jsx)("button",{onClick:()=>r(e.text),children:u("复制")}),(0,M.jsx)("button",{onClick:d,children:u("多选")})]})})]})]},e.id)}),(0,M.jsx)("div",{ref:c})]})};function W({onClose:e}){const{t:s}=(0,i.Bd)(),[t,c]=(0,a.fp)(_.AG.ai_images_extra_params),[o,l]=(0,n.useState)(t.size||"1024x1024"),[r,d]=(0,n.useState)(String(t.n??1)),[u,m]=(0,n.useState)(t.quality||""),[h,g]=(0,n.useState)(t.style||""),[p,f]=(0,n.useState)(t.extra_json||"");return(0,M.jsxs)("div",{className:"card floating",children:[(0,M.jsx)("div",{className:"card-title",children:(0,M.jsx)("h2",{children:s("图片生成参数设置")})}),(0,M.jsxs)("div",{className:"card-content",children:[(0,M.jsx)(x.Sm,{placeholderOut:s("图片尺寸 (size)"),value:o,handleInputChange:l,placeholder:"1024x1024"}),(0,M.jsx)(x.Sm,{placeholderOut:s("生成数量 (n)"),value:r,handleInputChange:d,type:"number"}),(0,M.jsx)(x.Sm,{placeholderOut:s("画质 (quality)"),value:u,handleInputChange:m,placeholder:"standard / hd"}),(0,M.jsx)(x.Sm,{placeholderOut:s("风格 (style)"),value:h,handleInputChange:g,placeholder:"vivid / natural"}),(0,M.jsx)(x.Sm,{placeholderOut:s("额外参数 JSON"),value:p,handleInputChange:f,placeholder:'{"key":"value"}'})]}),(0,M.jsxs)("div",{className:"card-action",children:[(0,M.jsx)("button",{className:"button button--flat button--grey",onClick:e,children:s("取消")}),(0,M.jsx)("button",{className:"button button--flat",onClick:()=>{const s={size:o,n:parseInt(r)||1};u&&(s.quality=u),h&&(s.style=h),p&&(s.extra_json=p),c(s),e()},children:s("确定")})]})]})}function Q({requestType:e}){const{t:s}=(0,i.Bd)(),[t,a]=(0,n.useState)(!1);return"completions"===e?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)($.rA,{icon:"tune",title:s("模型参数设置"),onClick:()=>a(!0)}),t&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{className:"overlay",onClick:()=>a(!1)}),"images"===e&&(0,M.jsx)(W,{onClose:()=>a(!1)})]})]})}const U=(0,n.forwardRef)(function({placeholder:e="",disabled:s=!1,className:t,style:a,onEnter:i,onPaste:c,onChange:o},l){const r=(0,n.useRef)(null),[d,u]=(0,n.useState)(!0),[m,h]=(0,n.useState)(!1),g=(0,n.useCallback)(()=>{const e=r.current;return e?(e.textContent??"").replace(/\u00A0/g," ").trimEnd():""},[]);(0,n.useImperativeHandle)(l,()=>({getValue:()=>g(),setValue:e=>{const s=r.current;if(!s)return;s.textContent=e,u(!e);const t=document.createRange();t.selectNodeContents(s),t.collapse(!1);const n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)},clear:()=>{const e=r.current;e&&(e.textContent="",u(!0))},focus:()=>r.current?.focus()})),(0,n.useEffect)(()=>{const e=r.current;if(!e)return;const s=()=>u(!e.textContent);return e.addEventListener("input",s),()=>e.removeEventListener("input",s)},[]);return(0,M.jsx)("div",{ref:r,contentEditable:!s,suppressContentEditableWarning:!0,className:"rich-textarea"+(t?" "+t:""),style:a,onKeyDown:e=>{m||"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),i?.())},onPaste:c,onInput:()=>o?.(g()),onCompositionStart:()=>h(!0),onCompositionEnd:()=>h(!1),"data-placeholder":d?e:void 0})});function X({pendingAttachments:e,onRemove:s}){return 0===e.length?null:(0,M.jsx)("div",{className:"chat-attachment-strip",children:e.map((e,t)=>(0,M.jsxs)("div",{className:"chat-attachment-chip",children:[(0,M.jsx)($.In,{icon:"attach_file"}),(0,M.jsx)("span",{title:e.name,children:e.name}),(0,M.jsx)("button",{type:"button",onClick:()=>s(t),children:(0,M.jsx)($.In,{icon:"close"})})]},`${e.name}_${t}`))})}const Z=(0,n.forwardRef)(({onSend:e,sending:s,onAbort:t,pendingAttachments:c,onRemoveAttachment:o,onOpenFilePicker:l,onAddFiles:r,onDrop:d,onDragOver:u,fileInputRef:m,requestType:h},g)=>{const{t:p}=(0,i.Bd)(),x=(0,n.useRef)(null),[f,j]=(0,n.useState)(!1),v=(0,n.useRef)(null),[b,y]=(0,a.fp)(_.AG.ai_chat_input_height);(0,n.useImperativeHandle)(g,()=>({getValue:()=>x.current?.getValue()??"",setValue:e=>x.current?.setValue(e),clear:()=>x.current?.clear()}));const w=(0,n.useCallback)(e=>{const s=v.current;if(!s)return;const t=s.getBoundingClientRect().bottom-e.clientY;let n=Math.round(t/21.375);n=Math.max(2,Math.min(20,n)),y(n)},[y]),S=(0,n.useCallback)(()=>j(!0),[]),N=(0,n.useCallback)(()=>j(!1),[]);(0,n.useEffect)(()=>{if(!f)return;const e=w;return window.addEventListener("pointermove",e),window.addEventListener("pointerup",N),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",N)}},[f,w,N]);const k={minHeight:`${b}em`,maxHeight:`${b}em`};return(0,M.jsxs)("div",{ref:v,className:"chat-input-area",onDrop:d,onDragOver:u,children:[(0,M.jsx)("div",{className:"chat-input-resize-handle"+(f?" dragging":""),onPointerDown:S}),(0,M.jsx)("input",{ref:m,type:"file",multiple:!0,style:{display:"none"},onChange:e=>{e.target.files?.length&&(r(e.target.files),e.currentTarget.value="")}}),(0,M.jsxs)("div",{className:"chat-input-shell",style:k,children:[(0,M.jsx)(X,{pendingAttachments:c,onRemove:o}),(0,M.jsx)(U,{ref:x,placeholder:p("输入消息"),onEnter:()=>e(),onPaste:e=>{const s=e.clipboardData?.files;s&&s.length>0&&(e.preventDefault(),r(s))},className:"chat-input",style:k})]}),(0,M.jsx)($.rA,{title:p("添加文件"),icon:"attach_file",onClick:l}),(0,M.jsx)(Q,{requestType:h}),s?(0,M.jsx)($.Vi,{color:"var( --icon-red)",text:p("暂停"),clickFun:t}):(0,M.jsx)($.Vi,{text:p("发送"),clickFun:e}),f&&(0,M.jsx)("div",{className:"chat-input-overlay",onPointerUp:N})]})}),Y={},ee=function(){const{t:e}=(0,i.Bd)(),[s,t]=(0,n.useState)([]),[c,l]=(0,n.useState)(!1),[r,d]=(0,n.useState)(null),[u,h]=(0,n.useState)(null),[g,p]=(0,n.useState)(!1),[x,f]=(0,a.fp)(_.AG.ai_bg_expanded),[,j]=(0,a.fp)(_.AG.ai_session_collapsed),v=()=>{f(!1)},b=(0,n.useCallback)(async()=>{l(!0);try{const e=new o.hf(o.HK.ai_bg_process_list_req);e.context={};const s=await C.ws.send(e);s?.context?.processes&&(t(s.context.processes),Y.onCountChange?.(s.context.processes.length))}catch(e){console.error("获取后台进程列表失败",e)}finally{l(!1)}},[]);Y.refresh=b;const y=(0,n.useCallback)(async e=>{p(!0),d(e);try{const s=new o.hf(o.HK.ai_bg_process_output_req);s.context={pid:e};const t=await C.ws.send(s);h(t.context)}catch(e){console.error("获取进程输出失败",e),(0,m.zN)("获取进程输出失败")}finally{p(!1)}},[]),w=(0,n.useCallback)(async e=>{try{const s=new o.hf(o.HK.ai_bg_process_kill_req);s.context={pid:e};const t=await C.ws.send(s);t?.context?.success?((0,m.SK)("进程已终止"),b(),r===e&&(d(null),h(null))):(0,m.zN)(t?.context?.message||"终止失败")}catch(e){console.error("终止进程失败",e),(0,m.zN)("终止进程失败")}},[b,r]);(0,n.useEffect)(()=>{b();const e=setInterval(b,5e3);return()=>clearInterval(e)},[b]);const S=s.filter(e=>e.running),N=s.filter(e=>!e.running);return(0,M.jsxs)(M.Fragment,{children:[x&&(0,M.jsx)("div",{className:"chat-session-overlay",onClick:v}),(0,M.jsxs)("aside",{className:"chat-bg-process-panel "+(x?"expanded":""),children:[(0,M.jsxs)("div",{className:"chat-bg-process-header",children:[(0,M.jsx)("span",{className:"chat-bg-process-title",children:e("后台进程")}),(0,M.jsx)($.rA,{icon:"close",title:e("关闭"),onClick:v})]}),(0,M.jsxs)("div",{className:"chat-bg-process-toolbar",children:[(0,M.jsx)($.rA,{icon:"refresh",title:e("刷新"),onClick:b}),(0,M.jsxs)("span",{className:"chat-bg-process-count",children:[S.length," ",e("个运行中"),N.length>0&&` / ${N.length} ${e("个已退出")}`]})]}),(0,M.jsxs)("div",{className:"chat-bg-process-list",children:[c&&0===s.length&&(0,M.jsx)("div",{className:"chat-bg-process-empty",children:e("加载中...")}),!c&&0===s.length&&(0,M.jsx)("div",{className:"chat-bg-process-empty",children:e("暂无后台进程")}),S.map(s=>(0,M.jsxs)("div",{className:`chat-bg-process-item ${r===s.pid?"active":""} running`,children:[(0,M.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(s.pid),children:[(0,M.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",s.pid]}),(0,M.jsx)("span",{className:"chat-bg-process-cmd",title:s.cmd,children:s.cmd.length>40?s.cmd.slice(0,40)+"...":s.cmd}),(0,M.jsx)("span",{className:"chat-bg-process-time",children:new Date(s.start_time).toLocaleTimeString()}),(0,M.jsx)("span",{className:"chat-bg-process-status running-dot",title:e("运行中"),children:"●"})]}),(0,M.jsxs)("div",{className:"chat-bg-process-item-actions",children:[(0,M.jsx)($.rA,{icon:"terminal",title:e("查看输出"),onClick:()=>y(s.pid)}),(0,M.jsx)($.rA,{icon:"stop",title:e("终止进程"),onClick:()=>w(s.pid)})]})]},s.pid)),N.map(e=>(0,M.jsx)("div",{className:`chat-bg-process-item ${r===e.pid?"active":""} finished`,children:(0,M.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(e.pid),children:[(0,M.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",e.pid]}),(0,M.jsx)("span",{className:"chat-bg-process-cmd",title:e.cmd,children:e.cmd.length>30?e.cmd.slice(0,30)+"...":e.cmd}),(0,M.jsx)("span",{className:"chat-bg-process-time",children:new Date(e.start_time).toLocaleTimeString()}),(0,M.jsxs)("span",{className:"chat-bg-process-exit-code",children:["exit: ",e.exit_code]})]})},e.pid))]}),null!==r&&(0,M.jsxs)("div",{className:"chat-bg-process-output",children:[(0,M.jsxs)("div",{className:"chat-bg-process-output-header",children:[(0,M.jsxs)("span",{children:["PID: ",r," ",e("输出")]}),(0,M.jsx)($.rA,{icon:"close",title:e("关闭"),onClick:()=>{d(null),h(null)}})]}),(0,M.jsx)("div",{className:"chat-bg-process-output-content",children:g?(0,M.jsx)("div",{className:"chat-bg-process-empty",children:e("加载中...")}):u?(0,M.jsx)("pre",{className:"chat-bg-process-output-pre",children:u.output||e("(无输出)")}):null})]})]})]})};function se(){const{t:e}=(0,i.Bd)(),s=((0,c.Zp)(),(0,h.y)()),{check_user_auth:t}=(0,d.MH)();(0,p.w)();const[v,y]=(0,n.useState)([]),[w,S]=(0,n.useState)([]),[N,A]=(0,n.useState)(""),[$,I]=(0,n.useState)(null),[D,R]=(0,n.useState)(!1),H=(0,n.useRef)(null),[T,E]=(0,n.useState)([]),[K,P]=(0,a.fp)(_.AG.ai_session_collapsed),[B,F]=(0,a.fp)(_.AG.ai_bg_expanded),[q,O]=(0,a.fp)(_.AG.prompt_card),[J,W]=(0,n.useState)(!1),[Q,U]=(0,n.useState)(new Set),[X,se]=(0,n.useState)(new Set),[te,ne]=(0,n.useState)(""),ae=(0,n.useRef)(null),ie=(0,n.useRef)(null),ce=(0,n.useRef)(null),oe=(0,n.useRef)(!0),le=(0,n.useRef)(null),re=(0,n.useRef)(0),de=(0,n.useRef)(null),ue=(0,n.useRef)(N),me=(0,n.useRef)($);(0,n.useEffect)(()=>{ue.current=N},[N]),(0,n.useEffect)(()=>{me.current=$},[$]);const he=(0,n.useRef)(new f.qq),[ge,pe]=(0,n.useState)([]),[_e,xe]=(0,n.useState)(""),[fe,je]=(0,n.useState)(0),ve=()=>he?.current?.ai_config?.request_type||"completions",be=(0,n.useRef)((0,r.sg)(e=>{y(e),oe.current&&ye(!1)},50)).current,ye=(e=!1)=>{const s=ce.current;s&&s.scrollTo({top:s.scrollHeight,behavior:e?"smooth":"auto"})},we=async()=>{const e=await l.jV.get("sessions");e.code===g.m.Success&&S(e.data??[])},Se=function(e){const{getMessages:s,setMessages:t,setMessagesDebounced:a,setSending:i,getActiveSessionId:c,setActiveSessionId:l,refreshSessions:r,scrollToBottom:d,buildRequestMessages:u,getSelectedSysPromptId:m}=e,h=(0,n.useRef)([]),g=(0,n.useRef)(null),p=(e,n,l)=>{const h=[...s(),n];t(h),i(e),g.current={abort:()=>{}};const p={id:n.id+1,sender:"bot",text:"AI思考中...",is_loading:!0};h.push(p),t([...h]);const _=new Map;let x=!0,f=p;const j=s=>{const t=s.context||{},n=t.text||"",i=t.tool_call_ends,o=t.chunk_index??0;if("[DONE]"!==n)if(x)x=!1,f.text=n,i&&(f.content_list=[{tool_call_ends:i,content:f.text,role:"assistant"}]),f.is_loading=!1,f.chunk_index=o,_.set(o,f),c()===e&&a([...h]);else{const s=_.get(o);if(s)s.text+=n,i&&(s.content_list=[{tool_call_ends:i,content:s.text,role:"assistant"}]),c()===e&&a([...h]);else{const s={id:Date.now()+Math.random(),sender:"bot",text:n,chunk_index:o};i&&(s.content_list=[{tool_call_ends:i,content:s.text,role:"assistant"}]),h.push(s),_.set(o,s),c()===e&&a([...h])}}},v=s=>{y(),g.current=null,i(s=>s===e?null:s),f.is_loading=!1,r(),d(!0),l()},b=s=>{y(),g.current=null,i(s=>s===e?null:s);const n=s.context||{};f.text="AI请求出错: "+(n.message||"未知错误"),f.is_loading=!1,c()===e&&t([...h]),l()},y=()=>{C.ws.off_message(`message_${o.HK.ai_chat_msg}`,j),C.ws.off_message(`message_${o.HK.ai_chat_end}`,v),C.ws.off_message(`message_${o.HK.ai_chat_error}`,b)};C.ws.addMsg(o.HK.ai_chat_msg,j),C.ws.addMsg(o.HK.ai_chat_end,v),C.ws.addMsg(o.HK.ai_chat_error,b),C.ws.sendData(o.HK.ai_chat_req,{messages:u(n),session_id:e,sys_prompt_id:m()})},_=()=>{const e=h.current;if(0===e.length)return;const s=e.shift();if(!s)return;t(e=>e.map(e=>"user"===e.sender&&e.text.includes("⏳(排队中...)")?{...e,text:e.text.replace(" ⏳(排队中...)","")}:e));const n={id:Date.now(),sender:"user",text:s.text,attachments:s.attachments};p(c(),n,_)};return{startChatStream:p,processPendingQueue:_,enqueueMessage:(e,s)=>{h.current.push({text:e,attachments:s})},getQueueLength:()=>h.current.length,abort:()=>{const e=c();e&&(C.ws.sendData(o.HK.ai_chat_abort,{session_id:e}),g.current&&(g.current=null,i(s=>s===e?null:s)))}}}({getMessages:()=>v,setMessages:y,setMessagesDebounced:be,setSending:I,getActiveSessionId:()=>ue.current,setActiveSessionId:A,refreshSessions:we,scrollToBottom:ye,buildRequestMessages:e=>{const s=(e.attachments??[]).filter(e=>"image"===e.kind);if(s.length>0){const t=[];e.text&&t.push({type:"text",text:e.text});for(const e of s)t.push({type:"image_url",image_url:{url:e.content}});return[{content:t,role:"user",attachments:e.attachments??[]}]}return[{content:e.text,role:"bot"===e.sender?"assistant":"user",attachments:e.attachments??[]}]},getSelectedSysPromptId:()=>te}),Ne=async e=>{const s=await l.jV.get("sessions");if(s.code!==g.m.Success)return;const t=s.data??[];S(t);const n=null===e?t[0]?.id??"":e||N||t[0]?.id||"";n?await ke(n):(y([]),A(""))},ke=async(e,s=!1)=>{const t=await l.jV.post("session/get",{session_id:e});if(t.code!==g.m.Success||!t.data)return;const n=t.data;A(n.id),R(!!n.running),de.current&&de.current!==n.id&&C.ws.sendData(o.HK.ai_chat_subscribe,{session_id:de.current,subscribe:!1}),de.current=n.running?n.id:null,de.current&&C.ws.sendData(o.HK.ai_chat_subscribe,{session_id:de.current,subscribe:!0});const a=b(n.messages);n.running&&n.live_messages?.length?y([...a,...b(n.live_messages)]):y(a),ne(n.sys_prompt_id??""),s&&P(!1),Y.refresh?.(),requestAnimationFrame(()=>ye(!1))},Ce=e=>{const s=Array.from(e??[]).filter(Boolean);s.length&&E(e=>[...e,...s])},Ae=()=>{J&&(U(new Set),se(new Set)),W(e=>!e)};(0,n.useEffect)(()=>((async()=>{const e=await l.XO.get("ai_agent_setting/env");if(e.code===g.m.Success){he.current=e.data;const s=e.data.ai_config?.model||"",t=(e.data.ai_config_env?.options_agent_model_list??[]).find(e=>e.label===s);xe(t?t.value:s)}await Ne();const s=await l.jV.get("system_prompts");s.code===g.m.Success&&pe(s.data??[])})(),requestAnimationFrame(()=>ye(!1)),Y.onCountChange=je,Y.refresh?.(),C.ws.addMsg(o.HK.ai_bg_process_count_notify,e=>{const s=e?.context?.count;"number"==typeof s&&je(s)}),()=>{C.ws.removeMsg(o.HK.ai_bg_process_count_notify)}),[]),(0,n.useEffect)(()=>{const e=ce.current;if(!e)return;const s=()=>{oe.current=((e,s=120)=>{const{scrollTop:t,scrollHeight:n,clientHeight:a}=e;return n-(t+a)<s})(e)};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)},[]),(0,n.useEffect)(()=>{const e=()=>ue.current,s=()=>me.current,t=(t,n)=>{if(e()&&e()===t){if(le.current=null,R(!1),de.current===t&&(C.ws.sendData(o.HK.ai_chat_subscribe,{session_id:t,subscribe:!1}),de.current=null),s()===t)return;n?.length?y(e=>{const s=b(n),t=e[e.length-1];return"bot"===t?.sender?[...e.slice(0,-1),...s]:[...e,...s]}):ke(t).catch(()=>{}),we()}},n=t=>{const n=t?.context||{};if(!n.session_id)return;var a,i,c;a=n.session_id,i=n.text||"",c=n.tool_call_ends,e()&&e()===a&&s()!==a&&y(e=>{const s=e[e.length-1];if(s&&"bot"===s.sender){const t=[...e],n={...s};return n.text+=i,c&&(n.content_list=[{tool_call_ends:c,content:n.text,role:"assistant"}]),t[t.length-1]=n,le.current=n.id,oe.current&&requestAnimationFrame(()=>ye(!1)),t}const t={id:Date.now()+Math.random(),sender:"bot",text:i};return c&&(t.content_list=[{tool_call_ends:c,content:i,role:"assistant"}]),le.current=t.id,oe.current&&requestAnimationFrame(()=>ye(!1)),[...e,t]});const o=Date.now();o-re.current>1500&&(re.current=o,we())},a=e=>{const s=e?.context||{};s.session_id&&t(s.session_id,s.once_messages_list)},i=e=>{const s=e?.context||{};s.session_id&&t(s.session_id)};return C.ws.addMsg(o.HK.ai_chat_msg,n),C.ws.addMsg(o.HK.ai_chat_end,a),C.ws.addMsg(o.HK.ai_chat_error,i),()=>{C.ws.off_message(`message_${o.HK.ai_chat_msg}`,n),C.ws.off_message(`message_${o.HK.ai_chat_end}`,a),C.ws.off_message(`message_${o.HK.ai_chat_error}`,i),de.current&&(C.ws.sendData(o.HK.ai_chat_subscribe,{session_id:de.current,subscribe:!1}),de.current=null)}},[]),(0,n.useLayoutEffect)(()=>{oe.current&&ye(!1)},[v]);return(0,M.jsxs)(n.Fragment,{children:[(0,M.jsx)(L,{currentModelName:_e,setCurrentModelName:xe,envConfigRef:he,sysPromptList:ge,batchMode:J,selectedMsgCount:Q.size,onToggleSessionPanel:()=>{P(e=>!e)},onCreateSession:async e=>{const s=void 0!==e?e:te,t=await l.jV.post("session",{title:"新会话",sys_prompt_id:s||void 0});if(t.code!==g.m.Success)return;const n=t.data;A(n.id),y([]),ne(n.sys_prompt_id??""),P(!1),await Ne(n.id),requestAnimationFrame(()=>{const e=document.querySelector(".chat-input");e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,200)+"px")})},onBatchDeleteMessages:()=>{0!==Q.size&&s({sub_title:e("确认删除选中的聊天消息吗?"),confirm_fun:async()=>{const e=[];v.forEach((s,t)=>{Q.has(s.id)&&e.push(t)}),y(v.filter(e=>!Q.has(e.id))),U(new Set),W(!1),N&&e.length>0&&l.jV.post("session/message/delete",{session_id:N,indices:e}).catch(console.error)}})},bgProcessVisible:B,bgProcessCount:fe,onToggleBgProcess:()=>F(e=>!e),selectedSysPromptId:te,setSelectedSysPromptId:e=>{ne(e),N&&l.jV.post("session/sys_prompt",{session_id:N,sys_prompt_id:e||void 0}).catch(console.error)}}),(0,M.jsxs)("div",{className:"chat-page chat-page-with-sessions",children:[K&&(0,M.jsx)("div",{className:"chat-session-overlay",onClick:()=>P(!1)}),(0,M.jsx)(z,{sessions:w,activeSessionId:N,onSelectSession:e=>ke(e,!1),onRenameSession:(e,t)=>{let n=t;s({confirm_fun:async()=>{await l.jV.post("sessions/update/meta",{id:e,title:n}),await Ne(N)},context_div:(0,M.jsx)("div",{className:"card-content",children:(0,M.jsx)(x.Sm,{value:n,handleInputChange:e=>{n=e}})})})},onDeleteSession:e=>{s({sub_title:"确认删除这个会话吗?",confirm_fun:async()=>{await l.jV.post("session/delete",{session_id:e}),N===e?(A(""),await Ne(null)):await Ne(N)}})},onToggleCmdAuto:async(s,t)=>{await l.jV.post("session/cmd_auto_allow",{session_id:s,allow:t}),(0,m.SK)(e(t?"命令检测已开启":"命令检测已关闭")),await Ne(N)},onShowUsageStats:async s=>{O({open:!0,title:e("Token消耗统计"),context_div:(0,M.jsx)("div",{className:"usage-stats-loading",children:e("加载中...")}),cancel:()=>O({open:!1})});try{const t=await l.jV.post("session/usage_stats",{session_id:s});if(t.code===g.m.Success&&t.data){const s=t.data;O({open:!0,title:e("Token消耗统计"),context_div:(0,M.jsxs)("div",{className:"usage-stats-panel",children:[[{l:e("对话轮次"),v:(s.turns??0).toString()},{l:e("AI输入Token"),v:j(s.input_tokens)},{l:e("AI输出Token"),v:j(s.output_tokens)},{l:e("AI输入Token(最近一轮)"),v:j(s.recent_input_tokens)},{l:e("AI输出Token(最近一轮)"),v:j(s.recent_output_tokens)}].map((e,s)=>(0,M.jsxs)("div",{className:"usage-stats-row",children:[(0,M.jsx)("span",{className:"usage-stats-label",children:e.l}),(0,M.jsx)("span",{className:"usage-stats-value",children:e.v})]},s)),(0,M.jsxs)("div",{className:"usage-stats-row usage-stats-total",children:[(0,M.jsx)("span",{className:"usage-stats-label",children:e("AI Token总计消耗")}),(0,M.jsx)("span",{className:"usage-stats-value",children:j((s.input_tokens||0)+(s.output_tokens||0))})]})]}),cancel:()=>O({open:!1})})}else O({open:!0,title:e("Token消耗统计"),context_div:(0,M.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>O({open:!1})})}catch{O({open:!0,title:e("Token消耗统计"),context_div:(0,M.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>O({open:!1})})}},batchMode:J,selectedSessionIds:X,onToggleSessionSelect:e=>{se(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onToggleBatchMode:Ae,onBatchDeleteSessions:()=>{0!==X.size&&s({sub_title:e("确认删除选中的会话吗?"),confirm_fun:async()=>{for(const e of X)await l.jV.post("session/delete",{session_id:e});se(new Set),W(!1),X.has(N)?(A(""),await Ne(null)):await Ne(N)}})},onClearAllSessions:()=>{s({sub_title:e("确认删除全部聊天会话吗?"),confirm_fun:async()=>{await l.jV.post("sessions/clear",{}),A(""),y([]),await Ne(null)}})}}),(0,M.jsx)(ee,{}),(0,M.jsxs)("section",{className:"chat-main",children:[0===v?.length&&(0,M.jsx)("div",{className:"chat-header",children:(0,M.jsx)("div",{children:e("询问服务器的一切")})}),(0,M.jsx)(G,{messages:v,batchMode:J,selectedMsgIds:Q,sending:$===N||D,chatContainerRef:ce,messagesEndRef:ie,onToggleMsgSelect:e=>{U(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onDelete:t=>{s({sub_title:e("确认删除这条消息吗?"),confirm_fun:async()=>{const e=v.findIndex(e=>e.id===t);if(e<0)return;const s=v.filter(e=>e.id!==t);y(s),N&&l.jV.post("session/message/delete",{session_id:N,indices:[e]}).catch(console.error)}})},onCopy:async e=>{(0,u.lW)(e),(0,m.SK)("复制成功")},onToggleBatchMode:Ae,t:e}),(0,M.jsx)(Z,{ref:H,onSend:async()=>{const e=(H.current?.getValue()??"").trim();if(!e&&0===T.length)return;if($===N){const s=await k(T);Se.enqueueMessage(e,s),H.current?.clear(),E([]);const t={id:Date.now(),sender:"user",text:e+(Se.getQueueLength()>1?" ⏳(排队中...)":""),attachments:s};return void y(e=>[...e,t])}let s=N;if(!s){const t=await l.jV.post("session",{title:(e||T[0]?.name||"新会话").slice(0,28),sys_prompt_id:te||void 0});if(t.code!==g.m.Success)return;s=t.data.id,A(s),await Ne(s)}const t=await k(T),n={id:Date.now(),sender:"user",text:e,attachments:t};H.current?.clear(),E([]);const a=ve();if("completions"!==a){const t={id:n.id+1,sender:"bot",text:"处理中...",is_loading:!0},i=[...v,n,t];y(i),I(s);return void(await V(a,e,s,async(e,s)=>{t.text=e,t.is_loading=!1,s?.images&&(t.images=s.images),s?.audio&&(t.audio=s.audio),s?.embeddings&&(t.embeddings=s.embeddings),y([...i]),I(null),we(),ye(!0),Se.processPendingQueue()})||(t.text=`请求类型 "${a}" 的专用处理器尚未实现,请使用 completions 类型。`,t.is_loading=!1,y([...i]),I(null),Se.processPendingQueue()))}Se.startChatStream(s,n,()=>Se.processPendingQueue())},sending:$===N||D,onAbort:Se.abort,pendingAttachments:T,onRemoveAttachment:e=>{E(s=>s.filter((s,t)=>t!==e))},onOpenFilePicker:()=>{ae.current?.click()},onAddFiles:Ce,onDrop:e=>{const s=e.dataTransfer?.files;s&&s.length>0&&(e.preventDefault(),Ce(s))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},fileInputRef:ae,requestType:ve()})]})]})]})}},72693(e,s,t){t.d(s,{w:()=>h});var n=t(96540),a=t(34899),i=t(14944),c=t(92275),o=t(34843),l=t(82893),r=t(85997),d=t(14284),u=t(74848);function m(e){const{t:s}=(0,a.Bd)(),[t,i]=(0,n.useState)(!1),c=!!e.sessionId;return(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),c&&(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5em",marginBottom:"0.75em",color:t?"var(--icon-blue)":"var(--textSecondary)"},children:[(0,u.jsx)(r.Ay,{checked:t,onChange:s=>{i(s),s&&e.onAutoAllow()},title:s("此会话不再询问")}),(0,u.jsx)("span",{children:s("此会话不再询问")})]}),(0,u.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,u.jsx)(r.$n,{text:s("拒绝"),color:"var(--red)",clickFun:e.onDeny}),(0,u.jsx)(r.$n,{text:s("允许"),clickFun:e.onAllow})]})]})}function h(){const[e,s]=(0,o.fp)(l.AG.prompt_card),{t}=(0,a.Bd)(),r=(0,n.useRef)([]),h=(0,n.useRef)(!1),g=(0,n.useRef)(null),p=(0,n.useRef)(void 0),_=(0,n.useRef)(()=>{}),x=(0,n.useCallback)(e=>{s({open:!1}),h.current=!1,g.current&&(i.ws.sendData(c.HK.ai_confirm_cmd,{askId:g.current,approved:e}),g.current=null),_.current()},[s]),f=(0,n.useCallback)(()=>{if(h.current)return;if(0===r.current.length)return h.current=!1,void s({open:!1});h.current=!0;const e=r.current.shift();e?(g.current=e.askId,p.current=e.session_id,s({open:!0,title:t("命令确认"),cancel:()=>x(!1),context_div:(0,u.jsx)(m,{cmd:e.cmd,sessionId:e.session_id,onDeny:()=>x(!1),onAllow:()=>x(!0),onAutoAllow:async()=>{if(p.current)try{await d.jV.post("session/cmd_auto_allow",{session_id:p.current,allow:!0})}catch(e){console.error("设置会话命令免确认失败",e)}x(!0)}})})):h.current=!1},[t,x,s]);_.current=f;const j=(0,n.useCallback)(e=>{r.current.push(e),f()},[f]);(0,n.useEffect)(()=>(i.ws.addMsg(c.HK.ai_confirm_cmd,e=>{const t=e.context||{};if(t.dismiss&&t.askId)return r.current=r.current.filter(e=>e.askId!==t.askId),void(h.current&&g.current===t.askId&&(g.current=null,h.current=!1,s({open:!1}),f()));t.askId&&t.cmd&&j({askId:t.askId,cmd:t.cmd,session_id:t.session_id})}),()=>{i.ws.removeMsg(c.HK.ai_confirm_cmd)}),[j]),(0,n.useEffect)(()=>()=>{r.current=[],h.current=!1,g.current=null},[])}},34299(e,s,t){t.r(s),t.d(s,{default:()=>p});t(96540);var n=t(73557),a=t(53995),i=t(18569),c=t(77979),o=t(8263),l=t(69428),r=t.n(l),d=(t(3775),t(21499)),u=t(99214),m=t(19878),h=(t(72411),t(74848));const g=new n.A({html:!0,highlight:function(e,s){if(s&&m.A.getLanguage(s))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${s}">${m.A.highlight(e,{language:s}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${m.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${g.utils.escapeHtml(e)}</code></pre>`}});function p(e){return(0,u.VD)(),(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:g.render(e.context)}})}g.use(a.A).use(i.A).use(c.A).use(o.A).use(r()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(s,t,n,a,i)=>{const c=s[t],o=c.content.trim(),l=c.info.trim();let r="";if(l&&m.A.getLanguage(l))try{r=m.A.highlight(o,{language:l}).value}catch(s){r=e.utils.escapeHtml(o)}else try{r=m.A.highlightAuto(o).value}catch(s){r=e.utils.escapeHtml(o)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${l||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(o)}">复制</button>\n </div>\n <pre><code class="hljs ${l?`language-${l}`:""}">${r}</code></pre>\n </div>`}}).use(e=>{const s=e.renderer.rules.link_open||function(e,s,t,n,a){return a.renderToken(e,s,t)};e.renderer.rules.link_open=(e,t,n,a,i)=>{const c=e[t],o=c.attrIndex("href");if(o>=0){const e=c.attrs[o][1];c.attrs[o][1]=(0,d.bi)(window.location.href,e)}return s(e,t,n,a,i)}})},45907(e,s,t){t.d(s,{y:()=>i});var n=t(34843),a=t(82893);function i(){const[e,s]=(0,n.fp)(a.AG.confirm);return({sub_title:e,confirm_fun:t,title:n,context_div:a})=>{s({open:!0,sub_title:e,handle:()=>{t(),s({open:!1,handle:null})},title:n,context_div:a})}}},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6892],{26892(e,t,c){c.r(t),c.d(t,{default:()=>m});c(96540);var s=c(83029),a=(c(27690),c(82893)),n=c(14284),i=c(53459),l=(c(85997),c(57952)),r=c(34899),d=c(78247),o=c(23430),_=c(34843),u=c(62042),f=c(74848);function m(){const{t:e}=(0,r.Bd)(),[t,c]=(0,_.fp)(a.AG.showPrompt),{check_user_auth:m}=(0,d.MH)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.A,{}),(0,f.jsx)(s.N,{have_auth_edit:m(o.oV.net_site_tag_update),getItems:async()=>{const e=await n.sY.get();return e.code===i.m.Success?e.data:[]},save:async e=>{(await n.sY.post("save",e)).code===i.m.Success&&(0,u.SK)("保存成功")},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]})]})}},83029(e,t,c){c.d(t,{N:()=>k});var s=c(96540),a=c(34843),n=c(82893),i=c(74848);function l(e){const[t,c]=(0,a.fp)(n.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 r=c(64694),d=c(61443),o=c(85997),_=c(76213),u=c(34899);const f=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,h,p=[];const v=[];function k(e){const[t,c]=(0,s.useState)([]),[k,x]=(0,s.useState)(-1),j=(0,_.zy)(),[y,b]=(0,s.useState)(!1),[g,C]=(0,s.useState)(!1),{t:N}=(0,u.Bd)(),[S,w]=(0,s.useState)([]),[I,A]=(0,a.fp)(n.AG.nav_index_add_item_by_now_list),D=e=>{-1!==k?v[k]._children=e:p=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();p=t,c(p)})()},[j]);(0,s.useEffect)(()=>{if(I){const e=[...t,{name:"",color:(0,r.Lr)(f),...I}];D(e),c(e),b(!0),A(void 0)}},[I]);const F=e=>{x(k+1),c(e._children),v.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==k&&(0,i.jsx)(o.rA,{title:"返回",icon:"arrow_back",onClick:()=>{c(0===k?p:v[k-1]._children),x(k-1),v.pop()}}),t.map((a,n)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,n),onDrop:e=>((e,s)=>{e.preventDefault();const a=t[m],n=t[s];if(n&&"dir"===n._type){const e=[...t];return e.splice(m,1),n._children||(n._children=[]),n._children.push(a),D(e),void c(e)}const i=[...t],l=i[m];i.splice(m,1),i.splice(s,0,l),D(i),c(i)})(e,n),style:{cursor:y?"move":"pointer"},children:[(0,i.jsx)(l,{name:a.name,item:a,...a,div:y,target:"_blank",click_dir:F,clickItem:e.clickItem}),y&&(void 0!==S.find(e=>e===n)||g)&&(0,i.jsxs)("div",{className:g?"":" site_edit ",children:["dir"===a._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(d.Sm,{value:a.name,handleInputChange:e=>{a.name=e},placeholder:N("输入类目名"),no_border:!0}),(0,i.jsx)(d.Sm,{value:a.color,handleInputChange:e=>{a.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(d.Sm,{value:a[e.key],handleInputChange:t=>{a[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!g&&(0,i.jsx)(o.C3,{text:N("折叠"),clickFun:()=>{w((0,r.P1)(S,n))}})]}),y&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(o.C3,{text:N("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),D(s),c(s)})(n)}}),(0,i.jsx)(o.C3,{text:N("编辑"),clickFun:()=>{void 0===S.find(e=>e===n)&&w([...S,n])}})]})})]},n)),y&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(o.rA,{title:N("取消"),icon:"cancel",onClick:()=>{w([]),b(!1),h&&(c(h),D(h)),C(!1)}}),(0,i.jsx)(o.rA,{title:N("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,r.Lr)(f),...e.get_pre_add_item&&await e.get_pre_add_item()}];D(s),c(s)}}),(0,i.jsx)(o.rA,{title:N("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];D(e),c(e)}}),(0,i.jsx)(o.rA,{title:N("全部编辑"),icon:g?"unfold_less":"unfold_more",onClick:()=>{C(!g)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(o.rA,{icon:y?"save":"edit",title:N(y?"保存":"编辑"),onClick:async()=>{y?e.save&&await e.save(p):h=t,b(!y)}})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6919],{86919(e,l,t){t.r(l),t.d(l,{default:()=>_});var r=t(96540),a=t(34899),i=t(76213),s=t(34843),n=t(57952),o=t(85997),h=t(75725),d=t(70447),c=t(61443),u=t(82893),m=t(14284),p=t(53459),x=t(62042),j=t(74848);function _(){const{t:e}=(0,a.Bd)(),l=(0,i.Zp)(),[t,_]=(0,s.fp)(u.AG.confirm),[,v]=(0,s.fp)(u.AG.prompt_card),[b,C]=(0,r.useState)(""),[S,g]=(0,r.useState)(""),[w,f]=(0,r.useState)(""),[k,y]=(0,r.useState)(""),[B,I]=(0,r.useState)(""),[W,A]=(0,r.useState)(""),[N,D]=(0,r.useState)(""),[P,T]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!0),[z,F]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{const e=await m.Yu.get("docker/config");if(e?.code!==p.m.Success)return;const l=e.data??{};C(l.http_proxy??""),g(l.https_proxy??""),f(l.no_proxy??""),y((l.registry_mirrors||[]).join(",")),I((l.insecure_registries||[]).join(",")),A(l.data_root??""),D(l.storage_driver??""),T(l.log_driver??""),Y(l.iptables??!0),F(!!l.live_restore)})()},[]);return(0,j.jsxs)("div",{children:[(0,j.jsx)(n.A,{children:(0,j.jsx)(o.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>l(-1)})}),(0,j.jsx)(h.jW,{isFull:!0,more:!0,children:(0,j.jsx)(h.NN,{children:(0,j.jsx)(h.xh,{children:(0,j.jsx)(h.fI,{children:(0,j.jsx)(h.VP,{widthPer:35,children:(0,j.jsxs)(d.uF,{self_title:(0,j.jsxs)("span",{className:"div-row",children:[(0,j.jsx)("h2",{children:e("Docker 代理配置")}),(0,j.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{v({open:!0,title:e("信息"),context_div:(0,j.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("代理写入 systemd 服务环境变量,其余写入 daemon.json;修改后需重启 Docker 生效,请谨慎操作(尤其数据存储目录变更)。")})})}})]}),titleCom:(0,j.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async()=>{const l=e=>e.split(/[\n,,]/).map(e=>e.trim()).filter(Boolean),t=await m.Yu.post("docker/config/save",{http_proxy:b,https_proxy:S,no_proxy:w,registry_mirrors:l(k),insecure_registries:l(B),data_root:W,storage_driver:N,log_driver:P,iptables:H,live_restore:z});t?.code===p.m.Success?_({open:!0,title:e("是否重启 Docker 服务以生效?"),sub_title:e("重启 Docker 会短暂中断容器服务,请确认当前没有关键任务在执行"),handle:async()=>{const l=await m.Yu.post("docker/restart");_({open:!1,handle:null}),l?.code===p.m.Success?(0,x.SK)(e("已重启 Docker,代理配置已生效")):(0,x.zN)(e("重启失败"))}}):(0,x.zN)(e("保存失败"))})()}),children:[(0,j.jsx)(c.BC,{label:e("HTTP 代理"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"http://127.0.0.1:3067",value:b,handleInputChange:e=>C(e)})}),(0,j.jsx)(c.BC,{label:e("HTTPS 代理"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://127.0.0.1:3067",value:S,handleInputChange:e=>g(e)})}),(0,j.jsx)(c.BC,{label:e("No Proxy"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"localhost,127.0.0.1",value:w,handleInputChange:e=>f(e)})}),(0,j.jsx)(c.BC,{label:e("镜像加速"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://docker.mirrors.ustc.edu.cn,https://hub-mirror.c.163.com",value:k,handleInputChange:e=>y(e)})}),(0,j.jsx)(c.BC,{label:e("不安全仓库"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"127.0.0.1:5000,registry.example.com",value:B,handleInputChange:e=>I(e)})}),(0,j.jsx)(c.BC,{label:e("数据存储目录"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"/var/lib/docker",value:W,handleInputChange:e=>A(e)})}),(0,j.jsx)(c.BC,{label:e("存储驱动"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"overlay2",value:N,handleInputChange:e=>D(e)})}),(0,j.jsx)(c.BC,{label:e("日志驱动"),label_width:"4rem",children:(0,j.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"json-file",value:P,handleInputChange:e=>T(e)})}),(0,j.jsx)(c.BC,{label:e("启用 iptables"),label_width:"4rem",input_max_width:"8rem",children:(0,j.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:H,onChange:e=>Y(!!e)})}),(0,j.jsx)(c.BC,{label:e("Live Restore"),label_width:"4rem",input_max_width:"8rem",children:(0,j.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:z,onChange:e=>F(!!e)})})]})})})})})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7133],{77133(e,s,i){i.r(s),i.d(s,{default:()=>d});var a=i(96540),t=i(85997),c=i(57952),l=i(34843),n=i(82893),r=i(47022),o=i(74848);function p(e){const s=(0,a.useRef)(null),i=(0,a.useRef)(null);return(0,o.jsx)("div",{className:"image-ex-container",ref:s,style:{height:"100%"},children:(0,o.jsx)("img",{className:"image-ex-img image-ex-img-center",ref:i,src:e.path,alt:""})})}var u=i(34899);const f=a.lazy(()=>Promise.all([i.e(8772),i.e(6100)]).then(i.bind(i,69160)));function d(e){const{t:s}=(0,u.Bd)(),[i,a]=(0,l.fp)(n.AG.file_preview);if(!i.open)return;let d;switch(i.type){case r.Iw.video:d=(0,o.jsx)(f,{source:i.url,options:{autoplay:!1}});break;case r.Iw.image:d=(0,o.jsx)(p,{path:i.url});break;case r.Iw.pdf:d=(0,o.jsx)("object",{className:"pdf",data:i.url+"&show=1",type:"application/pdf"})}const h=(0,o.jsxs)("div",{id:"previewer",children:[(0,o.jsx)(c.A,{ignore_tags:!0,left_children:[(0,o.jsx)(t.rA,{title:s("取消"),icon:"close",onClick:function(){a({open:!1}),i?.close?.()}},1)]}),(0,o.jsx)("div",{className:"preview",children:d})]});return i.open&&h}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7759],{45601(A,e,s){"use strict";s.r(e),s.d(e,{default:()=>G});var a=s(96540),t=s(34899),c=s(34843),d=s(82893),l=s(14944),r=s(92275),o=s(14284),Y=s(53459),i=s(61443),n=s(85997),p=s(83029),B=s(57952),j=(s(82341),s(91568)),h=s(18257),S=s.n(h),u=s(76559),f=s(62042),m=s(74777),x=s(78247),y=s(23430),z=s(74848);let N;function G(){const{t:A}=(0,t.Bd)(),[e,s]=(0,a.useState)(void 0),[h,G]=(0,a.useState)(!1),[P,k]=(0,c.fp)(d.AG.user_base_info),{check_user_auth:H}=(0,x.MH)(),g=(0,a.useRef)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{N&&(N.pause(),N.unload(),N.detachMediaElement(),N.destroy(),N=null),w.current&&w.current.dispose()},[]);const L=s=>{G(!0),(async e=>{P.sysSoftWare&&P.sysSoftWare[m.jk.ffmpeg]&&P.sysSoftWare[m.jk.ffmpeg].installed?(w.current=(0,j.default)(g.current,{controls:!0,width:640,height:360}),S().isSupported()?(N=S().createPlayer({type:"flv",url:u.I.getOtherWebSocketUrl(r.HK.rtsp_get,{url:e}),isLive:!0}),N.attachMediaElement(g.current),N.load(),N.load()):(0,f.zN)("FLV.js is not supported in this browser.")):(0,f.zN)(A("找不到ffmpeg"))})(s.address?s.address:e)};return(0,z.jsxs)("div",{children:[(0,z.jsxs)(B.A,{children:[(0,z.jsx)(i.$Z,{max_width:"40rem",placeholder:A(" rtsp://username:password@ip:port/path"),icon:"link",value:e,handleInputChange:A=>s(A)}),!h&&(0,z.jsx)(n.rA,{icon:"play_arrow",title:A("连接"),onClick:L}),h&&(0,z.jsx)(n.rA,{icon:"close",title:A("关闭"),onClick:async()=>{await l.ws.sendData(r.HK.rdp_disconnect,""),G(!1)}})]}),!h&&(0,z.jsx)(p.N,{have_auth_edit:H(y.oV.rtsp_proxy_tag_update),getItems:async()=>{const A=await o.K4.get("tag");return A.code===Y.m.Success?A.data:[]},save:async A=>{(await o.K4.post("tag/save",A)).code!==Y.m.Success&&(0,f.zN)("网络错误")},clickItem:async A=>{s(A.address),L(A)},items:[{key:"name",preName:A("名字")},{key:"address",preName:A("地址")},{key:"color",preName:"color"}]}),(0,z.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}}),(0,z.jsx)("div",{style:{display:h?"block":"none"},children:(0,z.jsx)("video",{ref:g,className:"video-js vjs-default-skin"})})]})}},17422(A){"use strict";A.exports="data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAD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