import{r as o,aY as x,u as y,ac as v,aS as _,gy as j,j as t,a$ as $,cf as b,c as k,b as u,Q as F,aZ as E,dl as I,dm as q}from"./index-ea7817a2.js";import{P}from"./Panel-041c5d61.js";import{u as S}from"./useUserPermissions-d2903885.js";import"./Deprecated-9bfe2e44.js";import"./CardActionButton-6aa39bc1.js";import"./index-8f672200.js";import"./file-utils-a5f053e8.js";import"./useCurrentProject-0132f110.js";import"./useProject-77619fff.js";const G=()=>{x(E.fgMetrics);const{id:s,fsId:r,fgId:a}=y(),{colorMode:l}=v(),d=_(),[i,n]=o.useState(void 0),{currentData:e,isFetching:m,refetch:p}=j({pId:+s,fsId:+r,fgId:+a}),{canEdit:c,isLoading:f,isDataScientist:g}=S();return o.useEffect(()=>{i===void 0&&(async()=>{const h=await new I().request({url:`/elastic/jwt/${+s}`,type:q.get});n(h.data.kibanaUrl)})()},[s,r,a,n,i]),m?t.jsx($,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(P,{isEditDisabled:!c||g||f,data:e,title:e==null?void 0:e.name,version:e==null?void 0:e.version,pathnamePostFix:"/logs",idColor:"labels.orange",onClickEdit:()=>{d(k(u.featureGroup.edit,u.project.value,{id:s,fsId:r,fgId:a}))},onClickRefresh:p}),t.jsx(F,{sx:{my:"20px",height:"100%",...l==="dark"?{filter:"invert(92%)"}:{}},children:t.jsx("iframe",{title:"Online feature group logs",src:`${i}#/?embed=true&hide-filter-bar=true&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h,to:now))&_a=(columns:!('@timestamp',priority,log_message),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'onlinefs_${+s}-*',key:log_arguments.feature_group_id,negate:!f,params:(query:'${a}'),type:phrase),query:(match_phrase:(log_arguments.feature_group_id:'${a}')))),index:'onlinefs_${+s}-*',interval:auto,query:(language:kuery,query:''),sort:!('@timestamp',desc))`,width:"100%",height:"100%",frameBorder:"0"})})]}):t.jsx(b,{})},N=o.memo(G);export{N as default};
