2 lines
5.5 KiB
JavaScript
2 lines
5.5 KiB
JavaScript
import{g as h,r as x,_ as k,W as z,k as f,m as _,n as l,t as o,p as e,E as i,F as m,D as I,G as S,H as U,ak as B,l as c}from"./vendor/index.CRpmXtWV.js";import{j as T,d as $,R as C}from"../index.D-NvtsOM.js";function M(){return T({url:"/monitor/system-info",method:"get",timeout:6e4})}const N=h({__name:"info",setup(j){const{t}=$();let b=x(!0),w=[{title:t("views.monitor.system.disk"),dataIndex:"target",align:"center"},{title:t("views.monitor.system.totalSize"),dataIndex:"size",align:"center"},{title:t("views.monitor.system.lastSize"),dataIndex:"avail",align:"center"},{title:t("views.monitor.system.usageSize"),dataIndex:"used",align:"center"},{title:t("views.monitor.system.spaceUsage"),dataIndex:"pcent",align:"center"}],s=k({cpu:{},disk:[],memory:{},network:{},project:{},system:{},time:{}});function g(r){if(typeof r=="string")return r;if(r<=0)return"-";let u=Math.floor(r/86400),a=Math.floor(r%86400/3600),n=Math.floor(r%3600/60),d=r%60,y=[];return u!==0&&y.push(`${u}${t("common.units.day")}`),a!==0&&y.push(`${a}${t("common.units.hour")}`),n!==0&&y.push(`${n}${t("common.units.minute")}`),y.push(`${d}${t("common.units.second")}`),y.join(" ")}return z(()=>{M().then(r=>{if(r.code===C&&r.data){let u=r.data.cpu;u.coreUsed=u.coreUsed.map(a=>a).join(" / "),s.cpu=u,s.disk=r.data.disk,s.memory=r.data.memory,s.network=r.data.network,s.project=r.data.project,s.system=r.data.system,s.time=r.data.time,b.value=!1}})}),(r,u)=>{const a=c.DescriptionsItem,n=c.Descriptions,d=c.Card,y=c.Table;return f(),_(e(B),{loading:e(b)},{default:l(()=>[o(d,{title:e(t)("views.monitor.system.systemInfo"),bordered:!1,"body-style":{marginBottom:"24px",padding:0}},{default:l(()=>[o(n,{size:"middle",layout:"horizontal","label-style":{width:"140px"},column:{lg:2,md:2,xs:1},bordered:!0},{default:l(()=>[o(a,{label:e(t)("views.monitor.system.runPlace")},{default:l(()=>[i(m(e(s).system.platform),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.placeVersion")},{default:l(()=>[i(m(e(s).system.platformVersion),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.systemPlace")},{default:l(()=>[i(m(e(s).system.os),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.systemArchitecture")},{default:l(()=>[i(m(e(s).system.arch),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.host")},{default:l(()=>[i(m(e(s).system.hostname),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.runTime")},{default:l(()=>[i(m(g(e(s).system.bootTime)),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["title"]),o(d,{title:e(t)("views.monitor.system.cpuInfo"),bordered:!1,"body-style":{marginBottom:"24px",padding:0}},{default:l(()=>[o(n,{size:"middle",layout:"horizontal","label-style":{width:"140px"},column:1,bordered:!0},{default:l(()=>[o(a,{label:e(t)("views.monitor.system.model")},{default:l(()=>[i(m(e(s).cpu.model),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.hz")},{default:l(()=>[i(m(e(s).cpu.speed),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.cores")},{default:l(()=>[i(m(e(s).cpu.core),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.usage")},{default:l(()=>[i(m(e(s).cpu.coreUsed),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["title"]),o(d,{title:e(t)("views.monitor.system.memory"),bordered:!1,"body-style":{marginBottom:"24px",padding:0}},{default:l(()=>[o(n,{size:"middle",layout:"horizontal","label-style":{width:"140px"},column:{lg:2,md:2,xs:1},bordered:!0},{default:l(()=>[o(a,{label:e(t)("views.monitor.system.totalMemory")},{default:l(()=>[i(m(e(s).memory.totalmem),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.lastMemory")},{default:l(()=>[i(m(e(s).memory.freemem),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.usage")},{default:l(()=>[i(m(e(s).memory.usage),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.proMemory")},{default:l(()=>[i(m(e(s).memory.rss),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.heapSize")},{default:l(()=>[i(m(e(s).memory.heapTotal),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.heapUsage")},{default:l(()=>[i(m(e(s).memory.heapUsed),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.libUse")},{default:l(()=>[i(m(e(s).memory.external),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["title"]),o(d,{title:e(t)("views.monitor.system.timeInfo"),bordered:!1,"body-style":{marginBottom:"24px",padding:0}},{default:l(()=>[o(n,{size:"middle",layout:"horizontal","label-style":{width:"140px"},column:{lg:3,md:3,xs:1},bordered:!0},{default:l(()=>[o(a,{label:e(t)("views.monitor.system.time")},{default:l(()=>[i(m(e(s).time.current),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.timeZone")},{default:l(()=>[i(m(e(s).time.timezone),1)]),_:1},8,["label"]),o(a,{label:e(t)("views.monitor.system.timeZoneName")},{default:l(()=>[i(m(e(s).time.timezoneName),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["title"]),o(d,{title:e(t)("views.monitor.system.networkInfo"),bordered:!1,"body-style":{marginBottom:"24px",padding:0}},{default:l(()=>[o(n,{size:"middle",layout:"horizontal","label-style":{width:"140px"},column:1,bordered:!0},{default:l(()=>[(f(!0),I(U,null,S(e(s).network,(v,p)=>(f(),_(a,{label:p,key:p},{default:l(()=>[i(m(v),1)]),_:2},1032,["label"]))),128))]),_:1})]),_:1},8,["title"]),o(d,{title:e(t)("views.monitor.system.diskInfo"),bordered:!1,"body-style":{padding:0}},{default:l(()=>[o(y,{class:"disk","row-key":"target",size:"middle",columns:e(w),"data-source":e(s).disk,pagination:!1,scroll:{x:!0}},null,8,["columns","data-source"])]),_:1},8,["title"])]),_:1},8,["loading"])}}});export{N as default};
|