blob: 86a2cc42434348e1765328f820c1eca6c7b9dcc7 [file] [log] [blame]
import{d as R,k as E,r as b,O as x,u as O,b as A,f as p,c as l,t as e,e as m,h as r,P as g,K as V,o as t,F as I,x as h,v as c,I as C,y as d,z as u,H as L,J as _,Y,Z as B,m as P,_ as M}from"./index-_yryC3Xm.js";import{S as j,a as z}from"./SearchUtil-y20l-pEy.js";import{a as F,b as H}from"./app-msvSfF-k.js";import"./request-c67rWRMa.js";const J={class:"__container_app_instance"},K={class:"statistic-icon-big"},U=R({__name:"instance",setup($){E(o=>({"7a377fc8":r(g)+"22","333222d4":r(g)}));let i=b({info:{},report:{}});x(async()=>{let o=(await F({})).data;i.info=o,i.report={providers:{icon:"carbon:branch",value:i.info.instanceTotal},consumers:{icon:"mdi:merge",value:i.info.versionTotal},cpu:{icon:"carbon:branch",value:i.info.cpuTotal},memory:{icon:"mdi:merge",value:i.info.memoryTotal}}});const k=[{title:"instanceDomain.ip",dataIndex:"ip",key:"ip",sorter:!0,width:150,fixed:"left"},{title:"instanceDomain.name",dataIndex:"name",key:"name",sorter:!0,width:180},{title:"instanceDomain.deployState",dataIndex:"deployState",key:"deployState",sorter:!0,width:150},{title:"instanceDomain.deployCluster",dataIndex:"deployCluster",key:"deployCluster",sorter:!0,width:180},{title:"instanceDomain.registerStates",dataIndex:"registerStates",key:"registerStates",sorter:!0,width:150},{title:"instanceDomain.registerClusters",dataIndex:"registerClusters",key:"registerClusters",sorter:!0,width:200},{title:"instanceDomain.cpu",dataIndex:"cpu",key:"cpu",sorter:!0,width:120},{title:"instanceDomain.memory",dataIndex:"memory",key:"memory",sorter:!0,width:120},{title:"instanceDomain.startTime",dataIndex:"startTime",key:"startTime",sorter:!0,width:150},{title:"instanceDomain.registerTime",dataIndex:"registerTime",key:"registerTime",sorter:!0,width:150},{title:"instanceDomain.labels",dataIndex:"labels",key:"labels",sorter:!0,fixed:"right",width:200}],y=b(new j([{label:"",param:"type",defaultValue:1,dict:[{label:"ip",value:1},{label:"name",value:2},{label:"label",value:3}],style:{width:"100px"}},{label:"",param:"search",style:{width:"300px"}}],H,k,{pageSize:4},!0));x(()=>{y.tableStyle={scrollX:"100",scrollY:"500px"},y.onSearch()}),O();const S=A(),w=o=>{S.push("/resources/services/detail/"+o)};return V(P.SEARCH_DOMAIN,y),(o,G)=>{const D=m("a-statistic"),v=m("a-flex"),T=m("a-card"),N=m("a-button"),f=m("a-tag");return t(),p("div",J,[l(v,{wrap:"wrap",gap:"small",vertical:!1,justify:"space-around",align:"left"},{default:e(()=>[(t(!0),p(I,null,h(r(i).report,(s,a)=>(t(),c(T,{class:"statistic-card"},{default:e(()=>[l(v,{gap:"middle",vertical:!1,justify:"space-between",align:"center"},{default:e(()=>[l(D,{value:s.value,class:"statistic"},{prefix:e(()=>[l(r(C),{class:"statistic-icon",icon:"solar:target-line-duotone"})]),title:e(()=>[d(u(o.$t(a.toString())),1)]),_:2},1032,["value"]),L("div",K,[l(r(C),{icon:s.icon},null,8,["icon"])])]),_:2},1024)]),_:2},1024))),256))]),_:1}),l(z,{"search-domain":y},{bodyCell:e(({column:s,text:a})=>[s.dataIndex==="serviceName"?(t(),c(N,{key:0,type:"link",onClick:n=>w(a)},{default:e(()=>[d(u(a),1)]),_:2},1032,["onClick"])):_("",!0),s.dataIndex==="deployState"?(t(),c(f,{key:1,color:r(Y)[a.toUpperCase()]},{default:e(()=>[d(u(a),1)]),_:2},1032,["color"])):_("",!0),s.dataIndex==="registerStates"?(t(!0),p(I,{key:2},h(a,n=>(t(),c(f,{color:r(B)[n.level.toUpperCase()]},{default:e(()=>[d(u(n.label),1)]),_:2},1032,["color"]))),256)):_("",!0),s.dataIndex==="registerClusters"?(t(!0),p(I,{key:3},h(a,n=>(t(),c(f,null,{default:e(()=>[d(u(n),1)]),_:2},1024))),256)):_("",!0),s.dataIndex==="labels"?(t(!0),p(I,{key:4},h(a,n=>(t(),c(f,{color:r(g)},{default:e(()=>[d(u(n),1)]),_:2},1032,["color"]))),256)):_("",!0)]),_:1},8,["search-domain"])])}}}),W=M(U,[["__scopeId","data-v-94a2114d"]]);export{W as default};