import{d as g,u as b,a as f,r as k,F as q,c as I,b as l,w as d,U as x,e as N,o as u,J as S,j as m,n as T,I as w,f as C,t as R,T as D,z as P,_ as Q}from"./index-FX23dEwE.js";import{s as V}from"./service-B7c_TbF_.js";import{S as E,a as $}from"./SearchUtil-_PbmflM7.js";import{p as A,q as i}from"./PromQueryUtil-fadptBha.js";import"./request-dCC5BMJA.js";const B={class:"__container_services_index"},F=["onClick"],J=g({__name:"search",setup(M){const p=b(),c=f();let _=c.query.query;const v=[{title:"service",key:"service",dataIndex:"serviceName"},{title:"version",key:"version",dataIndex:"version"},{title:"subset",key:"group",dataIndex:"group"},{title:"provider",key:"provider",dataIndex:"providerAppName"},{title:"avgQPS",key:"avgQPS",dataIndex:"avgQPS"},{title:"avgRT",key:"avgRT",dataIndex:"avgRT"},{title:"requestTotal",key:"requestTotal",dataIndex:"requestTotal"}];function y(a,r){return V(a).then(async o=>A(o,["avgQPS","avgRT","requestTotal"],async e=>{e.avgQPS=await i(`sum (dubbo_provider_qps_total{interface='${e.serviceName}'}) by (interface)`),e.avgRT=await i(`avg(dubbo_consumer_rt_avg_milliseconds_aggregate{interface="${e.serviceName}",method=~"$method"}>0)`),e.requestTotal=await i(`sum (increase(dubbo_provider_requests_total{interface="${e.serviceName}"}[1m]))`)}))}const t=k(new E([{label:"serviceName",param:"keywords",placeholder:"typeAppName",defaultValue:_,style:{width:"200px"}}],y,v,void 0,void 0));t.onSearch(),t.tableStyle={scrollX:"100",scrollY:"367px"};const h=(a,r,o,e)=>{p.push({name:"distribution",params:{pathId:a,group:r,version:o},query:e?{providerAppName:e}:{}})};return x(P.SEARCH_DOMAIN,t),q(c,(a,r)=>{t.queryForm.keywords=a.query.query,t.onSearch(),console.log(a)}),(a,r)=>{const o=N("a-tooltip");return u(),I("div",B,[l($,{"search-domain":t},{bodyCell:d(({column:e,record:s,text:n})=>[e.dataIndex==="serviceName"?(u(),S(o,{key:0,title:n},{default:d(()=>[m("span",{class:"app-link",onClick:O=>h(n,s.group,s.version,s.providerAppName)},[m("b",null,[l(T(w),{style:{"margin-bottom":"-2px"},icon:"material-symbols:attach-file-rounded"}),C(" "+R(n),1)])],8,F)]),_:2},1032,["title"])):D("",!0)]),_:1},8,["search-domain"])])}}}),L=Q(J,[["__scopeId","data-v-306e509f"]]);export{L as default};
