import{r as o,bb as x,u as y,aj as b,b4 as v,dm as _,j as t,L as j,bW as k,o as $,q as u,d as F,bc as q,cC as E,cD as I}from"./index-CK33qGU_.js";import{P as L}from"./Panel-q_vviXAK.js";import{u as P}from"./useUserPermissions-CGy0I-II.js";import"./Deprecated-D5xZ0QMJ.js";import"./CardActionButton-DcsFpjJz.js";import"./useDownload-hrjXceJg.js";import"./useProject-BzBQtp4J.js";import"./length-fOfC3W0h.js";import"./FileUploaderButton-Bppadu35.js";import"./dumbPluralize-CcxDsNiu.js";const G=()=>{x(q.fgMetrics);const{id:s,fsId:a,fgId:r}=y(),{colorMode:l}=b(),d=v(),[i,n]=o.useState(void 0),{currentData:e,isFetching:m,refetch:p}=_({pId:+s,fsId:+a,fgId:+r}),{canEdit:c,isLoading:f,isDataScientist:g}=P();return o.useEffect(()=>{i===void 0&&(async()=>{const h=await new E().request({url:`/elastic/jwt/${+s}`,type:I.get});n(h.data.kibanaUrl)})()},[s,a,r,n,i]),m?t.jsx(j,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(L,{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($(u.featureGroup.edit,u.project.value,{id:s,fsId:a,fgId:r}))},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:`https://localhost:8181${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:'${r}'),type:phrase),query:(match_phrase:(log_arguments.feature_group_id:'${r}')))),index:'onlinefs_${+s}-*',interval:auto,query:(language:kuery,query:''),sort:!('@timestamp',desc))`,width:"100%",height:"100%",frameBorder:"0"})})]}):t.jsx(k,{})},H=o.memo(G);export{H as default};
