import{a5 as y}from"./index.17037962789732.js";import"./index.170379627897316.js";import"./index.170379627897317.js";import{s as x}from"./dashboard.17037962789732.js";import n from"./TopEchartsItemNode.1703796278973.js";import{x as U}from"./system.1703796278973.js";import{i as j}from"./utils.1703796278973.js";import{m as C}from"./map.17037962789732.js";import{d as g,k as u,p as N,q as k,m as M,o as _,x as G,u as e,c as V,B,z as l,b as p}from"./vue.1703796278973.js";import{_ as I}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.1703796278973314.js";import"./tool.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897315.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./moment.1703796278973.js";const w={class:"dash-board"},F={class:"dash-board-item"},H={class:"dash-board-item"},$={class:"dash-board-item"},E={class:"dash-board-item"},J=g({name:"TopCard"}),S=g({...J,emits:["serviceChange"],setup(q,{emit:f}){const m=u(),r=u([]),t=u({cpu:0,jvm:0,jvmTotal:0,usage:0,usageTotal:0,systemUsage:0,systemUsageTotal:0}),c=u(),b=a=>{m.value=a},v=()=>{c.value&&c.value.unsubscribe()},h=()=>{const a="operations-statistics-system-info-realTime",i="/dashboard/systemMonitor/stats/info/realTime";v(),c.value=U(a,i,{type:"all",serverNodeId:m.value,interval:"1s",agg:"avg"}).pipe(C(o=>o.payload)).subscribe(o=>{const{value:{cpu:T,memory:s,disk:d}}=o;t.value={cpu:T.systemUsage,jvm:Number((s.jvmHeapUsage/100*(s.jvmHeapTotal/1024)).toFixed(1)),jvmTotal:Math.ceil(s.jvmHeapTotal/1024),usage:Number((d.total/1024*(d.usage/100)).toFixed(1)),usageTotal:Math.ceil(d.total/1024),systemUsage:Number((s.systemTotal/1024*(s.systemUsage/100)).toFixed(1)),systemUsageTotal:Math.ceil(s.systemTotal/1024)}})};return N(()=>{j&&x().then(a=>{var i;a.success&&(r.value=a.result.map(o=>({label:o.name,value:o.id})),r.value.length&&(m.value=(i=r.value[0])==null?void 0:i.value))})}),k(()=>{v()}),M(()=>m.value,a=>{a&&h(),f("serviceChange",a)}),(a,i)=>{const o=y;return _(),G("div",null,[e(r).length>1?(_(),V(o,{key:0,style:{width:"300px","margin-bottom":"20px"},onChange:b,value:e(m),options:e(r)},null,8,["value","options"])):B("",!0),l("div",w,[l("div",F,[p(n,{title:"CPU使用率",value:e(t).cpu},null,8,["value"])]),l("div",H,[p(n,{title:"JVM内存",max:e(t).jvmTotal,bottom:`总JVM内存 ${e(t).jvmTotal}G`,formatter:"G",value:e(t).jvm},null,8,["max","bottom","value"])]),l("div",$,[p(n,{title:"磁盘占用",max:e(t).usageTotal,bottom:`总磁盘大小 ${e(t).usageTotal}G`,formatter:"G",value:e(t).usage},null,8,["max","bottom","value"])]),l("div",E,[p(n,{title:"系统内存",max:e(t).systemUsageTotal,bottom:`系统内存 ${e(t).systemUsageTotal}G`,formatter:"G",value:e(t).systemUsage},null,8,["max","bottom","value"])])])])}}});const _e=I(S,[["__scopeId","data-v-4b3ef924"]]);export{_e as default};
