@odigos/ui-kit 0.0.251 → 0.0.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/lib/chunks/{connections-scope-CneIqjeg.js → connections-scope-Cb3gZ8MW.js} +1 -1
- package/lib/chunks/{flow-CQi_KYfs.js → flow-CAOY59Tu.js} +1 -1
- package/lib/chunks/{helpers-K1tnyqhm.js → helpers-CXxRJd5C.js} +1 -1
- package/lib/chunks/{index-Dv0RvKAp.js → index-BgflYoEI.js} +8 -8
- package/lib/chunks/{source-instrument-form-context-C79I_5cH.js → source-instrument-form-context-Rk2YlyRb.js} +1 -1
- package/lib/chunks/{ui-components-BKrLf2tx.js → ui-components-Dc15jc-B.js} +36 -35
- package/lib/chunks/use-odigos-api-qSWLSy9S.js +5 -0
- package/lib/components/_v2/drawer/index.d.ts +1 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/v2.js +4 -4
- package/lib/containers.js +1 -1
- package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +4 -4
- package/lib/contexts/odigos-api.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/use-odigos-api-CDHW7ekQ.js +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useMemo as e,useContext as t,createContext as r,useCallback as a,useState as n,useEffect as o}from"react";import{HttpLink as i,from as s,split as c,ApolloClient as d,InMemoryCache as u,ApolloProvider as l,useApolloClient as E,useLazyQuery as f,useQuery as T,gql as _}from"@apollo/client";import{jsx as p}from"react/jsx-runtime";import{onError as y}from"@apollo/client/link/error";import{setContext as S}from"@apollo/client/link/context";import{getMainDefinition as R}from"@apollo/client/utilities";import{o as m,y as A,D as O,S as I,X as N,Y as C,E as g,P as h,c as L,z as U,Z as P,_ as G,$ as D,a0 as v,a1 as w,a2 as b,a3 as F}from"./ui-components-Dc15jc-B.js";const k=e=>{if(!e)return!1;const t=e.toLowerCase();return t.includes("authentication required")||t.includes("authentication expired")||t.includes("http 401")},M=r(null),Y=()=>{const e=t(M);if(!e)throw new Error("[ui-kit] useOdigosApi() / useXxxApi() called outside of <OdigosApiProvider>. Make sure the host app mounts the provider at its layout level.");return e},H=({apolloConfig:t,operations:r,context:a,children:n})=>{const o=e(()=>(e=>{const t=new i({uri:e.httpUrl,credentials:e.credentials??"same-origin"}),r=y(({graphQLErrors:t,networkError:r})=>{t&&t.length>0&&t.some(e=>k(e.message))&&e.onAuthError?.(),r&&(401===r.statusCode||k(r.message))&&e.onAuthError?.()}),a=S(async(t,r)=>{const a={...r.headers};if(e.authHeader){const t=await e.authHeader();Object.assign(a,t)}return e.csrfHeader&&Object.assign(a,e.csrfHeader()),{headers:a}}),n=[];e.additionalLinks?.length&&n.push(...e.additionalLinks),n.push(a,r,t);let o=s(n);e.wsLink&&(o=c(({query:e})=>{const t=R(e);return"OperationDefinition"===t.kind&&"subscription"===t.operation},e.wsLink,o));const l=e.defaultFetchPolicies;return new d({link:o,cache:new u({addTypename:e.addTypename??!0,typePolicies:e.cacheTypePolicies}),defaultOptions:{watchQuery:{fetchPolicy:l?.watchQuery??"cache-and-network"},query:{fetchPolicy:l?.query??"cache-first"},mutate:{fetchPolicy:l?.mutate??"network-only"}}})})(t),[t.httpUrl,t.wsLink,t.addTypename,t.credentials]),E=e(()=>({operations:r,context:a,apolloConfig:t}),[r,a,t]);return p(l,{client:o,children:p(M.Provider,{value:E,children:n})})},W=M,x=e=>({error:e,results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:0}),K=(e,t)=>{if(e)return"function"==typeof e?e(t):e},V=e=>{if(!e)return"Unknown error";if(e instanceof Error)return e.cause instanceof Error?e.cause.message:e.message;if("object"==typeof e){const t=e;return t.cause?.message||t.message||String(e)}return String(e)},$=(e,t)=>e.client??t,B=async(e,t,r,a,n)=>{if(!t)return{error:"Query operation not configured"};const o=K(t.document,a);if(!o)return{error:"Query operation not supported in this context"};if(t.canRun&&!t.canRun(a))return{data:void 0};const i=t.transformVariables?t.transformVariables(r,a):r,s=$(t,e);try{const e=await s.query({query:o,variables:i,fetchPolicy:"network-only"});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:e.error?V(e.error):void 0}}catch(e){return{error:V(e)}}},j=async(e,t,r,a)=>{if(!t)return{error:"Mutation operation not configured"};const n=K(t.document,a);if(!n)return{error:"Mutation operation not supported in this context"};if(t.canRun&&!t.canRun(a))return{data:void 0};const o=t.transformVariables?t.transformVariables(r,a):r,i=$(t,e);try{const e=await i.mutate({mutation:n,variables:o});return{data:t.transformResult?t.transformResult(e.data,a):e.data,error:void 0}}catch(e){return{error:V(e)}}},q=async(e,t,r,a,n)=>{if(!t)return x("Multi fetch operation not configured");if(!r.length)return x("No proxy ids supplied for multi fetch");const o=$(t,e);if(t.transformVariablesMulti&&(t.documentMulti||t.document)){const e=t.transformVariablesMulti(r,a,n),i=[];for(const r of e)try{const e=await o.query({query:r.document,variables:r.variables,fetchPolicy:"network-only"});t.transformMultiResult?t.transformMultiResult(e.data,n).forEach(e=>i.push(e)):r.proxyIDs.forEach(t=>{i.push({proxyID:t,success:!e.error,data:e.data,error:e.error?.message})})}catch(e){const t=V(e);r.proxyIDs.forEach(e=>i.push({proxyID:e,success:!1,error:t}))}const s=i.filter(e=>e.success).length,c=i.length-s,d=Array.from(new Set(i.filter(e=>!!e.error).map(e=>e.error)));return{results:i,allSucceeded:0===c,anySucceeded:s>0,successCount:s,failureCount:c,error:d.length?d.join(", "):void 0}}const i=await Promise.all(r.map(async r=>{const o={...n,proxyID:r},i=await B(e,t,a,o);return{proxyID:r,success:!i.error,data:i.data,error:i.error}})),s=i.filter(e=>e.success).length,c=i.length-s,d=Array.from(new Set(i.filter(e=>!!e.error).map(e=>e.error)));return{results:i,allSucceeded:0===c,anySucceeded:s>0,successCount:s,failureCount:c,error:d.length?d.join(", "):void 0}},Q=(e,t)=>{if(e)return"string"==typeof e?e:N(e,t)},z=e=>{const{addNotification:t}=m(),r=(r,a,n,o,i)=>t({type:r,title:a,message:n,crdType:e,target:Q(o,e),hideFromHistory:i});return{notify:r,notifyError:(e,t,a)=>r(I.Error,e,t,a),notifySuccess:(e,t,a)=>r(I.Success,e,t,a),notifyPending:(e,t)=>r(I.Default,"Pending",e,t,!0),notifyReadonly:()=>{t({type:I.Warning,title:O.READONLY,message:A.READONLY_WARNING,hideFromHistory:!0})}}},X=e=>{e({type:I.Warning,title:O.READONLY,message:A.READONLY_WARNING,hideFromHistory:!0})},J=_`
|
|
2
|
+
query OdigosApiNoop {
|
|
3
|
+
__typename
|
|
4
|
+
}
|
|
5
|
+
`,Z=(e,t)=>{if(e)return"function"==typeof e?e(t):e},ee=(e,t)=>e[t],te=(e,t,r)=>{if(void 0===t)return;return e?.transformResult?e.transformResult(t,r):t},re=(e,t,r)=>{if(!e)return;const a=e.transformVariables;return a?a(t,r):t},ae=(t,r,n)=>{const{operations:o,context:i}=Y(),s=ee(o,t),c=e(()=>Z(s?.document,i),[s,i]),d=e(()=>re(s,r,i),[s,r,i]),u=!s||!c,l=!!s?.canRun&&!s.canRun(i),E=n?.skip||u||l,f=T(c??J,{variables:d,skip:E,pollInterval:n?.pollInterval,fetchPolicy:n?.fetchPolicy??"cache-and-network",notifyOnNetworkStatusChange:n?.notifyOnNetworkStatusChange,client:s?.client,onCompleted:n?.onCompleted?e=>{const t=te(s,e,i);void 0!==t&&n.onCompleted(t)}:void 0,onError:n?.onError}),_=e(()=>{if(!E)return te(s,f.data,i)},[s,i,f.data,E]),p=a(async()=>{if(u)return{data:void 0};const e=await f.refetch();return{data:te(s,e.data,i)}},[s,i,f,u]);return{data:_,loading:!E&&f.loading,error:f.error,refetch:p,unsupported:u}},ne=(t,r)=>{const{operations:n,context:o}=Y(),i=ee(n,t),s=e(()=>Z(i?.document,o),[i,o]),c=!i||!s,[d,u]=f(s??J,{fetchPolicy:r?.fetchPolicy??"network-only",notifyOnNetworkStatusChange:r?.notifyOnNetworkStatusChange,client:i?.client});return{execute:a(async e=>{if(c)return{error:void 0};if(i?.canRun&&!i.canRun(o))return{data:void 0};const t=re(i,e,o),r=await d({variables:t});return r.error?{error:r.error}:{data:te(i,r.data,o)}},[i,o,d,c]),data:e(()=>te(i,u.data,o),[i,o,u.data]),loading:u.loading,error:u.error,called:u.called,unsupported:c}},oe=(t,r)=>{const{operations:o,context:i}=Y(),s=E(),c=ee(o,t),d=e(()=>Z(c?.document,i),[c,i]),u=!c||!d,[l,f]=n({loading:!1,called:!1}),T=a(()=>f({loading:!1,called:!1}),[]);return[a(async e=>{if(u||!d)return{error:void 0};if(c?.canRun&&!c.canRun(i))return{data:void 0};const t=re(c,e,i),a=c?.client??s;f(e=>({...e,loading:!0,called:!0}));try{const e=await a.mutate({mutation:d,variables:t}),n=te(c,e.data,i);if(f({data:n,loading:!1,error:void 0,called:!0}),r?.refetchQueries){const e=a.refetchQueries({include:r.refetchQueries});r?.awaitRefetchQueries&&await e}return void 0!==n&&r?.onCompleted?.(n),{data:n}}catch(e){const t=e;return f({data:void 0,loading:!1,error:t,called:!0}),r?.onError?.(t),{error:t}}},[c,i,s,d,u,r]),{data:l.data,loading:l.loading,error:l.error,called:l.called,unsupported:u,reset:T}]},ie=(e,t,r,a)=>{let n=!0;const o={sources:[]};for(const[i,s]of Object.entries(e)){if(!s.length)continue;n=!1;const e=s.map(({id:e,selected:t,currentStreamName:a})=>({namespace:e.namespace,name:e.name,kind:e.kind,selected:void 0!==t&&t,currentStreamName:a||r}));let c=0,d=0;for(const r of e){const e=t.find(e=>e.id.namespace===i&&e.id.name===r.name&&e.id.kind===r.kind),a=e?.dataStreamNames||[];r.selected&&!e?c++:!r.selected&&e&&a.length<=1&&d++}a(c,d),o.sources.push(...e)}return{payload:o,isEmpty:n}},se=(e,t)=>{let r=!0;const a={namespaces:[]};for(const[n,{selected:o,currentStreamName:i}]of Object.entries(e))"boolean"==typeof o&&(r=!1,a.namespaces.push({namespace:n,selected:o,currentStreamName:i||t}));return{payload:a,isEmpty:r}},ce={filter:{markedForInstrumentation:!0}},de=[],ue=[],le=async e=>{const t=(e=>{try{return new URL("/diagnose/download",e).toString()}catch{return null}})(e.httpUrl);if(t)try{const[r,a]=await Promise.all([Promise.resolve(e.authHeader?.()??{}),Promise.resolve(e.csrfHeader?.()??{})]),n=await fetch(t,{credentials:e.credentials??"same-origin",headers:{...r,...a}});if(!n.ok)throw new Error(`Failed to download diagnose archive: ${n.status} ${n.statusText}`);((e,t)=>{if("undefined"==typeof document)return;const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)})(await n.blob(),`odigos-diagnose-${Date.now()}.tar.gz`)}catch(e){}},Ee=[],fe=[],Te=[],_e=(e,t)=>({...e,fields:e.fields.filter(({value:e})=>void 0!==e),currentStreamName:t}),pe=t=>{const{operations:r,context:n}=Y(),i=E(),s=t?.subscribe,c=!!s&&s.includes("sources"),d=!!s&&s.includes("destinations"),u=!!s&&s.includes("actions"),l=!!s&&s.includes("rules"),f=!!s&&s.includes("namespaces"),T=!!s&&s.includes("dataStreams"),_=!!s&&s.includes("destinationCategories"),p=!!s&&s.includes("potentialDestinations"),y=((e,t,r)=>{const n=E(),{notifyError:o,notifySuccess:i,notifyPending:s,notifyReadonly:c}=z(g.Source),{selectedStreamName:d}=U(),{setProgress:u,resetProgress:l}=P(),{setConfiguredSources:f,setConfiguredFutureApps:T}=G(),_=ae("GET_WORKLOADS",ce,{fetchPolicy:"cache-first",skip:!r?.subscribe}),p=_.data?.workloads??de,y=(e,t)=>{const{progress:r}=P.getState();e>0&&u(D.Instrumenting,{total:(r[D.Instrumenting]?.total||0)+e,current:r[D.Instrumenting]?.current||0}),t>0&&u(D.Uninstrumenting,{total:(r[D.Uninstrumenting]?.total||0)+t,current:r[D.Uninstrumenting]?.current||0})},S=a(async()=>{const{error:r}=await B(n,e.GET_WORKLOADS,ce,t);r&&o(C.Read,r)},[n,e.GET_WORKLOADS,t,o]);return{items:p,loading:_.loading,fetchAll:S,fetchByTargets:async(r,a)=>{const i=!!a?.slim,s=r.map(e=>v(e,g.Source)).filter(e=>e.namespace&&e.name&&e.kind);if(0===s.length)return;if(s.length>50)return void await S();const c=i&&e.GET_WORKLOADS_BY_IDS_SLIM?e.GET_WORKLOADS_BY_IDS_SLIM:e.GET_WORKLOADS_BY_IDS,{error:d}=await B(n,c,{ids:s.map(({namespace:e,kind:t,name:r})=>({namespace:e,kind:t,name:r}))},t);d?o(C.Read,d):await S()},fetchById:async r=>{const{data:a,error:i}=await B(n,e.GET_WORKLOADS_BY_IDS,{ids:[{namespace:r.namespace,kind:r.kind,name:r.name}]},t);if(!i)return await S(),a?.workloadsByIds?.find(e=>e.id.namespace===r.namespace&&e.id.kind===r.kind&&e.id.name===r.name);o(C.Read,i)},fetchLibraries:async r=>B(n,e.GET_SOURCE_LIBRARIES,r,t),fetchPeerSources:async r=>B(n,e.GET_PEER_SOURCES,{serviceName:r},t),persist:async(r,a)=>{if(t.isReadonly)return c();const{payload:i,isEmpty:u}=ie(r,p,d,y),{payload:E,isEmpty:_}=se(a,d);let S=!1;u||(S=!0,s("Persisting sources...")),_||S||s("Persisting namespaces...");const{error:R}=await j(n,e.PERSIST_SOURCES,i,t);if(R&&(l(D.Instrumenting),l(D.Uninstrumenting),o(C.Update,R)),e.PERSIST_NAMESPACES){const{error:r}=await j(n,e.PERSIST_NAMESPACES,E,t);r&&o(C.Update,r)}f({}),T({})},persistV2:async r=>{if(t.isReadonly)return c(),{error:"readonly"};const a=[];for(const[,o]of Object.entries(r)){const r={sources:[]},i={namespaces:[]};for(const e of o)e.name&&e.kind?r.sources.push(e):i.namespaces.push(e);if(i.namespaces.length>0&&e.PERSIST_NAMESPACES){const{error:r}=await j(n,e.PERSIST_NAMESPACES,i,t);r&&a.push(r)}if(r.sources.length>0){const{error:o}=await j(n,e.PERSIST_SOURCES,r,t);o&&a.push(o)}}return a.length?{error:a.join(", ")}:void 0},update:async(r,a)=>{if(t.isReadonly)return c();s("Updating source...");const u={sourceId:r,patchSourceRequest:{...a,currentStreamName:d}},{data:l,error:E}=await j(n,e.UPDATE_SOURCE,u,t);E?o(C.Update,E,r):l?.updateK8sActualSource&&i(C.Update,`Successfully updated "${r.name}" source`,r)},restartWorkloads:async r=>{if(t.isReadonly)return c();s("Restarting sources...");const{data:a,error:d}=await j(n,e.RESTART_WORKLOADS,{sourceIds:r},t);d?o(C.Update,d):a?.restartWorkloads&&i(C.Update,`Successfully restarted ${r.length} sources`)},restartPod:async(r,a)=>{if(t.isReadonly)return c();s("Restarting pod...");const{data:d,error:u}=await j(n,e.RESTART_POD,{namespace:r,name:a},t);u?o(C.Update,u):d?.restartPod&&i(C.Update,`Successfully restarted pod ${r}/${a}`)},recoverFromRollback:async r=>{if(t.isReadonly)return c();s("Recovering from rollback...");const{data:a,error:d}=await j(n,e.RECOVER_FROM_ROLLBACK,{sourceId:r},t);d?o(C.Update,d,r):a?.recoverFromRollbackForWorkload&&i(C.Update,"Successfully triggered recovery from rollback")}}})(r,n,{subscribe:c}),S=((e,t,r)=>{const a=E(),{notifyError:n,notifySuccess:o,notifyReadonly:i}=z(g.Destination),{selectedStreamName:s}=U(),c=ae("GET_DESTINATIONS",void 0,{fetchPolicy:"cache-first",skip:!r?.subscribe}),d=ae("GET_DESTINATION_CATEGORIES",void 0,{skip:!r?.subscribeCategories}),u=ae("GET_POTENTIAL_DESTINATIONS",void 0,{skip:!r?.subscribePotential}),l=c.data?.computePlatform?.destinations??c.data?.destinations??Te,f=async()=>{const{error:r}=await B(a,e.GET_DESTINATIONS,void 0,t);r&&n(C.Read,r)};return{items:l,loading:c.loading,fetchAll:f,categoriesResult:d.data,categoriesLoading:d.loading,potentialResult:u.data,potentialLoading:u.loading,testConnection:async r=>{const{data:n}=await j(a,e.TEST_DESTINATION_CONNECTION,{destination:_e(r,s)},t);return n},create:async r=>{if(t.isReadonly)return i();const{error:c}=await j(a,e.CREATE_DESTINATION,{destination:_e(r,s)},t);c?n(C.Create,c):(o(C.Create,`Successfully created "${r.type}" destination`),await f())},update:async(r,c)=>{if(t.isReadonly)return i();const{data:d,error:u}=await j(a,e.UPDATE_DESTINATION,{id:r,destination:_e(c,s)},t);u?n(C.Update,u,r):d?.updateDestination&&(o(C.Update,`Successfully updated "${c.type}" destination`,r),await f())},remove:async r=>{if(t.isReadonly)return i();const c=l.find(e=>w(e)===r)?.destinationType?.type,{error:d}=await j(a,e.DELETE_DESTINATION,{id:r,currentStreamName:s},t);d?n(C.Delete,d,r):(o(C.Delete,`Successfully deleted "${c??r}" destination`,r),await f())}}})(r,n,{subscribe:d,subscribeCategories:_,subscribePotential:p}),R=((e,t,r)=>{const a=E(),{notifyError:n,notifySuccess:o,notifyReadonly:i}=z(g.Action),s=ae("GET_ACTIONS",void 0,{fetchPolicy:"cache-first",skip:!r?.subscribe}),c=s.data?.computePlatform?.actions??s.data?.actions??ue,d=async()=>{const{error:r}=await B(a,e.GET_ACTIONS,void 0,t);r&&n(C.Read,r)};return{items:c,loading:s.loading,fetchAll:d,create:async r=>{if(t.isReadonly)return i();if(!e.CREATE_ACTION)return;const{error:s}=await j(a,e.CREATE_ACTION,{action:r},t);s?n(C.Create,s):(o(C.Create,`Successfully created "${r.type}" action`),await d())},update:async(r,s)=>{if(t.isReadonly)return i();if(!e.UPDATE_ACTION)return;const{error:c}=await j(a,e.UPDATE_ACTION,{id:r,action:s},t);c?n(C.Update,c,r):(o(C.Update,`Successfully updated "${s.type}" action`,r),await d())},remove:async(r,s)=>{if(t.isReadonly)return i();if(!e.DELETE_ACTION)return;const{error:c}=await j(a,e.DELETE_ACTION,{id:r,actionType:s},t);c?n(C.Delete,c,r):(o(C.Delete,`Successfully deleted "${s}" action`,r),await d())}}})(r,n,{subscribe:u}),A=((t,r,a)=>{const n=E(),{notifyError:o,notifySuccess:i,notifyReadonly:s}=z(g.InstrumentationRule),c=ae("GET_INSTRUMENTATION_RULES",void 0,{fetchPolicy:"cache-first",skip:!a?.subscribe}),d=e(()=>(c.data?.computePlatform?.instrumentationRules??c.data?.instrumentationRules??[]).map(b),[c.data]),u=async()=>{const{error:e}=await B(n,t.GET_INSTRUMENTATION_RULES,void 0,r);e&&o(C.Read,e)};return{items:d,loading:c.loading,fetchAll:u,create:async(e,a)=>{if(r.isReadonly)return s();if(!t.CREATE_INSTRUMENTATION_RULE)return;const{error:c}=await j(n,t.CREATE_INSTRUMENTATION_RULE,{instrumentationRule:F(e)},r);c?o(C.Create,c):(i(C.Create,`Successfully created${a?` "${a}"`:""} rule`),await u())},update:async(e,a,c)=>{if(r.isReadonly)return s();if(!t.UPDATE_INSTRUMENTATION_RULE)return;const{error:d}=await j(n,t.UPDATE_INSTRUMENTATION_RULE,{ruleId:e,instrumentationRule:F(a)},r);d?o(C.Update,d,e):(i(C.Update,`Successfully updated${c?` "${c}"`:""} rule`,e),await u())},remove:async(e,a)=>{if(r.isReadonly)return s();if(!t.DELETE_INSTRUMENTATION_RULE)return;const{error:c}=await j(n,t.DELETE_INSTRUMENTATION_RULE,{ruleId:e},r);c?o(C.Delete,c,e):(i(C.Delete,`Successfully deleted${a?` "${a}"`:""} rule`,e),await u())}}})(r,n,{subscribe:l}),O=((e,t,r)=>{const a=E(),{addNotification:n}=m(),{setDataStreams:i}=U(),s=!!r?.subscribe,c=(e,t)=>n({type:I.Error,title:e,message:t}),d=ae("GET_DATA_STREAMS",void 0,{fetchPolicy:"cache-first",skip:!s}),u=d.data?.computePlatform?.dataStreams??d.data?.dataStreams??fe;o(()=>{s&&i(u)},[s,JSON.stringify(u.map(e=>e.name))]);const l=async()=>{const{data:r,error:n}=await B(a,e.GET_DATA_STREAMS,void 0,t);if(n)c(C.Read,n);else if(r){const e=r.computePlatform?.dataStreams??r.dataStreams??[];i(e)}},f=e.CREATE_DATA_STREAM?async r=>{if(t.isReadonly)return X(n);const{error:o}=await j(a,e.CREATE_DATA_STREAM,{stream:r},t);o?c(C.Create,o):await l()}:void 0;return{items:u,loading:d.loading,fetchAll:l,create:f,update:async(r,o)=>{if(t.isReadonly)return X(n);const{error:i}=await j(a,e.UPDATE_DATA_STREAM,{id:r,dataStream:o},t);i?c(C.Update,i):await l()},remove:async r=>{if(t.isReadonly)return X(n);const{error:o}=await j(a,e.DELETE_DATA_STREAM,{id:r},t);o?c(C.Delete,o):await l()}}})(r,n,{subscribe:T}),N=((e,t,r)=>{const a=E(),{notifyError:n,notifyReadonly:o}=z(g.Namespace),i=ae("GET_NAMESPACES_WITH_WORKLOADS",void 0,{fetchPolicy:"cache-first",skip:!r?.subscribe});return{items:i.data?.namespaces??Ee,loading:i.loading,fetchAll:async()=>{const r=await B(a,e.GET_NAMESPACES_WITH_WORKLOADS,void 0,t);return r.error&&n(C.Read,r.error),r},persist:async r=>{if(t.isReadonly)return o();const{error:i}=await j(a,e.PERSIST_NAMESPACES,r,t);return i&&n(C.Update,i),i?{error:i}:void 0}}})(r,n,{subscribe:f}),k=((e,t)=>{const r=E(),{notifyError:a}=z(g.Source);return{fetch:async n=>{const o=await B(r,e.GET_K8S_MANIFEST,n,t);return o.error&&a(C.Read,o.error),o}}})(r,n),M=((e,t)=>{const r=E(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=z(g.Source);return{getEffectiveConfig:async a=>e.GET_EFFECTIVE_CONFIG?B(r,e.GET_EFFECTIVE_CONFIG,{id:a},t):{error:"GET_EFFECTIVE_CONFIG not configured"},applyConfigurations:e.UPDATE_REMOTE_CONFIG?async(n,i)=>{if(t.isReadonly)return o();const{error:s}=await j(r,e.UPDATE_REMOTE_CONFIG,{formData:n,connectionIds:i},t);return s&&a(C.Update,s),s?{error:s}:void 0}:void 0,getConfigYamls:e.GET_CONFIG_YAMLS?async()=>B(r,e.GET_CONFIG_YAMLS,void 0,t):void 0,updateLocalUiConfig:e.UPDATE_LOCAL_UI_CONFIG?async i=>{if(t.isReadonly)return o();const{error:s}=await j(r,e.UPDATE_LOCAL_UI_CONFIG,{config:i},t);return s?a(C.Update,s):n(C.Update,"Local UI configuration updated successfully"),s?{error:s}:void 0}:void 0,resetLocalUiConfigToDefaults:e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS?async()=>{if(t.isReadonly)return o();const{error:i}=await j(r,e.RESET_LOCAL_UI_CONFIG_TO_FACTORY_DEFAULTS,void 0,t);return i?a(C.Update,i):n(C.Update,"Local UI configuration reset to factory defaults"),i?{error:i}:void 0}:void 0}})(r,n),H=((e,t)=>{const r=E(),{apolloConfig:a}=Y();return{fetchDescribeOdigos:e.GET_DESCRIBE_ODIGOS?async()=>B(r,e.GET_DESCRIBE_ODIGOS,void 0,t):void 0,fetchDescribeSource:e.GET_DESCRIBE_SOURCE?async a=>B(r,e.GET_DESCRIBE_SOURCE,a,t):void 0,downloadDiagnose:e.GET_DIAGNOSE?async(n,o)=>{const i=await B(r,e.GET_DIAGNOSE,{input:n,dryRun:o?.dryRun??!1},t),s=i?.data?.stats?.fileCount??0;return!i.error&&s>0&&!o?.dryRun&&await le(a),i}:void 0}})(r,n),W=((e,t)=>{const r=E(),{notifyError:a,notifyReadonly:n}=z(g.Source);return{fetchTokens:e.GET_TOKENS?async()=>B(r,e.GET_TOKENS,void 0,t):void 0,updateToken:e.UPDATE_TOKEN?async o=>{if(t.isReadonly)return n();const{error:i}=await j(r,e.UPDATE_TOKEN,{token:o},t);return i&&a(C.Update,i),i?{error:i}:void 0}:void 0}})(r,n),x=((e,t)=>{const r=E();return{fetch:async()=>B(r,e.GET_METRICS,void 0,t)}})(r,n),K=((e,t)=>{const r=E();return{fetch:e.GET_SERVICE_MAP?async()=>B(r,e.GET_SERVICE_MAP,void 0,t):void 0}})(r,n),V=((e,t)=>{const r=E();return{fetchSlots:e.GET_PROFILING_SLOTS?async()=>B(r,e.GET_PROFILING_SLOTS,void 0,t):void 0,fetchSourceProfiling:e.GET_SOURCE_PROFILING?async a=>B(r,e.GET_SOURCE_PROFILING,a,t):void 0,enableProfiling:e.ENABLE_SOURCE_PROFILING?async a=>j(r,e.ENABLE_SOURCE_PROFILING,a,t):void 0}})(r,n),$=((e,t)=>{const r=E();return{getGatewayInfo:e.GET_GATEWAY_INFO?async()=>B(r,e.GET_GATEWAY_INFO,void 0,t):void 0,getGatewayPods:e.GET_GATEWAY_PODS?async()=>B(r,e.GET_GATEWAY_PODS,void 0,t):void 0,getNodeCollectorInfo:e.GET_NODE_COLLECTOR_INFO?async()=>B(r,e.GET_NODE_COLLECTOR_INFO,void 0,t):void 0,getNodeCollectorPods:e.GET_NODE_COLLECTOR_PODS?async()=>B(r,e.GET_NODE_COLLECTOR_PODS,void 0,t):void 0,getExtendedPodInfo:e.GET_COLLECTOR_POD_INFO?async(a,n)=>B(r,e.GET_COLLECTOR_POD_INFO,{namespace:a,name:n},t):void 0}})(r,n),q=((e,t)=>{const r=E(),{notifyError:a,notifySuccess:n,notifyReadonly:o}=z(g.SamplingRule),i=async()=>{e.GET_SAMPLING_RULES&&await B(r,e.GET_SAMPLING_RULES,void 0,t)},s=(e,s)=>e?async c=>{if(t.isReadonly)return o();const{error:d}=await j(r,e,c,t);return d?a(s,d):(n(C.Create,"Successfully created sampling rule"),await i()),d?{error:d}:void 0}:void 0,c=(e,s)=>e?async(c,d)=>{if(t.isReadonly)return o();const{error:u}=await j(r,e,{samplingId:d.samplingId,ruleId:c,rule:d.rule},t);return u?a(s,u):(n(C.Update,"Successfully updated sampling rule"),await i()),u?{error:u}:void 0}:void 0,d=e=>e?async(s,c)=>{if(t.isReadonly)return o();const{error:d}=await j(r,e,{samplingId:c,ruleId:s},t);return d?a(C.Delete,d):(n(C.Delete,"Successfully deleted sampling rule"),await i()),d?{error:d}:void 0}:void 0;return{fetchAll:e.GET_SAMPLING_RULES?async()=>B(r,e.GET_SAMPLING_RULES,void 0,t):void 0,createNoisy:s(e.CREATE_NOISY_OPERATION_RULE,C.Create),updateNoisy:c(e.UPDATE_NOISY_OPERATION_RULE,C.Update),deleteNoisy:d(e.DELETE_NOISY_OPERATION_RULE),createHighlyRelevant:s(e.CREATE_HIGHLY_RELEVANT_OPERATION_RULE,C.Create),updateHighlyRelevant:c(e.UPDATE_HIGHLY_RELEVANT_OPERATION_RULE,C.Update),deleteHighlyRelevant:d(e.DELETE_HIGHLY_RELEVANT_OPERATION_RULE),createCostReduction:s(e.CREATE_COST_REDUCTION_RULE,C.Create),updateCostReduction:c(e.UPDATE_COST_REDUCTION_RULE,C.Update),deleteCostReduction:d(e.DELETE_COST_REDUCTION_RULE),updateK8sHealthProbesConfig:e.UPDATE_LOCAL_UI_SAMPLING_CONFIG?async n=>{if(t.isReadonly)return o();const{error:s}=await j(r,e.UPDATE_LOCAL_UI_SAMPLING_CONFIG,{config:n},t);return s?a(C.Update,s):await i(),s?{error:s}:void 0}:void 0}})(r,n),Q=((e,t)=>{const r=E();return{getAllClusterSnapshots:e.GET_ALL_CLUSTER_SNAPSHOTS?async()=>B(r,e.GET_ALL_CLUSTER_SNAPSHOTS,void 0,t):void 0,getClusterSnapshot:e.GET_CLUSTER_SNAPSHOT?async a=>B(r,e.GET_CLUSTER_SNAPSHOT,{clusterId:a},t):void 0}})(r,n);return{sourcesApi:y,destinationsApi:S,actionsApi:R,instrumentationRulesApi:A,dataStreamsApi:O,namespacesApi:N,k8sManifestApi:k,configApi:M,describeApi:H,tokensApi:W,metricsApi:x,serviceMapApi:K,profilingApi:V,collectorsApi:$,samplingApi:q,snapshotsApi:Q,capabilities:e(()=>((e,t)=>{const r=t.platformType===h.Vm,a=t.tier===L.Onprem,n=!r;return{canBulkPersistSources:n&&!!e.PERSIST_SOURCES,canFetchSnapshots:n&&!!e.GET_ALL_CLUSTER_SNAPSHOTS,canRecoverFromRollback:n&&!!e.RECOVER_FROM_ROLLBACK,canRestartWorkloads:n&&!!e.RESTART_WORKLOADS,canFetchPeerSources:!!e.GET_PEER_SOURCES,canFetchSourceLibraries:!!e.GET_SOURCE_LIBRARIES,canFetchK8sManifest:n&&!!e.GET_K8S_MANIFEST,canCreateDestination:n&&!!e.CREATE_DESTINATION,canTestConnection:n&&!!e.TEST_DESTINATION_CONNECTION,canFetchDestinationCategories:!!e.GET_DESTINATION_CATEGORIES,canFetchPotentialDestinations:n&&!!e.GET_POTENTIAL_DESTINATIONS,canCreateAction:n&&!!e.CREATE_ACTION,canCreateInstrumentationRule:n&&!!e.CREATE_INSTRUMENTATION_RULE,canApplyEffectiveConfig:n&&!!e.UPDATE_REMOTE_CONFIG&&!!e.GET_EFFECTIVE_CONFIG,canFetchEffectiveConfig:!!e.GET_EFFECTIVE_CONFIG,canFetchConfigYamls:!!e.GET_CONFIG_YAMLS,canFetchProfiling:n&&!!e.GET_PROFILING_SLOTS,canFetchCollectorInfo:n&&!!e.GET_GATEWAY_INFO,canManageSamplingRules:!!e.GET_SAMPLING_RULES,isEnterprise:a,isVm:r}})(r,n),[r,n]),resetCache:a(async()=>{await i.cache.reset()},[i])}};export{H as O,W as _,ie as a,oe as b,ae as c,pe as d,Y as e,q as f,se as p,j as r,ne as u};
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{eH as Autocomplete,
|
|
1
|
+
export{eH as Autocomplete,ax as Badge,ae as Button,af as ButtonSize,gl as ButtonTab,gm as ButtonTabList,ag as ButtonVariants,a5 as Checkbox,gn as CheckboxList,di as CheckboxSize,bh as CliCommand,bb as Condition,a$ as Conditions,go as DEFAULT_TIME_UNITS,a_ as DataCard,l as Drawer,bV as DropData,bX as DropDataAlignX,bW as DropDataAlignY,aN as DropDown,a6 as FieldMessage,a4 as FieldTitle,dz as GaugeChart,gp as GaugeChartVariant,gq as Header,gr as HoverActions,aO as IconButton,aP as IconButtonSize,bn as IconGroup,an as Input,ab as InputList,a7 as InputTable,db as Island,aQ as Loader,b_ as Modal,gs as Navbar,N as NoData,q as Note,ak as Radio,gt as RadioGroup,am as RadioSize,bj as Search,aJ as SectionCard,gu as SectionCardSize,ah as Segment,ap as SegmentSize,bx as SegmentVariant,dy as StatusCard,dc as Stepper,bz as Table,bA as TableVariant,b5 as Tag,bg as TagVariants,ar as TextArea,dA as TextCard,dT as TimeInput,a9 as Toggle,aa as ToggleLabelAlign,gv as ToggleList,aU as ToggleSize,gw as ToggleVariant,ao as TruncatableTypography,f as Typography,ad as TypographyColor,h as TypographySize,aV as TypographyVariants,aA as WarningModal,gx as resolveTypographyColor}from"../chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aM as CenterThis,eN as Code,m as Divider,g3 as ErrorBoundary,g4 as FadeLoader,F as FlexColumn,n as FlexRow,g5 as IconButton,I as IconGroup,g6 as IconWrapped,g7 as ImageControlled,g8 as LoadingText,g9 as ModalBody,ga as NotificationNote,gb as Overlay,aZ as Padding,da as PageContent,e as Popup,gc as ScrollX,bk as ScrollY,bo as SkeletonLoader,gd as TableContainer,ge as TableTitleWrap,gf as TableWrap,T as Text,gg as ToggleCodeComponent,av as Tooltip,dB as UpgradeRequiredWrapper,gh as VerticalScroll,gi as getLinksFromText,gj as getStrongsFromText,gk as renderText}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ACTION_OPTIONS,fJ as ALL_SOURCES,bC as BTN_CANCEL,dF as BTN_CREATE_FIRST_RULE,bJ as BTN_CREATE_RULE,bF as BTN_DELETE_RULE,dV as BTN_EDIT_AUTO_RULE,bE as BTN_EDIT_RULE,bR as BTN_SAVE,bD as BTN_SAVE_RULE,aY as BUTTON_TEXTS,bG as CATEGORY_DESCRIPTIONS,ex as CATEGORY_LABELS,bK as CATEGORY_TITLES,fK as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,fL as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,fM as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,
|
|
1
|
+
export{A as ACTION_OPTIONS,fJ as ALL_SOURCES,bC as BTN_CANCEL,dF as BTN_CREATE_FIRST_RULE,bJ as BTN_CREATE_RULE,bF as BTN_DELETE_RULE,dV as BTN_EDIT_AUTO_RULE,bE as BTN_EDIT_RULE,bR as BTN_SAVE,bD as BTN_SAVE_RULE,aY as BUTTON_TEXTS,bG as CATEGORY_DESCRIPTIONS,ex as CATEGORY_LABELS,bK as CATEGORY_TITLES,fK as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,fL as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,fM as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,aX as DEFAULT_CLUSTER_ID,aW as DEFAULT_CLUSTER_NAME,dt as DEFAULT_DATA_STREAM_NAME,e0 as DESC_DURATION,d$ as DESC_ERRORS,e3 as DESC_OPERATION,fN as DESC_PERCENTAGE_HIGHLY_RELEVANT,aF as DESC_PERCENTAGE_NOISY,ey as DESC_RULE_TYPE,eG as DESC_SOURCE_SCOPE,aR as DESTINATION_CATEGORIES,ay as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,aq as DOCS_BASE_URL,C as DestinationCategoryTypes,bN as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,bO as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,bL as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,bM as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,bP as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,bQ as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,bH as EDIT_TITLES,ef as EMPTY_VALUE,al as EXTRACTION_FORMAT_COPY,ai as EXTRACT_ATTRIBUTE_FORM,dD as FILTER_TYPE_ALL,y as FORM_ALERTS,M as INSTRUMENTATION_RULE_OPTIONS,e1 as LABEL_CUSTOM_DURATION,aK as LABEL_CUSTOM_PERCENTAGE,aI as LABEL_DISABLED,dC as LABEL_DISABLED_RULE,ep as LABEL_DROP_ALL,aC as LABEL_DROP_AT_MOST,aH as LABEL_ENABLED,e8 as LABEL_HTTP_ROUTE,ea as LABEL_HTTP_ROUTE_PREFIX,ec as LABEL_KAFKA_TOPIC,eq as LABEL_KEEP_ALL,em as LABEL_KEEP_AT_LEAST,en as LABEL_KEEP_AT_MOST,el as LABEL_KEEP_PERCENTAGE,d_ as LABEL_KEEP_TRACES_DURATION,dY as LABEL_KEEP_TRACES_ERRORS,eb as LABEL_METHOD,et as LABEL_NOTE,dW as LABEL_NO_PREVIEW,ee as LABEL_OPERATION_TYPE,fO as LABEL_RULE_DISABLED,fP as LABEL_RULE_ENABLED,er as LABEL_RULE_NAME,es as LABEL_RULE_TYPE,eo as LABEL_SAMPLE,e5 as LABEL_SERVER_ADDRESS,e7 as LABEL_TEMPLATED_PATH,e9 as LABEL_TEMPLATED_PATH_PREFIX,bu as LANGUAGE_OPTIONS,dg as MONITORS_OPTIONS,eA as NOTE_ENTIRE_CLUSTER,eF as NOTE_SOURCE_SCOPE_LOGIC,fQ as OPENTELEMETRY_EBPF_DISTRO_OPTION,eh as OPERATION_ALL,eg as OPERATION_HTTP_CLIENT,ed as OPERATION_HTTP_SERVER,ei as OPERATION_KAFKA_CONSUMER,ej as OPERATION_KAFKA_PRODUCER,bt as OTEL_DISTRO_NAME_OPTIONS,ek as PERCENTAGE_SECTION_DESCRIPTIONS,ev as PLACEHOLDER_NOTE,e6 as PLACEHOLDER_ROUTE,eu as PLACEHOLDER_RULE_NAME,eI as PLACEHOLDER_SEARCH_SOURCE,e4 as PLACEHOLDER_SERVER_ADDRESS,bd as PROCESS_ATTRIBUTE_NAMES,ac as REGEX_TESTER_DRAWER,aG as SAMPLING_AUTO_RULE_TITLE,dL as SAMPLING_BTN_CREATE_RULE,dJ as SAMPLING_BTN_DOCS,dK as SAMPLING_BTN_REFRESH,aE as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,dO as SAMPLING_DELETE_MODAL_APPROVE,dP as SAMPLING_DELETE_MODAL_CANCEL,dQ as SAMPLING_DELETE_MODAL_DESCRIPTION,dR as SAMPLING_DELETE_MODAL_TITLE,bS as SAMPLING_DRAWER_WIDTH,dI as SAMPLING_DUPLICATE_RULE_WARNING,aB as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,cJ as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_1,cK as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_2,cL as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_3,cM as SAMPLING_ONBOARDING_ADVANCED_LEFT_TITLE,cN as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_1,cO as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_2,cP as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_3,cQ as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_4,cR as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_5,cS as SAMPLING_ONBOARDING_ADVANCED_RIGHT_TITLE,cU as SAMPLING_ONBOARDING_ADVANCED_SUBTITLE,cT as SAMPLING_ONBOARDING_ADVANCED_TITLE,d9 as SAMPLING_ONBOARDING_AMBIENT_LABEL,cf as SAMPLING_ONBOARDING_BTN_GO_TO,c0 as SAMPLING_ONBOARDING_BTN_NEXT,cI as SAMPLING_ONBOARDING_BTN_READ_MORE,cq as SAMPLING_ONBOARDING_BTN_SKIP,cr as SAMPLING_ONBOARDING_BTN_START,cV as SAMPLING_ONBOARDING_COMMON_BANNER,d8 as SAMPLING_ONBOARDING_COMMON_RULES_SECTION,cY as SAMPLING_ONBOARDING_DROP_DESCRIPTION,cX as SAMPLING_ONBOARDING_DROP_SUBTITLE,cW as SAMPLING_ONBOARDING_DROP_TITLE,c$ as SAMPLING_ONBOARDING_ERROR_PRESET_NAME,c_ as SAMPLING_ONBOARDING_ERROR_PRESET_TOGGLE_LABEL,d2 as SAMPLING_ONBOARDING_KEEP_DESCRIPTION,d1 as SAMPLING_ONBOARDING_KEEP_SUBTITLE,d0 as SAMPLING_ONBOARDING_KEEP_TITLE,d3 as SAMPLING_ONBOARDING_KEEP_USE_CASE_1,d4 as SAMPLING_ONBOARDING_KEEP_USE_CASE_2,d5 as SAMPLING_ONBOARDING_KEEP_USE_CASE_3,d6 as SAMPLING_ONBOARDING_KEEP_USE_CASE_4,d7 as SAMPLING_ONBOARDING_KEEP_USE_CASE_5,c7 as SAMPLING_ONBOARDING_NOISY_BANNER,c3 as SAMPLING_ONBOARDING_NOISY_DESCRIPTION,c6 as SAMPLING_ONBOARDING_NOISY_PRESET_NAME,c4 as SAMPLING_ONBOARDING_NOISY_PRESET_SECTION,c5 as SAMPLING_ONBOARDING_NOISY_PRESET_TOGGLE_LABEL,c2 as SAMPLING_ONBOARDING_NOISY_SUBTITLE,c1 as SAMPLING_ONBOARDING_NOISY_TITLE,cZ as SAMPLING_ONBOARDING_PRESET_RULES_SECTION,b$ as SAMPLING_ONBOARDING_RECOMMENDED_BADGE,cF as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_BADGE,cG as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_DESC,cH as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_NAME,cC as SAMPLING_ONBOARDING_STRATEGY_DROP_BADGE,cA as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_1,cB as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_2,cD as SAMPLING_ONBOARDING_STRATEGY_DROP_DESC,cE as SAMPLING_ONBOARDING_STRATEGY_DROP_NAME,cx as SAMPLING_ONBOARDING_STRATEGY_KEEP_BADGE,cv as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_1,cw as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_2,cy as SAMPLING_ONBOARDING_STRATEGY_KEEP_DESC,cz as SAMPLING_ONBOARDING_STRATEGY_KEEP_NAME,cu as SAMPLING_ONBOARDING_STRATEGY_KEEP_WARNING,ct as SAMPLING_ONBOARDING_STRATEGY_SUBTITLE,cs as SAMPLING_ONBOARDING_STRATEGY_TITLE,cc as SAMPLING_ONBOARDING_SUCCESS_BULLET_1,cd as SAMPLING_ONBOARDING_SUCCESS_BULLET_2,ce as SAMPLING_ONBOARDING_SUCCESS_BULLET_3,cb as SAMPLING_ONBOARDING_SUCCESS_INTRO,ca as SAMPLING_ONBOARDING_SUCCESS_SUBTITLE,c9 as SAMPLING_ONBOARDING_SUCCESS_TITLE,cp as SAMPLING_ONBOARDING_WELCOME_BANNER,ci as SAMPLING_ONBOARDING_WELCOME_INTRO,cj as SAMPLING_ONBOARDING_WELCOME_STAGE_1_DESC,ck as SAMPLING_ONBOARDING_WELCOME_STAGE_1_TITLE,cl as SAMPLING_ONBOARDING_WELCOME_STAGE_2_DESC,cm as SAMPLING_ONBOARDING_WELCOME_STAGE_2_TITLE,cn as SAMPLING_ONBOARDING_WELCOME_STAGE_3_DESC,co as SAMPLING_ONBOARDING_WELCOME_STAGE_3_TITLE,ch as SAMPLING_ONBOARDING_WELCOME_SUBTITLE,cg as SAMPLING_ONBOARDING_WELCOME_TITLE,dM as SAMPLING_PAGE_DESCRIPTION,dN as SAMPLING_PAGE_TITLE,eK as SCOPE_AND_LABEL,eJ as SCOPE_GROUP_ANY_OF_HINT,eE as SCOPE_GROUP_LANGUAGES_TITLE,eD as SCOPE_GROUP_NAMESPACES_TITLE,eB as SCOPE_GROUP_SOURCES_TITLE,dZ as SECTION_DURATION,dX as SECTION_ERRORS,aD as SECTION_KEEP_PERCENTAGE,e2 as SECTION_OPERATION,ez as SECTION_SAMPLING_PREVIEW,eL as SECTION_SOURCE_SCOPE,df as STORAGE_KEYS,dE as TITLE_NO_RESULTS,dG as TITLE_NO_RULES,fR as TOKEN_ABOUT_TO_EXPIRE,ew as TOOLTIP_NOTE,eC as UNKNOWN_SOURCE_LABEL,bI as UNNAMED_RULE,dH as getNoResultsSubTitle}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as T,h as x,d as k,b as E,c as I,S as $,j as A,R as N,k as O,l as R,a as D,r as F,o as P,p as _,q as L,s as z,t as M,w as B,x as X,y as V,z as U,A as G,B as H}from"../chunks/helpers-
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as T,h as x,d as k,b as E,c as I,S as $,j as A,R as N,k as O,l as R,a as D,r as F,o as P,p as _,q as L,s as z,t as M,w as B,x as X,y as V,z as U,A as G,B as H}from"../chunks/helpers-CXxRJd5C.js";import{v as j,F as W,a4 as K,a5 as Y,a6 as J,a7 as q,a8 as Z,a9 as Q,aa as ee,ab as te,l as oe,ac as ne,f as ae,ad as ie,h as le,n as re,ae as se,af as ce,ag as de,ah as ue,ai as pe,aj as he,ak as ge,al as me,am as fe,an as be,m as ve,w as ye,N as Ce,ao as Se,ap as we,aq as Te,ar as xe,as as ke,q as Ee,S as Ie,H as $e,K as Ae,G as Ne,at as Oe,au as Re,av as De,O as Fe,aw as Pe,R as _e,U as Le,Q as ze,V as Me,ax as Be,ay as Xe,az as Ve,aA as Ue,D as Ge,z as He,aB as je,aC as We,aD as Ke,aE as Ye,aF as Je,aG as qe,aH as Ze,aI as Qe,aJ as et,aK as tt,aL as ot,A as nt,aM as at,C as it,aN as lt,aO as rt,aP as st,aQ as ct,aR as dt,aS as ut,s as pt,J as ht,M as gt,E as mt,aT as ft,c as bt,aU as vt,aV as yt,Z as Ct,aW as St,aX as wt,$ as Tt,a1 as xt,aY as kt,aZ as Et,a_ as It,a$ as $t,b0 as At,r as Nt,b1 as Ot,L as Rt,b2 as Dt,b3 as Ft,b4 as Pt,o as _t,y as Lt,b5 as zt,b6 as Mt,b7 as Bt,b8 as Xt,b9 as Vt,ba as Ut,bb as Gt,bc as Ht,bd as jt,be as Wt,bf as Kt,bg as Yt,bh as Jt,bi as qt,bj as Zt,bk as Qt,bl as eo,bm as to,i as oo,j as no,bn as ao,W as io,bo as lo,bp as ro,bq as so,br as co,bs as uo,bt as po,bu as ho,bv as go,bw as mo,bx as fo,by as bo,bz as vo,bA as yo,bB as Co,bC as So,bD as wo,bE as To,bF as xo,bG as ko,bH as Eo,bI as Io,bJ as $o,bK as Ao,bL as No,bM as Oo,bN as Ro,bO as Do,bP as Fo,bQ as Po,bR as _o,bS as Lo,bT as zo,bU as Mo,bV as Bo,bW as Xo,bX as Vo,bY as Uo,bZ as Go,b_ as Ho,b$ as jo,c0 as Wo,c1 as Ko,c2 as Yo,c3 as Jo,c4 as qo,c5 as Zo,c6 as Qo,c7 as en,c8 as tn,c9 as on,ca as nn,cb as an,cc as ln,cd as rn,ce as sn,cf as cn,cg as dn,ch as un,ci as pn,cj as hn,ck as gn,cl as mn,cm as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,cs as wn,ct as Tn,cu as xn,cv as kn,cw as En,cx as In,cy as $n,cz as An,cA as Nn,cB as On,cC as Rn,cD as Dn,cE as Fn,cF as Pn,cG as _n,cH as Ln,cI as zn,cJ as Mn,cK as Bn,cL as Xn,cM as Vn,cN as Un,cO as Gn,cP as Hn,cQ as jn,cR as Wn,cS as Kn,cT as Yn,cU as Jn,cV as qn,cW as Zn,cX as Qn,cY as ea,cZ as ta,c_ as oa,c$ as na,d0 as aa,d1 as ia,d2 as la,d3 as ra,d4 as sa,d5 as ca,d6 as da,d7 as ua,d8 as pa,d9 as ha,da as ga,db as ma,dc as fa,dd as ba,de as va,df as ya,dg as Ca,dh as Sa,di as wa,dj as Ta,g as xa,dk as ka,k as Ea,dl as Ia,dm as $a,dn as Aa,dp as Na,dq as Oa,dr as Ra,ds as Da,u as Fa,_ as Pa,dt as _a,du as La,dv as za,dw as Ma,dx as Ba,dy as Xa,dz as Va,dA as Ua,dB as Ga,dC as Ha,dD as ja,dE as Wa,dF as Ka,dG as Ya,dH as Ja,dI as qa,dJ as Za,dK as Qa,dL as ei,dM as ti,dN as oi,dO as ni,dP as ai,dQ as ii,dR as li,dS as ri}from"../chunks/ui-components-Dc15jc-B.js";import{TrashIcon as si,PlusIcon as ci,ArrowRightIcon as di,VSquareIcon as ui,XSquareIcon as pi,BookIcon as hi,DeleteIcon as gi,EditIcon as mi,GoLogo as fi,JavaLogo as bi,ChevronRightIcon as vi,ActionIcon as yi,DestinationIcon as Ci,ChevronUpIcon as Si,ChevronDownIcon as wi,VIcon as Ti,XIcon as xi,InstrumentationRuleIcon as ki,SourceIcon as Ei,NamespacesIcon as Ii,SettingsIcon as $i,PodIcon as Ai,OdigosLogo as Ni,K8sLogo as Oi,RefreshIcon as Ri,ExclamationCircleIcon as Di,QuestionCircleIcon as Fi,InboundIcon as Pi,OutboundIcon as _i,UserIcon as Li,TerminalIcon as zi,SearchIcon as Mi,MinusIcon as Bi,ExpandIcon as Xi,CopyIcon as Vi,DotIcon as Ui,DownloadIcon as Gi,RefreshLeftArrowIcon as Hi,VmLogo as ji,SamplingIcon as Wi,ExclamationTriangleIcon as Ki,KeyIcon as Yi,DiagnoseIcon as Ji,StarIcon as qi,ArrowIcon as Zi,ConnectionsIcon as Qi,FilterIcon as el,DataStreamIcon as tl,PipelineCollectorIcon as ol,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as al,GatewayIcon as il,YamlIcon as ll}from"../icons.js";import{d as rl,c as sl,b as cl}from"../chunks/use-odigos-api-qSWLSy9S.js";import{S as dl,D as ul,I as pl,a as hl,A as gl,P as ml,b as fl,c as bl,R as vl,O as yl,d as Cl,e as Sl,f as wl,W as Tl,g as xl,C as kl,Y as El,h as Il,i as $l,U as Al}from"../chunks/index-BgflYoEI.js";import{O as Nl}from"../chunks/connections-scope-Cb3gZ8MW.js";import{u as Ol,f as Rl,g as Dl,e as Fl,i as Pl,h as _l,S as Ll,k as zl,E as Ml,l as Bl,m as Xl,j as Vl,b as Ul,d as Gl,a as Hl,A as jl,R as Wl,c as Kl,D as Yl}from"../chunks/source-instrument-form-context-Rk2YlyRb.js";import{createPortal as Jl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ql=[{id:"CREDIT_CARD",label:"Credit card"}],Zl=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],Ql=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],er=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ql}],tr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ql}],or=/^[a-zA-Z]$/,nr=new Set(["*","+","?"]),ar=new Set(["^","$"]),ir={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},lr=m.div`
|
|
2
2
|
padding: 8px 16px;
|
|
3
3
|
border-radius: 6px;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
@@ -168,7 +168,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
168
168
|
justify-content: space-between;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
171
|
-
`,us=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(cs,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ds,{$isOpen:s,children:[e(re,{$gap:10,children:[t(ae,{size:le.XS,children:o}),n&&t(De,{text:n,withIcon:!0}),t(Be,{label:a.length,status:l?Ie.Default:void 0})]}),t(rt,{icon:s?Si:wi,size:st.M,onClick:()=>c(e=>!e)})]}),s?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},ps=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Ne(e.supportedSignals).includes(o.signalType))):e,hs=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ls,{icon:ut(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Be,{status:n.succeeded?Ie.Success:Ie.Error,leftIcon:n.succeeded?Ti:xi})}),gs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Rl();return o?.length?t(us,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map((o,n)=>t(hs,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(us,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(hs,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ms;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ms||(ms={}));const fs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ms.SELF_HOSTED?n.push(...e.items):e.name===ms.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=pt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=ht(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[it.DETECTED]:o,[it.SELF_HOSTED]:n,[it.MANAGED]:a}},bs=["destinations","destinationCategories","potentialDestinations"],vs=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=rl({subscribe:bs}),[g,m]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v,categoriesResult:y,categoriesLoading:C,potentialResult:S,potentialLoading:w}=h,{activeForm:T,genericForm:x,unsavedDestinations:k,setUnsavedDestinations:E}=Rl();n(()=>{d&&E(d)},[d]);const I=C||w,$=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=r({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of $){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=ht(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,$]),n(()=>{(y||S)&&N(e=>({...e,...fs(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of k){const o=Oe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Rl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(gs,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=ps(o[e],n,i);l.length&&a.push(t(gs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:g,filters:f}),D=(()=>{const{activeForm:e}=Rl();return{width:"60%",list:e?[t(Lr,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:Ci,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Tl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:O,disableSave:!T&&!k.length,isFetching:I,isFormDirty:k.length>0||x?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_DESTINATION,subTitle:Ge.CREATING_DESTINATION_SUBTITLE},header:{icon:Ci,title:Ge.ADD_DESTINATIONS,subTitle:Ge.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:g,onChange:m},filters:t(ss,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},ys=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:s}=rl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Dl(),f=a(()=>c?gt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):gt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ls,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Hr,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Tl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await s.create(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_INSTRUMENTATION_RULE,subTitle:Ge.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ki,title:Ge.ADD_INSTRUMENTATION_RULE,subTitle:Ge.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Cs={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ge.FETCHING_NAMESPACES,subTitle:Ge.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Ge.SELECT_NAMESPACE,subTitle:Ge.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ss={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===mt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},ws=e=>e?Ss:Cs,Ts="No matches",xs="No sources",ks=e=>`No sources matched the filter '${e}'`,Es=e=>(e?"Unselect":"Select")+" all",Is="Show only:",$s="Selected",As="Auto",Ns="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Os="Enterprise only",Rs=m.div``,Ds=m.div`
|
|
171
|
+
`,us=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(cs,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ds,{$isOpen:s,children:[e(re,{$gap:10,children:[t(ae,{size:le.XS,children:o}),n&&t(De,{text:n,withIcon:!0}),t(Be,{label:a.length,status:l?Ie.Default:void 0})]}),t(rt,{icon:s?Si:wi,size:st.M,onClick:()=>c(e=>!e)})]}),s?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},ps=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Ne(e.supportedSignals).includes(o.signalType))):e,hs=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ls,{icon:ut(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Be,{status:n.succeeded?Ie.Success:Ie.Error,leftIcon:n.succeeded?Ti:xi})}),gs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Rl();return o?.length?t(us,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map((o,n)=>t(hs,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(us,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(hs,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ms;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ms||(ms={}));const fs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ms.SELF_HOSTED?n.push(...e.items):e.name===ms.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=pt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=ht(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[it.DETECTED]:o,[it.SELF_HOSTED]:n,[it.MANAGED]:a}},bs=["destinations","destinationCategories","potentialDestinations"],vs=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=rl({subscribe:bs}),[g,m]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v,categoriesResult:y,categoriesLoading:C,potentialResult:S,potentialLoading:w}=h,{activeForm:T,genericForm:x,unsavedDestinations:k,setUnsavedDestinations:E}=Rl();n(()=>{d&&E(d)},[d]);const I=C||w,$=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=r({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of $){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=ht(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,$]),n(()=>{(y||S)&&N(e=>({...e,...fs(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of k){const o=Oe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Rl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(gs,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=ps(o[e],n,i);l.length&&a.push(t(gs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:g,filters:f}),D=(()=>{const{activeForm:e}=Rl();return{width:"60%",list:e?[t(Lr,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:Ci,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Tl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:O,disableSave:!T&&!k.length,isFetching:I,isFormDirty:k.length>0||x?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_DESTINATION,subTitle:Ge.CREATING_DESTINATION_SUBTITLE},header:{icon:Ci,title:Ge.ADD_DESTINATIONS,subTitle:Ge.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:g,onChange:m},filters:t(ss,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},ys=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:s}=rl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Dl(),f=a(()=>c?gt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):gt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ls,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Hr,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Tl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_INSTRUMENTATION_RULE,subTitle:Ge.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ki,title:Ge.ADD_INSTRUMENTATION_RULE,subTitle:Ge.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Cs={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ge.FETCHING_NAMESPACES,subTitle:Ge.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Ge.SELECT_NAMESPACE,subTitle:Ge.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ss={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===mt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},ws=e=>e?Ss:Cs,Ts="No matches",xs="No sources",ks=e=>`No sources matched the filter '${e}'`,Es=e=>(e?"Unselect":"Select")+" all",Is="Show only:",$s="Selected",As="Auto",Ns="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Os="Enterprise only",Rs=m.div``,Ds=m.div`
|
|
172
172
|
visibility: hidden;
|
|
173
173
|
|
|
174
174
|
transition: visibility 0s;
|
|
@@ -188,7 +188,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
188
188
|
${Ps}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,Ls=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ps,{children:t(ls,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(re,{$gap:12,children:[!d&&t(_s,{$visible:r||i,children:t(De,{text:Ns,children:t(Q,{label:As,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(re,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:$s}),t(Be,{label:`${l.sourced}/${l.total}`,status:r?Ie.Default:ft.Unknown,minWidth:"42px"})]})]})})})},zs=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ls,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(us,{title:n,list:c,noBgColor:!0}):c},Ms=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,capabilities:g}=rl(),m=ws(p),{selectedStreamName:f}=He(),{progress:b,resetProgress:v}=Ct(),{isFetching:C,setIsFetching:S,setSnapshots:w,formData:T,handleSourceChange:x,handleSelectAll:k,formDiff:E,isFormDirty:I}=Vl(),$=g.canFetchSnapshots,{data:A,loading:N}=sl("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{skip:!$}),{data:O,loading:R}=sl("GET_NAMESPACES_WITH_WORKLOADS",void 0,{skip:$}),D=a(()=>{if($)return A??null;const e=O?.namespaces;return e?.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(f),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(f)??!1)}))||[]}))}]}:null},[$,A,O,f]);n(()=>{S(N||R),D&&w(D)},[D,N,R,S,w]);const[F,P]=r(""),[_,L]=r(mt.Namespace),[z,M]=r({showOnlySelected:!1}),[B,X]=r({clusterId:"",clusterName:"",namespaceName:""}),V=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ws(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Bl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Xl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(zs,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Es(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ii,title:Ts,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ii,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:C,formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:B,setSelectedArea:X,searchText:_===mt.Namespace?F:"",searchBy:_,filters:z}),U=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ws(u),h=d===bt.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>zl(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Ml.has(l);return t(Fs,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Os},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:le.XS,children:Es(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?r?{icon:Ei,title:Ts,subTitle:ks(r)}:{icon:Ei,title:xs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ei,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:{value:B},searchText:_===mt.Source?F:"",searchBy:_,filters:z});return t(Tl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{v(Tt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>h.persistV2(E),header:{icon:Ei,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:F,onChange:e=>{P(e),_===mt.Namespace&&X({clusterId:"",clusterName:"",namespaceName:""})},placeholder:m.searchPlaceholder(_),segment:{options:[{label:m.groupSegmentLabel,value:mt.Namespace},{label:m.itemSegmentLabel,value:mt.Source}],selected:_,setSelected:L}},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:Is}),t(Q,{name:"filter-selected",size:vt.S,label:$s,value:z.showOnlySelected,onChange:e=>M(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:C,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:b[Tt.BulkInstrumenting]?.percentage||0},leftColumn:V,rightColumn:U})},Bs=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Ge.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Xs=["actions"],Vs=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=rl({subscribe:Xs}),{items:u}=d,{selectedOption:p,loadAction:h,validateFormData:g,genericForm:m}=Ol(),[b,v]=r(!1),[y,C]=r(!1),[S,w]=r(null),T=b&&!!m?.isFormDirty,x=a(()=>u?.find(e=>xt(e)===s),[s,u]),k=a(()=>nt.find(({type:e})=>e===x?.type)??null,[x?.type]);n(()=>{x&&h(x)},[x]);const E=l(()=>{x&&v(!0)},[x]),I=l(()=>{x&&(h(x),v(!1))},[x,h]),$=l(()=>{T?w("close"):i()},[T,i]),A=l(()=>{T?w("cancel"):I()},[T,I]),N=l(()=>{const e=S;w(null),"close"===e?(I(),i()):I()},[S,I,i]),O=l(async()=>{if(x){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(x.id,t),v(!1))}},[x,g,d]),R=l(()=>{x&&C(!0)},[x]),D=l(async()=>{x&&(await d.remove(x.id,x.type),i())},[x,d,i]);if(!x||!k)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ie.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ye.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(x);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(x.type),title:k.label,onClose:$,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:b,onClick:E},{id:"edit-action-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:y,onClick:R}]},footer:{actions:b?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:O}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:b&&p?t(Fr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:x.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Bs(x,k)})]}),!!F?.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(xl,{target:"action",isOpen:y,onClose:()=>C(!1),onApprove:D}),t(kl,{isOpen:null!==S,onClose:()=>w(null),onApprove:N})]})},Us=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=rl(),[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&o}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=sl("GET_EFFECTIVE_CONFIG",b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:T,resetFormData:x}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(x);k.current=x,n(()=>{C&&k.current(C)},[C]);const E=a(()=>s.length>1||void 0!==C&&!T(C,S),[s.length,C,S]);return t(Tl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${s.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ls,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Gs=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Ge.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Hs=["destinations","destinationCategories"],js=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=rl({subscribe:Hs}),{items:h,categoriesResult:g,categoriesLoading:m}=p,{selectedStreamName:b}=He(),{activeForm:v,loadDestination:C,validateFormData:S,genericForm:w}=Rl(),T=i(null),[x,k]=r(!1),[E,I]=r(!1),[$,A]=r(null),N=x&&!!w?.isFormDirty,O=a(()=>Dt(h,b),[h,b]),R=a(()=>O?.find(e=>xt(e)===c),[c,O]),D=g?.destinationCategories?.categories??null;n(()=>{R&&D&&C(R,D)},[R,D]);const F=a(()=>R&&D?Ft(D,R):[],[R,D]),P=l(()=>{R&&k(!0)},[R]),_=l(()=>{R&&D&&(C(R,D),k(!1))},[R,D,C]),L=l(()=>{N?A("close"):s()},[N,s]),z=l(()=>{N?A("cancel"):_()},[N,_]),M=l(()=>{const e=$;A(null),"close"===e?(_(),s()):_()},[$,_,s]),B=l(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=S();e||(await p.update(R.id,Oe(t)),k(!1))}},[R,S,p]),X=l(()=>{R&&I(!0)},[R]),V=l(async()=>{R&&(await p.remove(R.id),s())},[R,p,s]);if(!R)return null;const{icon:U,iconSrc:G}=ut(R.destinationType.type),H=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&ke(h,i,a))return;const{type:m}=ht(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Rt.MultiInput){const t=ht(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Rt.KeyValuePair){const t=ht(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(R,F);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:U,iconSrc:G,title:R.name||R.destinationType.displayName,onClose:L,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:x,onClick:P},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:E,onClick:X}]},footer:{actions:x?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...v?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:m?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):x&&v?t(Lr,{ref:T,isEdit:!0}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[!u&&t($t,{conditions:R.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Gs(R)})]}),!!H.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(It,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(It,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(xl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:V}),t(kl,{isOpen:null!==$,onClose:()=>A(null),onApprove:M})]})},Ws=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Ks=["rules"],Ys=({onClose:i,ruleId:s})=>{const c=f(),{instrumentationRulesApi:d}=rl({subscribe:Ks}),{items:u}=d,{addNotification:p}=_t(),{selectedOption:h,loadRule:g,validateFormData:m,genericForm:b}=Dl(),[v,y]=r(!1),[C,S]=r(!1),[w,T]=r(null),x=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>xt(e)===s),[s,u]),E=a(()=>gt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const I=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});y(!0)}},[k,p]),$=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{x?T("close"):i()},[x,i]),N=l(()=>{x?T("cancel"):$()},[x,$]),O=l(()=>{const e=w;T(null),"close"===e?($(),i()):$()},[w,$,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.ruleId,t),y(!1))}},[k,m,d]),D=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});S(!0)}},[k,p]),F=l(async()=>{k&&(await d.remove(k.ruleId),i())},[k,d,i]);if(!k||!E)return null;const P=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.headersCollection?.[Fe.HeaderKeys]?.length&&e.headersCollection[Fe.HeaderKeys].forEach(e=>{e&&n.push(t(ae,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new Le(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(k,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt(k.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:I},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:v&&h?t(Hr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:k.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Ws(k,E)})]}),t(hl,{readOnly:!0,scopes:k.sourceScopes??null}),!!P.length&&t(It,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:P})}),!!E.supportedLanguages.length&&t(It,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:t(re,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(xl,{target:"instrumentation rule",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(kl,{isOpen:null!==w,onClose:()=>T(null),onApprove:O})]})};var Js;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Js||(Js={}));const qs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:r,withCopy:!0},{id:"age",title:Ge.AGE,label:s?h(s,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(It,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Zs=m.div`
|
|
191
|
+
`,Ls=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ps,{children:t(ls,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(re,{$gap:12,children:[!d&&t(_s,{$visible:r||i,children:t(De,{text:Ns,children:t(Q,{label:As,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(re,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:$s}),t(Be,{label:`${l.sourced}/${l.total}`,status:r?Ie.Default:ft.Unknown,minWidth:"42px"})]})]})})})},zs=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ls,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(us,{title:n,list:c,noBgColor:!0}):c},Ms=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,capabilities:g}=rl(),m=ws(p),{selectedStreamName:f}=He(),{progress:b,resetProgress:v}=Ct(),{isFetching:C,setIsFetching:S,setSnapshots:w,formData:T,handleSourceChange:x,handleSelectAll:k,formDiff:E,isFormDirty:I}=Vl(),$=g.canFetchSnapshots,{data:A,loading:N}=sl("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{skip:!$}),{data:O,loading:R}=sl("GET_NAMESPACES_WITH_WORKLOADS",void 0,{skip:$}),D=a(()=>{if($)return A??null;const e=O?.namespaces;return e?.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(f),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(f)??!1)}))||[]}))}]}:null},[$,A,O,f]);n(()=>{S(N||R),D&&w(D)},[D,N,R,S,w]);const[F,P]=r(""),[_,L]=r(mt.Namespace),[z,M]=r({showOnlySelected:!1}),[B,X]=r({clusterId:"",clusterName:"",namespaceName:""}),V=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ws(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Bl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Xl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(zs,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Es(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ii,title:Ts,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ii,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:C,formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:B,setSelectedArea:X,searchText:_===mt.Namespace?F:"",searchBy:_,filters:z}),U=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ws(u),h=d===bt.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>zl(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Ml.has(l);return t(Fs,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Os},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:le.XS,children:Es(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?r?{icon:Ei,title:Ts,subTitle:ks(r)}:{icon:Ei,title:xs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ei,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:{value:B},searchText:_===mt.Source?F:"",searchBy:_,filters:z});return t(Tl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{v(Tt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>h.persistV2(E),header:{icon:Ei,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:F,onChange:e=>{P(e),_===mt.Namespace&&X({clusterId:"",clusterName:"",namespaceName:""})},placeholder:m.searchPlaceholder(_),segment:{options:[{label:m.groupSegmentLabel,value:mt.Namespace},{label:m.itemSegmentLabel,value:mt.Source}],selected:_,setSelected:L}},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:Is}),t(Q,{name:"filter-selected",size:vt.S,label:$s,value:z.showOnlySelected,onChange:e=>M(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:C,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:b[Tt.BulkInstrumenting]?.percentage||0},leftColumn:V,rightColumn:U})},Bs=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Ge.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Xs=["actions"],Vs=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=rl({subscribe:Xs}),{items:u}=d,{selectedOption:p,loadAction:h,validateFormData:g,genericForm:m}=Ol(),[b,v]=r(!1),[y,C]=r(!1),[S,w]=r(null),T=b&&!!m?.isFormDirty,x=a(()=>u?.find(e=>xt(e)===s),[s,u]),k=a(()=>nt.find(({type:e})=>e===x?.type)??null,[x?.type]);n(()=>{x&&h(x)},[x]);const E=l(()=>{x&&v(!0)},[x]),I=l(()=>{x&&(h(x),v(!1))},[x,h]),$=l(()=>{T?w("close"):i()},[T,i]),A=l(()=>{T?w("cancel"):I()},[T,I]),N=l(()=>{const e=S;w(null),"close"===e?(I(),i()):I()},[S,I,i]),O=l(async()=>{if(x){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(x.id,t),v(!1))}},[x,g,d]),R=l(()=>{x&&C(!0)},[x]),D=l(async()=>{x&&(await d.remove(x.id,x.type),i())},[x,d,i]);if(!x||!k)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ie.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ye.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(x);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(x.type),title:k.label,onClose:$,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:b,onClick:E},{id:"edit-action-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:y,onClick:R}]},footer:{actions:b?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:O}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:b&&p?t(Fr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:x.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Bs(x,k)})]}),!!F?.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(xl,{target:"action",isOpen:y,onClose:()=>C(!1),onApprove:D}),t(kl,{isOpen:null!==S,onClose:()=>w(null),onApprove:N})]})},Us=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=rl(),[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&o}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=sl("GET_EFFECTIVE_CONFIG",b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:T,resetFormData:x}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(x);k.current=x,n(()=>{C&&k.current(C)},[C]);const E=a(()=>s.length>1||void 0!==C&&!T(C,S),[s.length,C,S]);return t(Tl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${s.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ls,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Gs=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Ge.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Hs=["destinations","destinationCategories"],js=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=rl({subscribe:Hs}),{items:h,categoriesResult:g,categoriesLoading:m}=p,{selectedStreamName:b}=He(),{activeForm:v,loadDestination:C,validateFormData:S,genericForm:w}=Rl(),T=i(null),[x,k]=r(!1),[E,I]=r(!1),[$,A]=r(null),N=x&&!!w?.isFormDirty,O=a(()=>Dt(h,b),[h,b]),R=a(()=>O?.find(e=>xt(e)===c),[c,O]),D=g?.destinationCategories?.categories??null;n(()=>{R&&D&&C(R,D)},[R,D]);const F=a(()=>R&&D?Ft(D,R):[],[R,D]),P=l(()=>{R&&k(!0)},[R]),_=l(()=>{R&&D&&(C(R,D),k(!1))},[R,D,C]),L=l(()=>{N?A("close"):s()},[N,s]),z=l(()=>{N?A("cancel"):_()},[N,_]),M=l(()=>{const e=$;A(null),"close"===e?(_(),s()):_()},[$,_,s]),B=l(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=S();e||(await p.update(R.id,Oe(t)),k(!1))}},[R,S,p]),X=l(()=>{R&&I(!0)},[R]),V=l(async()=>{R&&(await p.remove(R.id),s())},[R,p,s]);if(!R)return null;const{icon:U,iconSrc:G}=ut(R.destinationType.type),H=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&ke(h,i,a))return;const{type:m}=ht(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Rt.MultiInput){const t=ht(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Rt.KeyValuePair){const t=ht(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(R,F);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:U,iconSrc:G,title:R.name||R.destinationType.displayName,onClose:L,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:x,onClick:P},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:E,onClick:X}]},footer:{actions:x?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...v?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:m?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):x&&v?t(Lr,{ref:T,isEdit:!0}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[!u&&t($t,{conditions:R.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Gs(R)})]}),!!H.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(It,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(It,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(xl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:V}),t(kl,{isOpen:null!==$,onClose:()=>A(null),onApprove:M})]})},Ws=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Ks=["rules"],Ys=({onClose:i,ruleId:s})=>{const c=f(),{instrumentationRulesApi:d}=rl({subscribe:Ks}),{items:u}=d,{addNotification:p}=_t(),{selectedOption:h,loadRule:g,validateFormData:m,genericForm:b}=Dl(),[v,y]=r(!1),[C,S]=r(!1),[w,T]=r(null),x=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>xt(e)===s),[s,u]),E=a(()=>gt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const I=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});y(!0)}},[k,p]),$=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{x?T("close"):i()},[x,i]),N=l(()=>{x?T("cancel"):$()},[x,$]),O=l(()=>{const e=w;T(null),"close"===e?($(),i()):$()},[w,$,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.ruleId,t,k.type),y(!1))}},[k,m,d]),D=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});S(!0)}},[k,p]),F=l(async()=>{k&&(await d.remove(k.ruleId,k.type),i())},[k,d,i]);if(!k||!E)return null;const P=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.headersCollection?.[Fe.HeaderKeys]?.length&&e.headersCollection[Fe.HeaderKeys].forEach(e=>{e&&n.push(t(ae,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new Le(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(k,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt(k.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:I},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:v&&h?t(Hr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:k.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Ws(k,E)})]}),t(hl,{readOnly:!0,scopes:k.sourceScopes??null}),!!P.length&&t(It,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:P})}),!!E.supportedLanguages.length&&t(It,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:t(re,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(xl,{target:"instrumentation rule",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(kl,{isOpen:null!==w,onClose:()=>T(null),onApprove:O})]})};var Js;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Js||(Js={}));const qs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:r,withCopy:!0},{id:"age",title:Ge.AGE,label:s?h(s,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(It,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Zs=m.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
align-items: center;
|
|
194
194
|
justify-content: space-between;
|
|
@@ -362,7 +362,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
362
362
|
opacity: 1;
|
|
363
363
|
pointer-events: auto;
|
|
364
364
|
}
|
|
365
|
-
`,$d=({name:o,summary:n,onJumpToRule:a})=>e(xd,{children:[e(kd,{children:[o&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:o}),t(Ed,{children:t(S,{parts:n})})]}),a&&t(Id,{children:t(De,{text:Ge.OPEN_IN_SAMPLING_PAGE,children:t(se,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:Xi,onClick:a})})})]}),Ad=({source:e,onRedirectToSampling:o})=>t(It,{bgTint:"1000",richTitle:{title:Ge.SAMPLING},children:e.containers?.map(e=>t(Rd,{container:e,onRedirectToSampling:o},e.containerName))});var Nd;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Nd||(Nd={}));const Od=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?T(e.rule):"costReduction"===e.type?x(e.rule):[],Rd=({container:o,onRedirectToSampling:n})=>{const[i,l]=r(Nd.All),s=eo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Nd.Noisy?d:i===Nd.HighlyRelevant?u:i===Nd.CostReduction?p:[...d,...u,...p],[i,u,p]),g=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]);return e(It,{bgTint:"900",richTitle:{title:o.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e(It,{bgTint:"800",richTitle:{title:Ge.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:Ge.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t($d,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e(It,{bgTint:"800",richTitle:{title:Ge.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(m=d.length,f=u.length,b=p.length,[{value:Nd.All,label:"All",badge:{label:m+f+b,textSize:le.XXXS}},{value:Nd.Noisy,label:Ge.NOISY_OPERATIONS,badge:{label:m,textSize:le.XXXS}},{value:Nd.HighlyRelevant,label:Ge.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Nd.CostReduction,label:Ge.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t($d,{name:e.rule.name,summary:Od(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===Nd.All?`${Nd.Noisy}, ${Nd.HighlyRelevant} and ${Nd.CostReduction}`:i} operations`})})]})]});var m,f,b},Dd=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Fd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Fd||(Fd={}));const Pd=e=>!!e&&Ht(e.status)===Ie.Error,_d=e=>Pd(e.healthStatus),Ld=e=>Pd(e.odigosHealthStatus)||(e.processes??[]).some(_d),zd=e=>Pd(e.agentInjectedStatus)||Pd(e.odigosHealthStatus)||(e.containers??[]).some(Ld),Md=({onClose:o,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p}=rl(),{selectedStreamName:h}=He(),{genericForm:g,loadSource:m,validateFormData:b}=Pl(),{data:v}=sl("GET_EFFECTIVE_CONFIG"),[C,S]=r(!1),[w,T]=r(!1),[x,k]=r(!1),[E,I]=r(Js.Overview),[$,A]=r(null),[N,O]=r({openFor:null}),R=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Js.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Js.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=oc({identifyingAttributes:n.identifyingAttributes});t({tab:Js.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{R.jumpToTarget&&I(R.jumpToTarget.tab)},[R.jumpToTarget]),n(()=>{$&&JSON.stringify(to(s))!==JSON.stringify(to($))&&A(null)},[s,$]);const D=i(!1),F=l(async()=>A(await p.fetchById(s)||null),[s,p]);n(()=>{if(D.current||(F(),D.current=!0),!C){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,C]),n(()=>{$&&m($)},[$]);const P=$&&Dd.includes($.id.kind),_=a(()=>{const e=[],o=($?.pods??[]).some(zd);return e.push({value:Js.Overview,label:Ge.OVERVIEW}),u||(e.push({value:Js.Pods,label:Ge.PODS,icon:o?e=>t(Di,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Js.PeerSources,label:Ge.PEER_SOURCES}),v?.profiling?.enabled&&e.push({value:Js.Profiling,label:Ge.PROFILING}),e.push({value:Js.Sampling,label:Ge.SAMPLING}),e.push({value:Js.Debug,label:Ge.DEBUG})),e},[u,v,$?.pods]),L=l(()=>S(!0),[]),z=a(()=>()=>{o(),c()},[o,c]),M=l(()=>{$&&m($),S(!1)},[$]),B=l(async()=>{if(!$||!g)return;const{errorMessage:e,preparedFormData:t}=b();if(e)return;const o=t.otelServiceName!==$.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:o}),S(!1)},[$,g,b,s,p]),X=l(()=>T(!0),[]),V=l(async()=>{$&&(await p.persistV2({[wt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,selected:!1,currentStreamName:h}]}),T(!1),o())},[$,p,h,o]),U=l(()=>{O({openFor:Fd.Workload})},[]),G=l(e=>{I(e),R.clearJumpToTarget()},[R]),H=l(async()=>{await p.recoverFromRollback(s)},[p,s]),j=l(async()=>{N.openFor===Fd.Workload?await p.restartWorkloads([s]):N.openFor===Fd.Pod&&N.podNamespace&&N.podName&&await p.restartPod(N.podNamespace,N.podName),O({openFor:null})},[N,p,s]),K=a(()=>{const e=[];return C||E===Js.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:mi,active:C,onClick:L}),!u&&P&&e.push({id:"edit-source-btn-restart",label:kt.RESTART,icon:Hi,onClick:U}),e.push({id:"edit-source-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:w,onClick:X})),e},[E,C,w,u,P,L,U,X,d]),Y=a(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:$.id.name,leftIcon:u?void 0:Oi}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:Ni,textColor:d.v2.colors.silver[200]}),e},[$,d,u]);if(!$)return t(oe,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const J=E===Js.Profiling?x?"95vw":"80vw":C?void 0:"60vw";return e(uc,{value:R,children:[t(oe,{isOpen:!0,width:J,header:{icon:u?ji:Co($.containers)[0],titleBadges:Y,onClose:()=>{G(Js.Overview),A(null),k(!1),o()},actions:K},footer:{actions:C?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:M},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!C&&_.length>1&&t(ue,{options:_,selected:E,setSelected:G}),(()=>{switch(E){case Js.Overview:return C?t(Kr,{}):t(Kc,{source:$,onClickRollout:U,onClickRollback:H});case Js.Pods:return t(fc,{source:$,onClickRestartPod:P?(e,t)=>O({openFor:Fd.Pod,podNamespace:e,podName:t}):void 0});case Js.PeerSources:return t(vc,{source:$});case Js.Profiling:return t(Td,{source:$,onFlameFullscreenChange:k});case Js.Sampling:return t(Ad,{source:$,onRedirectToSampling:z});case Js.Debug:return t(Tc,{source:$});default:return null}})()]})})}),t(xl,{target:"source",action:"uninstrument",isOpen:w,onClose:()=>T(!1),onApprove:V}),t(xl,{target:`${N.openFor?.toLowerCase()??""}`,action:"restart",description:Ge.RESTART_POD_DESCRIPTION,isOpen:!!N.openFor,onClose:()=>O({openFor:null}),onApprove:j,overrideApproveButtonLabel:Ge.DELETE_POD_TO_RESTART})]})},Bd=m.div`
|
|
365
|
+
`,$d=({name:o,summary:n,onJumpToRule:a})=>e(xd,{children:[e(kd,{children:[o&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:o}),t(Ed,{children:t(S,{parts:n})})]}),a&&t(Id,{children:t(De,{text:Ge.OPEN_IN_SAMPLING_PAGE,children:t(se,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:Xi,onClick:a})})})]}),Ad=({source:e,onRedirectToSampling:o})=>t(It,{bgTint:"1000",richTitle:{title:Ge.SAMPLING},children:e.containers?.map(e=>t(Rd,{container:e,onRedirectToSampling:o},e.containerName))});var Nd;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Nd||(Nd={}));const Od=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?T(e.rule):"costReduction"===e.type?x(e.rule):[],Rd=({container:o,onRedirectToSampling:n})=>{const[i,l]=r(Nd.All),s=eo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Nd.Noisy?d:i===Nd.HighlyRelevant?u:i===Nd.CostReduction?p:[...d,...u,...p],[i,u,p]),g=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]);return e(It,{bgTint:"900",richTitle:{title:o.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e(It,{bgTint:"800",richTitle:{title:Ge.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:Ge.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t($d,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e(It,{bgTint:"800",richTitle:{title:Ge.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(m=d.length,f=u.length,b=p.length,[{value:Nd.All,label:"All",badge:{label:m+f+b,textSize:le.XXXS}},{value:Nd.Noisy,label:Ge.NOISY_OPERATIONS,badge:{label:m,textSize:le.XXXS}},{value:Nd.HighlyRelevant,label:Ge.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Nd.CostReduction,label:Ge.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t($d,{name:e.rule.name,summary:Od(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===Nd.All?`${Nd.Noisy}, ${Nd.HighlyRelevant} and ${Nd.CostReduction}`:i} operations`})})]})]});var m,f,b},Dd=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Fd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Fd||(Fd={}));const Pd=e=>!!e&&Ht(e.status)===Ie.Error,_d=e=>Pd(e.healthStatus),Ld=e=>Pd(e.odigosHealthStatus)||(e.processes??[]).some(_d),zd=e=>Pd(e.agentInjectedStatus)||Pd(e.odigosHealthStatus)||(e.containers??[]).some(Ld),Md=({onClose:o,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p}=rl(),{selectedStreamName:h}=He(),{genericForm:g,loadSource:m,validateFormData:b}=Pl(),{data:v}=sl("GET_EFFECTIVE_CONFIG"),[C,S]=r(!1),[w,T]=r(!1),[x,k]=r(!1),[E,I]=r(Js.Overview),[$,A]=r(null),[N,O]=r({openFor:null}),R=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Js.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Js.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=oc({identifyingAttributes:n.identifyingAttributes});t({tab:Js.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{R.jumpToTarget&&I(R.jumpToTarget.tab)},[R.jumpToTarget]),n(()=>{$&&JSON.stringify(to(s))!==JSON.stringify(to($))&&A(null)},[s,$]);const D=i(!1),F=l(async()=>A(await p.fetchById(s)||null),[s,p]);n(()=>{if(D.current||(F(),D.current=!0),!C){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,C]),n(()=>{$&&m($)},[$]);const P=$&&Dd.includes($.id.kind),_=a(()=>{const e=[],o=($?.pods??[]).some(zd);return e.push({value:Js.Overview,label:Ge.OVERVIEW}),u||(e.push({value:Js.Pods,label:Ge.PODS,icon:o?e=>t(Di,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Js.PeerSources,label:Ge.PEER_SOURCES}),v?.profiling?.enabled&&e.push({value:Js.Profiling,label:Ge.PROFILING}),e.push({value:Js.Sampling,label:Ge.SAMPLING}),e.push({value:Js.Debug,label:Ge.DEBUG})),e},[u,v,$?.pods]),L=l(()=>S(!0),[]),z=a(()=>()=>{o(),c()},[o,c]),M=l(()=>{$&&m($),S(!1)},[$]),B=l(async()=>{if(!$||!g)return;const{errorMessage:e,preparedFormData:t}=b();if(e)return;const o=t.otelServiceName!==$.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:o}),S(!1)},[$,g,b,s,p]),X=l(()=>T(!0),[]),V=l(async()=>{$&&(await p.persistV2({[wt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,selected:!1,currentStreamName:h}]}),T(!1),o())},[$,p,h,o]),U=l(()=>{O({openFor:Fd.Workload})},[]),G=l(e=>{I(e),R.clearJumpToTarget()},[R]),H=l(async()=>{await p.recoverFromRollback(s)},[p,s]),j=l(async()=>{N.openFor===Fd.Workload?await p.restartWorkloads([s]):N.openFor===Fd.Pod&&N.podNamespace&&N.podName&&await p.restartPod(N.podNamespace,N.podName),O({openFor:null})},[N,p,s]),K=a(()=>{const e=[];return C||E===Js.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:mi,active:C,onClick:L}),!u&&P&&e.push({id:"edit-source-btn-restart",label:kt.RESTART,icon:Hi,onClick:U}),e.push({id:"edit-source-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:w,onClick:X})),e},[E,C,w,u,P,L,U,X,d]),Y=a(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:$.id.name,leftIcon:u?void 0:Oi}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:Ni,textColor:d.v2.colors.silver[200]}),e},[$,d,u]);if(!$)return t(oe,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const J=E===Js.Profiling?x?"95vw":"80vw":C?void 0:"60vw";return e(uc,{value:R,children:[t(oe,{isOpen:!0,width:J,minWidth:"777px",header:{icon:u?ji:Co($.containers)[0],titleBadges:Y,onClose:()=>{G(Js.Overview),A(null),k(!1),o()},actions:K},footer:{actions:C?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:M},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!C&&_.length>1&&t(ue,{options:_,selected:E,setSelected:G}),(()=>{switch(E){case Js.Overview:return C?t(Kr,{}):t(Kc,{source:$,onClickRollout:U,onClickRollback:H});case Js.Pods:return t(fc,{source:$,onClickRestartPod:P?(e,t)=>O({openFor:Fd.Pod,podNamespace:e,podName:t}):void 0});case Js.PeerSources:return t(vc,{source:$});case Js.Profiling:return t(Td,{source:$,onFlameFullscreenChange:k});case Js.Sampling:return t(Ad,{source:$,onRedirectToSampling:z});case Js.Debug:return t(Tc,{source:$});default:return null}})()]})})}),t(xl,{target:"source",action:"uninstrument",isOpen:w,onClose:()=>T(!1),onApprove:V}),t(xl,{target:`${N.openFor?.toLowerCase()??""}`,action:"restart",description:Ge.RESTART_POD_DESCRIPTION,isOpen:!!N.openFor,onClose:()=>O({openFor:null}),onApprove:j,overrideApproveButtonLabel:Ge.DELETE_POD_TO_RESTART})]})},Bd=m.div`
|
|
366
366
|
display: flex;
|
|
367
367
|
align-items: center;
|
|
368
368
|
gap: 8px;
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as i,useRef as n,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as l}from"@xyflow/react";import{b as d,D as p,E as u,i as g,j as m,k as h,S as y,l as f,T as v,m as x,n as S,a as b,o as N,p as k,q as w}from"./chunks/ui-components-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as i,useRef as n,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as l}from"@xyflow/react";import{b as d,D as p,E as u,i as g,j as m,k as h,S as y,l as f,T as v,m as x,n as S,a as b,o as N,p as k,q as w}from"./chunks/ui-components-Dc15jc-B.js";import{UserIcon as K,ImageErrorIcon as T,ChevronDownIcon as M,ChevronRightIcon as I}from"./icons.js";import C,{useTheme as E}from"styled-components";import $ from"elkjs/lib/elk.bundled.js";import{c as z,d as G}from"./chunks/use-odigos-api-qSWLSy9S.js";import{F as V}from"./chunks/flow-CAOY59Tu.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@xyflow/react/dist/style.css";const j=e=>`${u.Source}-${e}-${d.MapItem}`,A=(e,t,r)=>{const i=e.isVirtual,n=r?[K]:i?[g(e)]:t?m(t):[T],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:h(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:a,aggService:e}},D=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),R=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=j(t.graphKey),a=n.get(r);if(!a)continue;const o=a.data?.status===y.Error;for(const a of t.connections){const c=j(a.targetGraphKey);n.has(c)&&i.push({id:`${r}-to-${c}`,type:"smoothstep",source:r,target:c,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:s.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return i},_=new $,O=`${u.Source}-user-${d.MapItem}`,q={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},B=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},F=C.div`
|
|
2
2
|
padding: 8px 0;
|
|
3
3
|
`,L=C.div`
|
|
4
4
|
display: flex;
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
* here rather than per-adapter.
|
|
22
22
|
*/
|
|
23
23
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
24
|
-
import { type InstrumentationRule, type InstrumentationRuleFormData } from '@/types';
|
|
24
|
+
import { type InstrumentationRule, type InstrumentationRuleFormData, type InstrumentationRuleType } from '@/types';
|
|
25
25
|
export interface InstrumentationRulesApi {
|
|
26
26
|
items: InstrumentationRule[];
|
|
27
27
|
loading: boolean;
|
|
28
28
|
fetchAll: () => Promise<void>;
|
|
29
|
-
create: (input: InstrumentationRuleFormData) => Promise<void>;
|
|
30
|
-
update: (id: string, input: InstrumentationRuleFormData) => Promise<void>;
|
|
31
|
-
remove: (id: string) => Promise<void>;
|
|
29
|
+
create: (input: InstrumentationRuleFormData, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
30
|
+
update: (id: string, input: InstrumentationRuleFormData, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
31
|
+
remove: (id: string, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
32
32
|
}
|
|
33
33
|
export declare const useInstrumentationRulesApi: (operations: OdigosApiOperations, ctx: OperationContext, options?: {
|
|
34
34
|
subscribe?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,r,f as t}from"../chunks/use-odigos-api-
|
|
1
|
+
import{e as o,r,f as t}from"../chunks/use-odigos-api-qSWLSy9S.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"../chunks/use-odigos-api-qSWLSy9S.js";export{O as OdigosApiConnectionsScope}from"../chunks/connections-scope-Cb3gZ8MW.js";import{useApolloClient as e}from"@apollo/client";import{P as s,t as i}from"../chunks/ui-components-Dc15jc-B.js";import"react";import"react/jsx-runtime";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"styled-components";import"../icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";const n=()=>{const s=e(),{operations:i,context:n}=o();return{multiFetch:async(o,r,e)=>{const a=i[o];return a?t(s,a,r,e,n):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:r.length,error:`Operation ${String(o)} not configured`}},bulkPersistSources:async(o,t)=>{const e=[];for(const a of o){const o={...n,proxyID:a},{error:c}=await r(s,i.PERSIST_SOURCES,t,o);c&&e.push(`${a}: ${c}`)}return e.length?{error:e.join(", ")}:void 0},applyConfigurations:async(o,t)=>{if(!i.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:e}=await r(s,i.UPDATE_REMOTE_CONFIG,{formData:t,connectionIds:o},n);return e?{error:e}:void 0}}},m=(o,r)=>o.platformType===s.K8s?r.K8s:o.platformType===s.Vm?r.Vm:void 0,l=o=>r=>{const t=o[r.platformType];if(!t)return;const e=Object.keys(t);if(0===e.length)return;const s=i(r.version),n=[...e].sort((o,r)=>i(r)-i(o)).find(o=>s>=i(o));return n?t[n]:void 0},f=(o,r)=>{const t={};for(const e of Object.keys(o))t[e]=r(o[e]);return t};export{m as pickByPlatform,n as useApiForConnections,l as versionedDocument,f as vmDialectMap};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-
|
|
1
|
+
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-Rk2YlyRb.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-CXxRJd5C.js";import{jsx as o}from"react/jsx-runtime";import{useMemo as r,useContext as t,createContext as s}from"react";export{O as OdigosApiConnectionsScope}from"./chunks/connections-scope-Cb3gZ8MW.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"./chunks/use-odigos-api-qSWLSy9S.js";export{pickByPlatform,useApiForConnections,versionedDocument,vmDialectMap}from"./contexts/odigos-api.js";import"./chunks/ui-components-Dc15jc-B.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const n=s({formType:void 0}),m=({children:e,formType:t})=>{const s=r(()=>({formType:t}),[t]);return o(n.Provider,{value:s,children:e})},l=()=>t(n);export{m as StorybookProvider,l as useStorybook};
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{a2 as adaptInstrumentationRuleFromWire,a3 as adaptInstrumentationRuleInputForWire,b9 as buildBadgeForDesiredStatus,fe as capitalizeFirstLetter,ff as cleanObjectEmptyStringsValues,as as compareCondition,fg as decimalsOnly,s as deepClone,dm as entityIdKey,ds as filterActions,dr as filterDestinations,b2 as filterDestinationsByStream,dq as filterSources,de as filterSourcesByStream,fh as flattenObjectKeys,bp as formatBytes,fi as formatDuration,bY as generateId,b0 as getActionIcon,k as getConditionsBooleans,bB as getContainersIcons,fj as getContainersInstrumentedCount,fk as getDeepValue,aS as getDestinationIcon,fl as getDetectedLanguageIcons,be as getEffectiveLanguage,bw as getEffectiveRuntimeVersion,dn as getEntityIcon,a1 as getEntityId,dk as getEntityIdKey,dl as getEntityLabel,fm as getHealthBadgeLabel,a0 as getIdFromSseTarget,b6 as getInstrumentationRuleIcon,fn as getMainContainerLanguage,fo as getMetricForEntity,fp as getMonitorIcon,fq as getPlatformIcon,fr as getPlatformLabel,az as getProgrammingLanguageIcon,fs as getRecursiveValues,j as getSourceLanguageIcons,X as getSseTargetFromId,ft as getStatusColor,dw as getStatusFromPodStatus,g as getStatusIcon,br as getStatusTypeFromOdigosHealth,fu as getValueForRange,i as getVirtualServiceIcon,bm as getWorkloadId,b3 as getYamlFieldsForDestination,fv as hasUnhealthyInstances,fw as instrumentationRuleSourceScopesFromWire,fx as instrumentationRuleSourceScopesToWire,x as isEmpty,B as isLegalK8sLabel,bU as isOverTime,fy as isStringABoolean,fz as isTimeElapsed,bv as isValidVersion,fA as mapConditions,bc as mapDesiredStatusToConditionStatus,b1 as mapDestinationFieldsForDisplay,K as mapExportedSignals,G as mapSupportedSignals,fB as numbersOnly,fC as parseBooleanFromString,fD as parseJsonStringToPrettyString,at as prepareDestinationFormData,fE as removeEmptyValuesFromObject,J as safeJsonParse,fF as safeJsonStringify,fG as setDeepValue,fH as sleep,b4 as splitCamelString,fI as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,u as useClickNode,p as useClickNotification,dp as useContainerSize,bq as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,r as useGenericForm,fY as useInstrumentationRuleFormData,bT as useKeyDown,bs as useOnClickOutside,fZ as useOverflow,d as usePopup,b8 as useScrollIntoViewWhen,dS as useScrollTo,dh as useSessionStorage,f_ as useSourceFormData,b7 as useTimeAgo}from"./chunks/ui-components-
|
|
1
|
+
export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,u as useClickNode,p as useClickNotification,dp as useContainerSize,bq as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,r as useGenericForm,fY as useInstrumentationRuleFormData,bT as useKeyDown,bs as useOnClickOutside,fZ as useOverflow,d as usePopup,b8 as useScrollIntoViewWhen,dS as useScrollTo,dh as useSessionStorage,f_ as useSourceFormData,b7 as useTimeAgo}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bi as ActionType,dv as Actions,du as RichTitle}from"../chunks/ui-components-
|
|
1
|
+
export{bi as ActionType,dv as Actions,du as RichTitle}from"../chunks/ui-components-Dc15jc-B.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-BgflYoEI.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"../chunks/helpers-CXxRJd5C.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{F as Flow,M as MapItemNode,N as NoDataNode}from"./chunks/flow-
|
|
1
|
+
export{F as Flow,M as MapItemNode,N as NoDataNode}from"./chunks/flow-CAOY59Tu.js";import"react/jsx-runtime";import"react";import"@xyflow/react/dist/style.css";import"styled-components";import"./chunks/ui-components-Dc15jc-B.js";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@xyflow/react";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{$ as ProgressKeys,a as useActiveNodeStore,fS as useDarkMode,z as useDataStreamStore,bl as useDrawerStore,dd as useFilterStore,bZ as useModalStore,o as useNotificationStore,Z as useProgressStore,dj as useSelectedStore,_ as useSetupStore}from"./chunks/ui-components-
|
|
1
|
+
export{$ as ProgressKeys,a as useActiveNodeStore,fS as useDarkMode,z as useDataStreamStore,bl as useDrawerStore,dd as useFilterStore,bZ as useModalStore,o as useNotificationStore,Z as useProgressStore,dj as useSelectedStore,_ as useSetupStore}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-
|
|
1
|
+
export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{v as ActionKeyTypes,w as ActionType,eO as AddNodeTypes,eP as AgentInjectedReason,eQ as BooleanOperation,
|
|
1
|
+
export{v as ActionKeyTypes,w as ActionType,eO as AddNodeTypes,eP as AgentInjectedReason,eQ as BooleanOperation,au as CodeAttributesKeyTypes,eR as ConditionType,Y as Crud,Q as CustomInstrumentationsKeyTypes,ba as DesiredStateProgress,eS as DestinationTypes,eT as EdgeTypes,E as EntityTypes,aj as ExtractionDataFormat,L as FieldTypes,R as GolangCustomProbe,O as HeadersCollectionKeyTypes,dU as InputTypes,eU as InstallationMethod,eV as InstallationStatus,V as InstrumentationRuleType,eW as IntrumentationStatus,U as JavaCustomProbe,eX as JsonOperation,a8 as K8sAttributesFrom,W as K8sResourceKind,eY as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,eZ as ListDirection,b as NodeTypes,e_ as NumberOperation,e$ as OtelDistroName,f0 as OtherEntityTypes,bf as OtherStatus,aT as OtherStatusType,aw as PayloadCollectionKeyTypes,P as PlatformType,f1 as PodContainerLifecycleStatus,f2 as PodContainerStatus,f3 as PodPhase,f4 as Profile,by as ProgrammingLanguages,f5 as SIGNAL_KEY_TO_TYPE,f6 as SIGNAL_TYPE_TO_KEY,f7 as SignalKey,H as SignalType,f8 as SortDirection,S as StatusType,f9 as StringOperation,c as Tier,fa as WorkloadRolloutReason,dx as WorkloadRolloutStatus}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fb as VISUAL_ODIGOS_LOGO_HEIGHT,fc as VISUAL_ODIGOS_LOGO_WIDTH,eM as VisualGreenRings,fd as VisualOdigosLogo,c8 as VisualPurpleRings}from"./chunks/ui-components-
|
|
1
|
+
export{fb as VISUAL_ODIGOS_LOGO_HEIGHT,fc as VISUAL_ODIGOS_LOGO_WIDTH,eM as VisualGreenRings,fd as VisualOdigosLogo,c8 as VisualPurpleRings}from"./chunks/ui-components-Dc15jc-B.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
|