import{r as o,bG as y,bH as _,u as b,aj as j,bx as v,bm as k,j as t,L as F,cE as I,t as P,x as u,q,dQ as E,dO as $,dP as G}from"./index-DNBEEyYo.js";import{P as L}from"./Panel-LhPx0w--.js";import{u as S}from"./useUserPermissions-j5Zhfxzb.js";import"./Deprecated-DmDD0-tM.js";const D=()=>{y(_.fgMetrics);const{id:s,fsId:r,fgId:a}=b(),{colorMode:d}=j(),l=v(),[i,n]=o.useState(void 0),{currentData:e,isFetching:c,refetch:m}=k({pId:+s,fsId:+r,fgId:+a}),{canEdit:p,isLoading:f,isDataScientist:g,isFeatureStoreRestricted:h}=S();return o.useEffect(()=>{i===void 0&&(async()=>{const x=await new $().request({url:`/elastic/jwt/${+s}`,type:G.get});n(x.data.kibanaUrl)})()},[s,r,a,n,i]),c?t.jsx(F,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(L,{isEditDisabled:!p||g||h||f,data:e,title:e==null?void 0:e.name,version:e==null?void 0:e.version,pathnamePostFix:"/logs",idColor:"labels.orange",onClickEdit:()=>{l(P(u.project.featureGroup.edit,u.project.value,{id:s,fsId:r,fgId:a}))},onClickRefresh:m}),t.jsx(q,{sx:{my:"20px",height:"100%",...d==="dark"?{filter:"invert(92%)"}:{}},children:t.jsx("iframe",{title:"Online feature group logs",src:`${E}${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(I,{})},A=o.memo(D);export{A as default};
