import{r as m,j as r}from"./vendor-react-wBh_31cN.js";import{R as y}from"./ResourceNotFound-DwuevSJ8.js";import{M as _,aq as j,g as u,r as a,A as x,cB as k,cV as b}from"./index-BKr2rJhV.js";import{u as F}from"./useTitle-DQo_L6Ox.js";import{t as I}from"./titles-CzjGGAB3.js";import{P as $}from"./Panel-epT8eD0X.js";import{u as q}from"./useUserPermissions-BVMFDLlq.js";import{c as P,u as E}from"./vendor-router-D1GqFWiT.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./MissingMandatoryTagsWarning-DpOcErx3.js";import"./tooltip-Da8-EbK8.js";import"./badge-nyizWwTN.js";import"./combobox-CcK1PxyF.js";import"./input-group-Z3Qmt3PL.js";import"./input-H6_qmzms.js";import"./label-Dnebucx5.js";import"./textarea-Co48BFy3.js";import"./vendor-recharts-DmJlpLaF.js";import"./list-page-header-DZysveul.js";import"./animated-progress-BdqEbBYd.js";import"./separator-2OqrG5Vy.js";import"./value-76ihWpF6.js";import"./metadata-field-B_vcklh-.js";import"./time-utils-tK1noPML.js";import"./addDays-DjM7nKyN.js";import"./always-CtAmwIxm.js";import"./init-BDcDHUTz.js";import"./concat-AxOj0lUI.js";import"./formatDistance-qDinyJzC.js";import"./CardActionButton-Ch696ne3.js";import"./Deprecated-lKLzSfj7.js";import"./uniqBy-qYjau2JN.js";import"./sort-BIlPehKK.js";import"./ascend-D9xyxTFQ.js";import"./selectors-CMD4o3wq.js";import"./index-DkvW68Om.js";import"./useCurrentProject-C6qZaZgv.js";import"./useProject-FSnHbCQX.js";import"./index-BeaoFlb1.js";import"./project-eQY1xQe-.js";const G=()=>{F(I.fgMetrics);const{id:e,fsId:i,fgId:o}=P(),n=E(),[s,p]=m.useState(void 0),{currentData:t,isFetching:l,refetch:c}=_({pId:+e,fsId:+i,fgId:+o}),{canEdit:d,isLoading:f,isDataScientist:g,isFeatureStoreRestricted:h}=q();return m.useEffect(()=>{s===void 0&&(async()=>{const v=await new k().request({url:`/elastic/jwt/${+e}`,type:b.get});p(v.data.kibanaUrl)})()},[e,i,o,p,s]),l?r.jsx(j,{}):t?r.jsxs(r.Fragment,{children:[r.jsx($,{isEditDisabled:!d||g||h||f,data:t,title:t==null?void 0:t.name,version:t==null?void 0:t.version,pathnamePostFix:"/logs",idColor:"labels.orange",onClickEdit:()=>{n(u(a.project.featureGroup.edit,a.project.value,{id:e,fsId:i,fgId:o}))},onClickRefresh:c}),r.jsx("div",{className:"my-5 h-full dark:invert-[0.92]",children:r.jsx("iframe",{title:"Online feature group logs",src:`${x}${s}#/?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_${+e}-*',key:log_arguments.feature_group_id,negate:!f,params:(query:'${o}'),type:phrase),query:(match_phrase:(log_arguments.feature_group_id:'${o}')))),index:'onlinefs_${+e}-*',interval:auto,query:(language:kuery,query:''),sort:!('@timestamp',desc))`,width:"100%",height:"100%",frameBorder:"0"})})]}):r.jsx(y,{resource:"feature group",backHref:u(a.project.featureGroup.list,a.project.value,{id:e,fsId:i}),backLabel:"Back to feature groups"})},kt=m.memo(G);export{kt as default};
