import{r as o,bx as x,u as y,aq as b,bp as v,dU as _,j as s,L as j,cr as k,q as $,s as u,B as q,by as F,db as I,dc as E}from"./index-C1DmWO_C.js";import{P as L}from"./Panel-Z-sMb6LN.js";import{u as P}from"./useUserPermissions-BiARnwL4.js";import"./Deprecated-BQWZLUTP.js";const B=()=>{x(F.fgMetrics);const{id:t,fsId:r,fgId:a}=y(),{colorMode:l}=b(),d=v(),[i,n]=o.useState(void 0),{currentData:e,isFetching:c,refetch:m}=_({pId:+t,fsId:+r,fgId:+a}),{canEdit:p,isLoading:f,isDataScientist:g}=P();return o.useEffect(()=>{i===void 0&&(async()=>{const h=await new I().request({url:`/elastic/jwt/${+t}`,type:E.get});n(h.data.kibanaUrl)})()},[t,r,a,n,i]),c?s.jsx(j,{}):e?s.jsxs(s.Fragment,{children:[s.jsx(L,{isEditDisabled:!p||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:t,fsId:r,fgId:a}))},onClickRefresh:m}),s.jsx(q,{sx:{my:"20px",height:"100%",...l==="dark"?{filter:"invert(92%)"}:{}},children:s.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_${+t}-*',key:log_arguments.feature_group_id,negate:!f,params:(query:'${a}'),type:phrase),query:(match_phrase:(log_arguments.feature_group_id:'${a}')))),index:'onlinefs_${+t}-*',interval:auto,query:(language:kuery,query:''),sort:!('@timestamp',desc))`,width:"100%",height:"100%",frameBorder:"0"})})]}):s.jsx(k,{})},w=o.memo(B);export{w as default};
