import{r as a,bG as u,bH as f,bI as x,j as e,f as p,q as r,c as v,aJ as n,dN as s,dO as h,dP as m,dQ as _}from"./index-DHiyXWqE.js";const j=()=>{u(f.monitoring);const[o,i]=a.useState(!1),l=x(),c=async()=>{try{i(!0);const t=await new h().request({url:"/elastic/jwt/services",type:m.get}),{kibanaUrl:d}=(t==null?void 0:t.data)??{},g=`${_}${d}security_tenant=private#/?_g=()&_a=(columns:!(service,host,logdate,logger_name,priority,log_message),index:'.services-*',interval:auto,sort:!(logdate,desc))`;window.open(g,"_blank")}catch{l.error({title:"Error",content:"Failed to open Service Logs."})}finally{i(!1)}};return e.jsxs(p,{title:"Monitoring",children:[e.jsx(r,{flexDirection:"row",children:e.jsx(v,{bold:!0,children:"Access to monitoring applications"})}),e.jsxs(r,{flexDirection:"row",mt:"20px",children:[e.jsx(n,{intent:"inline",href:`${s}/grafana`,target:"_blank",external:!0,children:"Grafana ↗"}),e.jsx(n,{intent:"inline",href:`${s}/hdfsui`,target:"_blank",external:!0,children:"HopsFS Admin ↗"}),e.jsx(n,{intent:"inline",onClick:c,isLoading:o,children:"Service Logs ↗"})]})]})},w=a.memo(j);export{w as default};
