filecat 6.49.1 → 6.50.1

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7180],{75007(e,t,s){s.d(t,{h:()=>o});s(96540);var n=s(85997),c=s(74848);function o(e){return(0,c.jsxs)("h2",{className:"message",children:[(0,c.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,c.jsx)("span",{children:e.context})]})}},22081(e,t,s){var n=s(96540),c=s(16349),o=s(74848);const i=({percentage:e})=>{const t=(0,n.useRef)(null),[s,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new c.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 i(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})})};s.d(t,["A",0,i])},77481(e,t,s){s.d(t,{S:()=>i,X:()=>o});var n=s(96540),c=s(74848);function o(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,c.jsxs)("table",{children:[(0,c.jsx)("thead",{children:(0,c.jsx)("tr",{children:e.headers?.map((e,t)=>(0,c.jsx)("th",{children:e},t))})}),(0,c.jsx)("tbody",{children:t.map((t,s)=>(0,c.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,c.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function i(e){return(0,c.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,c.jsx)("div",{children:e},t))})}},88062(e,t,s){s(96540),s(47022);var n=s(74848);function c(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)(c,{...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))})]}),i=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))})});s.d(t,["A",0,i])},57180(e,t,s){s.r(t),s.d(t,{default:()=>Q});var n=s(96540),c=s(75725),o=s(70447),i=s(22081),r=s(92275),l=s(14944),a=s(14284),d=s(57952),h=s(85997),x=s(77481),u=s(53459),p=s(34899),j=s(34843),f=s(82893),m=s(74777),_=s(62042),w=s(61443),g=s(74848);function y(e){const{t}=(0,p.Bd)(),[s,i]=(0,j.fp)(f.AG.disk),[r,l]=(0,n.useState)({}),[m,_]=(0,n.useState)([]),w=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===u.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,g.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}_(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:t("关闭"),onClick:()=>{i({})}})}),(0,g.jsx)(c.jW,{isFull:!0,more:!0,children:(0,g.jsx)(c.NN,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsxs)(c.VP,{widthPer:30,children:[(0,g.jsx)(c.xh,{children:(0,g.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,g.jsx)(c.Yh,{left:t("名字"),right:e.name}),(0,g.jsx)(c.Yh,{left:t("厂商名称"),right:e.typeName}),(0,g.jsx)(c.Yh,{left:t("类型"),right:e.type}),(0,g.jsx)(c.Yh,{left:t("容量"),right:e.total})]})}),(0,g.jsx)(c.xh,{children:(0,g.jsxs)(o.Zp,{title:t("物理信息"),children:[(0,g.jsx)(c.Yh,{left:t("是否健康"),right:!0===r.smart_status?"是":"否"}),(0,g.jsx)(c.Yh,{left:t("设备型号"),right:r.model_name}),(0,g.jsx)(c.Yh,{left:t("序列号"),right:r.serial_number}),(0,g.jsx)(c.Yh,{left:t("固件版本"),right:r.firmware_version}),(0,g.jsx)(c.Yh,{left:t("转速(每分钟)"),right:r.rotation_rate}),(0,g.jsx)(c.Yh,{left:t("通电时长(小时)"),right:r.power_on_time_hours}),(0,g.jsx)(c.Yh,{left:t("通电次数"),right:r.power_cycle_count}),(0,g.jsx)(c.Yh,{left:t("温度(°C)"),right:r.temperature}),(0,g.jsx)(c.Yh,{left:t("通信协议"),right:r.device_protocol})]})})]}),(0,g.jsx)(c.VP,{widthPer:50,children:(0,g.jsxs)(c.xh,{children:[m?.length?(0,g.jsx)(o.uF,{title:t("ATA/SATA详细信息"),children:(0,g.jsx)(x.X,{headers:w,rows:m,width:"10rem"})}):(0,g.jsx)(g.Fragment,{}),r.nvme_smart?(0,g.jsxs)(o.Zp,{title:t("NVME详细信息"),children:[(0,g.jsx)(c.Yh,{left:t("NVMe 可用备用块(%)"),right:r.nvme_smart.available_spare}),(0,g.jsx)(c.Yh,{left:t("NVMe 已使用寿命(%)"),right:r.nvme_smart.percentage_used}),(0,g.jsx)(c.Yh,{left:t("NVMe 读取量"),right:r.nvme_smart.data_units_read}),(0,g.jsx)(c.Yh,{left:t("NVMe 写入量"),right:r.nvme_smart.data_units_written}),(0,g.jsx)(c.Yh,{left:t("NVMe 通电次数"),right:r.nvme_smart.power_cycles}),(0,g.jsx)(c.Yh,{left:t("NVMe 通电时长(小时)"),right:r.nvme_smart.power_on_hours}),(0,g.jsx)(c.Yh,{left:t("NVMe 非正常关机"),right:r.nvme_smart.unsafe_shutdowns}),(0,g.jsx)(c.Yh,{left:t("NVMe 媒体错误"),right:r.nvme_smart.media_errors}),(0,g.jsx)(c.Yh,{left:t("NVMe 错误日志数"),right:r.nvme_smart.num_err_log_entries})]}):(0,g.jsx)(g.Fragment,{})]})})]})})})]})}let k=function(e){return e[e.mount=0]="mount",e}({});var v=s(88062),S=s(78247),A=s(23430);const C=e=>(0,g.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,g.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function b(){return(0,g.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,g.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,j.fp)(f.AG.disk),[i,r]=(0,n.useState)({}),[l,m]=(0,n.useState)([]),[w,y]=(0,n.useState)([]),[P,V]=(0,j.fp)(f.AG.showPrompt),{check_user_auth:Y}=(0,S.MH)(),[F,M]=(0,n.useState)([]),{click_file:$}=(0,S.kZ)(),[I,K]=(0,j.fp)(f.AG.prompt_card),E=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],N=async()=>{const e=await a.Yu.get("disk/blk");return e.code===u.m.Success&&m(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{N()})()},[]);const H=[(0,g.jsx)(h.rA,{icon:"info",title:e("提示"),onClick:async()=>{K({open:!0,title:"信息",context_div:(0,g.jsx)("div",{children:(0,g.jsxs)("ul",{children:[(0,g.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,g.jsxs)("li",{children:["文件系统,有多种格式",(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,g.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,g.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,g.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,g.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,g.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,g.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,g.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,g.jsx)("li",{children:"rw:以读写方式挂载"}),(0,g.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,g.jsx)("li",{children:"...等"})]})]}),(0,g.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,g.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,g.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:k.mount})).code===u.m.Success&&(0,_.SK)("挂载文件已生效")}},1)],G=async()=>(await a.Yu.get("get_fstab")).data,Z=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,g.jsx)(c.jW,{isFull:!0,more:!0,children:(0,g.jsx)(c.NN,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:40,children:(0,g.jsxs)(o.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:(0,g.jsxs)("div",{children:[Y(A.oV.sys_disk_mount)&&(0,g.jsx)(h.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{$({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:G,save_file_fun:Z,menu_list:H})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await N()===u.m.Success&&(0,_.SK)("刷新成功")}})]}),children:[(0,g.jsx)(x.X,{headers:E,rows:w,width:"10rem"}),(0,g.jsx)(v.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,g.jsxs)("span",{children:[t,(0,g.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]+";";y([[(0,g.jsx)(o.xP,{children:s}),(0,g.jsx)(o.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,g.jsx)(o.xP,{children:t.path}),t.pttype]])}})]})}),(0,g.jsx)(c.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 i=[];for(const e of t.lv_list)i.push({name:`${e.name}---(${e.size})`});return(0,g.jsx)(o.Zp,{children:(0,g.jsxs)(c.n5,{children:[(0,g.jsx)(C,{name:e("物理卷"),lvms:n}),(0,g.jsx)(b,{}),(0,g.jsx)(C,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,g.jsx)(b,{}),(0,g.jsx)(C,{name:e("逻辑卷"),lvms:i})]})},s)})})]})})})]})}var V=s(88815);let Y=!0;function F(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],w=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[k,v]=(0,j.fp)(f.AG.user_base_info),[S,C]=(0,n.useState)(0),[b,F]=(0,n.useState)(0),[M,$]=(0,n.useState)(0),[I,K]=(0,n.useState)(0),[E,N]=(0,n.useState)(0),[H,G]=(0,n.useState)({}),[Z,B]=(0,n.useState)(!1),[W,z]=(0,n.useState)(!1),[X,L]=(0,n.useState)(!1),[T,q]=(0,n.useState)(Y),[D,U]=(0,n.useState)(null),[O,J]=(0,n.useState)([]),[R,Q]=(0,n.useState)([]),[ee,te]=(0,j.fp)(f.AG.user_base_info),[se,ne]=(0,j.fp)(f.AG.disk),ce=async()=>{if(!Y)return;const e=new r.hf(r.HK.sys_get);await l.ws.send(e),l.ws.addMsg(r.HK.sys_getting,e=>{K(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;F(t),$(s),C((s-t)/s*100),U(e.context?.node_memory_usage),N(e.context?.node_cpu_usage)})};return(0,n.useEffect)(()=>((async()=>{await ce()})(),()=>{l.ws.sendData(r.HK.sys_cancel,{})}),[]),(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[k.sys===A.XM.linux&&(0,g.jsx)(h.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{B(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===u.m.Success){const t=e.data;G(t)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===u.m.Success){const s=e.data,n=[];let c=!0;ee.sysSoftWare&&ee.sysSoftWare[m.jk.smartmontools]&&ee.sysSoftWare[m.jk.smartmontools].installed||(c=!1);for(const e of s??[])n.push([(0,g.jsx)(o.xP,{context:e.name}),e.typeName,e.type,e.total,(0,g.jsx)(h.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{c?ne({type:"check",data:e}):(0,_.zN)("没有安装smartmontools")}})]);J(n)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{L(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===u.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,g.jsx)(o.xP,{context:e.name}),(0,g.jsx)(o.xP,{context:e.device_name}),e.fsType,(0,g.jsx)(o.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:T,text:t("实时信息"),clickFun:e=>{q(e),Y=e,ce()}})]}),(0,g.jsxs)(c.xh,{children:[T&&(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"Sys "+t("内存"),children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{children:(0,g.jsx)(i.A,{percentage:S})}),(0,g.jsx)(c.VP,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:100,children:(0,g.jsx)("div",{children:(0,g.jsx)(c.Yh,{left:t("总容量"),center:`${M}G`})})}),(0,g.jsx)(c.VP,{widthPer:100,children:(0,g.jsx)(c.Yh,{left:t("剩余"),center:`${b}G`})})]})})]})})}),(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"Sys cpu",children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{children:(0,g.jsx)(i.A,{percentage:I})}),(0,g.jsx)(c.VP,{children:(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.Yh,{left:t("使用率"),center:I})})})]})})}),(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"FileCat",children:(0,g.jsxs)(c.fI,{children:[(0,g.jsxs)(c.VP,{children:[(0,g.jsx)(c.qV,{content:t("内存")}),(0,g.jsx)(c.qV,{content:"total: "+(0,V.v7)(D?.rss)}),(0,g.jsx)(c.qV,{content:"object: "+(0,V.v7)(D?.heapTotal)}),(0,g.jsx)(c.qV,{content:"obj-use: "+(0,V.v7)(D?.heapUsed)}),(0,g.jsx)(c.qV,{content:"external: "+(0,V.v7)(D?.external)}),(0,g.jsx)(c.qV,{content:"buffer: "+(0,V.v7)(D?.arrayBuffers)})]}),(0,g.jsx)(c.VP,{children:(0,g.jsx)(c.qV,{content:"cpu growth rate: "+E})})]})})})]}),(0,g.jsxs)(c.fI,{children:[Z&&(0,g.jsx)(c.VP,{children:(0,g.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,g.jsx)(c.Yh,{left:t("总内存"),right:H.mem_total}),(0,g.jsx)(c.Yh,{left:`cpu ${t("制造商")}`,right:H.cpu_manufacturer}),(0,g.jsx)(c.Yh,{left:`cpu ${t("品牌")}`,right:H.cpu_brand}),(0,g.jsx)(c.Yh,{left:`cpu ${t("逻辑核心")}`,right:H.cpu_core_num}),(0,g.jsx)(c.Yh,{left:`cpu ${t("物理核心")}`,right:H.cpu_phy_core_num}),(0,g.jsx)(c.Yh,{left:`cpu ${t("最大")}hz`,right:H.cpu_speed_hz}),(0,g.jsx)(c.Yh,{left:`${t("当前系统")}:pid;ppid`,right:H.pid_ppid}),(0,g.jsx)(c.Yh,{left:t("运行用户"),right:H.user})]})}),W&&(0,g.jsx)(c.VP,{children:(0,g.jsx)(o.uF,{title:t("物理硬盘"),children:(0,g.jsx)(x.X,{headers:s,rows:O,width:"10rem"})})}),X&&(0,g.jsx)(c.VP,{children:(0,g.jsx)(o.uF,{title:t("文件硬盘"),children:(0,g.jsx)(x.X,{headers:w,rows:R,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,g.jsx)(y,{...se.data}),se&&"mount"===se.type&&(0,g.jsx)(P,{})]})}var M=s(75007),$=s(97856),I=s(64405);const K=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function E(e){const[t,s]=(0,n.useState)(null),[c,o]=(0,j.fp)(f.AG.dockerShellShow),[i,a]=(0,j.fp)(f.AG.user_base_info),d=i.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{c.show?(async()=>{const e=new $.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(h);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===c.type?r.HK.docker_shell_logs_getting:r.HK.docker_shell_exec_getting,e=>{"error"===e.context&&h(),t(e.context)}),"exec"===c.type&&e.onData(async e=>{const t=new r.hf(r.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():h()},[c]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(K,{show:c.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n=new I.n;let o;n.rows=e,n.cols=s,n.dockerId=c.dockerId,o="logs"===c.type?new r.hf(r.HK.docker_shell_logs):new r.hf(r.HK.docker_shell_exec_open),o.context=n,l.ws.send(o)}})}var N=s(27690);let H="",G=[],Z=!1;function B(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)({}),[m,y]=(0,n.useState)([]),[k,v]=(0,n.useState)([]),{check_user_auth:C}=(0,S.MH)(),[b,P]=(0,j.fp)(f.AG.dockerShellShow),[V,Y]=(0,j.fp)(f.AG.showPrompt),[F,$]=(0,j.fp)(f.AG.confirm),[I,K]=(0,n.useState)(H),[B,W]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[z,X]=(0,n.useState)([]),[L,T]=(0,n.useState)(void 0),[q,D]=(0,n.useState)(!1),U=["id",t("name"),t("create时间"),t("大小"),(0,g.jsxs)("span",{children:["选中",(0,g.jsx)(h.rA,{icon:"check_box",title:"全选",onClick:()=>{Z=!Z;const e={};for(let t=0;t<k.length&&Z;t++)e[k[t][0].props.context]=1;i(e)}})]})],O=async()=>{y([]),X([]);const e=new r.hf(r.HK.docker_get);await l.ws.send(e),l.ws.addMsg(r.HK.docker_getting,e=>{const t=[];if(H){for(const s of e.context)for(const e of s)if(`${e}`.includes(H)){t.push(s);break}}else t.push(...e.context);y(t.map(e=>{const t=e.map(e=>(0,g.jsx)(o.xP,{context:e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{X(t)}})),t}))})};(0,n.useEffect)(()=>(K(H),O(),()=>{(async()=>{P({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{H=I},[I]);const J=()=>{const e=new r.hf("logs"===b.type?r.HK.docker_shell_logs_cancel:r.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},R=e=>{const t=new r.hf(r.HK.docker_switch);t.context={type:e,dockerId:z[0].props.context},X([]),l.ws.send(t)},Q=async()=>{const e=await a.Yu.get("docker/images");if(e.code===u.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],c=[(0,g.jsx)(o.xP,{context:n[0]}),(0,g.jsx)(o.xP,{context:n[1]}),n[2],n[3],""];s.push(c)}G=s,v(s)}};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("docker镜像"),clickFun:e=>{D(e),e?(Q(),X([])):(O(),v([]),i({}))}}),children:[Object.keys(s).length>0&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{$({open:!0,title:t("确定删除选中的镜像吗"),handle:async()=>{const e=Object.keys(s),t=await a.Yu.post("docker/check/delete",{ids:e});if(t.code===u.m.Success)if(0===t.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===u.m.Success&&((0,_.SK)("删除完成"),Q(),$({open:!1,handle:null}))}else(0,_.N9)(`有镜像正在运行${JSON.stringify(t.data)}`)}})}}),z.length>0&&(0,g.jsx)("div",{children:z[1].props.context}),z.length>0&&(0,g.jsxs)("div",{children:[C(A.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{Y({show:!0,overlay:!0,type:N.PromptEnum.DockerDel,data:{dockerId:z[0].props.context,name:z[1].props.context}})}}),(0,g.jsx)(h.rA,{icon:"print",title:t("打印日志"),onClick:()=>{b.show?(P({show:!1,type:"",dockerId:""}),J()):P({show:!0,dockerId:z[0].props.context,type:"logs"})}}),C(A.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{b.show?(P({show:!1,type:"",dockerId:""}),J()):P({show:!0,dockerId:z[0].props.context,type:"exec"})}}),C(A.oV.docker_container_update)&&z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>R("stop")}),C(A.oV.docker_container_update)&&!z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{R("start")}})]}),(0!==m.length||I)&&!q&&(0,g.jsx)(h.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new r.hf(r.HK.docker_get);await l.ws.send(e)}})]}),(0,g.jsxs)(c.xh,{children:[q&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("镜像")} (${k.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤镜像"),value:L,handleInputChange:e=>{T(e)},handlerEnter:()=>{const e=[];if(L){for(const t of k)(t[0].props.context.includes(L)||t[1].props.context.includes(L))&&e.push(t);v(e)}else v(G)}}),children:(0,g.jsx)(x.X,{headers:U,rows:k.map((e,n)=>(e[4]=(0,g.jsx)(w.GL,{context:t(""),selected:s[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,s),t[e]?delete t[e]:t[e]=1,i(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===m.length&&!I&&!q&&(0,g.jsx)(M.h,{context:t("检测不到docker,主机可能没有安装docker or 容器为空")}),(0!==m.length||I)&&!q&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("容器")} (${m.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤"),value:I,handleInputChange:e=>{K(e)}}),children:(0,g.jsx)(x.X,{headers:B,rows:m,width:"10rem"})})})})]}),(0,g.jsx)(E,{})]})}var W=s(64694);let z="",X=!1,L=!1;function T(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)([]),[a,u]=(0,n.useState)([]),[j,f]=(0,n.useState)(0),[m,_]=(0,n.useState)(""),[y,k]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,g.jsxs)("span",{children:[t("内存"),(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{X=!X}})]}),(0,g.jsxs)("span",{children:["cpu%",(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{L=!L}})]}),t("选择")]),{check_user_auth:v}=(0,S.MH)();(0,n.useEffect)(()=>{_(z),(async()=>{i([]),f(0),u([]);const e=new r.hf(r.HK.process_get);await l.ws.send(e),l.ws.addMsg(r.HK.process_getting,e=>{const s=[];if(z){for(const t of e.context)for(const e of t)if(`${e}`.includes(z)){s.push(t);break}}else s.push(...e.context);X&&(0,W.di)(s,e=>e[3],!1),L&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,g.jsx)(o.xP,{context:3===t?(0,V.v7)(e):e}));return s.push((0,g.jsx)(h.rA,{icon:"place",title:t("选中"),onClick:()=>{u(s)}})),s});f(s.length),i(n)})})()},[]),(0,n.useEffect)(()=>{z=m},[m]);return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[a.length>0&&(0,g.jsx)("div",{children:a[1].props.context}),a.length>0&&v(A.oV.sys_process_close)&&(0,g.jsx)("div",{children:(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new r.hf(r.HK.process_close);e.context={pid:a[0].props.context},u([]),l.ws.send(e)}})})]}),(0,g.jsx)(c.xh,{children:0!==s.length||z?(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("进程")} (${j})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤"),value:m,handleInputChange:e=>{_(e)}}),children:(0,g.jsx)(x.X,{headers:y,rows:s,width:"10rem"})})})}):(0,g.jsx)(M.h,{context:t("加载中请等待...")})})]})}const q=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function D(e){const[t,s]=(0,n.useState)(null),[c,o]=(0,j.fp)(f.AG.systemd_shell_show),[i,a]=(0,j.fp)(f.AG.user_base_info),d=i.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!c.show)return void h();(async()=>{const e=new $.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(h),l.ws.addMsg(r.HK.systemd_logs_getting,t=>{"error"===t.context&&h(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[c]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(q,{show:c.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n={unit_name:c.unit_name},o=new r.hf(r.HK.systemd_logs_get);o.context=n,l.ws.send(o)}})}let U,O="";function J(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[i,m]=(0,j.fp)(f.AG.systemd_shell_show),[y,k]=(0,j.fp)(f.AG.confirm),[v,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[b,P]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[Y,F]=(0,n.useState)([]),[$,I]=(0,n.useState)([]),[K,E]=(0,n.useState)([]),[N,H]=(0,n.useState)(!1),[G,Z]=(0,n.useState)([]),[B,W]=(0,n.useState)(""),[z,X]=(0,n.useState)(""),[L,T]=(0,n.useState)(new Set),[q,J]=(0,j.fp)(f.AG.editorSetting);(0,n.useEffect)(()=>{X(O),(async()=>{F([]),E([]);const e=new r.hf(r.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(r.HK.systemd_inside_getting,e=>{const t=[];if(O){for(const s of e.context)for(const e of s)if(`${e}`.includes(O)){t.push(s);break}}else t.push(...e.context);F(t.map(e=>{const t=e.map((e,t)=>(0,g.jsx)(o.xP,{context:4===t?(0,V.v7)(e):e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{E(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{O=z},[z]);const R=e=>{if(i.show){m({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else m({show:!0,unit_name:e})};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{H(e),e?((async()=>{I([]),Z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==u.m.Success)return;T(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===u.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,g.jsx)(o.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,g.jsx)(o.xP,{context:t.description})];s.push([...e,(0,g.jsx)(h.rA,{icon:"place",title:"添加",onClick:()=>{Z([...e])}})])}U=s,I(s)}})(),E([])):Z([])}}),children:[K.length>0&&(0,g.jsx)("div",{children:K[1].props.context}),G.length>0&&(0,g.jsx)("div",{children:G[0].props.context}),K.length>0&&(0,g.jsxs)("div",{children:[s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:"从实时监控删除",onClick:()=>{(async e=>{k({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===u.m.Success&&((0,_.SK)("删除成功"),k({open:!1,handle:null}))}})})(K[1].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{R(K[1].props.context)}})]}),G.length>0&&(0,g.jsxs)("div",{children:[s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{k({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===u.m.Success&&((0,_.SK)("删除成功"),k({open:!1,handle:null}))}})})(G[0].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{R(G[0].props.context)}}),s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===u.m.Success&&(J({model:"text",open:!0,fileName:e.name,save:async e=>{const t={context:e};"/"===s.data.path[0]&&(s.data.path=s.data.path.slice(1)),(await a.$M.post(`save/${s.data.path}`,t)).code===u.m.Success&&(S.xK.set_value_temp(""),J({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(s.data.context))})(G[0].props.context)}}),s(A.oV.systemd_update)&&!L.has(G[0].props.context)&&(0,g.jsx)(h.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const t=await a.Yu.post("systemd/add",{unit_name:e});t.code===u.m.Success&&(T(new Set(t.data)),(0,_.SK)("添加成功"))})(G[0].props.context)})]})]}),(0,g.jsxs)(c.xh,{children:[N&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`systemd系统单元(${$.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:"过滤单元",value:B,handleInputChange:e=>{W(e)},handlerEnter:()=>{const e=[];if(B){for(const t of U)(t[0].props.context.includes(B)||t[3].props.context.includes(B))&&e.push(t);I(e)}else I(U)}}),children:(0,g.jsx)(x.X,{headers:b,rows:$,width:"10rem"})})})}),0===Y.length&&!N&&(0,g.jsx)(M.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==Y.length&&!N&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`filecat监控单元(${Y.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{X(e)}}),children:(0,g.jsx)(x.X,{headers:v,rows:Y,width:"10rem"})})})})]}),(0,g.jsx)(D,{})]})}var R=s(87361);function Q(e){const{t}=(0,p.Bd)(),[s,n]=(0,j.fp)(f.AG.user_base_info),o=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,g.jsx)(F,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,g.jsx)(T,{})},{index:3,name:t("docker容器"),rto:"docker/",component:(0,g.jsx)(B,{})}];return s.sys===A.XM.linux&&o.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,g.jsx)(J,{})}),(0,g.jsx)(c.W1,{optionList:o,father_route:R.o.info})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7180],{75007(e,t,s){s.d(t,{h:()=>o});s(96540);var n=s(85997),c=s(74848);function o(e){return(0,c.jsxs)("h2",{className:"message",children:[(0,c.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,c.jsx)("span",{children:e.context})]})}},22081(e,t,s){var n=s(96540),c=s(16349),o=s(74848);const i=({percentage:e})=>{const t=(0,n.useRef)(null),[s,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new c.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 i(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})})};s.d(t,["A",0,i])},77481(e,t,s){s.d(t,{S:()=>i,X:()=>o});var n=s(96540),c=s(74848);function o(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,c.jsxs)("table",{children:[(0,c.jsx)("thead",{children:(0,c.jsx)("tr",{children:e.headers?.map((e,t)=>(0,c.jsx)("th",{children:e},t))})}),(0,c.jsx)("tbody",{children:t.map((t,s)=>(0,c.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,c.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function i(e){return(0,c.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,c.jsx)("div",{children:e},t))})}},88062(e,t,s){s(96540),s(47022);var n=s(74848);function c(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)(c,{...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))})]}),i=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))})});s.d(t,["A",0,i])},57180(e,t,s){s.r(t),s.d(t,{default:()=>Q});var n=s(96540),c=s(75725),o=s(70447),i=s(22081),r=s(92275),l=s(14944),a=s(14284),d=s(57952),h=s(85997),x=s(77481),u=s(53459),p=s(34899),j=s(34843),f=s(82893),m=s(74777),_=s(62042),w=s(61443),g=s(74848);function y(e){const{t}=(0,p.Bd)(),[s,i]=(0,j.fp)(f.AG.disk),[r,l]=(0,n.useState)({}),[m,_]=(0,n.useState)([]),w=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===u.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,g.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}_(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:t("关闭"),onClick:()=>{i({})}})}),(0,g.jsx)(c.jW,{isFull:!0,more:!0,children:(0,g.jsx)(c.NN,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsxs)(c.VP,{widthPer:30,children:[(0,g.jsx)(c.xh,{children:(0,g.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,g.jsx)(c.Yh,{left:t("名字"),right:e.name}),(0,g.jsx)(c.Yh,{left:t("厂商名称"),right:e.typeName}),(0,g.jsx)(c.Yh,{left:t("类型"),right:e.type}),(0,g.jsx)(c.Yh,{left:t("容量"),right:e.total})]})}),(0,g.jsx)(c.xh,{children:(0,g.jsxs)(o.Zp,{title:t("物理信息"),children:[(0,g.jsx)(c.Yh,{left:t("是否健康"),right:!0===r.smart_status?"是":"否"}),(0,g.jsx)(c.Yh,{left:t("设备型号"),right:r.model_name}),(0,g.jsx)(c.Yh,{left:t("序列号"),right:r.serial_number}),(0,g.jsx)(c.Yh,{left:t("固件版本"),right:r.firmware_version}),(0,g.jsx)(c.Yh,{left:t("转速(每分钟)"),right:r.rotation_rate}),(0,g.jsx)(c.Yh,{left:t("通电时长(小时)"),right:r.power_on_time_hours}),(0,g.jsx)(c.Yh,{left:t("通电次数"),right:r.power_cycle_count}),(0,g.jsx)(c.Yh,{left:t("温度(°C)"),right:r.temperature}),(0,g.jsx)(c.Yh,{left:t("通信协议"),right:r.device_protocol})]})})]}),(0,g.jsx)(c.VP,{widthPer:50,children:(0,g.jsxs)(c.xh,{children:[m?.length?(0,g.jsx)(o.uF,{title:t("ATA/SATA详细信息"),children:(0,g.jsx)(x.X,{headers:w,rows:m,width:"10rem"})}):(0,g.jsx)(g.Fragment,{}),r.nvme_smart?(0,g.jsxs)(o.Zp,{title:t("NVME详细信息"),children:[(0,g.jsx)(c.Yh,{left:t("NVMe 可用备用块(%)"),right:r.nvme_smart.available_spare}),(0,g.jsx)(c.Yh,{left:t("NVMe 已使用寿命(%)"),right:r.nvme_smart.percentage_used}),(0,g.jsx)(c.Yh,{left:t("NVMe 读取量"),right:r.nvme_smart.data_units_read}),(0,g.jsx)(c.Yh,{left:t("NVMe 写入量"),right:r.nvme_smart.data_units_written}),(0,g.jsx)(c.Yh,{left:t("NVMe 通电次数"),right:r.nvme_smart.power_cycles}),(0,g.jsx)(c.Yh,{left:t("NVMe 通电时长(小时)"),right:r.nvme_smart.power_on_hours}),(0,g.jsx)(c.Yh,{left:t("NVMe 非正常关机"),right:r.nvme_smart.unsafe_shutdowns}),(0,g.jsx)(c.Yh,{left:t("NVMe 媒体错误"),right:r.nvme_smart.media_errors}),(0,g.jsx)(c.Yh,{left:t("NVMe 错误日志数"),right:r.nvme_smart.num_err_log_entries})]}):(0,g.jsx)(g.Fragment,{})]})})]})})})]})}let k=function(e){return e[e.mount=0]="mount",e}({});var v=s(88062),S=s(78247),A=s(23430);const C=e=>(0,g.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,g.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function b(){return(0,g.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,g.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,j.fp)(f.AG.disk),[i,r]=(0,n.useState)({}),[l,m]=(0,n.useState)([]),[w,y]=(0,n.useState)([]),[P,Y]=(0,j.fp)(f.AG.showPrompt),{check_user_auth:V}=(0,S.MH)(),[F,M]=(0,n.useState)([]),{click_file:$}=(0,S.kZ)(),[I,K]=(0,j.fp)(f.AG.prompt_card),E=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],N=async()=>{const e=await a.Yu.get("disk/blk");return e.code===u.m.Success&&m(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{N()})()},[]);const H=[(0,g.jsx)(h.rA,{icon:"info",title:e("提示"),onClick:async()=>{K({open:!0,title:"信息",context_div:(0,g.jsx)("div",{children:(0,g.jsxs)("ul",{children:[(0,g.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,g.jsxs)("li",{children:["文件系统,有多种格式",(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,g.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,g.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,g.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,g.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,g.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,g.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,g.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,g.jsx)("li",{children:"rw:以读写方式挂载"}),(0,g.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,g.jsx)("li",{children:"...等"})]})]}),(0,g.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,g.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,g.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:k.mount})).code===u.m.Success&&(0,_.SK)("挂载文件已生效")}},1)],G=async()=>(await a.Yu.get("get_fstab")).data,Z=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,g.jsx)(c.jW,{isFull:!0,more:!0,children:(0,g.jsx)(c.NN,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:40,children:(0,g.jsxs)(o.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:(0,g.jsxs)("div",{children:[V(A.oV.sys_disk_mount)&&(0,g.jsx)(h.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{$({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:G,save_file_fun:Z,menu_list:H})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await N()===u.m.Success&&(0,_.SK)("刷新成功")}})]}),children:[(0,g.jsx)(x.X,{headers:E,rows:w,width:"10rem"}),(0,g.jsx)(v.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,g.jsxs)("span",{children:[t,(0,g.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]+";";y([[(0,g.jsx)(o.xP,{children:s}),(0,g.jsx)(o.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,g.jsx)(o.xP,{children:t.path}),t.pttype]])}})]})}),(0,g.jsx)(c.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 i=[];for(const e of t.lv_list)i.push({name:`${e.name}---(${e.size})`});return(0,g.jsx)(o.Zp,{children:(0,g.jsxs)(c.n5,{children:[(0,g.jsx)(C,{name:e("物理卷"),lvms:n}),(0,g.jsx)(b,{}),(0,g.jsx)(C,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,g.jsx)(b,{}),(0,g.jsx)(C,{name:e("逻辑卷"),lvms:i})]})},s)})})]})})})]})}var Y=s(88815);let V=!0;function F(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],w=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[k,v]=(0,j.fp)(f.AG.user_base_info),[S,C]=(0,n.useState)(0),[b,F]=(0,n.useState)(0),[M,$]=(0,n.useState)(0),[I,K]=(0,n.useState)(0),[E,N]=(0,n.useState)(0),[H,G]=(0,n.useState)({}),[Z,B]=(0,n.useState)(!1),[W,z]=(0,n.useState)(!1),[X,L]=(0,n.useState)(!1),[T,q]=(0,n.useState)(V),[D,U]=(0,n.useState)(null),[O,J]=(0,n.useState)([]),[R,Q]=(0,n.useState)([]),[ee,te]=(0,j.fp)(f.AG.user_base_info),[se,ne]=(0,j.fp)(f.AG.disk),ce=async()=>{if(!V)return;const e=new r.hf(r.HK.sys_get);await l.ws.send(e),l.ws.addMsg(r.HK.sys_getting,e=>{K(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;F(t),$(s),C((s-t)/s*100),U(e.context?.node_memory_usage),N(e.context?.node_cpu_usage)})};return(0,n.useEffect)(()=>((async()=>{await ce()})(),()=>{l.ws.sendData(r.HK.sys_cancel,{})}),[]),(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[k.sys===A.XM.linux&&(0,g.jsx)(h.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{B(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===u.m.Success){const t=e.data;G(t)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===u.m.Success){const s=e.data,n=[];let c=!0;ee.sysSoftWare&&ee.sysSoftWare[m.jk.smartmontools]&&ee.sysSoftWare[m.jk.smartmontools].installed||(c=!1);for(const e of s??[])n.push([(0,g.jsx)(o.xP,{context:e.name}),e.typeName,e.type,e.total,(0,g.jsx)(h.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{c?ne({type:"check",data:e}):(0,_.zN)("没有安装smartmontools")}})]);J(n)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{L(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===u.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,g.jsx)(o.xP,{context:e.name}),(0,g.jsx)(o.xP,{context:e.device_name}),e.fsType,(0,g.jsx)(o.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:T,text:t("实时信息"),clickFun:e=>{q(e),V=e,ce()}})]}),(0,g.jsxs)(c.xh,{children:[T&&(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"Sys "+t("内存"),children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{children:(0,g.jsx)(i.A,{percentage:S})}),(0,g.jsx)(c.VP,{children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{widthPer:100,children:(0,g.jsx)("div",{children:(0,g.jsx)(c.Yh,{left:t("总容量"),center:`${M}G`})})}),(0,g.jsx)(c.VP,{widthPer:100,children:(0,g.jsx)(c.Yh,{left:t("剩余"),center:`${b}G`})})]})})]})})}),(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"Sys cpu",children:(0,g.jsxs)(c.fI,{children:[(0,g.jsx)(c.VP,{children:(0,g.jsx)(i.A,{percentage:I})}),(0,g.jsx)(c.VP,{children:(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.Yh,{left:t("使用率"),center:I})})})]})})}),(0,g.jsx)(c.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(o.Zp,{title:"FileCat",children:(0,g.jsxs)(c.fI,{children:[(0,g.jsxs)(c.VP,{children:[(0,g.jsx)(c.qV,{content:t("内存")}),(0,g.jsx)(c.qV,{content:"total: "+(0,Y.v7)(D?.rss)}),(0,g.jsx)(c.qV,{content:"object: "+(0,Y.v7)(D?.heapTotal)}),(0,g.jsx)(c.qV,{content:"obj-use: "+(0,Y.v7)(D?.heapUsed)}),(0,g.jsx)(c.qV,{content:"external: "+(0,Y.v7)(D?.external)}),(0,g.jsx)(c.qV,{content:"buffer: "+(0,Y.v7)(D?.arrayBuffers)})]}),(0,g.jsx)(c.VP,{children:(0,g.jsx)(c.qV,{content:"cpu growth rate: "+E})})]})})})]}),(0,g.jsxs)(c.fI,{children:[Z&&(0,g.jsx)(c.VP,{children:(0,g.jsxs)(o.Zp,{title:t("基本信息"),children:[(0,g.jsx)(c.Yh,{left:t("总内存"),right:H.mem_total}),(0,g.jsx)(c.Yh,{left:`cpu ${t("制造商")}`,right:H.cpu_manufacturer}),(0,g.jsx)(c.Yh,{left:`cpu ${t("品牌")}`,right:H.cpu_brand}),(0,g.jsx)(c.Yh,{left:`cpu ${t("逻辑核心")}`,right:H.cpu_core_num}),(0,g.jsx)(c.Yh,{left:`cpu ${t("物理核心")}`,right:H.cpu_phy_core_num}),(0,g.jsx)(c.Yh,{left:`cpu ${t("最大")}hz`,right:H.cpu_speed_hz}),(0,g.jsx)(c.Yh,{left:`${t("当前系统")}:pid;ppid`,right:H.pid_ppid}),(0,g.jsx)(c.Yh,{left:t("运行用户"),right:H.user})]})}),W&&(0,g.jsx)(c.VP,{children:(0,g.jsx)(o.uF,{title:t("物理硬盘"),children:(0,g.jsx)(x.X,{headers:s,rows:O,width:"10rem"})})}),X&&(0,g.jsx)(c.VP,{children:(0,g.jsx)(o.uF,{title:t("文件硬盘"),children:(0,g.jsx)(x.X,{headers:w,rows:R,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,g.jsx)(y,{...se.data}),se&&"mount"===se.type&&(0,g.jsx)(P,{})]})}var M=s(75007),$=s(97856),I=s(64405);const K=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function E(e){const[t,s]=(0,n.useState)(null),[c,o]=(0,j.fp)(f.AG.dockerShellShow),[i,a]=(0,j.fp)(f.AG.user_base_info),d=i.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{c.show?(async()=>{const e=new $.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(h);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===c.type?r.HK.docker_shell_logs_getting:r.HK.docker_shell_exec_getting,e=>{"error"===e.context&&h(),t(e.context)}),"exec"===c.type&&e.onData(async e=>{const t=new r.hf(r.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():h()},[c]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(K,{show:c.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n=new I.n;let o;n.rows=e,n.cols=s,n.dockerId=c.dockerId,o="logs"===c.type?new r.hf(r.HK.docker_shell_logs):new r.hf(r.HK.docker_shell_exec_open),o.context=n,l.ws.send(o)}})}var N=s(27690);let H="",G=[],Z=!1;function B(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)({}),[m,y]=(0,n.useState)([]),[k,v]=(0,n.useState)([]),{check_user_auth:C}=(0,S.MH)(),[b,P]=(0,j.fp)(f.AG.dockerShellShow),[Y,V]=(0,j.fp)(f.AG.showPrompt),[F,$]=(0,j.fp)(f.AG.confirm),[I,K]=(0,n.useState)(H),[B,W]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[z,X]=(0,n.useState)([]),[L,T]=(0,n.useState)(void 0),[q,D]=(0,n.useState)(!1),U=["id",t("name"),t("create时间"),t("大小"),(0,g.jsxs)("span",{children:["选中",(0,g.jsx)(h.rA,{icon:"check_box",title:"全选",onClick:()=>{Z=!Z;const e={};for(let t=0;t<k.length&&Z;t++)e[k[t][0].props.context]=1;i(e)}})]})],O=async()=>{y([]),X([]);const e=new r.hf(r.HK.docker_get);await l.ws.send(e),l.ws.addMsg(r.HK.docker_getting,e=>{const t=[];if(H){for(const s of e.context)for(const e of s)if(`${e}`.includes(H)){t.push(s);break}}else t.push(...e.context);y(t.map(e=>{const t=e.map(e=>(0,g.jsx)(o.xP,{context:e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{X(t)}})),t}))})};(0,n.useEffect)(()=>(K(H),O(),()=>{(async()=>{P({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{H=I},[I]);const J=()=>{const e=new r.hf("logs"===b.type?r.HK.docker_shell_logs_cancel:r.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},R=e=>{const t=new r.hf(r.HK.docker_switch);t.context={type:e,dockerId:z[0].props.context},X([]),l.ws.send(t)},Q=async()=>{const e=await a.Yu.get("docker/images");if(e.code===u.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],c=[(0,g.jsx)(o.xP,{context:n[0]}),(0,g.jsx)(o.xP,{context:n[1]}),n[2],n[3],""];s.push(c)}G=s,v(s)}};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("docker镜像"),clickFun:e=>{D(e),e?(Q(),X([])):(O(),v([]),i({}))}}),children:[Object.keys(s).length>0&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{$({open:!0,title:t("确定删除选中的镜像吗"),handle:async()=>{const e=Object.keys(s),t=await a.Yu.post("docker/check/delete",{ids:e});if(t.code===u.m.Success)if(0===t.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===u.m.Success&&((0,_.SK)("删除完成"),Q(),$({open:!1,handle:null}))}else(0,_.N9)(`有镜像正在运行${JSON.stringify(t.data)}`)}})}}),z.length>0&&(0,g.jsx)("div",{children:z[1].props.context}),z.length>0&&(0,g.jsxs)("div",{children:[C(A.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{V({show:!0,overlay:!0,type:N.PromptEnum.DockerDel,data:{dockerId:z[0].props.context,name:z[1].props.context}})}}),(0,g.jsx)(h.rA,{icon:"print",title:t("打印日志"),onClick:()=>{b.show?(P({show:!1,type:"",dockerId:""}),J()):P({show:!0,dockerId:z[0].props.context,type:"logs"})}}),C(A.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{b.show?(P({show:!1,type:"",dockerId:""}),J()):P({show:!0,dockerId:z[0].props.context,type:"exec"})}}),C(A.oV.docker_container_update)&&z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>R("stop")}),C(A.oV.docker_container_update)&&!z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{R("start")}})]}),(0!==m.length||I)&&!q&&(0,g.jsx)(h.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new r.hf(r.HK.docker_get);await l.ws.send(e)}})]}),(0,g.jsxs)(c.xh,{children:[q&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("镜像")} (${k.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤镜像"),value:L,handleInputChange:e=>{T(e)},handlerEnter:()=>{const e=[];if(L){for(const t of k)(t[0].props.context.includes(L)||t[1].props.context.includes(L))&&e.push(t);v(e)}else v(G)}}),children:(0,g.jsx)(x.X,{headers:U,rows:k.map((e,n)=>(e[4]=(0,g.jsx)(w.GL,{context:t(""),selected:s[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,s),t[e]?delete t[e]:t[e]=1,i(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===m.length&&!I&&!q&&(0,g.jsx)(M.h,{context:t("检测不到docker,主机可能没有安装docker or 容器为空")}),(0!==m.length||I)&&!q&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("容器")} (${m.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤"),value:I,handleInputChange:e=>{K(e)}}),children:(0,g.jsx)(x.X,{headers:B,rows:m,width:"10rem"})})})})]}),(0,g.jsx)(E,{})]})}var W=s(64694);let z="",X=!1,L=!1;function T(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)([]),[a,u]=(0,n.useState)([]),[j,f]=(0,n.useState)(0),[m,_]=(0,n.useState)(""),[y,k]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,g.jsxs)("span",{children:[t("内存"),(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{X=!X}})]}),(0,g.jsxs)("span",{children:["cpu%",(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{L=!L}})]}),t("选择")]),{check_user_auth:v}=(0,S.MH)();(0,n.useEffect)(()=>{_(z),(async()=>{i([]),f(0),u([]);const e=new r.hf(r.HK.process_get);await l.ws.send(e),l.ws.addMsg(r.HK.process_getting,e=>{const s=[];if(z){for(const t of e.context)for(const e of t)if(`${e}`.includes(z)){s.push(t);break}}else s.push(...e.context);X&&(0,W.di)(s,e=>e[3],!1),L&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,g.jsx)(o.xP,{context:3===t?(0,Y.v7)(e):e}));return s.push((0,g.jsx)(h.rA,{icon:"place",title:t("选中"),onClick:()=>{u(s)}})),s});f(s.length),i(n)})})()},[]),(0,n.useEffect)(()=>{z=m},[m]);return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[a.length>0&&(0,g.jsx)("div",{children:a[1].props.context}),a.length>0&&v(A.oV.sys_process_close)&&(0,g.jsx)("div",{children:(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new r.hf(r.HK.process_close);e.context={pid:a[0].props.context},u([]),l.ws.send(e)}})})]}),(0,g.jsx)(c.xh,{children:0!==s.length||z?(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`${t("进程")} (${j})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:t("过滤"),value:m,handleInputChange:e=>{_(e)}}),children:(0,g.jsx)(x.X,{headers:y,rows:s,width:"10rem"})})})}):(0,g.jsx)(M.h,{context:t("加载中请等待...")})})]})}const q=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function D(e){const[t,s]=(0,n.useState)(null),[c,o]=(0,j.fp)(f.AG.systemd_shell_show),[i,a]=(0,j.fp)(f.AG.user_base_info),d=i.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("close! "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!c.show)return void h();(async()=>{const e=new $.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(h),l.ws.addMsg(r.HK.systemd_logs_getting,t=>{"error"===t.context&&h(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[c]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(q,{show:c.show,terminal:t,init:(e,s)=>{t.writeln("connect... ");const n={unit_name:c.unit_name},o=new r.hf(r.HK.systemd_logs_get);o.context=n,l.ws.send(o)}})}let U,O="";function J(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[i,m]=(0,j.fp)(f.AG.systemd_shell_show),[y,k]=(0,j.fp)(f.AG.confirm),[v,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[b,P]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[V,F]=(0,n.useState)([]),[$,I]=(0,n.useState)([]),[K,E]=(0,n.useState)([]),[N,H]=(0,n.useState)(!1),[G,Z]=(0,n.useState)([]),[B,W]=(0,n.useState)(""),[z,X]=(0,n.useState)(""),[L,T]=(0,n.useState)(new Set),[q,J]=(0,j.fp)(f.AG.editorSetting);(0,n.useEffect)(()=>{X(O),(async()=>{F([]),E([]);const e=new r.hf(r.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(r.HK.systemd_inside_getting,e=>{const t=[];if(O){for(const s of e.context)for(const e of s)if(`${e}`.includes(O)){t.push(s);break}}else t.push(...e.context);F(t.map(e=>{const t=e.map((e,t)=>(0,g.jsx)(o.xP,{context:4===t?(0,Y.v7)(e):e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{E(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{O=z},[z]);const R=e=>{if(i.show){m({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else m({show:!0,unit_name:e})};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{H(e),e?((async()=>{I([]),Z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==u.m.Success)return;T(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===u.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,g.jsx)(o.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,g.jsx)(o.xP,{context:t.description})];s.push([...e,(0,g.jsx)(h.rA,{icon:"place",title:"添加",onClick:()=>{Z([...e])}})])}U=s,I(s)}})(),E([])):Z([])}}),children:[K.length>0&&(0,g.jsx)("div",{children:K[1].props.context}),G.length>0&&(0,g.jsx)("div",{children:G[0].props.context}),K.length>0&&(0,g.jsxs)("div",{children:[s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:"从实时监控删除",onClick:()=>{(async e=>{k({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===u.m.Success&&((0,_.SK)("删除成功"),k({open:!1,handle:null}))}})})(K[1].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{R(K[1].props.context)}})]}),G.length>0&&(0,g.jsxs)("div",{children:[s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{k({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===u.m.Success&&((0,_.SK)("删除成功"),k({open:!1,handle:null}))}})})(G[0].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{R(G[0].props.context)}}),s(A.oV.systemd_update)&&(0,g.jsx)(h.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===u.m.Success&&(J({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===u.m.Success&&(S.xK.set_value_temp(""),J({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(s.data.context))})(G[0].props.context)}}),s(A.oV.systemd_update)&&!L.has(G[0].props.context)&&(0,g.jsx)(h.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const t=await a.Yu.post("systemd/add",{unit_name:e});t.code===u.m.Success&&(T(new Set(t.data)),(0,_.SK)("添加成功"))})(G[0].props.context)})]})]}),(0,g.jsxs)(c.xh,{children:[N&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`systemd系统单元(${$.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:"过滤单元",value:B,handleInputChange:e=>{W(e)},handlerEnter:()=>{const e=[];if(B){for(const t of U)(t[0].props.context.includes(B)||t[3].props.context.includes(B))&&e.push(t);I(e)}else I(U)}}),children:(0,g.jsx)(x.X,{headers:b,rows:$,width:"10rem"})})})}),0===V.length&&!N&&(0,g.jsx)(M.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==V.length&&!N&&(0,g.jsx)(c.fI,{children:(0,g.jsx)(c.VP,{widthPer:80,children:(0,g.jsx)(o.uF,{title:`filecat监控单元(${V.length})`,titleCom:(0,g.jsx)(w.Sm,{placeholder:"过滤单元",value:z,handleInputChange:e=>{X(e)}}),children:(0,g.jsx)(x.X,{headers:v,rows:V,width:"10rem"})})})})]}),(0,g.jsx)(D,{})]})}var R=s(87361);function Q(e){const{t}=(0,p.Bd)(),[s,n]=(0,j.fp)(f.AG.user_base_info),o=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,g.jsx)(F,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,g.jsx)(T,{})},{index:3,name:t("docker容器"),rto:"docker/",component:(0,g.jsx)(B,{})}];return s.sys===A.XM.linux&&o.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,g.jsx)(J,{})}),(0,g.jsx)(c.W1,{optionList:o,father_route:R.o.info})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8714],{47374(e,t,i){i.d(t,{e:()=>f});var o=i(96540),n=i(76213),s=i(64694),a=i(34289),r=i(61443),l=i(75725),c=i(34899),_=i(85997),d=i(74848);function f(e){let t=(0,n.zy)();const[i,f]=(0,o.useState)([]),[p,m]=(0,o.useState)("/"),[h,u]=(0,o.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();o.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const o=i.indexOf(e.baseRoute),n=[];if(-1!=o){t=(0,s.IO)(i.slice(0,o),e.baseRoute);const a=i.slice(o+1);for(let e=0;e<a.length;e++){const i=a[e];n.push({value:i,href:0===e?`${t}${i}/`:(0,s.IO)(n[e-1].href,i)})}m(t),f(n)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,d.jsx)("div",{className:"breadcrumbs",onClick:e=>{u(void 0!==h?void 0:"")},children:(0,d.jsx)(o.Fragment,{children:void 0===h?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsx)("span",{className:"chevron",children:(0,d.jsx)(n.N_,{to:p,onClick:g,children:(0,d.jsx)(_.In,{icon:"home"})})}),i.map((e,t)=>(0,d.jsxs)("span",{className:"chevron",children:[(0,d.jsx)(_.In,{icon:"keyboard_arrow_right"}),(0,d.jsx)(n.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,d.jsx)(l.QM,{click:()=>{u(void 0)},children:(0,d.jsx)(r.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),u(void 0)}})})})})}},78714(e,t,i){i.r(t),i.d(t,{default:()=>U});var o=i(96540),n=i(47374),s=i(34843),a=i(82893),r=i(14284),l=i(76213),c=i(57952),_=i(27690),d=i(34289),f=i(53459),p=i(99214),m=i(61443),h=i(47022),u=i(62042),w=i(34899),v=i(7523),g=i(78247),y=i(88815),x=i(6960),k=i(47071),j=i(14944),G=i(92275),A=i(23430);var C=i(34251),b=i(60096),z=i(85997),P=i(23496),F=i(12730),M=i(75725),$=i(70447),S=i(87361),D=i(74848);let X={};function I(){const{t:e}=(0,w.Bd)();let t=(0,l.zy)();const i=(0,l.Zp)(),{check_user_auth:n}=(0,g.MH)(),[c,f]=(0,s.fp)(a.AG.nowFileList),[m,y]=(0,s.fp)(a.AG.uploadFiles),[x,k]=(0,s.fp)(a.AG.showPrompt),[b,P]=(0,s.fp)(a.AG.selectedFileList),[I,E]=(0,s.fp)(a.AG.copyedFileList),[K,Y]=(0,s.fp)(a.AG.cutedFileList),[L,R]=(0,s.fp)(a.AG.selectedFileList),[H,N]=(0,s.fp)(a.AG.clickFileList),[U,W]=(0,s.fp)(a.AG.fileShellShow),[B,O]=(0,s.fp)(a.AG.file_root_list),[Z,q]=(0,s.fp)(a.AG.file_root_index),[V,T]=(0,o.useState)(void 0),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(v.F),[re,le]=(0,s.fp)(a.AG.user_base_info),{click_file:ce}=(0,g.kZ)(),[_e,de]=(0,s.fp)(a.AG.prompt_card),fe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==h.Iw.folder?1:0),0),[c]),pe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===h.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function me(e){(0,u.SK)(e)}(0,o.useEffect)(()=>{X={}},[t]),(0,o.useEffect)(()=>()=>{W({show:!1,path:""})},[]);const he=(0,p.Vs)(),ue=t=>{de({open:!0,title:e("信息"),context_div:(0,D.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,D.jsx)(M.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,D.jsx)(M.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,D.jsx)(M.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,D.jsx)(M.Yh,{left:`${e("文件夹数")}`,right:pe}),(0,D.jsx)(M.Yh,{left:`${e("文件数")}`,right:fe}),(0,D.jsx)(M.Yh,{left:`${e("当前位置")}`,right:(0,D.jsx)($.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{j.ws.removeMsg(G.HK.file_info)}})};return(0,D.jsxs)(o.Fragment,{children:[b.length>0&&(0,D.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{k({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,b);E(e.map(e=>(0,p.Ok)(e.name))),Y([]),me("已复制")}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,b);Y(e.map(e=>(0,p.Ok)(e.name))),E([]),me("已剪切")}}),(I.length>0||K.length>0)&&(0,D.jsx)(z.rA,{onClick:function(){k({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:I.length+K.length}),b.length>0&&(0,D.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=r.$M.getDownloadUrl(e);window.open(t)}}),b.length>0&&(0,D.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,b);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?k({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,u.zN)("没有选中")}}),1===b.length&&(0,D.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){k({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),ne&&(0,D.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{te(!ee)}}),(0,D.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){U.show?W({show:!1,path:""}):W({show:!0,path:(0,d.GG)("file",(0,d.vX)())})}}),n(A.oV.share_file)&&(0,D.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`/${S.o.share_list_setting_page}`)}}),(0,D.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:he}),(0,D.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){k({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){k({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{k({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const o=[],n=new Set;for(let e=0;e<t.length;e++){const s=t[e],a=i?s.webkitRelativePath:`${s.webkitRelativePath}${s.name}`;s.fullPath=a,i&&n.add((0,F.S)(a)),o.push(s)}const s=[];if(i)for(const e of n)s.push({isDir:!0,fullPath:e,name:e});s.push(...o),y(s),k({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,D.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!X.now_absolute_path){j.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(X={...X,...i},j.ws.removeMsg(G.HK.file_info),ue(X))});const t=await j.ws.sendData(G.HK.file_info,{type:h.Iw.folder,path:(0,d.GG)("file",(0,d.vX)())});e=t.context,X=e,ue(X)}ue(X)}}),(0,D.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory,o.items=B,o.item_pre_value=Z,o.textClick=async t=>{if(-1===t)return i(`/${S.o.setting_private_env_setting}`),k({data:void 0,overlay:!1,type:"",show:!1}),void(0,u.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await r.$M.post("base_switch",{root_index:e}),await ae(),i("/file/"),R([]),N([])})(t),k({data:void 0,overlay:!1,type:"",show:!1})},k({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}})]})}var E=i(2543),K=i(21499),Y=i(64694);const L=o.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(i.bind(i,63659))),R=o.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(i.bind(i,81636)));let H,N="";function U(){const[e,t]=(0,s.fp)(a.AG.editorSetting),[i,u]=(0,s.fp)(a.AG.file_preview),{t:F}=(0,w.Bd)();let M=(0,l.zy)();const $=(0,l.Zp)(),[X,U]=(0,s.fp)(a.AG.nowFileList),[W,B]=(0,s.fp)(a.AG.showPrompt),[O,Z]=(0,s.fp)(a.AG.selectedFileList),[q,V]=(0,s.fp)(a.AG.clickFileList),[T,J]=(0,s.fp)(a.AG.fileShellShow),[Q,ee]=(0,o.useState)(""),[te,ie]=(0,s.fp)(a.AG.workflow_show),[oe,ne]=(0,s.fp)(a.AG.workflow_realtime_show),[se,ae]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:re}=(0,o.useContext)(v.F),[le,ce]=(0,s.fp)(a.AG.user_base_info),{click_file:_e}=(0,g.kZ)(),[de,fe]=(0,s.fp)(a.AG.to_running_files),[pe,me]=(0,s.fp)(a.AG.file_page),[he]=(0,s.fp)(a.AG.blank_search_mode),[ue,we]=(0,s.fp)(a.AG.blank_search_mode_for_temp),ve=function(){const[e,t]=(0,s.fp)(a.AG.user_base_info),{t:i}=(0,w.Bd)(),{check_user_auth:n}=(0,g.MH)(),[c,f]=(0,s.fp)(a.AG.router_jump),m=(0,l.Zp)(),{initUserInfo:u}=(0,o.useContext)(v.F),[y,x]=(0,s.fp)(a.AG.nowFileList),[k,b]=(0,s.fp)(a.AG.showPrompt),[z,F]=(0,s.fp)(a.AG.fileShellShow),[M,$]=(0,s.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const o=new C.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory;const s=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max?"green":void 0},children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max?"green":void 0},children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("大小逆序")}),v:A.t8.size_max_min}],l=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode&&e.user_data.file_list_pagination_mode!==A.yM.all?void 0:"green"},children:i("全部加载文件")}),v:A.yM.all},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode===A.yM.pagination?"green":void 0},children:i("分页滚动加载文件")}),v:A.yM.pagination}],c=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type&&e.user_data.file_time_show_type!==A.KD.current?void 0:"green"},children:i("最近时间")}),v:A.KD.current},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type===A.KD.time?"green":void 0},children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type?void 0:"green"},children:i("系统默认")}),v:A.t8.defualt},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.name?"green":void 0},children:i("名字")}),v:A.t8.name},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("修改时间")}),v:!1,items:s},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:l},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,D.jsx)("span",{style:{color:M?"green":void 0},children:i("以空白搜索模式打开目录")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];y?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),n(A.oV.code_resource)&&w.push({r:i("添加http资源根目录"),v:"code_resource"}),n(A.oV.http_proxy)&&w.push({r:i("在此目录下载http资源"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),o.items=w,o.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,d.GG)("file",(0,d.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`/${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,d.GG)("file",(0,d.vX)());return b({data:void 0,overlay:!1,type:"",show:!1}),void m(`/${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/setting/customer_router/")}if("http_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({http_download_map_path:e.context.now_absolute_path}),b({data:void 0,overlay:!1,type:"",show:!1}),void m("/proxy/http/")}if("zoom_adjust"===e)return b({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{b({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",F({show:!0,path:(0,d.GG)("file",(0,d.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return $(!M),void b({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await r.wm.post(P.s.user_save_private_attr,{type:e,...t}),await u(),b({data:void 0,overlay:!1,type:"",show:!1}),m((0,d.vX)())},b({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}}(),ge=async()=>{const e=new k.Nd;e.dir_path=`${(0,d.GG)("file",(0,d.vX)())}`,j.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);fe(new Set(t.running_file_list))}}),await j.ws.sendData(G.HK.workflow_realtime,e)},ye=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,y.v7)(i.size),le.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{ge()})),i.name===k.SB&&(t=!0);for(const i of e.folders??[])le.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",i.name===k.SB&&(t=!0);ae(t)};(0,o.useEffect)(()=>async()=>{fe(new Set)},[]);const xe=()=>{(async()=>{const e=(0,d.GG)("file",(0,d.vX)());if(he||ue)return;let t;if(le.user_data.file_list_pagination_mode===A.yM.pagination){if(N!==e){if(N=e,1!==pe.page_num)return void me({page_size:pe.page_size,page_num:1})}else if(pe.page_num<0)return;if(t=await r.$M.post("file_get_page",{param_path:e,page_num:pe.page_num,page_size:pe.page_size}),t.code!==f.m.Success)return;const i=t.data;return ye(i),i.files?.length?(U(e=>{const t=(0,E.cloneDeep)(1===pe.page_num?i.files:[...e?.files??[],...i.files]),o={...e,files:t};return(0,p.yC)(o,le.user_data.dir_show_type),o}),void(H=t.data)):void me({page_size:pe.page_size,page_num:-1})}if(t=await r.$M.get(e),t.code!==f.m.Success)return;const i=t.data;(0,p.yC)(i,le.user_data.dir_show_type),ye(t.data),U(t.data),H=t.data})(),t({open:!1}),u({open:!1}),ae(!1)};(0,o.useEffect)(()=>{xe()},[M,pe]);const ke=e=>{e.target===e.currentTarget&&(Z([]),V([]))};return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsxs)(c.A,{left_children:(0,D.jsx)(m.$Z,{handleEnterPress:async()=>{if(he||ue){if(Z([]),V([]),!Q||!Q.trim())return void U({files:[],folders:[]});const e=(0,d.GG)("file",(0,d.vX)()),t=await r.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:Q.trim()});if(t.code!==f.m.Success)return;const i=t.data;return(0,p.yC)(i,le.user_data.dir_show_type),ye(i),U(i),void(H=i)}if(!H)return;Z([]),V([]);const e=[],t=[];for(const t of H.files??[])t.name.includes(Q)&&e.push(t);for(const e of H.folders??[])e.name.includes(Q)&&t.push(e);U({files:e,folders:t})},placeholder:F("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{ee(e)},max_width:"25em"}),children:[(0,D.jsx)("div",{className:"mobile-context-btn",children:(0,D.jsx)(z.rA,{icon:"more_horiz",title:F("右键"),onClick:()=>{const e=O[O.length-1];if(void 0!==e){const t=[...X.folders??[],...X.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],o=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},n={preventDefault:()=>{},stopPropagation:()=>{},clientX:o.left+10,clientY:o.bottom??100},s=new C.ik;s.path=(0,Y.IO)((0,d.vX)(),t.name),s.filename=t.name,s.x=n.clientX,s.y=n.clientY,s.type=t.type===h.Iw.folder?h.Iw.folder:(0,C.uL)(t.name),s.size=t.origin_size,B({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:s})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};ve(e)}}})}),(0,D.jsx)(I,{})]}),(0,D.jsx)(n.e,{baseRoute:"file",clickFun:function(){Z([]),V([])},input_path_enter:e=>{var t;Z([]),V([]),U({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?$(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let o=e.length-1-t;o>=0;o--)if(e[o]===i)return e.substring(0,o+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,d.vX)(),e)):(e=e.replace(0===(t=le.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),$(e))}}),le.user_data.file_list_pagination_mode===A.yM.pagination?(0,D.jsx)(b.$J,{handleContextMenu:ve,clickBlank:ke,list:X.files}):(0,D.jsx)(b.t$,{handleContextMenu:ve,file_list:X.files,folder_list:X.folders,clickBlank:ke}),te&&(0,D.jsx)(L,{}),oe.open&&(0,D.jsx)(R,{})]})}}}]);
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.aa09beced31832f77e06.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><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"/><script defer="defer" src="main.e6cb1e00d837d7b25b30.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>