import{r as o,j as e}from"./vendor-react-wBh_31cN.js";import{t as d}from"./toast-3g7Fh-a0.js";import{C as p,a as g,b as x,c as h}from"./card-DISTA6Ay.js";import{G as r,a5 as i,cB as u,cV as f,A as j}from"./index-BKr2rJhV.js";import{u as v}from"./useTitle-DQo_L6Ox.js";import{t as _}from"./titles-CzjGGAB3.js";import{a_ as a}from"./vendor-icons-BUUmD6ht.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-router-D1GqFWiT.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";const C=()=>{v(_.monitoring);const[n,t]=o.useState(!1),l=async()=>{try{t(!0);const s=await new u().request({url:"/elastic/jwt/services",type:f.get}),{kibanaUrl:c}=(s==null?void 0:s.data)??{},m=`${j}${c}security_tenant=private#/?_g=()&_a=(columns:!(service,host,logdate,logger_name,priority,log_message),index:'.services-*',interval:auto,sort:!(logdate,desc))`;window.open(m,"_blank")}catch{d.error("Failed to open Service Logs.")}finally{t(!1)}};return e.jsxs(p,{children:[e.jsx(g,{children:e.jsx(x,{children:"Monitoring"})}),e.jsxs(h,{children:[e.jsx("span",{className:"text-xs font-bold",children:"Access to monitoring applications"}),e.jsxs("div",{className:"mt-5 flex gap-3",children:[e.jsx(r,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:`${i}/grafana`,target:"_blank",rel:"noopener noreferrer",children:["Grafana",e.jsx(a,{className:"w-4 h-4"})]})}),e.jsx(r,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:`${i}/hdfsui`,target:"_blank",rel:"noopener noreferrer",children:["HopsFS Admin",e.jsx(a,{className:"w-4 h-4"})]})}),e.jsxs(r,{variant:"outline",size:"sm",onClick:l,loading:n,children:["Service Logs",e.jsx(a,{className:"w-4 h-4"})]})]})]})]})},O=o.memo(C);export{O as default};
