import{r as a,bw as u,bx as x,by as p,j as e,b as v,$ as r,c as f,b1 as n,dr as s,ds as h,dt as m,du as _}from"./index-46ma1THH.js";const b=()=>{u(x.monitoring);const[o,i]=a.useState(!1),l=p(),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(v,{title:"Monitoring",children:[e.jsx(r,{flexDirection:"row",children:e.jsx(f,{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(b);export{w as default};
