import{r as m,j as r}from"./vendor-react-wBh_31cN.js";import{R as y}from"./ResourceNotFound-Cgzu0F33.js";import{M as _,aq as j,g as u,r as a,A as x,cB as k,cV as b}from"./index-dNe6i2rS.js";import{u as F}from"./useTitle-DQo_L6Ox.js";import{t as I}from"./titles-CzjGGAB3.js";import{P as $}from"./Panel-D_anPZvo.js";import{u as q}from"./useUserPermissions-Bu9Wyk8A.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-BHZy5VlV.js";import"./tooltip-DFFgUYh6.js";import"./badge-UCnweWGd.js";import"./combobox-QqI9aNup.js";import"./input-group-gxy3DSmS.js";import"./input-DFI7JniT.js";import"./label-gPWmc6ow.js";import"./textarea-BJVuSob1.js";import"./vendor-recharts-DmJlpLaF.js";import"./list-page-header-Fc18Qd7m.js";import"./animated-progress-DY4TkPAt.js";import"./separator-CxqNNMXg.js";import"./value-7N0Keti9.js";import"./metadata-field-Uf1PM1Ss.js";import"./time-utils-CQYZ5msB.js";import"./addDays-Cdit4yPz.js";import"./always-oSAuSdys.js";import"./init-Dq_gEBi9.js";import"./concat-CTXo1gGM.js";import"./formatDistance-B6o-SXVU.js";import"./CardActionButton-9dnJFRFw.js";import"./Deprecated-DEh1iT37.js";import"./uniqBy-6oWnYXMs.js";import"./sort-qlseijG5.js";import"./ascend-DedmOJV5.js";import"./selectors-DK1_X0Cd.js";import"./index-DLI8oDiK.js";import"./useCurrentProject-CTMLbmkf.js";import"./useProject-BbrP3CX5.js";import"./index-DURBtSjL.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};
