import{r as u}from"./request-dCC5BMJA.js";import{r as i,a4 as l}from"./index-FX23dEwE.js";const f=async t=>u({url:"promQL/query",method:"get",params:t});async function q(t){var e,n;try{const r=(n=(e=await f({query:t}))==null?void 0:e.data)==null?void 0:n.result[0];return r!=null&&r.value&&r.value.length>0?Number(r.value[1]):"NA"}catch(r){console.error("fetch from prom error: ",r)}return"NA"}function p(t,e,n){var s;const r=i(t);for(const a of e){const o=(s=t==null?void 0:t.data)==null?void 0:s.list;for(const c of o)c[a]="skeleton-loading"}return l(async()=>{var a;try{const o=((a=r==null?void 0:r.data)==null?void 0:a.list)||[];for(const c of o)n(c)}catch(o){console.error(o)}}),r}export{p,q};
