filecat 7.21.2 → 7.22.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 (50) hide show
  1. package/build/dist/122.4dcdda2738126091bb48.js +1 -0
  2. package/build/dist/1317.4d1617ed6eddfd2960b5.js +1 -0
  3. package/build/dist/2334.9568f51c698d1e261092.js +1 -0
  4. package/build/dist/{4924.32129da284e5464bf078.js → 2543.c1df37b86fd6b03c3976.js} +2 -2
  5. package/build/dist/259.5dbfcbe6ecd5e8ce07ca.js +1 -0
  6. package/build/dist/2674.983f76fc32b01e807e4d.js +1 -0
  7. package/build/dist/3355.221b11ae8755cb58412f.js +1 -0
  8. package/build/dist/{3402.30e70a3fe5d2c355bae5.js → 3402.913056b796b3aa4dfd5f.js} +1 -1
  9. package/build/dist/4091.4ec37d360601d3f388ee.js +1 -0
  10. package/build/dist/4564.d7a5595346660e89760b.js +2 -0
  11. package/build/dist/4564.d7a5595346660e89760b.js.LICENSE.txt +39 -0
  12. package/build/dist/4598.48aad39fc631a51c30d3.js +1 -0
  13. package/build/dist/47.423c0f43594850475f8d.js +1 -0
  14. package/build/dist/5272.16c3f9821799656a93a9.js +1 -0
  15. package/build/dist/6097.3b8a75477b58137301a6.js +1 -0
  16. package/build/dist/676.ad9fb1447bfc5b04b30a.js +1 -0
  17. package/build/dist/7181.031a335fc6a96a548882.js +1 -0
  18. package/build/dist/7678.b2889b36fac2b90a9061.js +1 -0
  19. package/build/dist/{8435.5cf0507f0dfbd7576fff.js → 8435.1f63fa3aa621962786b1.js} +1 -1
  20. package/build/dist/{8765.13b3b3db8cf2edb74526.js → 8765.800f703d3d31566267ab.js} +1 -1
  21. package/build/dist/9202.acca2abe478020a45f13.js +1 -0
  22. package/build/dist/9260.2f474cb25f7647cb995a.js +1 -0
  23. package/build/dist/{9546.cd3b1747ad87bbd7ccc4.js → 9546.2dc17877ae589e21d6d2.js} +1 -1
  24. package/build/dist/9765.15869054c7b8e56ccc76.js +1 -0
  25. package/build/dist/991.2ff5a3ada566cb075df6.js +1 -0
  26. package/build/dist/index.html +1 -1
  27. package/build/dist/main.19ecdddaf894b36f1a47.js +2 -0
  28. package/build/main.js +1 -1
  29. package/package.json +5 -1
  30. package/build/dist/2334.8944eba9ea6bea2c873b.js +0 -1
  31. package/build/dist/2543.a6ee7f78b6f447ccae9f.js +0 -1
  32. package/build/dist/259.ed90168189edc15b3ea6.js +0 -1
  33. package/build/dist/2674.26ef7b92f7a50dde4275.js +0 -1
  34. package/build/dist/3355.70ffd73778049aa73d5c.js +0 -1
  35. package/build/dist/3528.f4bf3684610c3ce28c08.js +0 -1
  36. package/build/dist/4091.bbca4ee92e5d078ee770.js +0 -1
  37. package/build/dist/4598.6528d76c619352e7e1f3.js +0 -1
  38. package/build/dist/47.0ad0f7d1c95e6691b317.js +0 -1
  39. package/build/dist/5272.124204f2cb80d69e8561.js +0 -1
  40. package/build/dist/5877.afb89fcd6cbae1ab8e39.js +0 -1
  41. package/build/dist/6097.98ee6ec678fafcc2c2ba.js +0 -1
  42. package/build/dist/676.4671c5b267b93fd2112d.js +0 -1
  43. package/build/dist/7181.2403d6d75f9d4ea6917d.js +0 -1
  44. package/build/dist/7678.5769d70f52981f9434d1.js +0 -1
  45. package/build/dist/8358.1d1c09cc6b9185e388a2.js +0 -1
  46. package/build/dist/9260.72cae497ae765cc00d54.js +0 -1
  47. package/build/dist/9765.2f0daa101ea2bc02379a.js +0 -1
  48. package/build/dist/main.f512bdab9a0595432be0.js +0 -2
  49. /package/build/dist/{4924.32129da284e5464bf078.js.LICENSE.txt → 2543.c1df37b86fd6b03c3976.js.LICENSE.txt} +0 -0
  50. /package/build/dist/{main.f512bdab9a0595432be0.js.LICENSE.txt → main.19ecdddaf894b36f1a47.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9546],{75007(e,t,s){s.d(t,{h:()=>o});s(96540);var n=s(85997),i=s(74848);function o(e){return(0,i.jsxs)("h2",{className:"message",children:[(0,i.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,i.jsx)("span",{children:e.context})]})}},22081(e,t,s){s.d(t,{A:()=>r});var n=s(96540),i=s(16349),o=s(74848);const r=({percentage:e})=>{const t=(0,n.useRef)(null),[s,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new i.Ay(s,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return r(n),()=>{n.destroy()}},[]),(0,n.useEffect)(()=>{s&&(s.data.datasets[0].data=[e,100-e],s.update())},[e]),(0,o.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,o.jsx)("canvas",{ref:t})})}},77481(e,t,s){s.d(t,{S:()=>c,X:()=>r});var n=s(96540),i=s(61443),o=s(74848);function r(e){const[t,s]=n.useState([]),r=(0,n.useRef)(-1),[c,l]=(0,n.useState)(-1),[a,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const u=()=>{r.current=-1,l(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let r=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(r=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):t},s)})})}),(0,o.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(c===s?"row-dragging":"")+(a===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(r.current=s,l(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=r.current,s=a;u(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:u,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function c(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},88062(e,t,s){s.d(t,{A:()=>r});s(96540),s(47022);var n=s(74848);function i(e){return(0,n.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(t,e)},children:e.name})}const o=e=>(0,n.jsxs)("li",{children:[e.click?(0,n.jsx)(i,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,n.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,n.jsx)("ul",{children:e.node.children.map((t,s)=>(0,n.jsx)(o,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),r=e=>(0,n.jsx)("div",{className:"card-tree-view",children:(0,n.jsx)("ul",{children:e.list&&e.list.map((t,s)=>(0,n.jsx)(o,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})})},59546(e,t,s){s.r(t),s.d(t,{default:()=>le});var n=s(96540),i=s(75725),o=s(70447),r=s(22081),c=s(92275),l=s(14944),a=s(14284),d=s(4412),u=s(85997),h=s(77481),x=s(53459),p=s(22022),m=s(34843),f=s(82893),j=s(74777),g=s(62042),_=s(61443),y=s(74848);function w(e){const{t}=(0,p.Bd)(),[s,r]=(0,m.fp)(f.AG.disk),[c,l]=(0,n.useState)({}),[j,g]=(0,n.useState)([]),_=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===x.m.Success){const e=[];for(const n of s.data.ata_smart_attributes??[]){let s;n[1]>=n[2]?s="var(--icon-green)":n[1]<=n[3]&&(s="var(--icon-red)"),n[0]=(0,y.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}g(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{position:"right",children:(0,y.jsx)(u.rA,{icon:"close",title:t("关闭"),onClick:()=>{r({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{widthPer:30,children:[(0,y.jsx)(i.xh,{children:(0,y.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("名字"),right:e.name}),(0,y.jsx)(i.Yh,{left:t("厂商名称"),right:e.typeName}),(0,y.jsx)(i.Yh,{left:t("类型"),right:e.type}),(0,y.jsx)(i.Yh,{left:t("容量"),right:e.total})]})}),(0,y.jsx)(i.xh,{children:(0,y.jsxs)(o.Zp,{title:t("物理信息"),children:[(0,y.jsx)(i.Yh,{left:t("是否健康"),right:!0===c.smart_status?"是":"否"}),(0,y.jsx)(i.Yh,{left:t("设备型号"),right:c.model_name}),(0,y.jsx)(i.Yh,{left:t("序列号"),right:c.serial_number}),(0,y.jsx)(i.Yh,{left:t("固件版本"),right:c.firmware_version}),(0,y.jsx)(i.Yh,{left:t("转速(每分钟)"),right:c.rotation_rate}),(0,y.jsx)(i.Yh,{left:t("通电时长(小时)"),right:c.power_on_time_hours}),(0,y.jsx)(i.Yh,{left:t("通电次数"),right:c.power_cycle_count}),(0,y.jsx)(i.Yh,{left:t("温度(°C)"),right:c.temperature}),(0,y.jsx)(i.Yh,{left:t("通信协议"),right:c.device_protocol})]})})]}),(0,y.jsx)(i.VP,{widthPer:50,children:(0,y.jsxs)(i.xh,{children:[j?.length?(0,y.jsx)(o.uF,{title:t("ATA/SATA详细信息"),children:(0,y.jsx)(h.X,{headers:_,rows:j,width:"10rem"})}):(0,y.jsx)(y.Fragment,{}),c.nvme_smart?(0,y.jsxs)(o.Zp,{title:t("NVME详细信息"),children:[(0,y.jsx)(i.Yh,{left:t("NVMe 可用备用块(%)"),right:c.nvme_smart.available_spare}),(0,y.jsx)(i.Yh,{left:t("NVMe 已使用寿命(%)"),right:c.nvme_smart.percentage_used}),(0,y.jsx)(i.Yh,{left:t("NVMe 读取量"),right:c.nvme_smart.data_units_read}),(0,y.jsx)(i.Yh,{left:t("NVMe 写入量"),right:c.nvme_smart.data_units_written}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电次数"),right:c.nvme_smart.power_cycles}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电时长(小时)"),right:c.nvme_smart.power_on_hours}),(0,y.jsx)(i.Yh,{left:t("NVMe 非正常关机"),right:c.nvme_smart.unsafe_shutdowns}),(0,y.jsx)(i.Yh,{left:t("NVMe 媒体错误"),right:c.nvme_smart.media_errors}),(0,y.jsx)(i.Yh,{left:t("NVMe 错误日志数"),right:c.nvme_smart.num_err_log_entries})]}):(0,y.jsx)(y.Fragment,{})]})})]})})})]})}let v=function(e){return e[e.mount=0]="mount",e}({});var k=s(88062),S=s(78247),b=s(23430),C=s(99214);const A=e=>(0,y.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,y.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function V(){return(0,y.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}})})}function P(){const{t:e}=(0,p.Bd)(),[t,s]=(0,m.fp)(f.AG.disk),[r,c]=(0,n.useState)({}),[l,j]=(0,n.useState)([]),[_,w]=(0,n.useState)([]),[P,$]=(0,m.fp)(f.AG.showPrompt),{check_user_auth:Y}=(0,S.MH)(),[F,I]=(0,n.useState)([]),{click_file:N}=(0,C.kZ)(),[E,K]=(0,m.fp)(f.AG.prompt_card),M=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],B=async()=>{const e=await a.Yu.get("disk/blk");return e.code===x.m.Success&&j(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{B()})()},[]);const H=[(0,y.jsx)(u.rA,{icon:"info",title:e("提示"),onClick:async()=>{K({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,y.jsxs)("li",{children:["文件系统,有多种格式",(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,y.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,y.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,y.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,y.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,y.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,y.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,y.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,y.jsx)("li",{children:"rw:以读写方式挂载"}),(0,y.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,y.jsx)("li",{children:"...等"})]})]}),(0,y.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,y.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,y.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,y.jsx)(u.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:v.mount})).code===x.m.Success&&(0,g.SK)(e("挂载文件已生效"))}},1)],Z=async()=>(await a.Yu.get("get_fstab")).data,G=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{position:"right",children:(0,y.jsx)(u.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:40,children:(0,y.jsxs)(o.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),rightTopCom:(0,y.jsxs)("div",{children:[Y(b.oV.sys_disk_mount)&&(0,y.jsx)(u.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{N({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:Z,save_file_fun:G,menu_list:H})}}),(0,y.jsx)(u.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await B()===x.m.Success&&(0,g.SK)(e("刷新成功"))}})]}),children:[(0,y.jsx)(h.X,{headers:M,rows:_,width:"10rem"}),(0,y.jsx)(k.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,y.jsxs)("span",{children:[t,(0,y.jsx)("span",{style:{color:"green"},children:"(已挂载)"})]}):t},onContextMenu:(e,t)=>{e.preventDefault()},click:t=>{let s="";if(t.mountpoint)for(let e=0;e<t.mountpoints.length;e++)s+=t.mountpoints[e]+";";w([[(0,y.jsx)(o.xP,{children:s}),(0,y.jsx)(o.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,y.jsx)(o.xP,{children:t.path}),t.pttype]])}})]})}),(0,y.jsx)(i.VP,{widthPer:60,children:F.map((t,s)=>{const n=[];for(const e of t.pv_list)n.push({name:`${e.name}---(${e.size})---(${e.free_size})`});const r=[];for(const e of t.lv_list)r.push({name:`${e.name}---(${e.size})`});return(0,y.jsx)(o.Zp,{children:(0,y.jsxs)(i.n5,{children:[(0,y.jsx)(A,{name:e("物理卷"),lvms:n}),(0,y.jsx)(V,{}),(0,y.jsx)(A,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,y.jsx)(V,{}),(0,y.jsx)(A,{name:e("逻辑卷"),lvms:r})]})},s)})})]})})})]})}var $=s(88815);let Y=!0;function F(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],_=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[v,k]=(0,m.fp)(f.AG.user_base_info),[S,C]=(0,n.useState)(0),[A,V]=(0,n.useState)(0),[F,I]=(0,n.useState)(0),[N,E]=(0,n.useState)(0),[K,M]=(0,n.useState)(0),[B,H]=(0,n.useState)({}),[Z,G]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[T,W]=(0,n.useState)(!1),[X,q]=(0,n.useState)(Y),[U,L]=(0,n.useState)(null),[R,O]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[ee,te]=(0,m.fp)(f.AG.user_base_info),[se,ne]=(0,m.fp)(f.AG.disk),ie=async()=>{Y&&(await l.ws.addMsg(c.HK.sys_getting,e=>{E(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;V(t),I(s),C((s-t)/s*100),L(e.context?.node_memory_usage),M(e.context?.node_cpu_usage)}),await l.ws.send(new c.hf(c.HK.sys_get)))};return(0,n.useEffect)(()=>((async()=>{await ie()})(),()=>{l.ws.sendData(c.HK.sys_cancel,{})}),[]),(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[v.sys===b.XM.linux&&(0,y.jsx)(u.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{G(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===x.m.Success){const t=e.data;H(t)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===x.m.Success){const s=e.data,n=[];let i=!0;ee.sysSoftWare&&ee.sysSoftWare[j.jk.smartmontools]&&ee.sysSoftWare[j.jk.smartmontools].installed||(i=!1);for(const e of s??[])n.push([(0,y.jsx)(o.xP,{context:e.name}),e.typeName,e.type,e.total,(0,y.jsx)(u.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{i?ne({type:"check",data:e}):(0,g.zN)(t("没有安装smartmontools"))}})]);O(n)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{W(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===x.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,y.jsx)(o.xP,{context:e.name}),(0,y.jsx)(o.xP,{context:e.device_name}),e.fsType,(0,y.jsx)(o.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:X,text:t("实时信息"),clickFun:e=>{q(e),Y=e,ie()}})]}),(0,y.jsxs)(i.xh,{children:[X&&(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"Sys "+t("内存"),children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.A,{percentage:S})}),(0,y.jsx)(i.VP,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)("div",{children:(0,y.jsx)(i.Yh,{left:t("总容量"),center:`${F}G`})})}),(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)(i.Yh,{left:t("剩余"),center:`${A}G`})})]})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"Sys cpu",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.A,{percentage:N})}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.Yh,{left:t("使用率"),center:N})})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"FileCat",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{children:[(0,y.jsx)(i.qV,{content:t("内存")}),(0,y.jsx)(i.qV,{content:"total: "+(0,$.v7)(U?.rss)}),(0,y.jsx)(i.qV,{content:"object: "+(0,$.v7)(U?.heapTotal)}),(0,y.jsx)(i.qV,{content:"obj-use: "+(0,$.v7)(U?.heapUsed)}),(0,y.jsx)(i.qV,{content:"external: "+(0,$.v7)(U?.external)}),(0,y.jsx)(i.qV,{content:"buffer: "+(0,$.v7)(U?.arrayBuffers)})]}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.qV,{content:"cpu growth rate: "+K})})]})})})]}),(0,y.jsxs)(i.fI,{children:[Z&&(0,y.jsx)(i.VP,{children:(0,y.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("总内存"),right:B.mem_total}),(0,y.jsx)(i.Yh,{left:`cpu ${t("制造商")}`,right:B.cpu_manufacturer}),(0,y.jsx)(i.Yh,{left:`cpu ${t("品牌")}`,right:B.cpu_brand}),(0,y.jsx)(i.Yh,{left:`cpu ${t("逻辑核心")}`,right:B.cpu_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("物理核心")}`,right:B.cpu_phy_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("最大")}hz`,right:B.cpu_speed_hz}),(0,y.jsx)(i.Yh,{left:`${t("当前系统")}:pid;ppid`,right:B.pid_ppid}),(0,y.jsx)(i.Yh,{left:t("运行用户"),right:B.user})]})}),D&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(o.uF,{title:t("物理硬盘"),children:(0,y.jsx)(h.X,{headers:s,rows:R,width:"10rem"})})}),T&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(o.uF,{title:t("文件硬盘"),children:(0,y.jsx)(h.X,{headers:_,rows:J,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,y.jsx)(w,{...se.data}),se&&"mount"===se.type&&(0,y.jsx)(P,{})]})}var I=s(75007),N=s(97856),E=s(64405);const K=n.lazy(()=>Promise.all([s.e(4924),s.e(5614)]).then(s.bind(s,85614)));function M(e){const[t,s]=(0,n.useState)(null),[i,o]=(0,m.fp)(f.AG.dockerShellShow),[r,a]=(0,m.fp)(f.AG.user_base_info),d=r.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{i.show?(async()=>{const e=new N.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});let t;l.ws.subscribeUnconnect(u);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===i.type?c.HK.docker_shell_logs_getting:c.HK.docker_shell_exec_getting,e=>{"error"===e.context&&u(),t(e.context)}),"exec"===i.type&&e.onData(async e=>{const t=new c.hf(c.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():u()},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,y.jsx)(K,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n=new E.n;let o;n.rows=e,n.cols=s,n.dockerId=i.dockerId,o="logs"===i.type?new c.hf(c.HK.docker_shell_logs):new c.hf(c.HK.docker_shell_exec_open),o.context=n,l.ws.send(o)}})}var B=s(89824),H=s(52671),Z=s(87361);let G="",D=[],z=!1;function T(e){const{t}=(0,p.Bd)(),s=(0,H.Zp)(),[r]=(0,m.fp)(f.AG.user_base_info),[j,w]=(0,n.useState)({}),[v,k]=(0,n.useState)([]),[C,A]=(0,n.useState)([]),{check_user_auth:V}=(0,S.MH)(),[P,$]=(0,m.fp)(f.AG.dockerShellShow),[Y,F]=(0,m.fp)(f.AG.showPrompt),[N,E]=(0,m.fp)(f.AG.confirm),[K,T]=(0,n.useState)(G),[W,X]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[q,U]=(0,n.useState)([]),[L,R]=(0,n.useState)(void 0),[O,J]=(0,n.useState)(!1),Q=["id",t("name"),t("create时间"),t("大小"),(0,y.jsxs)("span",{children:["选中",(0,y.jsx)(u.rA,{icon:"check_box",title:"全选",onClick:()=>{z=!z;const e={};for(let t=0;t<C.length&&z;t++)e[C[t][0].props.context]=1;w(e)}})]})],ee=(0,n.useRef)(()=>{}),te=async()=>{k([]),U([]),l.ws.off_message(`message_${c.HK.docker_getting}`,ee.current);const e=e=>{k((e=>{const t=[];if(G){for(const s of e)for(const e of s)if(`${e}`.includes(G)){t.push(s);break}}else t.push(...e);return t.map(e=>{const t=e.map(e=>(0,y.jsx)(o.xP,{context:e}));return t.push((0,y.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{U(t)}})),t})})(e.context??[]))};ee.current=e,l.ws.addMsg(c.HK.docker_getting,e);const t=new c.hf(c.HK.docker_get);await l.ws.send(t)};(0,n.useEffect)(()=>(T(G),te(),()=>{(async()=>{l.ws.off_message(`message_${c.HK.docker_getting}`,ee.current),$({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{G=K},[K]);const se=()=>{const e=new c.hf("logs"===P.type?c.HK.docker_shell_logs_cancel:c.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},ne=e=>{const t=new c.hf(c.HK.docker_switch);t.context={type:e,dockerId:q[0].props.context},U([]),l.ws.send(t)},ie=async()=>{const e=await a.Yu.get("docker/images");if(e.code===x.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],i=[(0,y.jsx)(o.xP,{context:n[0]}),(0,y.jsx)(o.xP,{context:n[1]}),n[2],n[3],""];s.push(i)}D=s,A(s)}};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{children:(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("doc_img"),clickFun:e=>{J(e),e?(ie(),U([])):(te(),A([]),w({}))}})}),(0,y.jsxs)(d.aZ,{position:"right",children:[r.sys===b.XM.linux&&(0,y.jsx)(u.rA,{icon:"settings",title:t("doc_cfg"),onClick:()=>s(Z.o.docker_setting_page)}),Object.keys(j).length>0&&(0,y.jsx)(u.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{E({open:!0,title:t("doc_icf"),handle:async()=>{const e=Object.keys(j),s=await a.Yu.post("docker/check/delete",{ids:e});if(s.code===x.m.Success)if(0===s.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===x.m.Success&&((0,g.SK)(t("删除完成")),ie(),E({open:!1,handle:null}))}else(0,g.N9)(`有镜像正在运行${JSON.stringify(s.data)}`)}})}}),q.length>0&&(0,y.jsx)("div",{children:q[1].props.context}),q.length>0&&(0,y.jsxs)("div",{children:[V(b.oV.docker_container_update)&&(0,y.jsx)(u.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{F({show:!0,overlay:!0,type:B.PromptEnum.DockerDel,data:{dockerId:q[0].props.context,name:q[1].props.context}})}}),(0,y.jsx)(u.rA,{icon:"print",title:t("打印日志"),onClick:()=>{P.show?($({show:!1,type:"",dockerId:""}),se()):$({show:!0,dockerId:q[0].props.context,type:"logs"})}}),V(b.oV.docker_container_update)&&(0,y.jsx)(u.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{P.show?($({show:!1,type:"",dockerId:""}),se()):$({show:!0,dockerId:q[0].props.context,type:"exec"})}}),V(b.oV.docker_container_update)&&q[4].props.context.includes("Up")&&(0,y.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>ne("stop")}),V(b.oV.docker_container_update)&&!q[4].props.context.includes("Up")&&(0,y.jsx)(u.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{ne("start")}})]}),(0!==v.length||K)&&!O&&(0,y.jsx)(u.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new c.hf(c.HK.docker_get);await l.ws.send(e)}})]}),(0,y.jsxs)(i.xh,{children:[O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("镜像")} (${C.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤镜像"),value:L,handleInputChange:e=>{R(e)},handlerEnter:()=>{const e=[];if(L){for(const t of C)(t[0].props.context.includes(L)||t[1].props.context.includes(L))&&e.push(t);A(e)}else A(D)}}),children:(0,y.jsx)(h.X,{headers:Q,rows:C.map((e,s)=>(e[4]=(0,y.jsx)(_.GL,{context:t(""),selected:j[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,j),t[e]?delete t[e]:t[e]=1,w(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===v.length&&!K&&!O&&(0,y.jsx)(I.h,{context:t("dc_nne")}),(0!==v.length||K)&&!O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("容器")} (${v.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤"),value:K,handleInputChange:e=>{T(e)}}),children:(0,y.jsx)(h.X,{headers:W,rows:v,width:"10rem"})})})})]}),(0,y.jsx)(M,{})]})}var W=s(64694);let X="",q=!1,U=!1;function L(e){const{t}=(0,p.Bd)(),[s,r]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[m,f]=(0,n.useState)(0),[j,g]=(0,n.useState)(""),[w,v]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,y.jsxs)("span",{children:[t("内存"),(0,y.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{q=!q}})]}),(0,y.jsxs)("span",{children:["cpu%",(0,y.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{U=!U}})]}),t("选择")]),{check_user_auth:k}=(0,S.MH)();(0,n.useEffect)(()=>{g(X),(async()=>{r([]),f(0),x([]);const e=new c.hf(c.HK.process_get);await l.ws.send(e),l.ws.addMsg(c.HK.process_getting,e=>{const s=[];if(X){for(const t of e.context)for(const e of t)if(`${e}`.includes(X)){s.push(t);break}}else s.push(...e.context);q&&(0,W.di)(s,e=>e[3],!1),U&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,y.jsx)(o.xP,{context:3===t?(0,$.v7)(e):e}));return s.push((0,y.jsx)(u.rA,{icon:"place",title:t("选中"),onClick:()=>{x(s)}})),s});f(s.length),r(n)})})()},[]),(0,n.useEffect)(()=>{X=j},[j]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[a.length>0&&(0,y.jsx)("div",{children:a[1].props.context}),a.length>0&&k(b.oV.sys_process_close)&&(0,y.jsx)("div",{children:(0,y.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new c.hf(c.HK.process_close);e.context={pid:a[0].props.context},x([]),l.ws.send(e)}})})]}),(0,y.jsx)(i.xh,{children:0!==s.length||X?(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("进程")} (${m})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤"),value:j,handleInputChange:e=>{g(e)}}),children:(0,y.jsx)(h.X,{headers:w,rows:s,width:"10rem"})})})}):(0,y.jsx)(I.h,{context:t("ld_wait")})})]})}const R=n.lazy(()=>Promise.all([s.e(4924),s.e(5614)]).then(s.bind(s,85614)));function O(e){const[t,s]=(0,n.useState)(null),[i,o]=(0,m.fp)(f.AG.systemd_shell_show),[r,a]=(0,m.fp)(f.AG.user_base_info),d=r.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!i.show)return void u();(async()=>{const e=new N.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});l.ws.subscribeUnconnect(u),l.ws.addMsg(c.HK.systemd_logs_getting,t=>{"error"===t.context&&u(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,y.jsx)(R,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n={unit_name:i.unit_name},o=new c.hf(c.HK.systemd_logs_get);o.context=n,l.ws.send(o)}})}const J=[{title:"no(不自动重启)",value:"no"},{title:"always(总是重启)",value:"always"},{title:"on-failure(失败才重启)",value:"on-failure"},{title:"on-abnormal(异常才重启)",value:"on-abnormal"}],Q=[{title:"simple",value:"simple"},{title:"forking",value:"forking"},{title:"oneshot",value:"oneshot"},{title:"notify",value:"notify"}],ee=[{title:"multi-user.target",value:"multi-user.target"},{title:"network.target",value:"network.target"}];function te(e,t){const s=[];s.push("[Unit]"),t.description.trim()?s.push(`Description=${t.description.trim()}`):s.push(`Description=${e}`),s.push(""),s.push("[Service]"),s.push(`Type=${t.type.trim()||"simple"}`),t.exec_start.trim()&&s.push(`ExecStart=${t.exec_start.trim()}`),t.working_dir.trim()&&s.push(`WorkingDirectory=${t.working_dir.trim()}`),t.user_.trim()&&s.push(`User=${t.user_.trim()}`);for(const e of t.env){const t=e.key.trim();if(!t)continue;const n=e.value??"",i=`${t}=${n}`,o=/[\s"'\\]/.test(n);s.push(`Environment=${o?`"${i.replace(/"/g,'\\"')}"`:i}`)}return t.restart&&"no"!==t.restart&&s.push(`Restart=${t.restart.trim()}`),s.push(""),s.push("[Install]"),s.push(`WantedBy=${t.wanted.trim()||"multi-user.target"}`),s.push(""),s.join("\n")}function se(e){const t={description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target",env:[]},s=(t,s)=>{const n=e.split(/\r?\n/);let i=!1;for(const e of n){const n=e.trim(),o=n.match(/^\[(.*)\]$/);if(o){i=(o[1]||"").trim()===t;continue}if(!i)continue;const r=n.match(new RegExp(`^${s}\\s*=\\s*(.*)$`,"i"));if(r)return r[1].trim()}return""};t.description=s("Unit","Description"),t.type=s("Service","Type")||"simple",t.exec_start=s("Service","ExecStart"),t.working_dir=s("Service","WorkingDirectory"),t.user_=s("Service","User"),t.restart=s("Service","Restart")||"no",t.wanted=s("Install","WantedBy")||"multi-user.target";let n=!1;for(const s of e.split(/\r?\n/)){const e=s.trim(),i=e.match(/^\[(.*)\]$/);if(i){n="Service"===(i[1]||"").trim();continue}if(!n)continue;const o=e.match(/^Environment\s*=\s*(.*)$/i);if(!o)continue;const r=o[1].trim();if(!r)continue;const c=[];let l=0;for(;l<r.length;){const e=r[l];if(/\s/.test(e))l++;else if('"'===e||"'"===e){const t=e;l++;const s=l;for(;l<r.length&&r[l]!==t;)l++;c.push({text:r.slice(s,l),quoted:!0}),l++}else{const e=l;for(;l<r.length&&!/\s/.test(r[l]);)l++;c.push({text:r.slice(e,l),quoted:!1})}}for(const e of c){const s=e.text,n=s.indexOf("=");n>0?t.env.push({key:s.slice(0,n).trim(),value:s.slice(n+1)}):t.env.length&&(t.env[t.env.length-1].value+=" "+s)}}return t}function ne(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)("form"),[o,r]=(0,n.useState)(()=>(e.unit_name||"").replace(/\.service$/i,"")),[c,l]=(0,n.useState)({description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target",env:[]}),[d,u]=(0,n.useState)(""),[h,j]=(0,n.useState)(""),[w,v]=(0,n.useState)(!1),[k,S]=(0,m.fp)(f.AG.confirm);(0,n.useEffect)(()=>{"edit"===e.mode&&e.unit_name&&(async()=>{v(!0);try{const t=await a.Yu.post("systemd/get/context",{unit_name:e.unit_name});if(t.code!==x.m.Success)return;const s=t.data.context??"",n=t.data.path??"";j(n),u(s),l(se(s))}finally{v(!1)}})()},[e.mode,e.unit_name]);const b=e=>{e!==s&&("text"===e?u(te(o,c)):l(se(d)),i(e))},C=e=>t=>{l(s=>({...s,[e]:t}))},A=(e,t,s)=>{l(n=>{const i=[...n.env];return i[e]={...i[e],[t]:s},{...n,env:i}})};return(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem",marginBottom:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat "+("form"===s?"":"button--grey"),onClick:()=>b("form"),children:t("表单")}),(0,y.jsx)("button",{className:"button button--flat "+("text"===s?"":"button--grey"),onClick:()=>b("text"),children:t("文本")})]}),w?(0,y.jsx)("div",{children:t("加载中...")}):"form"===s?(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.6rem"},children:[(0,y.jsx)(_.BC,{label:t("服务名称"),children:(0,y.jsx)(_.Sm,{placeholder:t("服务名称"),value:o,disabled:"edit"===e.mode,handleInputChange:e=>r(e),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("服务描述"),children:(0,y.jsx)(_.Sm,{placeholder:t("服务描述"),value:c.description,handleInputChange:C("description"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("启动命令"),required:!0,children:(0,y.jsx)(_.Sm,{placeholder:t("ExecStart 启动命令,必填"),value:c.exec_start,handleInputChange:C("exec_start"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("运行类型"),children:(0,y.jsx)(_.l6,{options:Q,value:c.type,onChange:C("type")})}),(0,y.jsx)(_.BC,{label:t("工作目录"),children:(0,y.jsx)(_.Sm,{placeholder:t("工作目录(可选)"),value:c.working_dir,handleInputChange:C("working_dir"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("运行用户"),children:(0,y.jsx)(_.Sm,{placeholder:t("运行用户(可选)"),value:c.user_,handleInputChange:C("user_"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("重启策略"),children:(0,y.jsx)(_.l6,{options:J,value:c.restart,onChange:C("restart")})}),(0,y.jsx)(_.BC,{label:t("安装目标"),children:(0,y.jsx)(_.l6,{options:ee,value:c.wanted,onChange:C("wanted")})}),(0,y.jsxs)("div",{className:"div-row",style:{justifyContent:"space-between"},children:[(0,y.jsx)("span",{children:t("环境变量")}),(0,y.jsx)("button",{className:"button button--flat button--grey",onClick:()=>l(e=>({...e,env:[...e.env,{key:"",value:""}]})),children:t("添加")})]}),0===c.env.length&&(0,y.jsx)("div",{className:"text-secondary",style:{fontSize:"0.85rem"},children:t("暂无环境变量")}),c.env.map((e,s)=>(0,y.jsxs)("div",{className:"div-row",style:{gap:"0.4rem"},children:[(0,y.jsx)(_.Sm,{placeholder:"KEY",value:e.key,width:"35%",handleInputChange:e=>A(s,"key",e)}),(0,y.jsx)(_.Sm,{placeholder:"value",value:e.value,width:"50%",handleInputChange:e=>A(s,"value",e)}),(0,y.jsx)("button",{className:"button button--flat button--grey",onClick:()=>(e=>{l(t=>({...t,env:t.env.filter((t,s)=>s!==e)}))})(s),children:t("删除")})]},s))]}):(0,y.jsx)(_.Z2,{style:{width:"100%",minHeight:"16rem",fontFamily:"monospace",fontSize:"0.85rem",boxSizing:"border-box"},value:d,onChange:e=>u(e.target.value),spellCheck:!1}),(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.4rem",marginTop:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat button--grey",disabled:w,onClick:e.onClose,children:t("取消")}),(0,y.jsx)("button",{className:"button button--flat",disabled:w,onClick:async()=>{if(!o.trim())return void(0,g.zN)(t("请填写服务名称"));const n=(i=o).trim().endsWith(".service")?i.trim():`${i.trim()}.service`;var i;const r="text"===s?d:te(n,c);if(r.includes("ExecStart=")){if("form"===s){if(c.env.find(e=>!e.key.trim()&&""!==(e.value??"").trim()))return void(0,g.zN)(t("环境变量的 KEY 不能为空"))}v(!0);try{if("create"===e.mode){const s=`/etc/systemd/system/${n}`;await a.Yu.post("systemd/sys/save",{unit_name:n,path:s,context:r}),await a.Yu.post("systemd/sys/enable",{unit_name:n}),await a.Yu.post("systemd/add",{unit_name:n}),(0,g.SK)(t("添加成功")),e.onClose(),e.onDone?.()}else await a.Yu.post("systemd/sys/save",{unit_name:n,path:h,context:r}),(0,g.SK)(t("保存成功")),e.onClose(),e.onDone?.(),S({open:!0,title:t("配置已保存,是否立即重启该服务让新配置生效?"),handle:async()=>{(await a.Yu.post("systemd/sys/restart",{unit_name:n})).code===x.m.Success&&((0,g.SK)(t("重启成功")),S({open:!1,handle:null}))}})}catch(e){console.error("systemd 保存失败",e)}finally{v(!1)}}else(0,g.zN)(t("请至少填写 ExecStart 启动命令"))},children:t("保存")})]})]})}let ie,oe="";function re(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[r,j]=(0,m.fp)(f.AG.systemd_shell_show),[w,v]=(0,m.fp)(f.AG.confirm),[k,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[A,V]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[P,Y]=(0,n.useState)([]),[F,N]=(0,n.useState)([]),[E,K]=(0,n.useState)([]),[M,B]=(0,n.useState)(!1),[H,Z]=(0,n.useState)([]),[G,D]=(0,n.useState)(""),[z,T]=(0,n.useState)(""),[W,X]=(0,n.useState)(new Set),[q,U]=(0,m.fp)(f.AG.editorSetting),[L,R]=(0,m.fp)(f.AG.prompt_card);(0,n.useEffect)(()=>{T(oe),(async()=>{Y([]),K([]);const e=new c.hf(c.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(c.HK.systemd_inside_getting,e=>{const t=[];if(oe){for(const s of e.context)for(const e of s)if(`${e}`.includes(oe)){t.push(s);break}}else t.push(...e.context);Y(t.map(e=>{const t=e.map((e,t)=>(0,y.jsx)(o.xP,{context:4===t?(0,$.v7)(e):e}));return t.push((0,y.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{K(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{oe=z},[z]);const J=e=>{if(r.show){j({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else j({show:!0,unit_name:e})},Q=async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/restart",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("重启成功")),v({open:!1,handle:null}))}})},ee=async()=>{N([]),Z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==x.m.Success)return;X(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===x.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,y.jsx)(o.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,y.jsx)(o.xP,{context:t.description})];s.push([...e,(0,y.jsx)(u.rA,{icon:"place",title:"添加",onClick:()=>{Z([...e])}})])}ie=s,N(s)}},te=(e,s)=>{R({open:!0,title:t("create"===e?"新建 systemd 服务":"编辑 systemd 服务"),context_div:(0,y.jsx)(ne,{mode:e,unit_name:s,onClose:()=>R({open:!1}),onDone:()=>{R({open:!1}),l.ws.send(new c.hf(c.HK.systemd_inside_get)),M&&ee(),K([]),Z([])}})})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{children:(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{B(e),e?(ee(),K([])):Z([])}})}),(0,y.jsxs)(d.aZ,{position:"right",children:[s(b.oV.systemd)&&(0,y.jsx)("div",{children:(0,y.jsx)(u.rA,{icon:"add_circle",title:t("添加 systemd"),onClick:()=>{te("create")}})}),E.length>0&&(0,y.jsx)("div",{children:E[1].props.context}),H.length>0&&(0,y.jsx)("div",{children:H[0].props.context}),E.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"remove",title:"从实时监控删除",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("删除成功")),v({open:!1,handle:null}))}})})(E[1].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"edit",title:"可视化编辑",onClick:()=>{te("edit",E[1].props.context)}}),s(b.oV.systemd)&&W.has(E[1].props.context)&&(0,y.jsx)(u.rA,{icon:"restart_alt",title:t("重启服务"),onClick:()=>{Q(E[1].props.context)}}),(0,y.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(E[1].props.context)}})]}),H.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("删除成功")),v({open:!1,handle:null}))}})})(H[0].props.context)}}),(0,y.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(H[0].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"restart_alt",title:t("重启服务"),onClick:()=>{Q(H[0].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===x.m.Success&&(U({model:"text",open:!0,fileName:e.name,save:async e=>{const n={unit_name:t,path:s.data.path,context:e};(await a.Yu.post("systemd/sys/save",n)).code===x.m.Success&&S.xK.set_value_temp("")}}),S.xK.set_value_temp(s.data.context))})(H[0].props.context)}}),s(b.oV.systemd)&&!W.has(H[0].props.context)&&(0,y.jsx)(u.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const s=await a.Yu.post("systemd/add",{unit_name:e});s.code===x.m.Success&&(X(new Set(s.data)),(0,g.SK)(t("添加成功")))})(H[0].props.context)})]})]}),(0,y.jsxs)(i.xh,{children:[M&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`systemd系统单元(${F.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:"过滤单元",value:G,handleInputChange:e=>{D(e)},handlerEnter:()=>{const e=[];if(G){for(const t of ie)(t[0].props.context.includes(G)||t[3].props.context.includes(G))&&e.push(t);N(e)}else N(ie)}}),children:(0,y.jsx)(h.X,{headers:A,rows:F,width:"10rem"})})})}),0===P.length&&!M&&(0,y.jsx)(I.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==P.length&&!M&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`filecat监控单元(${P.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{T(e)}}),children:(0,y.jsx)(h.X,{headers:k,rows:P,width:"10rem"})})})})]}),(0,y.jsx)(O,{})]})}function ce(){const{t:e}=(0,p.Bd)(),t=[{title:e("放行"),value:"allow"},{title:e("拒绝"),value:"deny"},{title:e("限速"),value:"limit"},{title:e("拒绝响应"),value:"reject"}],s=[{title:e("入站"),value:"in"},{title:e("出站"),value:"out"}],[r,c]=(0,n.useState)(null),[l,j]=(0,n.useState)("allow"),[w,v]=(0,n.useState)("in"),[k,S]=(0,n.useState)("tcp"),[b,C]=(0,n.useState)(""),[A,V]=(0,n.useState)(""),[P,$]=(0,n.useState)("list"),[Y,F]=(0,n.useState)([]),[N,E]=(0,n.useState)(""),[K,M]=(0,n.useState)(!1),[B,H]=(0,m.fp)(f.AG.confirm),Z=async()=>{try{const e=await a.V_.get("status");e.code===x.m.Success&&c(e.data)}catch(e){}},G=async()=>{M(!0);try{const e=await a.V_.get("rules");if(e.code===x.m.Success){const t=e.data;F(t?.rules??[]),E(t?.raw??"")}}catch(e){F([]),E("")}finally{M(!1)}};(0,n.useEffect)(()=>{Z(),G()},[]);const D=!0===r?.installed,z=!0===r?.active;return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[(0,y.jsxs)("div",{children:[e("已安装"),": ",D?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"red"},children:"✗"})]}),(0,y.jsxs)("div",{children:[e("已启用"),": ",z?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"gray"},children:"✗"})]}),D&&(0,y.jsx)(u.rA,{icon:"power_settings_new",title:e(z?"停用":"启用"),onClick:()=>(async t=>{try{const s=await a.V_.post("enable",{enabled:t});if(s.code!==x.m.Success)return void(0,g.zN)(s.message||e("操作失败"));(0,g.SK)(s.data||e(t?"已启用":"已停用")),Z(),G()}catch(e){}})(!z)}),(0,y.jsx)(u.rA,{icon:"refresh",title:e("刷新规则"),onClick:G})]}),(0,y.jsxs)(i.xh,{children:[(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:35,children:(0,y.jsxs)(o.uF,{title:e("添加ufw规则"),rightTopCom:(0,y.jsx)(u.rA,{icon:"add",title:e("添加"),onClick:async()=>{if(b.trim())try{const t=await a.V_.post("rule/add",{action:l,direction:w,proto:k,port:b.trim(),from:"in"===w&&A.trim()||void 0});if(t.code!==x.m.Success)return void(0,g.zN)(t.message||e("操作失败"));(0,g.SK)(t.data||e("已添加")),G()}catch(e){}else(0,g.zN)(e("请填写端口号"))}}),children:[(0,y.jsx)(_.BC,{label:e("动作"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:t,value:l,onChange:e=>j(e),defaultValue:"allow"})}),(0,y.jsx)(_.BC,{label:e("方向"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:s,value:w,onChange:e=>v(e),defaultValue:"in"})}),(0,y.jsx)(_.BC,{label:e("协议"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:[{title:"tcp",value:"tcp"},{title:"udp",value:"udp"}],value:k,onChange:e=>S(e),defaultValue:"tcp"})}),(0,y.jsx)(_.BC,{label:e("端口"),label_width:"4rem",required:!0,children:(0,y.jsx)(_.Sm,{maxWidth:"20rem",placeholder:e("可填范围如 1000:2000"),value:b,handleInputChange:e=>C(e)})}),"in"===w&&(0,y.jsx)(_.BC,{label:e("来源"),label_width:"4rem",children:(0,y.jsx)(_.Sm,{maxWidth:"20rem",placeholder:e("IP/网段,可选"),value:A,handleInputChange:e=>V(e)})})]})})}),(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsxs)(o.uF,{title:e("规则列表"),rightTopCom:(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,y.jsx)(u.C3,{text:e("名单视图"),clickFun:()=>$("list")}),(0,y.jsx)(u.C3,{text:e("文本视图"),clickFun:()=>$("text")})]}),children:[K&&(0,y.jsx)(I.h,{context:e("加载中...")}),!K&&"list"===P&&(0===Y.length?(0,y.jsx)(I.h,{context:e("暂无规则")}):(0,y.jsx)(h.X,{headers:[e("编号"),e("目标(To)"),e("动作"),e("fw_from"),e("备注"),e("操作")],rows:Y.map(t=>[t.number,(0,y.jsx)(o.xP,{context:t.to,tip_context:t.to}),t.action,t.from?(0,y.jsx)(o.xP,{context:t.from,tip_context:t.from}):"",t.description||"",(0,y.jsx)(u.rA,{icon:"delete",title:e("删除规则"),onClick:()=>(async(t,s,n)=>{H({open:!0,title:e("确定删除吗?"),sub_title:e(`${s} ${n}`),handle:async()=>{try{const s=await a.V_.post("ufw/rule/del",{number:t});if(s.code!==x.m.Success)return void(0,g.zN)(s.message||e("操作失败"));(0,g.SK)(s.data||e("规则已删除")),H({open:!1,handle:null}),G()}catch(e){}}})})(t.number,t.to,t.from)})]),width:"8rem"})),!K&&"text"===P&&(N?(0,y.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontSize:"0.85rem",margin:0},children:N}):(0,y.jsx)(I.h,{context:e("暂无规则")}))]})})})]})]})}function le(e){const{t}=(0,p.Bd)(),[s,n]=(0,m.fp)(f.AG.user_base_info),o=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,y.jsx)(F,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,y.jsx)(L,{})},{index:3,name:t("doc_ct"),rto:"docker/",component:(0,y.jsx)(T,{})}];if(s.sys===b.XM.linux){(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.systemd))&&o.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,y.jsx)(re,{})});(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.firewall))&&s.sysSoftWare?.[j.jk.ufw]?.installed&&o.push({index:5,name:t("防火墙"),rto:"firewall/",component:(0,y.jsx)(ce,{})})}return(0,y.jsx)(i.W1,{optionList:o,father_route:Z.o.info})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9546],{75007(e,t,s){s.d(t,{h:()=>o});s(96540);var n=s(85997),i=s(74848);function o(e){return(0,i.jsxs)("h2",{className:"message",children:[(0,i.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,i.jsx)("span",{children:e.context})]})}},22081(e,t,s){s.d(t,{A:()=>r});var n=s(96540),i=s(16349),o=s(74848);const r=({percentage:e})=>{const t=(0,n.useRef)(null),[s,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new i.Ay(s,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return r(n),()=>{n.destroy()}},[]),(0,n.useEffect)(()=>{s&&(s.data.datasets[0].data=[e,100-e],s.update())},[e]),(0,o.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,o.jsx)("canvas",{ref:t})})}},77481(e,t,s){s.d(t,{S:()=>c,X:()=>r});var n=s(96540),i=s(61443),o=s(74848);function r(e){const[t,s]=n.useState([]),r=(0,n.useRef)(-1),[c,l]=(0,n.useState)(-1),[a,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const u=()=>{r.current=-1,l(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let r=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(r=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(i.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):t},s)})})}),(0,o.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(c===s?"row-dragging":"")+(a===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(r.current=s,l(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=r.current,s=a;u(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:u,children:t.map((s,n)=>{const i=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:i,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function c(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},88062(e,t,s){s.d(t,{A:()=>r});s(96540),s(47022);var n=s(74848);function i(e){return(0,n.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(t,e)},children:e.name})}const o=e=>(0,n.jsxs)("li",{children:[e.click?(0,n.jsx)(i,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,n.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,n.jsx)("ul",{children:e.node.children.map((t,s)=>(0,n.jsx)(o,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),r=e=>(0,n.jsx)("div",{className:"card-tree-view",children:(0,n.jsx)("ul",{children:e.list&&e.list.map((t,s)=>(0,n.jsx)(o,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})})},59546(e,t,s){s.r(t),s.d(t,{default:()=>le});var n=s(96540),i=s(75725),o=s(70447),r=s(22081),c=s(92275),l=s(14944),a=s(14284),d=s(4412),u=s(85997),h=s(77481),x=s(53459),p=s(22022),m=s(34843),f=s(82893),j=s(74777),g=s(62042),_=s(61443),y=s(74848);function w(e){const{t}=(0,p.Bd)(),[s,r]=(0,m.fp)(f.AG.disk),[c,l]=(0,n.useState)({}),[j,g]=(0,n.useState)([]),_=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===x.m.Success){const e=[];for(const n of s.data.ata_smart_attributes??[]){let s;n[1]>=n[2]?s="var(--icon-green)":n[1]<=n[3]&&(s="var(--icon-red)"),n[0]=(0,y.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}g(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{position:"right",children:(0,y.jsx)(u.rA,{icon:"close",title:t("关闭"),onClick:()=>{r({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{widthPer:30,children:[(0,y.jsx)(i.xh,{children:(0,y.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("名字"),right:e.name}),(0,y.jsx)(i.Yh,{left:t("厂商名称"),right:e.typeName}),(0,y.jsx)(i.Yh,{left:t("类型"),right:e.type}),(0,y.jsx)(i.Yh,{left:t("容量"),right:e.total})]})}),(0,y.jsx)(i.xh,{children:(0,y.jsxs)(o.Zp,{title:t("物理信息"),children:[(0,y.jsx)(i.Yh,{left:t("是否健康"),right:!0===c.smart_status?"是":"否"}),(0,y.jsx)(i.Yh,{left:t("设备型号"),right:c.model_name}),(0,y.jsx)(i.Yh,{left:t("序列号"),right:c.serial_number}),(0,y.jsx)(i.Yh,{left:t("固件版本"),right:c.firmware_version}),(0,y.jsx)(i.Yh,{left:t("转速(每分钟)"),right:c.rotation_rate}),(0,y.jsx)(i.Yh,{left:t("通电时长(小时)"),right:c.power_on_time_hours}),(0,y.jsx)(i.Yh,{left:t("通电次数"),right:c.power_cycle_count}),(0,y.jsx)(i.Yh,{left:t("温度(°C)"),right:c.temperature}),(0,y.jsx)(i.Yh,{left:t("通信协议"),right:c.device_protocol})]})})]}),(0,y.jsx)(i.VP,{widthPer:50,children:(0,y.jsxs)(i.xh,{children:[j?.length?(0,y.jsx)(o.uF,{title:t("ATA/SATA详细信息"),children:(0,y.jsx)(h.X,{headers:_,rows:j,width:"10rem"})}):(0,y.jsx)(y.Fragment,{}),c.nvme_smart?(0,y.jsxs)(o.Zp,{title:t("NVME详细信息"),children:[(0,y.jsx)(i.Yh,{left:t("NVMe 可用备用块(%)"),right:c.nvme_smart.available_spare}),(0,y.jsx)(i.Yh,{left:t("NVMe 已使用寿命(%)"),right:c.nvme_smart.percentage_used}),(0,y.jsx)(i.Yh,{left:t("NVMe 读取量"),right:c.nvme_smart.data_units_read}),(0,y.jsx)(i.Yh,{left:t("NVMe 写入量"),right:c.nvme_smart.data_units_written}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电次数"),right:c.nvme_smart.power_cycles}),(0,y.jsx)(i.Yh,{left:t("NVMe 通电时长(小时)"),right:c.nvme_smart.power_on_hours}),(0,y.jsx)(i.Yh,{left:t("NVMe 非正常关机"),right:c.nvme_smart.unsafe_shutdowns}),(0,y.jsx)(i.Yh,{left:t("NVMe 媒体错误"),right:c.nvme_smart.media_errors}),(0,y.jsx)(i.Yh,{left:t("NVMe 错误日志数"),right:c.nvme_smart.num_err_log_entries})]}):(0,y.jsx)(y.Fragment,{})]})})]})})})]})}let v=function(e){return e[e.mount=0]="mount",e}({});var k=s(88062),S=s(78247),b=s(23430),C=s(99214);const A=e=>(0,y.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,y.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function V(){return(0,y.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}})})}function P(){const{t:e}=(0,p.Bd)(),[t,s]=(0,m.fp)(f.AG.disk),[r,c]=(0,n.useState)({}),[l,j]=(0,n.useState)([]),[_,w]=(0,n.useState)([]),[P,$]=(0,m.fp)(f.AG.showPrompt),{check_user_auth:Y}=(0,S.MH)(),[F,I]=(0,n.useState)([]),{click_file:N}=(0,C.kZ)(),[E,K]=(0,m.fp)(f.AG.prompt_card),M=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],B=async()=>{const e=await a.Yu.get("disk/blk");return e.code===x.m.Success&&j(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{B()})()},[]);const H=[(0,y.jsx)(u.rA,{icon:"info",title:e("提示"),onClick:async()=>{K({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,y.jsxs)("li",{children:["文件系统,有多种格式",(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,y.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,y.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,y.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,y.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,y.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,y.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,y.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,y.jsx)("li",{children:"rw:以读写方式挂载"}),(0,y.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,y.jsx)("li",{children:"...等"})]})]}),(0,y.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,y.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,y.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,y.jsx)(u.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:v.mount})).code===x.m.Success&&(0,g.SK)(e("挂载文件已生效"))}},1)],Z=async()=>(await a.Yu.get("get_fstab")).data,G=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{position:"right",children:(0,y.jsx)(u.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,y.jsx)(i.jW,{isFull:!0,more:!0,children:(0,y.jsx)(i.NN,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:40,children:(0,y.jsxs)(o.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),rightTopCom:(0,y.jsxs)("div",{children:[Y(b.oV.sys_disk_mount)&&(0,y.jsx)(u.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{N({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:Z,save_file_fun:G,menu_list:H})}}),(0,y.jsx)(u.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await B()===x.m.Success&&(0,g.SK)(e("刷新成功"))}})]}),children:[(0,y.jsx)(h.X,{headers:M,rows:_,width:"10rem"}),(0,y.jsx)(k.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,y.jsxs)("span",{children:[t,(0,y.jsx)("span",{style:{color:"green"},children:"(已挂载)"})]}):t},onContextMenu:(e,t)=>{e.preventDefault()},click:t=>{let s="";if(t.mountpoint)for(let e=0;e<t.mountpoints.length;e++)s+=t.mountpoints[e]+";";w([[(0,y.jsx)(o.xP,{children:s}),(0,y.jsx)(o.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,y.jsx)(o.xP,{children:t.path}),t.pttype]])}})]})}),(0,y.jsx)(i.VP,{widthPer:60,children:F.map((t,s)=>{const n=[];for(const e of t.pv_list)n.push({name:`${e.name}---(${e.size})---(${e.free_size})`});const r=[];for(const e of t.lv_list)r.push({name:`${e.name}---(${e.size})`});return(0,y.jsx)(o.Zp,{children:(0,y.jsxs)(i.n5,{children:[(0,y.jsx)(A,{name:e("物理卷"),lvms:n}),(0,y.jsx)(V,{}),(0,y.jsx)(A,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,y.jsx)(V,{}),(0,y.jsx)(A,{name:e("逻辑卷"),lvms:r})]})},s)})})]})})})]})}var $=s(88815);let Y=!0;function F(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],_=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[v,k]=(0,m.fp)(f.AG.user_base_info),[S,C]=(0,n.useState)(0),[A,V]=(0,n.useState)(0),[F,I]=(0,n.useState)(0),[N,E]=(0,n.useState)(0),[K,M]=(0,n.useState)(0),[B,H]=(0,n.useState)({}),[Z,G]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[T,W]=(0,n.useState)(!1),[X,q]=(0,n.useState)(Y),[U,L]=(0,n.useState)(null),[R,O]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[ee,te]=(0,m.fp)(f.AG.user_base_info),[se,ne]=(0,m.fp)(f.AG.disk),ie=async()=>{Y&&(await l.ws.addMsg(c.HK.sys_getting,e=>{E(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;V(t),I(s),C((s-t)/s*100),L(e.context?.node_memory_usage),M(e.context?.node_cpu_usage)}),await l.ws.send(new c.hf(c.HK.sys_get)))};return(0,n.useEffect)(()=>((async()=>{await ie()})(),()=>{l.ws.sendData(c.HK.sys_cancel,{})}),[]),(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[v.sys===b.XM.linux&&(0,y.jsx)(u.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{G(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===x.m.Success){const t=e.data;H(t)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===x.m.Success){const s=e.data,n=[];let i=!0;ee.sysSoftWare&&ee.sysSoftWare[j.jk.smartmontools]&&ee.sysSoftWare[j.jk.smartmontools].installed||(i=!1);for(const e of s??[])n.push([(0,y.jsx)(o.xP,{context:e.name}),e.typeName,e.type,e.total,(0,y.jsx)(u.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{i?ne({type:"check",data:e}):(0,g.zN)(t("没有安装smartmontools"))}})]);O(n)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{W(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===x.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,y.jsx)(o.xP,{context:e.name}),(0,y.jsx)(o.xP,{context:e.device_name}),e.fsType,(0,y.jsx)(o.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,y.jsx)(u.Z$,{defaultStatus:X,text:t("实时信息"),clickFun:e=>{q(e),Y=e,ie()}})]}),(0,y.jsxs)(i.xh,{children:[X&&(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"Sys "+t("内存"),children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.A,{percentage:S})}),(0,y.jsx)(i.VP,{children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)("div",{children:(0,y.jsx)(i.Yh,{left:t("总容量"),center:`${F}G`})})}),(0,y.jsx)(i.VP,{widthPer:100,children:(0,y.jsx)(i.Yh,{left:t("剩余"),center:`${A}G`})})]})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"Sys cpu",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsx)(i.VP,{children:(0,y.jsx)(r.A,{percentage:N})}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.Yh,{left:t("使用率"),center:N})})})]})})}),(0,y.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,y.jsx)(o.Zp,{title:"FileCat",children:(0,y.jsxs)(i.fI,{children:[(0,y.jsxs)(i.VP,{children:[(0,y.jsx)(i.qV,{content:t("内存")}),(0,y.jsx)(i.qV,{content:"total: "+(0,$.v7)(U?.rss)}),(0,y.jsx)(i.qV,{content:"object: "+(0,$.v7)(U?.heapTotal)}),(0,y.jsx)(i.qV,{content:"obj-use: "+(0,$.v7)(U?.heapUsed)}),(0,y.jsx)(i.qV,{content:"external: "+(0,$.v7)(U?.external)}),(0,y.jsx)(i.qV,{content:"buffer: "+(0,$.v7)(U?.arrayBuffers)})]}),(0,y.jsx)(i.VP,{children:(0,y.jsx)(i.qV,{content:"cpu growth rate: "+K})})]})})})]}),(0,y.jsxs)(i.fI,{children:[Z&&(0,y.jsx)(i.VP,{children:(0,y.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,y.jsx)(i.Yh,{left:t("总内存"),right:B.mem_total}),(0,y.jsx)(i.Yh,{left:`cpu ${t("制造商")}`,right:B.cpu_manufacturer}),(0,y.jsx)(i.Yh,{left:`cpu ${t("品牌")}`,right:B.cpu_brand}),(0,y.jsx)(i.Yh,{left:`cpu ${t("逻辑核心")}`,right:B.cpu_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("物理核心")}`,right:B.cpu_phy_core_num}),(0,y.jsx)(i.Yh,{left:`cpu ${t("最大")}hz`,right:B.cpu_speed_hz}),(0,y.jsx)(i.Yh,{left:`${t("当前系统")}:pid;ppid`,right:B.pid_ppid}),(0,y.jsx)(i.Yh,{left:t("运行用户"),right:B.user})]})}),D&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(o.uF,{title:t("物理硬盘"),children:(0,y.jsx)(h.X,{headers:s,rows:R,width:"10rem"})})}),T&&(0,y.jsx)(i.VP,{children:(0,y.jsx)(o.uF,{title:t("文件硬盘"),children:(0,y.jsx)(h.X,{headers:_,rows:J,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,y.jsx)(w,{...se.data}),se&&"mount"===se.type&&(0,y.jsx)(P,{})]})}var I=s(75007),N=s(97856),E=s(64405);const K=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function M(e){const[t,s]=(0,n.useState)(null),[i,o]=(0,m.fp)(f.AG.dockerShellShow),[r,a]=(0,m.fp)(f.AG.user_base_info),d=r.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{i.show?(async()=>{const e=new N.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});let t;l.ws.subscribeUnconnect(u);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===i.type?c.HK.docker_shell_logs_getting:c.HK.docker_shell_exec_getting,e=>{"error"===e.context&&u(),t(e.context)}),"exec"===i.type&&e.onData(async e=>{const t=new c.hf(c.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():u()},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,y.jsx)(K,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n=new E.n;let o;n.rows=e,n.cols=s,n.dockerId=i.dockerId,o="logs"===i.type?new c.hf(c.HK.docker_shell_logs):new c.hf(c.HK.docker_shell_exec_open),o.context=n,l.ws.send(o)}})}var B=s(78150),H=s(52671),Z=s(87361);let G="",D=[],z=!1;function T(e){const{t}=(0,p.Bd)(),s=(0,H.Zp)(),[r]=(0,m.fp)(f.AG.user_base_info),[j,w]=(0,n.useState)({}),[v,k]=(0,n.useState)([]),[C,A]=(0,n.useState)([]),{check_user_auth:V}=(0,S.MH)(),[P,$]=(0,m.fp)(f.AG.dockerShellShow),[Y,F]=(0,m.fp)(f.AG.showPrompt),[N,E]=(0,m.fp)(f.AG.confirm),[K,T]=(0,n.useState)(G),[W,X]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[q,U]=(0,n.useState)([]),[L,R]=(0,n.useState)(void 0),[O,J]=(0,n.useState)(!1),Q=["id",t("name"),t("create时间"),t("大小"),(0,y.jsxs)("span",{children:["选中",(0,y.jsx)(u.rA,{icon:"check_box",title:"全选",onClick:()=>{z=!z;const e={};for(let t=0;t<C.length&&z;t++)e[C[t][0].props.context]=1;w(e)}})]})],ee=(0,n.useRef)(()=>{}),te=async()=>{k([]),U([]),l.ws.off_message(`message_${c.HK.docker_getting}`,ee.current);const e=e=>{k((e=>{const t=[];if(G){for(const s of e)for(const e of s)if(`${e}`.includes(G)){t.push(s);break}}else t.push(...e);return t.map(e=>{const t=e.map(e=>(0,y.jsx)(o.xP,{context:e}));return t.push((0,y.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{U(t)}})),t})})(e.context??[]))};ee.current=e,l.ws.addMsg(c.HK.docker_getting,e);const t=new c.hf(c.HK.docker_get);await l.ws.send(t)};(0,n.useEffect)(()=>(T(G),te(),()=>{(async()=>{l.ws.off_message(`message_${c.HK.docker_getting}`,ee.current),$({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{G=K},[K]);const se=()=>{const e=new c.hf("logs"===P.type?c.HK.docker_shell_logs_cancel:c.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},ne=e=>{const t=new c.hf(c.HK.docker_switch);t.context={type:e,dockerId:q[0].props.context},U([]),l.ws.send(t)},ie=async()=>{const e=await a.Yu.get("docker/images");if(e.code===x.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],i=[(0,y.jsx)(o.xP,{context:n[0]}),(0,y.jsx)(o.xP,{context:n[1]}),n[2],n[3],""];s.push(i)}D=s,A(s)}};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{children:(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("doc_img"),clickFun:e=>{J(e),e?(ie(),U([])):(te(),A([]),w({}))}})}),(0,y.jsxs)(d.aZ,{position:"right",children:[r.sys===b.XM.linux&&(0,y.jsx)(u.rA,{icon:"settings",title:t("doc_cfg"),onClick:()=>s(Z.o.docker_setting_page)}),Object.keys(j).length>0&&(0,y.jsx)(u.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{E({open:!0,title:t("doc_icf"),handle:async()=>{const e=Object.keys(j),s=await a.Yu.post("docker/check/delete",{ids:e});if(s.code===x.m.Success)if(0===s.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===x.m.Success&&((0,g.SK)(t("删除完成")),ie(),E({open:!1,handle:null}))}else(0,g.N9)(`有镜像正在运行${JSON.stringify(s.data)}`)}})}}),q.length>0&&(0,y.jsx)("div",{children:q[1].props.context}),q.length>0&&(0,y.jsxs)("div",{children:[V(b.oV.docker_container_update)&&(0,y.jsx)(u.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{F({show:!0,overlay:!0,type:B.PromptEnum.DockerDel,data:{dockerId:q[0].props.context,name:q[1].props.context}})}}),(0,y.jsx)(u.rA,{icon:"print",title:t("打印日志"),onClick:()=>{P.show?($({show:!1,type:"",dockerId:""}),se()):$({show:!0,dockerId:q[0].props.context,type:"logs"})}}),V(b.oV.docker_container_update)&&(0,y.jsx)(u.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{P.show?($({show:!1,type:"",dockerId:""}),se()):$({show:!0,dockerId:q[0].props.context,type:"exec"})}}),V(b.oV.docker_container_update)&&q[4].props.context.includes("Up")&&(0,y.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>ne("stop")}),V(b.oV.docker_container_update)&&!q[4].props.context.includes("Up")&&(0,y.jsx)(u.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{ne("start")}})]}),(0!==v.length||K)&&!O&&(0,y.jsx)(u.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new c.hf(c.HK.docker_get);await l.ws.send(e)}})]}),(0,y.jsxs)(i.xh,{children:[O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("镜像")} (${C.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤镜像"),value:L,handleInputChange:e=>{R(e)},handlerEnter:()=>{const e=[];if(L){for(const t of C)(t[0].props.context.includes(L)||t[1].props.context.includes(L))&&e.push(t);A(e)}else A(D)}}),children:(0,y.jsx)(h.X,{headers:Q,rows:C.map((e,s)=>(e[4]=(0,y.jsx)(_.GL,{context:t(""),selected:j[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,j),t[e]?delete t[e]:t[e]=1,w(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===v.length&&!K&&!O&&(0,y.jsx)(I.h,{context:t("dc_nne")}),(0!==v.length||K)&&!O&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("容器")} (${v.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤"),value:K,handleInputChange:e=>{T(e)}}),children:(0,y.jsx)(h.X,{headers:W,rows:v,width:"10rem"})})})})]}),(0,y.jsx)(M,{})]})}var W=s(64694);let X="",q=!1,U=!1;function L(e){const{t}=(0,p.Bd)(),[s,r]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[m,f]=(0,n.useState)(0),[j,g]=(0,n.useState)(""),[w,v]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,y.jsxs)("span",{children:[t("内存"),(0,y.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{q=!q}})]}),(0,y.jsxs)("span",{children:["cpu%",(0,y.jsx)(u.rA,{icon:"sort",title:t("升序"),onClick:()=>{U=!U}})]}),t("选择")]),{check_user_auth:k}=(0,S.MH)();(0,n.useEffect)(()=>{g(X),(async()=>{r([]),f(0),x([]);const e=new c.hf(c.HK.process_get);await l.ws.send(e),l.ws.addMsg(c.HK.process_getting,e=>{const s=[];if(X){for(const t of e.context)for(const e of t)if(`${e}`.includes(X)){s.push(t);break}}else s.push(...e.context);q&&(0,W.di)(s,e=>e[3],!1),U&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,y.jsx)(o.xP,{context:3===t?(0,$.v7)(e):e}));return s.push((0,y.jsx)(u.rA,{icon:"place",title:t("选中"),onClick:()=>{x(s)}})),s});f(s.length),r(n)})})()},[]),(0,n.useEffect)(()=>{X=j},[j]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[a.length>0&&(0,y.jsx)("div",{children:a[1].props.context}),a.length>0&&k(b.oV.sys_process_close)&&(0,y.jsx)("div",{children:(0,y.jsx)(u.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new c.hf(c.HK.process_close);e.context={pid:a[0].props.context},x([]),l.ws.send(e)}})})]}),(0,y.jsx)(i.xh,{children:0!==s.length||X?(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`${t("进程")} (${m})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:t("过滤"),value:j,handleInputChange:e=>{g(e)}}),children:(0,y.jsx)(h.X,{headers:w,rows:s,width:"10rem"})})})}):(0,y.jsx)(I.h,{context:t("ld_wait")})})]})}const R=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function O(e){const[t,s]=(0,n.useState)(null),[i,o]=(0,m.fp)(f.AG.systemd_shell_show),[r,a]=(0,m.fp)(f.AG.user_base_info),d=r.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",u=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!i.show)return void u();(async()=>{const e=new N.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});l.ws.subscribeUnconnect(u),l.ws.addMsg(c.HK.systemd_logs_getting,t=>{"error"===t.context&&u(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[i]),(0,n.useEffect)(()=>()=>{u()},[]);return(0,y.jsx)(R,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n={unit_name:i.unit_name},o=new c.hf(c.HK.systemd_logs_get);o.context=n,l.ws.send(o)}})}const J=[{title:"no(不自动重启)",value:"no"},{title:"always(总是重启)",value:"always"},{title:"on-failure(失败才重启)",value:"on-failure"},{title:"on-abnormal(异常才重启)",value:"on-abnormal"}],Q=[{title:"simple",value:"simple"},{title:"forking",value:"forking"},{title:"oneshot",value:"oneshot"},{title:"notify",value:"notify"}],ee=[{title:"multi-user.target",value:"multi-user.target"},{title:"network.target",value:"network.target"}];function te(e,t){const s=[];s.push("[Unit]"),t.description.trim()?s.push(`Description=${t.description.trim()}`):s.push(`Description=${e}`),s.push(""),s.push("[Service]"),s.push(`Type=${t.type.trim()||"simple"}`),t.exec_start.trim()&&s.push(`ExecStart=${t.exec_start.trim()}`),t.working_dir.trim()&&s.push(`WorkingDirectory=${t.working_dir.trim()}`),t.user_.trim()&&s.push(`User=${t.user_.trim()}`);for(const e of t.env){const t=e.key.trim();if(!t)continue;const n=e.value??"",i=`${t}=${n}`,o=/[\s"'\\]/.test(n);s.push(`Environment=${o?`"${i.replace(/"/g,'\\"')}"`:i}`)}return t.restart&&"no"!==t.restart&&s.push(`Restart=${t.restart.trim()}`),s.push(""),s.push("[Install]"),s.push(`WantedBy=${t.wanted.trim()||"multi-user.target"}`),s.push(""),s.join("\n")}function se(e){const t={description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target",env:[]},s=(t,s)=>{const n=e.split(/\r?\n/);let i=!1;for(const e of n){const n=e.trim(),o=n.match(/^\[(.*)\]$/);if(o){i=(o[1]||"").trim()===t;continue}if(!i)continue;const r=n.match(new RegExp(`^${s}\\s*=\\s*(.*)$`,"i"));if(r)return r[1].trim()}return""};t.description=s("Unit","Description"),t.type=s("Service","Type")||"simple",t.exec_start=s("Service","ExecStart"),t.working_dir=s("Service","WorkingDirectory"),t.user_=s("Service","User"),t.restart=s("Service","Restart")||"no",t.wanted=s("Install","WantedBy")||"multi-user.target";let n=!1;for(const s of e.split(/\r?\n/)){const e=s.trim(),i=e.match(/^\[(.*)\]$/);if(i){n="Service"===(i[1]||"").trim();continue}if(!n)continue;const o=e.match(/^Environment\s*=\s*(.*)$/i);if(!o)continue;const r=o[1].trim();if(!r)continue;const c=[];let l=0;for(;l<r.length;){const e=r[l];if(/\s/.test(e))l++;else if('"'===e||"'"===e){const t=e;l++;const s=l;for(;l<r.length&&r[l]!==t;)l++;c.push({text:r.slice(s,l),quoted:!0}),l++}else{const e=l;for(;l<r.length&&!/\s/.test(r[l]);)l++;c.push({text:r.slice(e,l),quoted:!1})}}for(const e of c){const s=e.text,n=s.indexOf("=");n>0?t.env.push({key:s.slice(0,n).trim(),value:s.slice(n+1)}):t.env.length&&(t.env[t.env.length-1].value+=" "+s)}}return t}function ne(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)("form"),[o,r]=(0,n.useState)(()=>(e.unit_name||"").replace(/\.service$/i,"")),[c,l]=(0,n.useState)({description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target",env:[]}),[d,u]=(0,n.useState)(""),[h,j]=(0,n.useState)(""),[w,v]=(0,n.useState)(!1),[k,S]=(0,m.fp)(f.AG.confirm);(0,n.useEffect)(()=>{"edit"===e.mode&&e.unit_name&&(async()=>{v(!0);try{const t=await a.Yu.post("systemd/get/context",{unit_name:e.unit_name});if(t.code!==x.m.Success)return;const s=t.data.context??"",n=t.data.path??"";j(n),u(s),l(se(s))}finally{v(!1)}})()},[e.mode,e.unit_name]);const b=e=>{e!==s&&("text"===e?u(te(o,c)):l(se(d)),i(e))},C=e=>t=>{l(s=>({...s,[e]:t}))},A=(e,t,s)=>{l(n=>{const i=[...n.env];return i[e]={...i[e],[t]:s},{...n,env:i}})};return(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem",marginBottom:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat "+("form"===s?"":"button--grey"),onClick:()=>b("form"),children:t("表单")}),(0,y.jsx)("button",{className:"button button--flat "+("text"===s?"":"button--grey"),onClick:()=>b("text"),children:t("文本")})]}),w?(0,y.jsx)("div",{children:t("加载中...")}):"form"===s?(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.6rem"},children:[(0,y.jsx)(_.BC,{label:t("服务名称"),children:(0,y.jsx)(_.Sm,{placeholder:t("服务名称"),value:o,disabled:"edit"===e.mode,handleInputChange:e=>r(e),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("服务描述"),children:(0,y.jsx)(_.Sm,{placeholder:t("服务描述"),value:c.description,handleInputChange:C("description"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("启动命令"),required:!0,children:(0,y.jsx)(_.Sm,{placeholder:t("ExecStart 启动命令,必填"),value:c.exec_start,handleInputChange:C("exec_start"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("运行类型"),children:(0,y.jsx)(_.l6,{options:Q,value:c.type,onChange:C("type")})}),(0,y.jsx)(_.BC,{label:t("工作目录"),children:(0,y.jsx)(_.Sm,{placeholder:t("工作目录(可选)"),value:c.working_dir,handleInputChange:C("working_dir"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("运行用户"),children:(0,y.jsx)(_.Sm,{placeholder:t("运行用户(可选)"),value:c.user_,handleInputChange:C("user_"),width:"100%"})}),(0,y.jsx)(_.BC,{label:t("重启策略"),children:(0,y.jsx)(_.l6,{options:J,value:c.restart,onChange:C("restart")})}),(0,y.jsx)(_.BC,{label:t("安装目标"),children:(0,y.jsx)(_.l6,{options:ee,value:c.wanted,onChange:C("wanted")})}),(0,y.jsxs)("div",{className:"div-row",style:{justifyContent:"space-between"},children:[(0,y.jsx)("span",{children:t("环境变量")}),(0,y.jsx)("button",{className:"button button--flat button--grey",onClick:()=>l(e=>({...e,env:[...e.env,{key:"",value:""}]})),children:t("添加")})]}),0===c.env.length&&(0,y.jsx)("div",{className:"text-secondary",style:{fontSize:"0.85rem"},children:t("暂无环境变量")}),c.env.map((e,s)=>(0,y.jsxs)("div",{className:"div-row",style:{gap:"0.4rem"},children:[(0,y.jsx)(_.Sm,{placeholder:"KEY",value:e.key,width:"35%",handleInputChange:e=>A(s,"key",e)}),(0,y.jsx)(_.Sm,{placeholder:"value",value:e.value,width:"50%",handleInputChange:e=>A(s,"value",e)}),(0,y.jsx)("button",{className:"button button--flat button--grey",onClick:()=>(e=>{l(t=>({...t,env:t.env.filter((t,s)=>s!==e)}))})(s),children:t("删除")})]},s))]}):(0,y.jsx)(_.Z2,{style:{width:"100%",minHeight:"16rem",fontFamily:"monospace",fontSize:"0.85rem",boxSizing:"border-box"},value:d,onChange:e=>u(e.target.value),spellCheck:!1}),(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.4rem",marginTop:"0.6rem"},children:[(0,y.jsx)("button",{className:"button button--flat button--grey",disabled:w,onClick:e.onClose,children:t("取消")}),(0,y.jsx)("button",{className:"button button--flat",disabled:w,onClick:async()=>{if(!o.trim())return void(0,g.zN)(t("请填写服务名称"));const n=(i=o).trim().endsWith(".service")?i.trim():`${i.trim()}.service`;var i;const r="text"===s?d:te(n,c);if(r.includes("ExecStart=")){if("form"===s){if(c.env.find(e=>!e.key.trim()&&""!==(e.value??"").trim()))return void(0,g.zN)(t("环境变量的 KEY 不能为空"))}v(!0);try{if("create"===e.mode){const s=`/etc/systemd/system/${n}`;await a.Yu.post("systemd/sys/save",{unit_name:n,path:s,context:r}),await a.Yu.post("systemd/sys/enable",{unit_name:n}),await a.Yu.post("systemd/add",{unit_name:n}),(0,g.SK)(t("添加成功")),e.onClose(),e.onDone?.()}else await a.Yu.post("systemd/sys/save",{unit_name:n,path:h,context:r}),(0,g.SK)(t("保存成功")),e.onClose(),e.onDone?.(),S({open:!0,title:t("配置已保存,是否立即重启该服务让新配置生效?"),handle:async()=>{(await a.Yu.post("systemd/sys/restart",{unit_name:n})).code===x.m.Success&&((0,g.SK)(t("重启成功")),S({open:!1,handle:null}))}})}catch(e){console.error("systemd 保存失败",e)}finally{v(!1)}}else(0,g.zN)(t("请至少填写 ExecStart 启动命令"))},children:t("保存")})]})]})}let ie,oe="";function re(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[r,j]=(0,m.fp)(f.AG.systemd_shell_show),[w,v]=(0,m.fp)(f.AG.confirm),[k,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[A,V]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[P,Y]=(0,n.useState)([]),[F,N]=(0,n.useState)([]),[E,K]=(0,n.useState)([]),[M,B]=(0,n.useState)(!1),[H,Z]=(0,n.useState)([]),[G,D]=(0,n.useState)(""),[z,T]=(0,n.useState)(""),[W,X]=(0,n.useState)(new Set),[q,U]=(0,m.fp)(f.AG.editorSetting),[L,R]=(0,m.fp)(f.AG.prompt_card);(0,n.useEffect)(()=>{T(oe),(async()=>{Y([]),K([]);const e=new c.hf(c.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(c.HK.systemd_inside_getting,e=>{const t=[];if(oe){for(const s of e.context)for(const e of s)if(`${e}`.includes(oe)){t.push(s);break}}else t.push(...e.context);Y(t.map(e=>{const t=e.map((e,t)=>(0,y.jsx)(o.xP,{context:4===t?(0,$.v7)(e):e}));return t.push((0,y.jsx)(u.rA,{icon:"place",title:"选中",onClick:()=>{K(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{oe=z},[z]);const J=e=>{if(r.show){j({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else j({show:!0,unit_name:e})},Q=async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/restart",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("重启成功")),v({open:!1,handle:null}))}})},ee=async()=>{N([]),Z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==x.m.Success)return;X(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===x.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,y.jsx)(o.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,y.jsx)(o.xP,{context:t.description})];s.push([...e,(0,y.jsx)(u.rA,{icon:"place",title:"添加",onClick:()=>{Z([...e])}})])}ie=s,N(s)}},te=(e,s)=>{R({open:!0,title:t("create"===e?"新建 systemd 服务":"编辑 systemd 服务"),context_div:(0,y.jsx)(ne,{mode:e,unit_name:s,onClose:()=>R({open:!1}),onDone:()=>{R({open:!1}),l.ws.send(new c.hf(c.HK.systemd_inside_get)),M&&ee(),K([]),Z([])}})})};return(0,y.jsxs)("div",{children:[(0,y.jsx)(d.aZ,{children:(0,y.jsx)(u.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{B(e),e?(ee(),K([])):Z([])}})}),(0,y.jsxs)(d.aZ,{position:"right",children:[s(b.oV.systemd)&&(0,y.jsx)("div",{children:(0,y.jsx)(u.rA,{icon:"add_circle",title:t("添加 systemd"),onClick:()=>{te("create")}})}),E.length>0&&(0,y.jsx)("div",{children:E[1].props.context}),H.length>0&&(0,y.jsx)("div",{children:H[0].props.context}),E.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"remove",title:"从实时监控删除",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("删除成功")),v({open:!1,handle:null}))}})})(E[1].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"edit",title:"可视化编辑",onClick:()=>{te("edit",E[1].props.context)}}),s(b.oV.systemd)&&W.has(E[1].props.context)&&(0,y.jsx)(u.rA,{icon:"restart_alt",title:t("重启服务"),onClick:()=>{Q(E[1].props.context)}}),(0,y.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(E[1].props.context)}})]}),H.length>0&&(0,y.jsxs)("div",{children:[s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===x.m.Success&&((0,g.SK)(t("删除成功")),v({open:!1,handle:null}))}})})(H[0].props.context)}}),(0,y.jsx)(u.rA,{icon:"print",title:"打印日志",onClick:()=>{J(H[0].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"restart_alt",title:t("重启服务"),onClick:()=>{Q(H[0].props.context)}}),s(b.oV.systemd)&&(0,y.jsx)(u.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===x.m.Success&&(U({model:"text",open:!0,fileName:e.name,save:async e=>{const n={unit_name:t,path:s.data.path,context:e};(await a.Yu.post("systemd/sys/save",n)).code===x.m.Success&&S.xK.set_value_temp("")}}),S.xK.set_value_temp(s.data.context))})(H[0].props.context)}}),s(b.oV.systemd)&&!W.has(H[0].props.context)&&(0,y.jsx)(u.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const s=await a.Yu.post("systemd/add",{unit_name:e});s.code===x.m.Success&&(X(new Set(s.data)),(0,g.SK)(t("添加成功")))})(H[0].props.context)})]})]}),(0,y.jsxs)(i.xh,{children:[M&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`systemd系统单元(${F.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:"过滤单元",value:G,handleInputChange:e=>{D(e)},handlerEnter:()=>{const e=[];if(G){for(const t of ie)(t[0].props.context.includes(G)||t[3].props.context.includes(G))&&e.push(t);N(e)}else N(ie)}}),children:(0,y.jsx)(h.X,{headers:A,rows:F,width:"10rem"})})})}),0===P.length&&!M&&(0,y.jsx)(I.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==P.length&&!M&&(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsx)(o.uF,{title:`filecat监控单元(${P.length})`,rightTopCom:(0,y.jsx)(_.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{T(e)}}),children:(0,y.jsx)(h.X,{headers:k,rows:P,width:"10rem"})})})})]}),(0,y.jsx)(O,{})]})}function ce(){const{t:e}=(0,p.Bd)(),t=[{title:e("放行"),value:"allow"},{title:e("拒绝"),value:"deny"},{title:e("限速"),value:"limit"},{title:e("拒绝响应"),value:"reject"}],s=[{title:e("入站"),value:"in"},{title:e("出站"),value:"out"}],[r,c]=(0,n.useState)(null),[l,j]=(0,n.useState)("allow"),[w,v]=(0,n.useState)("in"),[k,S]=(0,n.useState)("tcp"),[b,C]=(0,n.useState)(""),[A,V]=(0,n.useState)(""),[P,$]=(0,n.useState)("list"),[Y,F]=(0,n.useState)([]),[N,E]=(0,n.useState)(""),[K,M]=(0,n.useState)(!1),[B,H]=(0,m.fp)(f.AG.confirm),Z=async()=>{try{const e=await a.V_.get("status");e.code===x.m.Success&&c(e.data)}catch(e){}},G=async()=>{M(!0);try{const e=await a.V_.get("rules");if(e.code===x.m.Success){const t=e.data;F(t?.rules??[]),E(t?.raw??"")}}catch(e){F([]),E("")}finally{M(!1)}};(0,n.useEffect)(()=>{Z(),G()},[]);const D=!0===r?.installed,z=!0===r?.active;return(0,y.jsxs)("div",{children:[(0,y.jsxs)(d.aZ,{position:"right",children:[(0,y.jsxs)("div",{children:[e("已安装"),": ",D?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"red"},children:"✗"})]}),(0,y.jsxs)("div",{children:[e("已启用"),": ",z?(0,y.jsx)("span",{style:{color:"green"},children:"✓"}):(0,y.jsx)("span",{style:{color:"gray"},children:"✗"})]}),D&&(0,y.jsx)(u.rA,{icon:"power_settings_new",title:e(z?"停用":"启用"),onClick:()=>(async t=>{try{const s=await a.V_.post("enable",{enabled:t});if(s.code!==x.m.Success)return void(0,g.zN)(s.message||e("操作失败"));(0,g.SK)(s.data||e(t?"已启用":"已停用")),Z(),G()}catch(e){}})(!z)}),(0,y.jsx)(u.rA,{icon:"refresh",title:e("刷新规则"),onClick:G})]}),(0,y.jsxs)(i.xh,{children:[(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:35,children:(0,y.jsxs)(o.uF,{title:e("添加ufw规则"),rightTopCom:(0,y.jsx)(u.rA,{icon:"add",title:e("添加"),onClick:async()=>{if(b.trim())try{const t=await a.V_.post("rule/add",{action:l,direction:w,proto:k,port:b.trim(),from:"in"===w&&A.trim()||void 0});if(t.code!==x.m.Success)return void(0,g.zN)(t.message||e("操作失败"));(0,g.SK)(t.data||e("已添加")),G()}catch(e){}else(0,g.zN)(e("请填写端口号"))}}),children:[(0,y.jsx)(_.BC,{label:e("动作"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:t,value:l,onChange:e=>j(e),defaultValue:"allow"})}),(0,y.jsx)(_.BC,{label:e("方向"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:s,value:w,onChange:e=>v(e),defaultValue:"in"})}),(0,y.jsx)(_.BC,{label:e("协议"),label_width:"4rem",input_max_width:"8rem",children:(0,y.jsx)(_.l6,{options:[{title:"tcp",value:"tcp"},{title:"udp",value:"udp"}],value:k,onChange:e=>S(e),defaultValue:"tcp"})}),(0,y.jsx)(_.BC,{label:e("端口"),label_width:"4rem",required:!0,children:(0,y.jsx)(_.Sm,{maxWidth:"20rem",placeholder:e("可填范围如 1000:2000"),value:b,handleInputChange:e=>C(e)})}),"in"===w&&(0,y.jsx)(_.BC,{label:e("来源"),label_width:"4rem",children:(0,y.jsx)(_.Sm,{maxWidth:"20rem",placeholder:e("IP/网段,可选"),value:A,handleInputChange:e=>V(e)})})]})})}),(0,y.jsx)(i.fI,{children:(0,y.jsx)(i.VP,{widthPer:80,children:(0,y.jsxs)(o.uF,{title:e("规则列表"),rightTopCom:(0,y.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,y.jsx)(u.C3,{text:e("名单视图"),clickFun:()=>$("list")}),(0,y.jsx)(u.C3,{text:e("文本视图"),clickFun:()=>$("text")})]}),children:[K&&(0,y.jsx)(I.h,{context:e("加载中...")}),!K&&"list"===P&&(0===Y.length?(0,y.jsx)(I.h,{context:e("暂无规则")}):(0,y.jsx)(h.X,{headers:[e("编号"),e("目标(To)"),e("动作"),e("fw_from"),e("备注"),e("操作")],rows:Y.map(t=>[t.number,(0,y.jsx)(o.xP,{context:t.to,tip_context:t.to}),t.action,t.from?(0,y.jsx)(o.xP,{context:t.from,tip_context:t.from}):"",t.description||"",(0,y.jsx)(u.rA,{icon:"delete",title:e("删除规则"),onClick:()=>(async(t,s,n)=>{H({open:!0,title:e("确定删除吗?"),sub_title:e(`${s} ${n}`),handle:async()=>{try{const s=await a.V_.post("ufw/rule/del",{number:t});if(s.code!==x.m.Success)return void(0,g.zN)(s.message||e("操作失败"));(0,g.SK)(s.data||e("规则已删除")),H({open:!1,handle:null}),G()}catch(e){}}})})(t.number,t.to,t.from)})]),width:"8rem"})),!K&&"text"===P&&(N?(0,y.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontSize:"0.85rem",margin:0},children:N}):(0,y.jsx)(I.h,{context:e("暂无规则")}))]})})})]})]})}function le(e){const{t}=(0,p.Bd)(),[s,n]=(0,m.fp)(f.AG.user_base_info),o=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,y.jsx)(F,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,y.jsx)(L,{})},{index:3,name:t("doc_ct"),rto:"docker/",component:(0,y.jsx)(T,{})}];if(s.sys===b.XM.linux){(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.systemd))&&o.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,y.jsx)(re,{})});(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.firewall))&&s.sysSoftWare?.[j.jk.ufw]?.installed&&o.push({index:5,name:t("防火墙"),rto:"firewall/",component:(0,y.jsx)(ce,{})})}return(0,y.jsx)(i.W1,{optionList:o,father_route:Z.o.info})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9765],{59765(e){e.exports=JSON.parse('{"title":"FileCat","修改密码":"Change Password","自定义auth":"Custom Auth","tk_exp":"Token Expiration Time","目标":"Target","目标列表":"Targets","被同步的源目录":"Source dir to sync","成功":"Success","已开启":"Enabled","已关闭":"Disabled","sy_tp1":"Only small files are supported, such as config and code files","sy_tp2":"Files are not synced immediately by default, only after modification. With full sync enabled for a target, that client recursively syncs all files on every connect, which is heavy for large trees.","sy_tp3":"One task can have multiple targets, each with its own directory and full sync option.","立即同步":"Sync now","已触发同步":"Sync triggered","操作失败":"Operation failed","tsk_off":"Please enable and save the task first","mnt_type":"Mount type","cred_sel":"Credential","lcl_abs":"Local absolute path to mount","rem_dir":"Remote dir","disp_only":"Name shown in list","语言":"Language","文件夹路径":"Folder Path","编号":"Number","路径":"Path","sub_dir":"Subdirectory","是否默认":"Default","备注":"Remarks","编辑SQL":"Edit SQL","SQL 预设":"SQL Preset","耗时":"Elapsed time","确认":"Confirm","请输入备注":"Please enter note","查询全部表":"Query All Tables","SQL预设设置":"SQL Preset Settings","SQL预设":"SQL Preset","更新保存":"Update & Save","创建新预选项":"Create New Preset","添加预设":"Add Preset","SQL代码":"SQL Code","保存成功":"Saved successfully","大纲":"Outline","新建主题":"New Theme","编辑主题":"Edit Theme","删除主题":"Delete Theme","主题名称":"Theme Name","请输入主题名称":"Please enter theme name","主题实时预览":"Live preview","删除成功":"Deleted","删除失败":"Delete failed","cf_thm":"Delete this theme?","导出PDF":"Export PDF","no_head":"No headings yet","未命名标题":"Untitled heading","更新成功":"Updated successfully","创建成功":"Created successfully","sql_in":"Please enter SQL statement","新密码":"New Password","新账号":"New Account","关闭":"Close","开启":"Open","展开":"Expand","指定时间":"Specified Time","永不过期":"Never Expire","清空token":"Clear Token","保存":"Save","确定":"Confirm","确定修改":"Confirm Modification","删除":"Delete","添加":"Add","系统":"System","follow_sys":"Follow system setting","no_theme":"No theme","自定义页面路由":"Custom Page Route","api_rt":"Custom API Route","跳转路由":"Redirect Route","路由":"Route","文件":"File","自定义路由":"Custom Routes","编辑":"Edit","查看":"View","默认配置":"Default Configuration","设置":"Settings","退出登录":"Log Out","虚拟网络":"Virtual Network","系统信息":"System Information","工具箱":"Toolbox","索引":"Index","文件夹":"Folder","客户端":"Client","服务器":"Server","服务端":"Server Side","基本信息":"Basic Information","系统性能":"System Performance","总容量":"Total Capacity","剩余":"Remaining","使用率":"Usage Rate","内存":"Memory","系统进程":"System Processes","doc_ct":"Docker Containers","物理硬盘":"Physical Hard Disk","文件硬盘":"File Hard Disk","容器":"Container","名字":"Name","镜像":"Image","命令":"Command","状态":"Status","选择":"Select","过滤":"Filter","账号":"Account","密码":"Password","目录":"Directory","私钥路径":"Private Key Path","连接地址":"Connection Address","端口":"Port","port":"port","host":"host","key":"key","代理":"Proxy","浏览器":"Browser","网络唤醒":"Wake-on-LAN","时间工具":"Time Tools","JSON 格式转换":"JSON Format Convert","编解码":"Encode / Decode","摘要算法":"Hash","正则测试":"Regex Tester","开发者工具":"Developer Tools","切换样式":"Switch Style","更多":"More","创建文件夹":"Create Folder","创建文件":"Create File","连接":"Connect","地址":"Address","目标设备":"Target Device","发送":"Send","腾讯":"Tencent","云":"Cloud","厂商":"Vendor","名称":"Name","厂商名称":"Vendor Name","类型":"Type","容量":"Capacity","挂载位置":"Mount Point","剩余容量":"Remaining Capacity","登录":"Login","是":"Yes","否":"No","流量转发":"Traffic Forwarding","点对点":"Peer-to-Peer","模式":"Mode","虚拟":"Virtual","在线状态":"Online Status","物理":"Physical","账号设置":"Account Settings","说明":"Description","文件系统类型":"File System Type","机械":"Mechanical","固态":"Solid State","复制":"Copy","剪切":"Cut","压缩":"Compress","下载":"Download","重命名":"Rename","创建文本文件":"Create Text File","解压":"Extract","转换到":"Convert To","自定义":"Custom","粘贴到此处":"Paste Here","创建":"Create","制造商":"Manufacturer","总内存":"Total Memory","最大":"Maximum","品牌":"Brand","逻辑核心":"Logical Cores","搜索当前目录":"Search Current Directory","压缩文件":"Compressed File","取消":"Cancel","环境控制":"Environment Control","control_env_tip":"Configured with env-style key-value text; comment out a line to disable it. allowed_hosts only permits matching hosts, forbid_hosts rejects matching hosts. Values are regular expression arrays (full match, hostname only without port). Rejected requests are disconnected immediately without any response.","只支持以下配置项":"Only these keys are supported","值必须是 JSON 数组":"Value must be a JSON array","正则表达式不合法":"Invalid regular expression","运行":"Run","格式":"Format","压缩到":"Compress To","进度":"Progress","解压到":"Extract To","当前目录":"Current Directory","解压文件":"Extract File","视频格式转换":"Video Format Conversion","gen_dir":"The generated file is in this directory","ff_fmt":"Target formats supported by ffmpeg","del_f":"Delete selected files?","输入目录名":"Enter directory name","cut_ovr":"Confirm cut (overwrite)","cp_ovr":"Confirm copy (overwrite)","修改名字":"Change Name","输入新名字":"Enter new name","个文件正在上传":"files are uploading","确定删除":"Confirm Deletion","是否删除":"Delete?","输入文本名":"Enter text name","添加索引":"Add Index","物理核心":"Physical Cores","创建目录":"Create Directory","访问目录":"Access Directory","mac_dst":"Target Device MAC Address","要代理的url":"URL to Proxy","系统代理端口":"System Proxy Port","返回":"Return","不允许为空":"Cannot be empty","ff_none":"ffmpeg not found","disk":"Disk","part":"Partition","lvm":"Logical Volume","网址":"Website","环境":"Environment","外部软件":"External Software","保护路径":"Protected Path","软件":"Software","是否安装":"Installed","角色管理":"Role Management","用户管理":"User Management","角色id":"Role ID","角色名":"Role Name","用户id":"User ID","用户名":"Username","目录范围":"Directory Scope","可执行的命令":"Executable Commands","禁止目录范围":"Forbidden Directory Scope","可执行命令":"Executable Command","系统进程关闭":"System Process Shutdown","dc_ctdl":"Stop/Delete Docker Container","dc_idl":"Delete Docker Image","tk_time":"Modify Token Time","自定义资源路由":"Custom Resource Route","磁盘挂载":"Disk Mount","ssh_sv":"Save SSH Key to Disk","外部软件路径":"External Software Path","log_del":"File Delete, Cut, Rename","内容更新":"Update Content","标签编辑权限":"Label Edit Permission","ssh代理":"SSH Proxy","http代理":"HTTP Proxy","浏览器代理":"Browser Proxy","rdp代理":"RDP Proxy","rtsp播放器":"RTSP Player","tag_pub":"Label edits are visible to all users","角色":"Role","文件回收站":"File Recycle Bin","个人保护路径":"Personal Protected Path","系统保护路径":"System Protected Path","小于一分钟":"Less than a minute","分钟前":"Minutes ago","小时前":"Hours ago","天前":"Days ago","月前":"Months ago","年前":"Years ago","挂载位置磁盘":"Mounted Disk","信息":"Information","磁盘剩余":"Disk Remaining","文件系统":"File System","文件夹数":"Number of Folders","文件数":"Number of Files","当前位置":"Current Location","输入文件名":"Enter File Name","o_stdo":"Open with Studio","o_img":"Open with Image Editor","预览图片":"Preview Image","运行并实时查看":"Run and View in Real Time","实时查看":"Real-Time View","输入参数运行":"Run with Parameters","以文本打开":"Open as Text","以日志打开":"Open as Log","上传":"Upload","文件选项":"File Options","添加类目":"Add Category","全部编辑":"Edit All","输入类目名":"Enter Category Name","折叠":"Collapse","全部折叠":"Collapse All","(无内容)":"(No Content)","请求头":"Request Header","请求体":"Request Body","值":"Value","上传文件":"Upload File","下载到本地目录":"Download to Local Directory","本地地址":"Local Address","完成":"Complete","结束":"End","响应头":"Response Header","正在下载":"Downloading","输入标签名":"Enter Label Name","frm_lm":"Form contains file, browser restrictions prevent addition","非对称密钥":"Asymmetric Key","将覆盖密钥文件":"Will Overwrite Key File","加密算法":"Encryption Algorithm","输出格式":"Output Format","普通PEM":"Standard PEM","生成":"Generate","ssh_dir":"Save to .ssh Directory","私钥":"Private Key","时间转换器":"Time Converter","格式化时间":"Format Time","毫秒":"Milliseconds","分秒":"Minutes and Seconds","实时信息":"Real-Time Info","运行用户":"Running User","当前系统":"Current System","进程":"Process","ld_wait":"Loading, please wait...","选中":"Selected","创建用户":"Create User","升序":"Ascending","降序":"Descending","dc_nne":"Docker not detected, host may not have Docker installed or no containers","过滤镜像":"Filter Images","列表更新":"Update List","执行命令":"Execute Command","打印日志":"Print Logs","删除容器":"Delete Container","删除镜像":"Delete Image","doc_img":"Docker Image","doc_icf":"Are you sure you want to delete selected image(s)?","系统运行于":"System Running On","全局变量":"Global Variables","up_conc":"Max Concurrent File Uploads","单用户并发数量":"Concurrent Uploads Per User","系统并发数量":"System Concurrent Uploads","big_res":"Enable Large File Resume","big_sz":"Large File Threshold (MB)","大文件并发数量":"Large File Concurrent Uploads","big_ck":"Large File Chunk Size (MB)","页面资源路由":"Page Resource Route","wf_rt":"Workflow Trigger Route","过期时间(s)":"Expiration Time (s)","文件路径":"File Path","path_up":"Update System Protected Path","path_md":"Modify PATH Variable","执行用户":"Executing User","执行":"Execute","wf_api":"Modify Workflow Trigger API","up_lim":"Modify Directory Upload File Count Limit","功能权限":"Feature Permissions","角色备注":"Role Remarks","pxy_off":"Disable HTTP Proxy Download","工具功能":"Tool Functions","全局变量设置":"Global Variable Settings","文件回收站修改":"Modify File Recycle Bin","文件权限":"File Permission","log_wr":"File creation, upload, content update, decompress","只读目录范围":"Scope of the read-only directory","更新":"update","use_env":"Environment variables are used by default","sync_sv":"sync message to selected server","add_rot":"Add the HTTP Resource Root Directory","dl_here":"Download the HTTP resources in this directory","文件排序":"file sort","系统默认":"sys default","修改时间":"mtime","时间逆序":"time desc","时间顺序":"time asc","大小逆序":"size desc","大小顺序":"size asc","文件大小":"file size","网站标题":"web site title","通用设置":"Common Setting","主题":"theme","时区":"time zone","时间":"time","服务器时间":"server time","在线时间":"online time","离线时间":"offline time","在线":"online","离线":"offline","功能文档":"Function Specification","官网地址":"https://filecat.xiaobaidadada.fun/#/en","远程代理":"Remote Proxy","系统管理":"System Management","网址导航":"Site Navigation","目录快捷命令":"Directory Shortcut Command","文件快捷命令":"File Shortcut Command","系统网络":"Sys Net","复制名字":"Copy Name","分享":"Share","复制绝对路径":"Copy Absolute Path","复制相对路径":"Copy Relative Path","切换目录":"Switch Directory","统计信息":"Statistics","更新AI知识库":"Update AI Knowledge Base","exp_hr":"Remaining Expiration Time (hours)","可以为空":"Can be empty","自动加载":"Auto Load","本地知识库":"Local Knowledge Base","知识库加载信息":"Knowledge Base Load Info","最近一次加载":"Last Load Time","加载进度":"Load Progress","总文件数量":"Total File Count","总文件字符数量":"Total File Character Count","总文件大小":"Total File Size","总耗时":"Total Duration","上一页":"Previous Page","目标地址":"Target Address","目标端口":"Target Port","连接状态":"Connection Status","个人设置":"Personal Settings","系统设置":"System Settings","文件后缀":"File Suffix","禁止执行的命令":"Forbidden Commands","Ai 配置":"AI Configuration","文件分享":"File Sharing","输入跳转的目录":"Enter target directory to jump","文件分享列表":"File Sharing List","过期小时":"Expiration Hours","下载次数":"Download Count","剩余时间":"Remaining Time","文件加载方式":"File Loading Mode","全部加载文件":"Load All Files","scrll_l":"Load Files with Infinite Scroll","剩余时间(h)":"Remaining Time (h)","网络代理":"Network Proxy","个人":"Personal","安装方式":"Installation Method","是否开启":"Enabled","系统启动执行":"Run on System Startup","表达式":"Expression","用户":"User","详细信息":"Details","服务器配置":"Server Configuration","客户端列表":"Client List","更多服务器":"More Servers","端口映射":"Port Mapping","序号":"No.","服务器端口":"Server Port","转发客户端名称":"Forwarding Client Name","服务端口":"Service Port","转发ip":"Forwarding IP","转发端口":"Forwarding Port","客户端代理配置":"Client Proxy Configuration","客户端桥接配置":"Client Bridge Configuration","远程地址":"Remote Address","在线时长":"Online Duration","fwd_nm":"Forwarding Client Name","sv_ntf":"Save and Notify the Client of the First Key and Port","br_port":"Bridge Server Port List","输入消息":"Enter Message","用户权限":"User Permissions","系统管理权限":"System Management Permissions","网络功能权限":"Network Feature Permissions","Ai 设置权限":"AI Settings Permissions","系统设置权限":"System Settings Permissions","系统环境设置":"System Environment Settings","sys_env":"System Environment Settings Page","sys_env_setting_tip":"Used to configure various system environments, including some nginx-like features","自定义路由页面":"Custom Route Page","代理功能":"Proxy Features","其他功能":"Other Features","ddns":"DDNS","ai_page":"AI Chat Page","pty cmd":"PTY Cmd","wf_run":"Workflow Execution","wf_user":"Workflow Execution User","cmd_rst":"filecat-restart Restart Command","cmd_upg":"filecat-upgrade Upgrade Command","cmd_dwn":"filecat-down Close Main Process Command","cmd_ai":"AI Command (AI Chat)","个性化设置":"Personalized Settings","lgn_usr":"Display User Info on Login","pxy_url":"HTTP Proxy Address","个人环境":"Personal Environment","系统环境":"System Environment","持久化":"Persist","个人环境设置":"Personal Environment Settings","其他参数":"Other Parameters","父编号":"Parent ID","代理配置":"Proxy Configuration","桥接配置":"Bridge Configuration","brg_tip":"Set a port on the client. Accessing this port forwards traffic to the first address within the network environment of another client.","内网穿透":"Intranet Penetration","fc_pxy":"Filecat Proxy Access","fc_pxyw":"Filecat Proxy Access Using Server Frontend","fc_pxyr":"Custom Filecat Proxy Address","fc_pxyc":"Copy filecat proxy URL","fc_pxyo":"Open filecat proxy URL","对端账号":"Remote account","对端密码":"Remote password","保存账号":"Save account","验证登录":"Verify login","已设置":"Set","未设置":"Not set","便于辨认的名字":"A recognizable name","对端 FileCat 登录名":"Remote FileCat login","留空表示不修改":"Leave empty to keep unchanged","请填写对端账号":"Please enter the remote account","已保存":"Saved","文件列表展示":"File List Display","缩放调整":"Zoom Adjustment","缩放百分比":"Zoom Percentage","范围":"Range","结果过多":"Too many results, refine your keyword","已显示":"Shown","时间展示":"Time Display","最近时间":"Recent Time","准确时间":"Exact Time","缩放调整成功":"Zoom adjusted successfully","原客户端":"Source Client","原目录":"Source Directory","目标客户端":"Target Client","目标目录":"Target Directory","忽略目录":"Ignore Directory","双向同步":"Bidirectional Sync","客户端文件同步":"Client File Sync","客户端设置":"Client Settings","pxy_nln":"Do not use proxy server for local (Intranet) addresses","忽略ip":"Ignore IP","ai_ask":"Ask server about everything","本地目录":"Local directory","响应体":"Response body","客户端功能":"Client features","全量同步":"Full synchronization","公钥":"Public Key","跟随系统":"Follow system","字符消耗统计":"Character Usage Statistics","加载中...":"Loading...","对话轮次":"Conversation Turns","AI输入字符":"AI Input Characters","AI输出字符":"AI Output Characters","暂无统计数据":"No Statistics Available","会话":"Sessions","新会话":"New Session","提示词":"Prompt","llm_pmt":"LLM-Editable Prompt","LLM编辑开关":"LLM Edit Switch","编辑规则":"Edit Rules","选择系统提示词":"Select System Prompt","清空全部会话":"Clear All Sessions","cf_all":"Confirm delete all chat sessions?","cf_msgs":"Confirm delete selected messages?","cf_ses":"Confirm delete selected sessions?","cf_one":"Confirm delete this message?","批量选择":"Batch Select","查看所有用户会话":"All Users\' Sessions","查看全部会话时不可发送消息":"Cannot send messages while viewing all sessions","仅看我的会话":"My Sessions Only","取消批量选择":"Cancel Batch Select","删除选中消息":"Delete Selected Messages","删除选中会话":"Delete Selected Sessions","切换模型":"Switch Model","添加文件":"Add File","无描述":"No Description","暂无工具":"No Tools","查看工具":"View Tools","加载工具":"Load Tools","系统会话提示词":"System Session Prompts","删除记录":"Delete Record","手动加载":"Manual Load","从索引删除":"Delete from Index","知识库开关":"Knowledge Base Switch","文本对话":"Text Chat","图片生成":"Image Generation","向量嵌入":"Vector Embedding","图片参数设置":"Image Parameter Settings","更多属性":"More Attributes","model类型":"Model Type","成为tool":"Become Tool","操作":"Operations","https_s":"HTTPS Settings","ssl_crt":"SSL Certificate Path","ssl_key":"SSL Private Key Path","crt_pth":"Certificate Path (cert.pem/fullchain.pem)","ky_pth":"Private Key Path (privkey.pem)","查看Git提交":"View Git Commits","Git":"Git","变更":"Changes","提交记录":"Commits","全选":"Select All","没有变更":"No changes","暂无提交记录":"No commits yet","分支":"Branch","git_msg":"Enter commit message...","提交":"Commit","暂存全部":"Stage All","暂存选中":"Stage Selected","取消暂存":"Unstage","已暂存":"Staged","已暂存全部":"All staged","已取消暂存":"Unstaged","请输入提交信息":"Please enter commit message","提交成功":"Commit successful","推送成功":"Push successful","拉取成功":"Pull successful","切换分支成功":"Branch switched","远程操作":"Remote Operations","拉取":"Pull","推送":"Push","强制推送":"Force Push","暂存工作区":"Stash","暂存工作区成功":"Stash successful","恢复工作区":"Stash Pop","恢复工作区成功":"Stash pop successful","刷新":"Refresh","请先选择文件":"Please select files first","提示:":"Tips:","git_stg":"Check files on the left, then use \\"Stage Selected\\" to add them to staging area","git_cmt":"Enter commit message and click \\"Commit\\"","git_cf":"If conflicts occur, please resolve them in shell before committing","git_frc":"\\"Force Push\\" will overwrite the remote branch, use with caution","配置表":"Config Table","offcal":"Leave empty to use official GitHub Releases","def_180":"Default 180s (3 minutes)","用户配置":"User Config","邮箱":"Email","代理设置":"Proxy Settings","全局代理":"Global Proxy","仓库代理":"Repository Proxy","修改":"Edit","用户配置已保存":"User config saved","代理配置已保存":"Proxy config saved","pxy_clr":"Leave empty to clear proxy","pxy_nte":"User config and global proxy apply to all repositories","端口扫描":"Port Scan","目标主机":"Target Host","起始端口":"Start Port","结束端口":"End Port","并发数":"Concurrency","超时(ms)":"Timeout (ms)","扫描":"Scan","扫描结果":"Scan Results","扫描完成":"Scan complete","扫描失败":"Scan failed","正在扫描...":"Scanning...","未发现开放端口":"No open ports found","scan_in":"Enter parameters and click scan","hostreq":"Host address cannot be empty","端口范围无效":"Invalid port range","portrng":"Start port cannot be greater than end port","开放":"Open","总计扫描":"Total Scanned","已发现":"Found","当前":"Current","扫描已取消":"Scan cancelled","自动换行":"Auto Wrap","不换行":"No Wrap","替换":"Replace","env编辑":"Env edit","命令确认":"Command Confirm","命令检测开启":"Enable command detection","命令检测关闭":"Disable command detection","命令检测已开启":"Command detection enabled","命令检测已关闭":"Command detection disabled","此会话不再询问":"Don\'t ask again for this session","doc_pxy":"Docker Proxy Config","HTTP 代理":"HTTP Proxy","pxy_htt":"HTTPS Proxy","pxy_nne":"No Proxy","保存失败":"Save failed","MD编辑器":"MD Editor","行":"Row","列":"Column","默认":"Default","删除行":"Delete row","删除列":"Delete column","上方插入行":"Insert row above","切换表头行":"Toggle Header Row","合并单元格":"Merge Cells","拆分单元格":"Split Cell","下方插入行":"Insert row below","左侧插入列":"Insert column left","右侧插入列":"Insert column right","插入表格":"Insert table","加载中":"Loading","打开失败":"Failed to open","重启失败":"Restart failed","doc_cfg":"Docker Config","名单视图":"List view","文本视图":"Text view","目标(To)":"Target (To)","动作":"Action","fw_from":"Source (From)","删除规则":"Delete rule","规则编号":"Rule number","点击复制":"Click to copy","镜像加速":"Registry Mirrors","不安全仓库":"Insecure Registries","开启调试":"Enable debug","数据存储目录":"Data Root","存储驱动":"Storage Driver","日志驱动":"Log Driver","fw_iptb":"Enable iptables","lve_rst":"Live Restore","添加规则":"Add rule","请填写端口号":"Please enter a port","方向":"Direction","协议":"Protocol","来源地址":"Source address","获取失败":"Failed to get","进程环境变量":"Process Environment Variables","端口实例":"Port Instance","srchbln":"Open directory in blank search mode","搜索会话":"Search sessions","sw_mdl":"Allow switching AI models","选择模型":"Select model","mv_self":"Cannot move a folder into itself","网站 Logo":"Website Logo","lclorur":"Local file path or http(s) image URL","全部":"All","源码模式":"Source mode","实时编辑模式":"Live edit mode","编辑器设置":"Editor settings","正文最大宽度":"Max content width","正文左右边距":"Content side padding","正文字号":"Content font size","行高":"Line height","恢复默认":"Restore defaults","保存中":"Saving","预览":"Preview","nprmtp":"You do not have permission to change this setting. The current configuration is shown below.","md_set":"MD editor settings","目录挂载":"Directory Mount","总开关":"Master switch","挂载":"Mount","挂载到网盘":"Mount to cloud drive","编辑挂载配置":"Edit mount settings","取消挂载":"Unmount","确认取消挂载":"Confirm unmount","已取消挂载":"Unmounted","该目录尚未挂载":"This directory is not mounted","挂载目录":"Mount directory","只读":"Read-only","挂载类型":"Mount type","显示名称":"Display name","标识色":"Marker color","只读模式":"Read-only mode","测试连接":"Test connection","测试中":"Testing","连接成功":"Connection succeeded","连接失败":"Connection failed","请选择挂载类型":"Please select a mount type","请填写":"Please fill in: ","未授权":"Unauthorized","服务地址":"Server URL","起始目录":"Start directory","留空表示根目录":"Leave empty for the root directory","主机":"Host","默认 22":"Default 22","私钥内容":"Private key content","与私钥二选一":"Choose either this or the private key","与密码二选一":"Choose either this or the password","存储桶":"Bucket","区域":"Region","强制路径风格":"Force path style","授权账号":"Authorized account","百度网盘授权":"Baidu Netdisk authorization","去授权":"Authorize","完成授权":"Complete authorization","授权码":"Authorization code","回调地址":"Redirect URI","rqappky":"Please enter AppKey","rq_scrt":"Please enter SecretKey","请填写授权码":"Please enter the authorization code","svappfr":"Please save the app configuration first","授权成功":"Authorization succeeded","账号可用":"Account is available","账号不可用":"Account is unavailable","校验":"Verify","已授权账号":"Authorized accounts","已删除":"Deleted","处理中":"Processing","AppKey":"AppKey","网盘挂载":"Cloud drive mount","凭据管理":"Credentials","凭据":"Credential","新增凭据":"Add credential","凭据已丢失":"Credential missing","挂载列表":"Mounts","新增挂载":"Add mount","munt_rq":"Mount directory cannot be empty","请选择凭据":"Please select a credential","请选择类型":"Please select a type","启用":"Enabled","已停用":"Disabled","确认删除":"Confirm deletion of","nmuntpr":"The current account has no permission for directory mounting","百度网盘":"Baidu Netdisk","应用配置":"App settings","授权":"Authorize","授权失败":"Authorization failed","strtdrt":"Start dir","ftr2rmt":"Forward to remote","ftr2rmt_tip":"Terminal, workflow and git requests under this dir run on the remote FileCat","授权检测":"Auth check","scrtkep":"Leave SecretKey empty to keep unchanged","编辑应用":"Edit app","新增授权账号":"Add authorized account","一键授权":"One-click authorize","outh_ob":"Manual (oob)","pst_cd":"Paste the authorization code","确认授权":"Confirm authorization","授权检测/刷新":"Verify / refresh","检测完成":"Check completed","导入":"imported","账号名":"Account name","百度账号":"Baidu account","网盘昵称":"Netdisk nickname","授权状态":"Auth status","过期时间":"Expires at","授权时间":"Authorized at","已授权":"Authorized","已过期":"Expired","停用":"Disable","已配置":"Configured","未配置":"Not configured","网盘使用":"Netdisk enabled","自动刷新":"Auto refresh","编辑账号":"Edit account","使用":"Use","当前为挂载目录":"Mounted directory","启用挂载":"Enable mounts","已启用":"Enabled","挂载已启用":"Mounts enabled","挂载已停用":"Mounts disabled","muntont":"Mounts enabled, click to disable","muntoff":"Mounts disabled, click to enable","凭证管理":"Credentials","授权方式":"Authorization Mode","去授权(一键)":"Authorize (one-click)","去授权(手动)":"Authorize (manual)","保存应用配置":"Save App Config","atathtp":"One-click: you will be redirected back here after authorization and the account is added automatically","atathnt":"One-click requires registering this service\'s /mount/baidu/callback as the redirect URI in Baidu\'s console","pstatht":"Manual: no redirect URI needed. After authorizing, copy the code on Baidu\'s page, paste it below and click Complete","crd_tp":"A credential is the account info used to connect to a cloud drive / remote host. It can be shared by multiple mounts, and editing it takes effect everywhere at once.","bidacct":"Baidu Netdisk accounts are not managed here. Authorize them in the \\"Baidu Netdisk\\" panel below; the corresponding account is created automatically after authorization.","pwdkept":"When editing, leaving a password-type field empty means the original value is kept.","tstbfrs":"Before saving, you can click \\"Test connection\\" to verify the account works.","prtwbdv":"A general-purpose file protocol supported by Jianguoyun, Synology NAS, Nextcloud, Alist and more. One service URL plus an account is enough to browse the remote directory.","prtsftp":"Access a directory on a remote server over SSH, transferring files via the SFTP subsystem. Ideal for mounting a directory from another Linux machine.","prt_s3":"Object storage services reachable over the S3 protocol, such as MinIO, Alibaba Cloud OSS, Tencent COS, Qiniu and Cloudflare R2. Requires a service endpoint, a bucket and a key pair.","深搜":"Deep Search","搜索":"Search","搜索中":"Searching","搜文件名":"Search file name recursively","搜到该处":"Go to its folder","打开所在目录":"Open containing folder","输入后搜":"Type a file name and press Enter","无匹配":"No matching files found","结果截断":"Too many results, showing first 500","未加载":"Not loaded","加载成功":"Loaded","加载失败":"Load failed","个工具":"tools","No share found":"No share found","Enter host first":"Enter host first","下一步":"Next","上一步":"Back","共享目录":"Share folder","prt_smb":"Windows shared folder (SMB/CIFS). Fill in the host and account, then pick a share name from the list.","prt_bd":"Baidu Netdisk. Create an app on the Baidu Open Platform, fill in AppKey / SecretKey, then authorize an account.","没有找到共享":"No shares found","粘贴授权码 code":"Paste authorization code","重新授权":"Reauthorize","请选择账号":"Please select an account","请填写备注":"Please enter a note","账号已丢失":"Account missing","已暂存的更改":"Staged Changes","全部暂存":"Stage All","全部取消暂存":"Unstage All","暂存":"Stage","无差异":"No differences","二进制文件":"Binary file","单栏":"Unified","并排":"Side by side","点击左侧文件查看差异":"Click a file on the left to view its diff","未跟踪文件无差异":"Untracked files have no diff","请先暂存要提交的文件":"Stage the files you want to commit first","没有已更改的文件":"No changed files","未暂存":"Unstaged","逐行归属":"Blame","无法读取该文件的归属信息":"Cannot read blame info for this file","全部文件":"All files","新建分支":"New branch","删除分支":"Delete branch","确认删除分支":"Delete branch?","合并到此分支":"Merge into this branch","新分支名":"New branch name","当前分支":"Current branch","切换到":"Switch to","分支创建成功":"Branch created","分支删除成功":"Branch deleted","合并成功":"Merged","标签":"Tags","新建标签":"New tag","标签名":"Tag name","暂无标签":"No tags","标签创建成功":"Tag created","标签删除成功":"Tag deleted","标签推送成功":"Tag pushed","删除标签":"Delete tag","确认删除标签":"Delete tag?","请输入标签名":"Enter a tag name","推送到远程":"Push to remote","基于提交":"Based on commit","基于当前提交":"Based on current commit","暂存工作区记录":"Stashes","暂无记录":"No records","恢复并删除":"Pop","已恢复并删除记录":"Restored and removed","已应用":"Applied","远程分支":"Remote branches","拉取远程信息":"Fetch","拉取并清理已删除分支":"Fetch and prune","未配置远程仓库":"No remote configured","签出到本地":"Checkout locally","拉取完成":"Fetch complete","冲突":"Conflicts","采用我方版本":"Use ours","采用对方版本":"Use theirs","标记已解决":"Mark resolved","标记全部已解决":"Finish merge","放弃合并":"Abort merge","确认放弃当前合并并恢复到操作前状态":"Abort and restore to the previous state?","已解决冲突":"Conflict resolved","已放弃合并":"Merge aborted","合并已完成":"Merge finished","撤销提交":"Revert commit","将生成一个反向提交来撤销":"Will create a reverse commit to revert","已撤销":"Reverted","摘取提交":"Cherry-pick","将该提交应用到当前分支":"Apply this commit to the current branch","摘取成功":"Cherry-picked","搜索提交":"Search commits","提交信息关键词":"Commit message","作者":"Author","请输入搜索条件":"Enter search criteria","操作历史":"History","回退到此处":"Reset here","强制回退(丢弃改动)":"Hard reset (discard changes)","此操作将永久丢弃未提交的改动":"This permanently discards uncommitted changes","已回退":"Reset done","已强制回退":"Hard reset done","子模块":"Submodules","无子模块":"No submodules","初始化并更新子模块":"Init and update submodules","子模块更新完成":"Submodules updated","未初始化":"Not initialized","与记录不一致":"Differs from record","正常":"Normal","当前提交":"Current commit","领先上游":"Ahead of upstream","落后上游":"Behind upstream","钩子":"Hooks","停用钩子":"Disable hook","确认删除并停用":"Delete and disable","保存并启用":"Save and enable","已保存并启用":"Saved and enabled","与工作区对比":"Compare with worktree","仓库":"Repos","初始化仓库":"Init repository","克隆仓库":"Clone repository","仓库初始化成功":"Repository initialized","克隆成功":"Cloned","目录名":"Directory name","请输入目录名":"Enter a directory name","仓库地址":"Repository URL","请输入仓库地址":"Enter a repository URL","当前目录下没有仓库":"No repositories here","进入":"Open","修改最后一次提交":"Amend last commit","已修改最后一次提交":"Last commit amended","分支比较":"Compare branches","两个分支没有差异":"No differences between branches","确认删除远程分支":"Delete remote branch","该分支会从远程仓库删除":"This branch will be deleted from the remote repository","删除远程分支":"Delete remote branch","将":"Merge","合并到":"into","未推送":"Not pushed","已到底部":"No more","没有可提交的更改":"Nothing to commit","存在未暂存的改动,是否一并暂存并提交?":"There are unstaged changes. Stage and commit them together?","二进制文件无法比较":"Binary file cannot be compared","请选择文件查看改动":"Select a file to view changes","clk_edt":"Click to edit","rendering":"Rendering…","思维导图":"Mind map","新窗口打开":"Open in new tab","已选":"Selected","复制所选":"Copy selected","删除所选":"Delete selected","全部复制":"Copy all","多选":"Select","wbvpn_allow":"WebVPN Target Allowlist","wbvpn_allow_ph":"One entry per line: 192.168.1.0/24 (CIDR) / 192.168.1.1 (IP) / router.local (domain, exact match, no subdomains)","wbvpn_tip":"WebVPN target allowlist. One entry per line. Three formats are supported:\\n · CIDR range: 192.168.1.0/24\\n · Exact IP: 192.168.1.1 (also 10.0.0.5, fd00::/8, ::1)\\n · Exact domain: router.local, nas.example.com (exact match, subdomains are NOT included)\\nPublic addresses are allowed by default. Private, loopback, link-local, cloud metadata (169.254.169.254) and other reserved addresses are denied unless listed here. Malformed lines are ignored.","wbvpn_port_range":"Proxy Port Range","wbvpn_port_tip":"Each target occupies an independent port. Open the access URL to browse that site; the page path stays clean so SPA routing works and sites are isolated by origin.","wbvpn_port_tip2":"Access requires login: opening from here carries a token once, then a cookie keeps the session. Targets are still subject to the allowlist / address policy.","wbvpn_port_tip3":"Links in the page that point to an enabled target are automatically rewritten to that target\'s port, so clicks stay inside the proxy; domains that are not configured as targets are left untouched.","网页代理目标":"Proxy Targets","访问地址":"Access URL","打开":"Open","已复制":"Copied","复制失败":"Copy failed","添加成功":"Added","目标地址不能为空":"Target address cannot be empty","目标地址例如":"Target address, e.g. 192.168.1.1:8080","网页代理":"Web Proxy","当前窗口打开":"Open in current tab","修改成功":"Updated","浏览器代理编辑":"Browser Proxy Editing","已禁用":"Disabled","prt_local":"Local directory. Enter an existing absolute path on this machine as the source; after mounting you can access it as a directory link inside filecat.","移动到最上":"Move to Top","移动到最下":"Move to Bottom","会话设置":"Session Settings","服务器工作目录":"Server Working Directory","服务器工作目录提示":"e.g. D:\\\\projects\\\\myapp","AI 聊天":"AI Chat","动态域名解析":"Dynamic DNS","平台":"Provider","账号凭证":"Credentials","域名绑定":"Domain Binding","IP 来源":"IP Source","域名":"Domain","多个域名用空格分隔":"Separate multiple domains with spaces","绑定":"Binding","填写格式":"Format","请填写账号凭证":"Please fill in credentials","确定删除吗":"Confirm delete?","ddns_help_1":"Configure DDNS to auto-update DNS records with your current public IP.","ddns_help_2":"IP sources include local network interfaces and custom HTTP endpoints.","请输入地址":"Please enter the URL","IP 来源管理":"Manage IP Sources","暂无数据":"No data","http_source_tip":"Add an IP source: either an HTTP endpoint that returns your public IP (e.g. https://4.ipw.cn), or a fixed IP address.","同步间隔":"Sync Interval","账号状态":"Account","上次同步":"Last Sync","验证":"Verify","未验证":"Unverified","失败":"Failed","同步完成":"Sync completed","间隔不能小于 10 秒":"Interval must be at least 10 seconds","文字":"Text","请填写完整的账号凭证":"Please fill in all credential fields","加载时间线失败":"Failed to load timeline","展开编辑":"Show edit tools","收起编辑":"Hide edit tools","添加阶段":"Add phase","上移":"Move up","下移":"Move down","起始时间":"Start time","结束时间":"End time","阶段倒置":"Reverse phases","在阶段前插入":"Insert before","在阶段后插入":"Insert after","拖动排序":"Drag to reorder","导出 SVG":"Export SVG","折叠全部阶段":"Collapse all phases","展开全部阶段":"Expand all phases","导出图片":"Export as image","导出图片失败":"Failed to export image","撤销":"Undo","重做":"Redo","缩小":"Zoom out","放大":"Zoom in","重置缩放":"Reset zoom","进入编辑模式":"Enter edit mode","退出编辑模式":"Exit edit mode","事件":"Event","标题":"Title","描述":"Description","日期":"Date","左侧":"Left","右侧":"Right","颜色":"Color","自定义颜色":"Custom color","跟随阶段":"Follow phase","拖动事件气泡可改变位置与所属阶段":"Drag the bubble to change its position and phase","删除事件":"Delete event","在左侧添加事件":"Add event on the left","在右侧添加事件":"Add event on the right","删除阶段":"Delete phase","阶段":"Phase","阶段头":"Phase header","显示":"Show","隐藏":"Hide","拖动阶段头可调整顺序":"Drag the phase header to reorder","用上移下移调整事件顺序,用左右切换事件所在侧":"Use move up/down to reorder events, and left/right to switch the event side","拖动调整阶段高度":"Drag to resize phase height","未命名":"Untitled","有未保存的修改,确定要关闭吗?":"There are unsaved changes. Close anyway?","纵向":"Vertical","横向":"Horizontal","节点样式":"Node style","圆点":"Dot","圆形":"Circle","方形":"Square","图片":"Image","卡片样式":"Card style","卡片":"Card","朴素":"Plain","气泡":"Bubble","连线风格":"Line style","实线":"Solid","虚线":"Dashed","点线":"Dotted","显示连线":"Show connectors","上侧":"Top","下侧":"Bottom","添加事件":"Add event","图片地址":"Image URL","拖动调整卡片宽度":"Drag to resize card width","拖动调整连线长度":"Drag to adjust connector length","隐藏阶段头":"Hide phase header","显示阶段头":"Show phase header","时间线":"Timeline","添加子节点":"Add child node","添加同级节点":"Add sibling node","删除节点":"Delete node","插入图片":"Insert image","插入图标":"Insert icon","插入超链接":"Insert hyperlink","节点备注":"Node note","结构":"Structure","逻辑结构图":"Logical structure","组织结构图":"Organization chart","目录组织图":"Catalog chart","时间轴(左)":"Timeline (left)","时间轴(下)":"Timeline (bottom)","时间轴(上)":"Timeline (top)","时间轴(竖)":"Timeline (vertical)","鱼骨图":"Fishbone","鱼骨图(右)":"Fishbone (right)","曲线":"Curve","直线":"Straight","直连":"Direct","默认主题":"Default","经典":"Classic","暗色":"Dark","极简":"Minimal","缤纷":"Colorful","请先选中一个节点":"Select a node first","请输入链接地址":"Enter link URL","加载思维导图失败":"Failed to load mind map","编辑器尚未就绪":"Editor not ready","中心主题":"Central topic","适应窗口":"Fit to window","插入父节点":"Insert parent node","粘贴":"Paste","节点标签":"Node tag","请输入节点备注":"Enter node note","请输入节点标签,多个用逗号分隔":"Enter tags, separated by commas","添加概要":"Add summary","删除概要":"Remove summary","请先选中要合并的节点(按住 Ctrl 拖框可多选)":"Select the nodes to merge first (hold Ctrl and drag to multi-select)","删除图标":"Remove icon","删除备注":"Remove note","删除超链接":"Remove link","供应商设置":"Provider Settings","默认model":"Default model","全局prompt":"Global prompt","全局":"Global","model请求参数json编写":"Request params JSON","额外参数设置":"Extra params","编辑器自动保存":"Editor Auto-Save","自动保存间隔(秒)":"Auto-save interval (sec)","请输入不小于 1 的整数(秒)":"Please enter an integer >= 1 (seconds)","文本编辑器(ace)":"Text editor (Ace)","md编辑器":"MD editor","思维导图编辑器":"Mind map editor","draw编辑器":"Draw editor","时间线编辑器":"Timeline editor","图片编辑器":"Image editor","excel编辑器":"Excel editor","编辑器":"Editors","cron表达式":"Cron Expression","系统提示词":"System prompt","不使用":"None","消息数":"Messages","来源":"Source","更多操作":"More actions","环境变量":"Environment Variables","暂无环境变量":"No environment variables","环境变量的 KEY 不能为空":"Environment variable KEY cannot be empty","重启成功":"Restarted successfully","重启服务":"Restart service","配置已保存,是否立即重启该服务让新配置生效?":"Configuration saved. Restart the service now to apply it?","暂停中":"Pausing","discard":"Discard Changes","discarded":"Changes discarded","discard_untracked_tip":"This file is not tracked. Discarding will delete it permanently. Continue?","discard_modified_tip":"Local changes will be discarded and reverted to the repository version. Continue?","discard_selected_tip":"Local changes to the selected {{n}} file(s) will be discarded. Continue?","加载资源失败":"Failed to load resource","网络错误":"Network error","没有安装smartmontools":"smartmontools is not installed","挂载文件已生效":"Mount file applied","刷新成功":"Refreshed","未选择转发送 client":"No forwarding client selected","删除完成":"Deleted","保护路径不能删除":"Protected path cannot be deleted","MCP工具加载成功":"MCP tools loaded","没有选中":"Nothing selected","不能为空":"Cannot be empty","和原文件格式后缀一样":"Same extension as the original file","发生错误":"An error occurred","不支持的文件后缀":"Unsupported file extension","更新到AI知识库成功":"Added to AI knowledge base","文件名不能为空":"File name cannot be empty","挂载目录不能为空":"Mount directory cannot be empty","重复挂载":"Duplicate mount","该设备块没有具体路径":"This device has no specific path","该设备块没有文件系统":"This device has no filesystem","路由不能为空":"Route cannot be empty","创建完成":"Created","保存完成":"Saved","获取进程输出失败":"Failed to get process output","进程已终止":"Process terminated","终止进程失败":"Failed to terminate process","账号密码不能为空":"Account and password cannot be empty","两次密码不一样":"Passwords do not match","目录不能为空":"Directory cannot be empty","秒数不能为空":"Seconds cannot be empty","清理完成,重新登录":"Cleanup complete, please log in again","密钥不能为空":"Key cannot be empty","保存到服务器":"Save to server","加载资源失败,请检查文件":"Failed to load resource, please check the file","操作成功":"Done","未获取到路径":"Failed to get path","复制成功":"Copied","暂无聊天记录":"No chat history","暂无内容":"No content","到达顶部":"Reached the top","范围在0-100":"Range is 0-100","不存在的http method":"Unsupported HTTP method","不存在":"Not found","不是数字":"Not a number","已经存在的页面资源路由配置目录设置":"This page resource route directory is already configured","mac地址不能为空":"MAC address cannot be empty","发送唤醒命令成功":"Wake command sent","不能都为空":"Fields cannot all be empty","转换成":"Convert to","转换":"Convert","格式化":"Format","结果转到输入":"Move result to input","示例":"Sample","输入":"Input","输出":"Output","内容为空":"Content is empty","输出为空":"Output is empty","编码":"Encode","解码":"Decode","大写":"Uppercase","空格分隔":"Space separated","正则表达式":"Regular expression","分组索引":"indices","忽略大小写":"ignore case","多行":"multiline","含换行":"dotall","Unicode 集合":"unicode sets","粘性":"sticky","匹配到":"Matched","测试文本":"Test text","高亮结果":"Highlighted result","匹配详情":"Match details","空":"empty","位置":"at","未匹配":"unmatched","时间转换":"Timestamp converter","时间戳":"Timestamp","秒或毫秒":"seconds or milliseconds","现在":"Now","秒级":"Seconds","毫秒级":"Milliseconds","本地时间":"Local time","UTC 时间":"UTC time","距现在":"Relative","转时间戳":"To timestamp","无效时间戳":"Invalid timestamp","天":"d","小时":"h","分钟":"m","还有":"in","已过去":"ago","刚刚":"just now","进制转换":"Radix converter","输入数值":"Enter a number","进制":"base","字节":"Bytes","位":"bits","颜色转换":"Color converter","复制颜色":"Copy color","颜色格式无效":"Invalid color format","UUID / 随机密码":"UUID / Random password","生成 UUID":"Generate UUID","生成密码":"Generate password","长度":"Length","符号":"Symbols","二维码生成":"QR code generator","尺寸":"Size","纠错级别":"Error correction","下载 PNG":"Download PNG","处":"match(es)","秒":"s","文本对比":"Text diff","原文本":"Original text","新文本":"New text","粘贴原文本":"Paste the original text","粘贴新文本":"Paste the new text","差异":"Diff","输入文本后这里显示差异":"The diff appears here after you type","生成二维码":"Generate QR code","need_input":"Please enter some content first","num_invalid":"Not a valid number","date_invalid":"Unrecognized date format, e.g. 2024-01-01 12:00:00","color_invalid":"Invalid color, use #abc or #aabbcc","qr_empty":"The QR code appears here after you type","qr_in_ph":"Enter text or URL to encode","qr_none":"No QR code to download","codec_in_ph":"Enter text to encode or decode","codec_out_ph":"The result appears here and can be edited","hash_in_ph":"Enter text to hash, results update live","regex_in_ph":"Paste the text to test here","regex_empty":"Highlighted result will appear here","pw_need_set":"Select at least one character type"}')}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[991],{20734(e,t,n){n.d(t,{A:()=>l});var s=n(96540),r=n(48890),a=n(74848);function l({valueA:e,valueB:t,mode:n="split",theme:l,filename:o}){const c=(0,s.useRef)(null),i=(0,s.useRef)(null),d=(0,s.useMemo)(()=>o&&r.Tt.getModeForPath(o).mode||"ace/mode/text",[o]);return(0,s.useEffect)(()=>{const s=c.current;if(!s)return;const a=r.Kw.require("ace/ext/diff"),o={valueA:e??"",valueB:t??"",diffProvider:new a.DiffProvider},h="inline"===n,u=h?new a.InlineDiffView({...o,inline:"a"},s):new a.SplitDiffView(o);h||(u.container=s,s.appendChild(u.editorA.container),s.appendChild(u.editorB.container)),l&&u.setTheme(l),u.editorA?.session.setMode(d),u.editorB?.session.setMode(d),u.onInput(),u.foldUnchanged();const x=requestAnimationFrame(()=>{u.editorA?.resize(!0),u.editorB?.resize(!0)});return i.current=u,()=>{cancelAnimationFrame(x);try{u.destroy()}catch(e){}i.current=null,s.innerHTML=""}},[e,t,n,l,d]),(0,a.jsx)("div",{className:"ace-diff",ref:c})}},77481(e,t,n){n.d(t,{S:()=>o,X:()=>l});var s=n(96540),r=n(61443),a=n(74848);function l(e){const[t,n]=s.useState([]),l=(0,s.useRef)(-1),[o,c]=(0,s.useState)(-1),[i,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const h=()=>{l.current=-1,c(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let l=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(l=`${t} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},n)})})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(o===n?"row-dragging":"")+(i===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(l.current=n,c(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=l.current,n=i;h(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:h,children:t.map((n,s)=>{const r=s===t.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function o(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))})}},48890(e,t,n){n.d(t,{Kw:()=>s,Tt:()=>r});var s=n(80952),r=(n(82327),n(1766),n(24854),n(90008),n(90846),n(40975),n(44286),n(30766),n(14973),n(69687),n(1234),n(47507),n(87268),n(55208),n(34678),n(24522));const a=`https://gcore.jsdelivr.net/npm/ace-builds@${s.version}/src-min-noconflict/`;s.config.set("basePath",a),s.config.set("modePath",a),s.config.set("themePath",a),s.config.set("workerPath",a)},83029(e,t,n){n.d(t,{N:()=>g});var s=n(96540),r=n(34843),a=n(82893),l=n(74848);function o(e){const[t,n]=(0,r.fp)(a.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 c=n(64694),i=n(61443),d=n(85997),h=n(52671),u=n(22022);const x=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let p,m,f=[];const j=[];function g(e){const[t,n]=(0,s.useState)([]),[g,v]=(0,s.useState)(-1),b=(0,h.zy)(),[w,S]=(0,s.useState)(!1),[C,y]=(0,s.useState)(!1),{t:N}=(0,u.Bd)(),[_,k]=(0,s.useState)([]),[I,A]=(0,r.fp)(a.AG.nav_index_add_item_by_now_list),P=e=>{-1!==g?j[g]._children=e:f=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();f=t,n(f)})()},[b]);(0,s.useEffect)(()=>{if(I){const e=[...t,{name:"",color:(0,c.Lr)(x),...I}];P(e),n(e),S(!0),A(void 0)}},[I]);const M=e=>{v(g+1),n(e._children),j.push(e)};return(0,l.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==g&&(0,l.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{n(0===g?f:j[g-1]._children),v(g-1),j.pop()}}),t.map((r,a)=>(0,l.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{p=t})(0,a),onDrop:e=>((e,s)=>{e.preventDefault();const r=t[p],a=t[s];if(a&&"dir"===a._type){const e=[...t];return e.splice(p,1),a._children||(a._children=[]),a._children.push(r),P(e),void n(e)}const l=[...t],o=l[p];l.splice(p,1),l.splice(s,0,o),P(l),n(l)})(e,a),style:{cursor:w?"move":"pointer"},children:[(0,l.jsx)(o,{name:r.name,item:r,...r,div:w,target:"_blank",click_dir:M,clickItem:e.clickItem}),w&&(void 0!==_.find(e=>e===a)||C)&&(0,l.jsxs)("div",{className:C?"":" site_edit ",children:["dir"===r._type?(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(i.Sm,{value:r.name,handleInputChange:e=>{r.name=e},placeholder:N("输入类目名"),no_border:!0}),(0,l.jsx)(i.Sm,{value:r.color,type:"color",handleInputChange:e=>{r.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,l.jsx)("div",{children:(0,l.jsx)(i.Sm,{value:r[e.key],type:"color"===e.key?"color":void 0,handleInputChange:t=>{r[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!C&&(0,l.jsx)(d.C3,{text:N("折叠"),clickFun:()=>{k((0,c.P1)(_,a))}})]}),w&&(0,l.jsx)("div",{style:{display:"block"},children:(0,l.jsxs)("span",{className:"div-row ",children:[(0,l.jsx)(d.C3,{text:N("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),P(s),n(s)})(a)}}),(0,l.jsx)(d.C3,{text:N("编辑"),clickFun:()=>{void 0===_.find(e=>e===a)&&k([..._,a])}})]})})]},a)),w&&(0,l.jsxs)("div",{style:{display:"block"},children:[(0,l.jsx)(d.rA,{title:N("取消"),icon:"cancel",onClick:()=>{k([]),S(!1),m&&(n(m),P(m)),y(!1)}}),(0,l.jsx)(d.rA,{title:N("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,c.Lr)(x),...e.get_pre_add_item&&await e.get_pre_add_item()}];P(s),n(s)}}),(0,l.jsx)(d.rA,{title:N("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];P(e),n(e)}}),(0,l.jsx)(d.rA,{title:N("全部编辑"),icon:C?"unfold_less":"unfold_more",onClick:()=>{y(!C)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,l.jsx)(d.rA,{icon:w?"save":"edit",title:N(w?"保存":"编辑"),onClick:async()=>{w?e.save&&await e.save(f):m=t,S(!w)}})]})}},30991(e,t,n){n.r(t),n.d(t,{default:()=>Ne});var s=n(96540),r=n(75725),a=n(61443),l=n(70447),o=n(85997),c=n(34289),i=n(22022),d=n(62042),h=n(14284),u=n(53459),x=n(74848);function p(e){const{t}=(0,i.Bd)(),[n,p]=(0,s.useState)(t("毫秒")),[m,f]=(0,s.useState)(""),[j,g]=(0,s.useState)(""),[v,b]=(0,s.useState)(null),[w,S]=(0,s.useState)(null),[C,y]=(0,s.useState)(Date.now());return(0,s.useEffect)(()=>{(async()=>{const e=await h.Yu.get("sys_time/get");if(e.code===u.m.Success){const t=await e.data;b(t.timestamp),S(t.timezone),y(t.timestamp)}})();const e=setInterval(()=>{y(e=>e+1e3)},1e3);return()=>clearInterval(e)},[]),(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:33,children:(0,x.jsxs)(l.Zp,{title:t("时间转换器"),rightBottomCom:(0,x.jsx)(o.C3,{text:t("确定"),clickFun:function(){if(!m&&!j)return void(0,d.zN)(t("不能都为空"));let e=0;const s=""!==m&&0!==m;if(s){if(!(0,c.kf)(m))return void(0,d.zN)("must be number !");e=parseInt(m),"分秒"===n&&(e*=1e3)}const r=new Date(s?e:j),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(r);if(g(a),!m){const e=r.getTime();f("毫秒"===n?e:e/1e3)}}}),children:[(0,x.jsx)(a.l6,{value:n,options:[{title:t("毫秒"),value:"毫秒"},{title:t("分秒"),value:"分秒"}],onChange:function(e){p(e)}}),(0,x.jsx)(a.Sm,{placeholder:n,value:m,handleInputChange:e=>{f(e)}}),(0,x.jsx)(a.Sm,{placeholder:t("格式化时间"),value:j,handleInputChange:e=>{g(e)}})]})}),(0,x.jsx)(r.VP,{children:null!==v&&null!==w&&(0,x.jsxs)(l.Zp,{title:t("服务器时间"),children:[(0,x.jsxs)("h1",{children:[t("时区"),": ",w]}),(0,x.jsxs)("h1",{children:[t("时间"),": ",new Date(C).toLocaleString(navigator.language,{timeZone:w})]})]})})]})}var m=n(4412),f=n(83029),j=n(78247),g=n(23430);function v(e){const{t}=(0,i.Bd)(),{check_user_auth:n}=(0,j.MH)(),[r,l]=(0,s.useState)(""),c=async e=>{const n=e||r;if(!n)return void(0,d.zN)(t("mac地址不能为空"));(await h._U.post("wol/exec",{mac:n})).code===u.m.Success&&(0,d.SK)(t("发送唤醒命令成功"))};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(m.aZ,{position:"right",children:[(0,x.jsx)(o.rA,{icon:"play_arrow",title:t("发送"),onClick:()=>{c()}}),(0,x.jsx)(a.$Z,{placeholder:t("mac_dst"),icon:"laptop_mac",value:r,handleInputChange:e=>l(e)})]}),(0,x.jsx)(f.N,{have_auth_edit:n(g.oV.wol_proxy_tag_update),getItems:async()=>{const e=await h._U.get("wol/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await h._U.post("wol/tag/save",e)).code!==u.m.Success&&(0,d.zN)(t("网络错误"))},clickItem:async e=>{l(e.mac),c(e.mac)},items:[{key:"name",preName:t("名字")},{key:"mac",preName:"mac"+t("地址")},{key:"color",preName:"color"}]})]})}var b=n(77481),w=n(34843),S=n(82893),C=n(40505);let y;function N(){const[e,t]=(0,s.useState)("rsa"),[n,c]=(0,s.useState)("pem"),{t:p,i18n:f}=(0,i.Bd)(),[j,g]=(0,w.fp)(S.AG.confirm),[v,N]=(0,s.useState)(""),[_,k]=(0,s.useState)(""),I=async t=>{if(!_||!v)return void(0,d.zN)(p("密钥不能为空"));let n="id_"+e;"pub"===t&&(n+=".pub"),g({open:!0,title:p("将覆盖密钥文件"),sub_title:`之前的密钥将作废。 将会作为 ${n} 文件保存到系统上的"${y}"目录下,此目录会作为openssh(git)所使用的默认目录。`,handle:async()=>{(await h.cD.post("save_openssh",{name:n,context:"pub"===t?v:_})).code===u.m.Success&&((0,d.SK)(p("完成")),g({open:!1,handle:null}))}})};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(m.aZ,{position:"right",children:(0,x.jsx)(b.S,{isFlex:!0,columns:[(0,x.jsx)(a.l6,{tip:p("加密算法"),value:e,width:"auto",onChange:e=>{t(e)},options:[{title:p("RSA"),value:"rsa"},{title:p("DSA"),value:"dsa"},{title:p("ECDSA"),value:"ecdsa"}]}),(0,x.jsx)(a.l6,{tip:p("输出格式"),value:n,width:"auto",onChange:e=>{c(e)},options:[{title:p("普通PEM"),value:"pem"},{title:p("opensshPEM"),value:"openssh_pem"}]}),(0,x.jsx)(o.rA,{icon:"play_arrow",title:p("生成"),onClick:()=>{(async()=>{const t=await h.cD.post("generate",{type:e,form:n});t.code===u.m.Success&&(N(t.data.public_key),k(t.data.private_key),y=t.data.home_path)})()}})]})}),(0,x.jsx)(r.xh,{children:(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{children:(0,x.jsx)(l.Zp,{title:p("公钥"),rightTopCom:(0,x.jsx)(o.rA,{title:p("复制"),icon:"copy_all",onClick:()=>{v&&((0,C.lW)(v),(0,d.SK)(p("完成")))}}),rightBottomCom:"openssh_pem"===n&&(0,x.jsx)(o.C3,{text:p("ssh_dir"),clickFun:()=>{I("pub")}}),children:(0,x.jsx)(a.Z2,{style:{width:"100%",height:"270px"},onChange:e=>{N(e.target.value)},value:v})})}),(0,x.jsx)(r.VP,{children:(0,x.jsx)(l.Zp,{title:p("私钥"),rightTopCom:(0,x.jsx)(o.rA,{title:p("复制"),icon:"copy_all",onClick:()=>{_&&((0,C.lW)(_),(0,d.SK)(p("成功")))}}),rightBottomCom:"openssh_pem"===n&&(0,x.jsx)(o.C3,{text:p("ssh_dir"),clickFun:()=>{I("pri")}}),children:(0,x.jsx)(a.Z2,{style:{width:"100%",height:"270px"},value:_,onChange:e=>{k(e.target.value)}})})})]})})]})}var _=n(14944),k=n(92275);function I(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(""),[c,h]=(0,s.useState)("1"),[u,p]=(0,s.useState)("65535"),[m,f]=(0,s.useState)("100"),[j,g]=(0,s.useState)("2000"),[v,w]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[y,N]=(0,s.useState)([]),[I,A]=(0,s.useState)(null),P=(0,s.useRef)([]),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!M.current)return M.current=!0,_.ws.addMsg(k.HK.port_scan_progress,e=>{C(e.context)}),_.ws.addMsg(k.HK.port_scan_result,e=>{const t=e.context,n=[...P.current,t];P.current=n,N(n)}),_.ws.addMsg(k.HK.port_scan_end,t=>{A(t.context),w(!1),t.context.cancelled?(0,d.zN)(e("扫描已取消")):(0,d.SK)(e("扫描完成"))}),()=>{_.ws.sendData(k.HK.port_scan_cancel,{}),_.ws.removeMsg(k.HK.port_scan_progress),_.ws.removeMsg(k.HK.port_scan_result),_.ws.removeMsg(k.HK.port_scan_end),M.current=!1}},[]);return(0,x.jsx)(r.xh,{children:(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{children:(0,x.jsxs)(l.Zp,{title:e("TCP ")+e("端口扫描"),rightTopCom:(0,x.jsxs)("span",{children:[S&&(0,x.jsxs)("span",{children:[e("已发现"),": ",S.openCount]}),I&&(0,x.jsxs)("span",{children:[e("总计扫描"),": ",I.totalScanned," | ",e("开放"),": ",I.totalOpen]})]}),rightBottomCom:v?(0,x.jsx)(o.C3,{text:e("取消"),clickFun:()=>{_.ws.sendData(k.HK.port_scan_cancel,{}).catch(()=>{})}}):(0,x.jsx)(o.C3,{text:e("扫描"),clickFun:()=>(()=>{if(!t)return void(0,d.zN)(e("hostreq"));const n=parseInt(c),s=parseInt(u);isNaN(n)||isNaN(s)||n<1||s<1||n>65535||s>65535?(0,d.zN)(e("端口范围无效")):n>s?(0,d.zN)(e("portrng")):(w(!0),C(null),N([]),P.current=[],A(null),_.ws.sendData(k.HK.port_scan_req,{host:t,startPort:n,endPort:s,concurrency:parseInt(m)||100,timeout:parseInt(j)||2e3}).catch(()=>{}))})()}),children:[(0,x.jsx)(a.Sm,{placeholder:e("目标主机"),value:t,handleInputChange:e=>n(e)}),(0,x.jsx)(a.Sm,{placeholder:e("起始端口"),value:c,handleInputChange:e=>h(e)}),(0,x.jsx)(a.Sm,{placeholder:e("结束端口"),value:u,handleInputChange:e=>p(e)}),(0,x.jsx)(a.Sm,{placeholder:e("并发数"),value:m,handleInputChange:e=>f(e)}),(0,x.jsx)(a.Sm,{placeholder:e("超时(ms)"),value:j,handleInputChange:e=>g(e)}),v&&S&&(0,x.jsxs)("div",{children:[(0,x.jsxs)("p",{children:[e("已扫描"),": ",S.scanned," / ",S.total]}),(0,x.jsx)(l.gz,{progress:S.percent})]}),y.length>0&&(0,x.jsx)(b.X,{headers:[e("端口"),e("状态")],rows:y.map(t=>[t.port,(0,x.jsx)("span",{children:e("开放")})])}),v&&0===y.length&&(0,x.jsx)("p",{children:e("正在扫描...")}),!v&&I&&0===y.length&&(0,x.jsx)("p",{children:e("未发现开放端口")}),!v&&!I&&0===y.length&&(0,x.jsx)("p",{children:e("scan_in")})]})})})})}var A=n(48890);const P=(0,s.forwardRef)(function({value:e="",mode:t="plain_text",showLineNumbers:n=!0,wrap:r=!1,readOnly:a=!1,onChange:l,onCursorChange:o,onSave:c,className:i,style:d,options:h},u){const p=(0,s.useRef)(null),m=(0,s.useRef)(null),[f]=(0,w.fp)(S.AG.user_base_info),j=f.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day",g=(0,s.useRef)({onChange:l,onCursorChange:o,onSave:c});return g.current={onChange:l,onCursorChange:o,onSave:c},(0,s.useImperativeHandle)(u,()=>({getValue:()=>m.current?.getValue()??"",setValue:(e,t=!1)=>{const n=m.current;if(n&&(n.setValue(e,-1),t)){const e=n.getSession();e.indentAll?.()}},getEditor:()=>m.current,getCursorOffset:()=>{const e=m.current;return e?e.session.doc.positionToIndex(e.getCursorPosition(),0):0},setCursorOffset:e=>{const t=m.current;if(!t)return;const n=t.session.doc.indexToPosition(Math.max(0,e),0);t.selection.moveCursorTo(n.row,n.column),t.selection.clearSelection(),t.scrollToLine(n.row,!0,!1,()=>{})},focus:()=>m.current?.focus()}),[]),(0,s.useEffect)(()=>{const s=p.current;if(!s)return;const l=A.Kw.edit(s,{value:e,mode:`ace/mode/${t}`,theme:`ace/theme/${j}`,showPrintMargin:!1,highlightActiveLine:!1,fontSize:14,readOnly:a,showLineNumbers:n,showGutter:n,wrap:r,useWorker:!1,...h});return l.on("change",()=>{g.current.onChange?.(l.getValue())}),l.selection.on("changeCursor",()=>{g.current.onCursorChange?.()}),l.commands.addCommand({name:"filecat_save",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:()=>{g.current.onSave?.()},readOnly:!0}),m.current=l,()=>{l.destroy(),m.current=null}},[]),(0,x.jsx)("div",{ref:p,className:i,style:d})});var M=n(20382),T=n(63398),D=n(55921),V=n(63963);const $={json:"json",yaml:"yaml",toml:"toml",xml:"xml",properties:"properties"},W="#text",F=new D.A({ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:W,parseAttributeValue:!0,parseTagValue:!0,trimValues:!0,isArray:()=>!1}),E=new V.A({ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:W,format:!0,indentBy:" ",suppressEmptyNode:!0});function Z(e){return e.replace(/\\(u[0-9a-fA-F]{4}|.)/g,(e,t)=>"u"===t[0]?String.fromCharCode(parseInt(t.slice(1),16)):"n"===t?"\n":"t"===t?"\t":"r"===t?"\r":t)}function U(e){return e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}function B(e,t){if(""===e.trim())return null;if("json"===t)return JSON.parse(e);if("yaml"===t)return M.Hh(e);if("toml"===t)return(0,T.qg)(e);if("properties"===t)return function(e){const t={},n=[];let s="";for(const t of e.split(/\r?\n/)){if(""===s&&""===t.trim())continue;const e=s+t,r=e.match(/\\+$/);null!==r&&r[0].length%2==1?s=e.slice(0,-1):(n.push(e),s="")}""!==s&&n.push(s);for(const e of n){const n=e.trimStart();if(""===n||n.startsWith("#")||n.startsWith("!"))continue;let s=-1;for(let t=0;t<e.length;t++){const n=e[t];if("\\"!==n){if("="===n||":"===n){s=t;break}}else t++}const r=-1===s?e:e.slice(0,s),a=-1===s?"":e.slice(s+1),l=Z(r.trim());""!==l&&(t[l]=Z(a.trim()))}return t}(e);const n=F.parse(e);return n&&"object"==typeof n&&delete n["?xml"],n}function H(e,t){if("json"===t)return JSON.stringify(e,null,2);if("yaml"===t)return M.Bh(e,{indent:2,lineWidth:-1,noRefs:!0});if("toml"===t){if(null===e||"object"!=typeof e||Array.isArray(e))throw new Error("TOML 顶层必须是对象,无法转换标量或数组");return(0,T.As)(e)}if("properties"===t)return function(e){if(null===e||"object"!=typeof e)throw new Error("Properties 顶层必须是对象,无法转换标量");const t=[],n=(e,s)=>{if(null!=e)if(Array.isArray(e))e.forEach((e,t)=>n(e,""===s?String(t):`${s}.${t}`));else if("object"!=typeof e)""!==s&&t.push(`${U(s)}=${U(String(e))}`);else for(const[t,r]of Object.entries(e))n(r,""===s?t:`${s}.${t}`)};return n(e,""),t.join("\n")}(e);if(null===e||"object"!=typeof e)throw new Error("XML 顶层必须是对象,无法转换标量");if(Array.isArray(e))throw new Error("XML 顶层必须是对象,无法转换数组");return 1===Object.keys(e).length?E.build(e):E.build({root:e})}const R=[{label:"JSON",value:"json"},{label:"YAML",value:"yaml"},{label:"TOML",value:"toml"},{label:"XML",value:"xml"},{label:"Properties",value:"properties"}];let z=0;function L(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)("json"),[c,h]=(0,s.useState)("yaml"),[u,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(++z),[j,g]=(0,s.useState)(++z),v=(0,s.useRef)(""),b=(0,s.useRef)(""),w=(0,s.useRef)(null),S=(0,s.useRef)(null),C=e=>{v.current=e,f(++z)},y=n=>{const s=w.current?.getValue()??"";if(""!==s.trim())try{const e=function(e,t,n){return H(B(e,t),n)}(s,t,n);b.current=e,g(++z),p("")}catch(e){p(e.message)}else(0,d.zN)(e("need_input"))};return(0,x.jsxs)(r.xh,{children:[(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{widthPer:100,maxWidth:"60rem",children:(0,x.jsxs)(l.Zp,{title:e("JSON 格式转换"),children:[(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)(a.l6,{options:R,value:t,width:"9em",onChange:e=>{const t=w.current?.getValue();n(e),C(void 0!==t?t:v.current)}}),(0,x.jsx)("span",{children:e("转换成")}),(0,x.jsx)(a.l6,{options:R,value:c,width:"9em",onChange:h}),(0,x.jsx)(o.C3,{text:e("转换"),clickFun:()=>y(c)}),(0,x.jsx)(o.C3,{text:e("格式化"),clickFun:()=>y(t)}),(0,x.jsx)(o.C3,{text:e("结果转到输入"),clickFun:()=>{const t=S.current?.getValue();t?(n(c),C(t)):(0,d.zN)(e("输出为空"))}})]}),""!==u&&(0,x.jsx)("div",{className:"error_tip",children:u})]})})}),(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"50rem",children:(0,x.jsx)(l.Zp,{title:e("输入")+"("+t.toUpperCase()+")",children:(0,x.jsx)(P,{ref:w,className:"toolbox-ace",value:v.current,mode:$[t],wrap:!0,onChange:()=>p("")},m)})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"50rem",children:(0,x.jsx)(l.Zp,{title:e("输出")+"("+c.toUpperCase()+")",children:(0,x.jsx)(P,{ref:S,className:"toolbox-ace",value:b.current,mode:$[c],wrap:!0},j)})})]})]})}const O="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";const K=[{label:"Base64",value:"base64"},{label:"Base32",value:"base32"},{label:"Hex",value:"hex"},{label:"Unicode",value:"unicode"},{label:"URL",value:"url"},{label:"ASCII",value:"ascii"},{label:"HTML 实体",value:"html"}];function q(e,t,n=!1,s=!1){return"base64"===t?function(e){const t=(new TextEncoder).encode(e);let n="";return t.forEach(e=>n+=String.fromCharCode(e)),btoa(n)}(e):"base32"===t?function(e){const t=(new TextEncoder).encode(e);let n=0,s=0,r="";for(const e of t)for(s=s<<8|e,n+=8;n>=5;)r+=O[s>>>n-5&31],n-=5;for(n>0&&(r+=O[s<<5-n&31]);r.length%8!=0;)r+="=";return r}(e):"hex"===t?function(e,t=!1,n=!1){const s=(new TextEncoder).encode(e),r=[];return s.forEach(e=>{const n=e.toString(16).padStart(2,"0");r.push(t?n.toUpperCase():n)}),r.join(n?" ":"")}(e,n,s):"unicode"===t?function(e){let t="";for(const n of e){const e=n.codePointAt(0);if(e<128)t+=n;else if(e>65535){const n=(e-65536)%1024+56320;t+="\\u"+(Math.floor((e-65536)/1024)+55296).toString(16).padStart(4,"0"),t+="\\u"+n.toString(16).padStart(4,"0")}else t+="\\u"+e.toString(16).padStart(4,"0")}return t}(e):"url"===t?function(e,t=!0){return t?encodeURIComponent(e):encodeURI(e)}(e):"ascii"===t?function(e,t=!0){const n=(new TextEncoder).encode(e);return Array.from(n).join(t?" ":"")}(e,s):function(e){return e.replace(/[\s\S]/g,e=>{const t=e.codePointAt(0);return t>127?`&#${t};`:e})}(e)}function G(e,t){return"base64"===t?function(e){const t=atob(e.trim()),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return(new TextDecoder).decode(n)}(e):"base32"===t?function(e){const t=e.trim().replace(/=+$/,"").toUpperCase();let n=0,s=0;const r=[];for(const e of t){const t=O.indexOf(e);if(t<0)throw new Error(`非法的 Base32 字符:${e}`);s=s<<5|t,n+=5,n>=8&&(r.push(s>>>n-8&255),n-=8)}return(new TextDecoder).decode(new Uint8Array(r))}(e):"hex"===t?function(e){const t=e.replace(/[\s,]/g,"");if(t.length%2!=0)throw new Error("十六进制长度必须是偶数");if(!/^[0-9a-fA-F]*$/.test(t))throw new Error("包含非十六进制字符");const n=new Uint8Array(t.length/2);for(let e=0;e<n.length;e++)n[e]=parseInt(t.substr(2*e,2),16);return(new TextDecoder).decode(n)}(e):"unicode"===t?function(e){return e.replace(/\\u([0-9a-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}(e):"url"===t?function(e){return decodeURIComponent(e)}(e):"ascii"===t?function(e){const t=e.split(/[\s,]+/).filter(e=>""!==e),n=new Uint8Array(t.length);return t.forEach((e,t)=>{const s=Number(e);if(!Number.isInteger(s)||s<0||s>255)throw new Error(`非法的 ASCII 码:${e}`);n[t]=s}),(new TextDecoder).decode(n)}(e):function(e){return e.replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t))).replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>String.fromCodePoint(parseInt(t,16)))}(e)}function X(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)("base64"),[c,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(""),[j,g]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),w=e=>{try{p(e()),f("")}catch(e){f(e.message)}},S="hex"===t,y="hex"===t||"ascii"===t,N=t=>(0,x.jsx)(o.rA,{icon:"content_copy",title:e("复制"),onClick:()=>{""!==t?(0,C.lW)(t):(0,d.zN)(e("内容为空"))}});return(0,x.jsx)(r.xh,{children:(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:25,maxWidth:"20rem",children:(0,x.jsxs)(l.Zp,{title:e("编解码"),children:[(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)(a.l6,{options:K,value:t,width:"10em",onChange:n}),(0,x.jsx)(o.C3,{text:e("编码"),clickFun:()=>w(()=>q(c,t,j,v))}),(0,x.jsx)(o.C3,{text:e("解码"),clickFun:()=>w(()=>G(c,t))}),(0,x.jsx)(o.C3,{text:e("结果转到输入"),clickFun:()=>{""!==u?(h(u),p("")):(0,d.zN)(e("输出为空"))}}),S&&(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:j,onChange:e=>g(e.target.checked)}),(0,x.jsx)("span",{children:e("大写")})]}),y&&(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:v,onChange:e=>b(e.target.checked)}),(0,x.jsx)("span",{children:e("空格分隔")})]})]}),""!==m&&(0,x.jsx)("div",{className:"error_tip",children:m})]})}),(0,x.jsx)(r.VP,{widthPer:37.5,maxWidth:"30rem",children:(0,x.jsx)(l.Zp,{title:e("输入"),rightTopCom:N(c),children:(0,x.jsx)(a.Z2,{value:c,style:{width:"100%",height:"270px"},spellCheck:!1,handleInputChange:e=>{h(e),f("")},placeholder:e("codec_in_ph")})})}),(0,x.jsx)(r.VP,{widthPer:37.5,maxWidth:"30rem",children:(0,x.jsx)(l.Zp,{title:e("输出"),rightTopCom:N(u),children:(0,x.jsx)(a.Z2,{value:u,style:{width:"100%",height:"270px"},spellCheck:!1,handleInputChange:e=>p(e),placeholder:e("codec_out_ph")})})})]})})}var J=n(86940);const Y=[{label:"MD5",value:"md5"},{label:"SHA-1",value:"sha1"},{label:"SHA-256",value:"sha256"},{label:"SHA-384",value:"sha384"},{label:"SHA-512",value:"sha512"}],Q={md5:"MD5",sha1:"SHA-1",sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"};async function ee(e,t){if("md5"===t)return(0,J.F)(e);const n=(new TextEncoder).encode(e),s=await crypto.subtle.digest(Q[t],n);return r=s,Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("");var r}function te(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(""),[c,h]=(0,s.useState)({});return(0,s.useEffect)(()=>{let e=!0;if(""!==t)return async function(e){const t=await Promise.all(Y.map(async t=>[t.value,await ee(e,t.value)]));return Object.fromEntries(t)}(t).then(t=>{e&&h(t)}),()=>{e=!1};h({})},[t]),(0,x.jsx)(r.xh,{children:(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{widthPer:100,maxWidth:"60rem",children:(0,x.jsxs)(l.Zp,{title:e("摘要算法"),children:[(0,x.jsx)(a.Z2,{value:t,style:{width:"100%",height:"120px"},spellCheck:!1,handleInputChange:e=>n(e),placeholder:e("hash_in_ph")}),(0,x.jsx)("div",{style:{marginTop:"0.5em"},children:Y.map(t=>(0,x.jsxs)("div",{className:"hash-row",children:[(0,x.jsx)("span",{className:"hash-name",children:t.label}),(0,x.jsx)("span",{className:"hash-value",children:c[t.value]??""}),(0,x.jsx)(o.rA,{icon:"content_copy",title:e("复制"),onClick:()=>{const n=c[t.value];n?(0,C.lW)(n):(0,d.zN)(e("内容为空"))}})]},t.value))})]})})})})}const ne=[{label:"d",value:"d",desc:"分组索引"},{label:"g",value:"g",desc:"全局"},{label:"i",value:"i",desc:"忽略大小写"},{label:"m",value:"m",desc:"多行"},{label:"s",value:"s",desc:"含换行"},{label:"u",value:"u",desc:"Unicode",raw:!0},{label:"v",value:"v",desc:"Unicode 集合"},{label:"y",value:"y",desc:"粘性"}];function se(e,t){if(0===t.length)return e;const n=[];let s=0;return t.forEach((t,r)=>{t.index>s&&n.push(e.slice(s,t.index)),""!==t.text&&n.push((0,x.jsx)("mark",{className:"regex-mark",children:t.text},r)),s=t.index+t.text.length}),s<e.length&&n.push(e.slice(s)),n}function re(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(""),[o,c]=(0,s.useState)(""),[d,h]=(0,s.useState)("g"),u=(0,s.useMemo)(()=>function(e,t,n){if(""===e)return{matches:[],error:""};let s;try{s=new RegExp(e,t)}catch(e){return{matches:[],error:e.message}}const r=[],a=t.includes("g")||t.includes("y");let l,o=0;for(;null!==(l=s.exec(n))&&(r.push({text:l[0],index:l.index,groups:l.slice(1)}),a)&&(""===l[0]&&s.lastIndex++,!(++o>1e4)););return{matches:r,error:""}}(t,d,o),[t,d,o]);return(0,x.jsxs)(r.xh,{children:[(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{widthPer:100,maxWidth:"60rem",children:(0,x.jsxs)(l.Zp,{title:e("正则表达式"),children:[(0,x.jsxs)("div",{className:"regex-input-row",children:[(0,x.jsx)("span",{className:"regex-slash",children:"/"}),(0,x.jsx)(a.Sm,{width:"100%",value:t,placeholder:e("正则表达式"),handleInputChange:e=>n(e)}),(0,x.jsx)("span",{className:"regex-slash",children:"/"}),(0,x.jsx)("span",{className:"regex-flags",children:d})]}),(0,x.jsx)("div",{className:"regex-flag-row",children:ne.map(t=>(0,x.jsxs)("label",{title:t.raw?t.desc:e(t.desc),className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:d.includes(t.value),onChange:()=>{return e=t.value,void h(t=>t.includes(e)?t.replace(e,""):t+e);var e}}),(0,x.jsx)("span",{className:"regex-flag-letter",children:t.label}),(0,x.jsx)("span",{children:t.raw?t.desc:e(t.desc)})]},t.value))}),""!==u.error&&(0,x.jsx)("div",{className:"error_tip",children:u.error}),(0,x.jsxs)("div",{style:{marginTop:"0.5em"},children:[e("匹配到")," ",(0,x.jsx)("b",{children:u.matches.length})," ",e("处")]})]})})}),(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(l.Zp,{title:e("测试文本"),children:(0,x.jsx)(a.Z2,{value:o,style:{width:"100%",height:"260px"},spellCheck:!1,handleInputChange:e=>c(e),placeholder:e("regex_in_ph")})})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(l.Zp,{title:e("高亮结果"),children:(0,x.jsx)("div",{className:"regex-preview",children:""===o?(0,x.jsx)("span",{className:"regex-empty",children:e("regex_empty")}):se(o,u.matches)})})})]}),u.matches.length>0&&(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{widthPer:100,maxWidth:"60rem",children:(0,x.jsx)(l.Zp,{title:e("匹配详情"),children:(0,x.jsx)("div",{className:"regex-match-list",children:u.matches.map((t,n)=>(0,x.jsxs)("div",{className:"regex-match-item",children:[(0,x.jsxs)("span",{className:"regex-match-index",children:["#",n+1]}),(0,x.jsx)("span",{className:"regex-match-text",children:""===t.text?e("空"):t.text}),(0,x.jsxs)("span",{className:"regex-match-pos",children:[e("位置")," ",t.index]}),t.groups.length>0&&(0,x.jsx)("span",{className:"regex-match-groups",children:t.groups.map((t,n)=>(0,x.jsxs)("span",{className:"regex-group",children:["$",n+1,"=",t??e("未匹配")]},n))})]},n))})})})})]})}function ae(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(String(Math.floor(Date.now()/1e3))),[r,c]=(0,s.useState)(""),h=function(e){const t=Number(e.trim());return!Number.isFinite(t)||t<=0?null:new Date(t<1e11?1e3*t:t)}(t),u=new Date,p=h?function(e){const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`}(h):e("无效时间戳");return(0,x.jsxs)(l.Zp,{title:e("时间转换"),children:[(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)("span",{className:"toolbox-label",children:e("时间戳")}),(0,x.jsx)(a.Sm,{width:"14em",value:t,placeholder:e("秒或毫秒"),handleInputChange:n}),(0,x.jsx)(o.C3,{text:e("现在"),clickFun:()=>n(String(Math.floor(Date.now()/1e3)))})]}),(0,x.jsxs)("div",{className:"toolbox-kv",children:[(0,x.jsx)("span",{children:e("秒级")}),(0,x.jsx)("span",{className:"toolbox-mono",children:h?Math.floor(h.getTime()/1e3):"-"}),(0,x.jsx)("span",{children:e("毫秒级")}),(0,x.jsx)("span",{className:"toolbox-mono",children:h?h.getTime():"-"}),(0,x.jsx)("span",{children:e("本地时间")}),(0,x.jsx)("span",{className:"toolbox-mono",children:p}),(0,x.jsx)("span",{children:"ISO 8601"}),(0,x.jsx)("span",{className:"toolbox-mono",children:h?h.toISOString():"-"}),(0,x.jsx)("span",{children:e("UTC 时间")}),(0,x.jsx)("span",{className:"toolbox-mono",children:h?h.toUTCString():"-"}),(0,x.jsx)("span",{children:e("距现在")}),(0,x.jsx)("span",{className:"toolbox-mono",children:h?le(h.getTime()-u.getTime(),e):"-"})]}),(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",marginTop:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)("span",{className:"toolbox-label",children:e("日期")}),(0,x.jsx)(a.Sm,{width:"14em",value:r,placeholder:"2024-01-01 12:00:00",handleInputChange:c}),(0,x.jsx)(o.C3,{text:e("转时间戳"),clickFun:()=>{const t=new Date(r.trim().replace(" ","T"));isNaN(t.getTime())?(0,d.zN)(e("date_invalid")):n(String(Math.floor(t.getTime()/1e3)))}})]})]})}function le(e,t){const n=Math.abs(e),s=e>0,r=[[864e5,t("天")],[36e5,t("小时")],[6e4,t("分钟")],[1e3,t("秒")]];for(const[e,a]of r)if(n>=e){const r=Math.floor(n/e);return`${t(s?"还有":"已过去")} ${r} ${a}`}return t("刚刚")}function oe(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)("255"),[r,o]=(0,s.useState)("10"),c=[{label:"2 "+e("进制"),value:"2"},{label:"8 "+e("进制"),value:"8"},{label:"10 "+e("进制"),value:"10"},{label:"16 "+e("进制"),value:"16"},{label:"36 "+e("进制"),value:"36"}];let d=NaN;try{const e=t.trim().toLowerCase().replace(/^0x/,"");d="10"===r?Number(e):parseInt(e,Number(r))}catch(e){d=NaN}const h=[];return Number.isFinite(d)&&(h.push({label:"2 "+e("进制"),v:d.toString(2)}),h.push({label:"8 "+e("进制"),v:d.toString(8)}),h.push({label:"10 "+e("进制"),v:d.toString(10)}),h.push({label:"16 "+e("进制"),v:d.toString(16).toUpperCase()}),h.push({label:"36 "+e("进制"),v:d.toString(36).toUpperCase()}),h.push({label:e("字节"),v:ce(d,e)})),(0,x.jsxs)(l.Zp,{title:e("进制转换"),children:[(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)(a.Sm,{width:"14em",value:t,placeholder:e("输入数值"),handleInputChange:e=>n(e)}),(0,x.jsx)(a.l6,{options:c,value:r,width:"8em",onChange:o})]}),Number.isFinite(d)?(0,x.jsx)("div",{className:"toolbox-kv",children:h.map(e=>(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)("span",{children:e.label}),(0,x.jsx)("span",{className:"toolbox-mono",children:e.v})]},e.label))}):(0,x.jsx)("div",{className:"error_tip",children:e("num_invalid")})]})}function ce(e,t){if(e<0||!Number.isInteger(e))return"-";const n=Math.max(8,8*Math.ceil(e.toString(2).length/8));return`${n/8} ${t("字节")} (${n} ${t("位")})`}function ie(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)("#4a90d9"),r=function(e){const t=e.trim().replace(/^#/,"");return/^[0-9a-fA-F]{3}$/.test(t)?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16)}:/^[0-9a-fA-F]{6}$/.test(t)?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16)}:null}(t),c=r?function(e,t,n){const s=e/255,r=t/255,a=n/255,l=Math.max(s,r,a),o=Math.min(s,r,a),c=(l+o)/2;if(l===o)return{h:0,s:0,l:Math.round(100*c)};const i=l-o,d=c>.5?i/(2-l-o):i/(l+o);let h=0;return h=l===s?((r-a)/i+(r<a?6:0))/6:l===r?((a-s)/i+2)/6:((s-r)/i+4)/6,{h:Math.round(360*h),s:Math.round(100*d),l:Math.round(100*c)}}(r.r,r.g,r.b):null;return(0,x.jsxs)(l.Zp,{title:e("颜色转换"),children:[(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)("input",{type:"color",className:"toolbox-color-picker",value:r?de(r.r,r.g,r.b):"#000000",onChange:e=>n(e.target.value)}),(0,x.jsx)(a.Sm,{width:"12em",value:t,placeholder:"#4a90d9",handleInputChange:n}),(0,x.jsx)(o.rA,{icon:"content_copy",title:e("复制颜色"),onClick:()=>{r?(0,C.lW)(de(r.r,r.g,r.b)):(0,d.zN)(e("颜色格式无效"))}})]}),r&&c?(0,x.jsxs)("div",{className:"toolbox-kv",children:[(0,x.jsx)("span",{children:"HEX"}),(0,x.jsx)("span",{className:"toolbox-mono",children:de(r.r,r.g,r.b).toUpperCase()}),(0,x.jsx)("span",{children:"RGB"}),(0,x.jsxs)("span",{className:"toolbox-mono",children:["rgb(",r.r,", ",r.g,", ",r.b,")"]}),(0,x.jsx)("span",{children:"RGBA"}),(0,x.jsxs)("span",{className:"toolbox-mono",children:["rgba(",r.r,", ",r.g,", ",r.b,", 1)"]}),(0,x.jsx)("span",{children:"HSL"}),(0,x.jsxs)("span",{className:"toolbox-mono",children:["hsl(",c.h,", ",c.s,"%, ",c.l,"%)"]})]}):(0,x.jsx)("div",{className:"error_tip",children:e("color_invalid")})]})}function de(e,t,n){const s=e=>e.toString(16).padStart(2,"0");return`#${s(e)}${s(t)}${s(n)}`}const he="0123456789abcdef";function ue(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t="";return e.forEach(e=>t+=he[e>>4]+he[15&e]),`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const xe="abcdefghijklmnopqrstuvwxyz",pe="ABCDEFGHIJKLMNOPQRSTUVWXYZ",me="0123456789",fe="!@#$%^&*()-_=+[]{};:,.<>?";function je(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(()=>[ue(),ue(),ue()]),[r,c]=(0,s.useState)("16"),[h,u]=(0,s.useState)(!0),[p,m]=(0,s.useState)(!0),[f,j]=(0,s.useState)(!0),[g,v]=(0,s.useState)(!1),[b,w]=(0,s.useState)("");return(0,x.jsxs)(l.Zp,{title:e("UUID / 随机密码"),children:[(0,x.jsx)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",flexWrap:"wrap"},children:(0,x.jsx)(o.C3,{text:e("生成 UUID"),clickFun:()=>n([ue(),ue(),ue()])})}),(0,x.jsx)("div",{className:"toolbox-kv",children:t.map((t,n)=>(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)("span",{children:["UUID ",n+1]}),(0,x.jsx)("span",{className:"toolbox-mono toolbox-copyable",onClick:()=>(0,C.lW)(t),title:e("点击复制"),children:t})]},n))}),(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",marginTop:"0.75em",flexWrap:"wrap"},children:[(0,x.jsx)("span",{className:"toolbox-label",children:e("长度")}),(0,x.jsx)(a.Sm,{width:"5em",value:r,handleInputChange:c}),(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:h,onChange:e=>u(e.target.checked)}),(0,x.jsx)("span",{children:"a-z"})]}),(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:p,onChange:e=>m(e.target.checked)}),(0,x.jsx)("span",{children:"A-Z"})]}),(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:f,onChange:e=>j(e.target.checked)}),(0,x.jsx)("span",{children:"0-9"})]}),(0,x.jsxs)("label",{className:"toolbox-check",children:[(0,x.jsx)("input",{type:"checkbox",checked:g,onChange:e=>v(e.target.checked)}),(0,x.jsx)("span",{children:e("符号")})]}),(0,x.jsx)(o.C3,{text:e("生成密码"),clickFun:()=>{let t="";if(h&&(t+=xe),p&&(t+=pe),f&&(t+=me),g&&(t+=fe),""===t)return void(0,d.zN)(e("pw_need_set"));const n=Math.max(1,Math.min(256,Number(r)||16)),s=new Uint32Array(n);crypto.getRandomValues(s);let a="";for(let e=0;e<n;e++)a+=t[s[e]%t.length];w(a)}})]}),""!==b&&(0,x.jsxs)("div",{className:"toolbox-kv",children:[(0,x.jsx)("span",{children:e("密码")}),(0,x.jsx)("span",{className:"toolbox-mono toolbox-copyable",onClick:()=>(0,C.lW)(b),title:e("点击复制"),children:b})]})]})}function ge(){return(0,x.jsxs)(r.xh,{children:[(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(ae,{})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(oe,{})})]}),(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(ie,{})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(je,{})})]})]})}var ve=n(87583);const be=[{label:"L (7%)",value:"L"},{label:"M (15%)",value:"M"},{label:"Q (25%)",value:"Q"},{label:"H (30%)",value:"H"}];function we(){const{t:e}=(0,i.Bd)(),t=(0,s.useRef)(null),[n,c]=(0,s.useState)(""),[h,u]=(0,s.useState)("320"),[p,m]=(0,s.useState)("M"),[f,j]=(0,s.useState)("");(0,s.useEffect)(()=>{const e=t.current;if(!e)return;if(""===n){const t=e.getContext("2d");return t?.clearRect(0,0,e.width,e.height),void j("")}const s=Math.max(80,Math.min(2048,Number(h)||320));ve.toCanvas(e,n,{width:s,margin:2,errorCorrectionLevel:p}).then(()=>j("")).catch(e=>{j(e.message)})},[n,h,p]);const g=()=>{const s=t.current;if(!s||""===n)return void(0,d.zN)(e("qr_none"));const r=s.toDataURL("image/png"),a=document.createElement("a");a.href=r,a.download="qrcode.png",a.click()};return(0,x.jsx)(r.xh,{children:(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsxs)(l.Zp,{title:e("二维码生成"),children:[(0,x.jsx)(a.Z2,{value:n,style:{width:"100%",height:"200px"},spellCheck:!1,handleInputChange:e=>c(e),placeholder:e("qr_in_ph")}),(0,x.jsxs)("div",{className:"div-row",style:{alignItems:"center",gap:"0.5em",marginTop:"0.5em",flexWrap:"wrap"},children:[(0,x.jsx)("span",{className:"toolbox-label",children:e("尺寸")}),(0,x.jsx)(a.Sm,{width:"6em",value:h,handleInputChange:e=>u(e)}),(0,x.jsx)("span",{className:"toolbox-label",children:e("纠错级别")}),(0,x.jsx)("select",{className:"toolbox-select",value:p,onChange:e=>m(e.target.value),children:be.map(e=>(0,x.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,x.jsx)(o.C3,{text:e("下载 PNG"),clickFun:g})]}),""!==f&&(0,x.jsx)("div",{className:"error_tip",children:f})]})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"30rem",children:(0,x.jsx)(l.Zp,{title:e("预览"),rightTopCom:(0,x.jsx)(o.rA,{icon:"download",title:e("下载"),onClick:g}),children:(0,x.jsxs)("div",{className:"toolbox-qr-preview",children:[(0,x.jsx)("canvas",{ref:t,style:{display:""===n?"none":"block"}}),""===n&&(0,x.jsx)("span",{className:"toolbox-empty",children:e("qr_empty")})]})})})]})})}var Se=n(20734);function Ce(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(""),[o,c]=(0,s.useState)(""),d=""!==t||""!==o;return(0,x.jsxs)(r.xh,{children:[(0,x.jsxs)(r.fI,{children:[(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"50rem",children:(0,x.jsx)(l.Zp,{title:e("原文本"),children:(0,x.jsx)(a.Z2,{value:t,style:{width:"100%",height:"200px"},spellCheck:!1,handleInputChange:e=>n(e),placeholder:e("粘贴原文本")})})}),(0,x.jsx)(r.VP,{widthPer:50,maxWidth:"50rem",children:(0,x.jsx)(l.Zp,{title:e("新文本"),children:(0,x.jsx)(a.Z2,{value:o,style:{width:"100%",height:"200px"},spellCheck:!1,handleInputChange:e=>c(e),placeholder:e("粘贴新文本")})})})]}),(0,x.jsx)(r.fI,{children:(0,x.jsx)(r.VP,{widthPer:100,maxWidth:"100rem",children:(0,x.jsx)(l.Zp,{title:e("差异"),children:(0,x.jsx)("div",{className:"text-diff-box",children:d?(0,x.jsx)(Se.A,{valueA:t,valueB:o,mode:"split"}):(0,x.jsx)("div",{className:"text-diff-empty",children:e("输入文本后这里显示差异")})})})})})]})}var ye=n(87361);function Ne(e){const{t}=(0,i.Bd)(),{check_user_auth:n}=(0,j.MH)(),s=[];return s.push({index:1,name:t("开发者工具"),rto:"developer/",component:(0,x.jsx)(ge,{})},{index:1,name:t("时间工具"),rto:"timeutil/",component:(0,x.jsx)(p,{})},{index:1,name:t("JSON 格式转换"),rto:"format/",component:(0,x.jsx)(L,{})},{index:1,name:t("编解码"),rto:"codec/",component:(0,x.jsx)(X,{})},{index:1,name:t("摘要算法"),rto:"hash/",component:(0,x.jsx)(te,{})},{index:1,name:t("正则测试"),rto:"regex/",component:(0,x.jsx)(re,{})},{index:1,name:t("文本对比"),rto:"diff/",component:(0,x.jsx)(Ce,{})},{index:1,name:t("二维码"),rto:"qrcode/",component:(0,x.jsx)(we,{})},{index:1,name:t("非对称密钥"),rto:"crypto/",component:(0,x.jsx)(N,{})}),n(g.oV.port_scan)&&s.push({index:1,name:t("端口扫描"),rto:"portscan/",component:(0,x.jsx)(I,{})}),n(g.oV.wol_proxy)&&s.push({index:1,name:t("网络唤醒"),rto:"netwol/",component:(0,x.jsx)(v,{})}),(0,x.jsx)(r.W1,{optionList:s,father_route:ye.o.toolbox})}}}]);
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><base href="/"><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="/main.f512bdab9a0595432be0.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
1
+ <!doctype html><html lang="en"><head><base href="/"><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="/main.19ecdddaf894b36f1a47.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>