@odigos/ui-kit 0.0.236 → 0.0.238
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 +15 -0
- package/lib/chunks/index-CCaTS6aq.js +145 -0
- package/lib/chunks/{index-CmhFl_vY.js → index-ChkHWnzu.js} +4 -4
- package/lib/chunks/{index-zIhroDGj.js → index-D6SlbWIi.js} +1 -1
- package/lib/chunks/ui-components-rpRyPe3l.js +2235 -0
- package/lib/components/data-card/data-card-fields/index.d.ts +0 -1
- package/lib/components/index.d.ts +0 -20
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +5 -6
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/overview/search/builder.d.ts +1 -1
- package/lib/containers/_v2/sampling-rules/converters.d.ts +2 -0
- package/lib/containers/index.d.ts +0 -32
- package/lib/containers/v2.js +96 -96
- package/lib/containers.js +19 -556
- package/lib/contexts.js +1 -1
- package/lib/functions/decimals-only/index.d.ts +1 -0
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +5 -2
- package/lib/snippets/index.d.ts +0 -2
- 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/common/index.d.ts +2 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-Cm0_bD--.js +0 -145
- package/lib/chunks/ui-components-DHsbbgZi.js +0 -2708
- package/lib/components/auto-complete-input/index.d.ts +0 -22
- package/lib/components/data-finger/index.d.ts +0 -12
- package/lib/components/docs-button/index.d.ts +0 -8
- package/lib/components/header/index.d.ts +0 -8
- package/lib/components/icon-title-badge/index.d.ts +0 -11
- package/lib/components/icons-nav/index.d.ts +0 -17
- package/lib/components/input-list/index.d.ts +0 -13
- package/lib/components/input-table/index.d.ts +0 -13
- package/lib/components/input-table/map-columns-to-fields/index.d.ts +0 -15
- package/lib/components/input-table/types.d.ts +0 -15
- package/lib/components/interactive-table/index.d.ts +0 -27
- package/lib/components/interactive-table/table-row.d.ts +0 -13
- package/lib/components/key-value-input-list/index.d.ts +0 -20
- package/lib/components/monitors-checkboxes/index.d.ts +0 -13
- package/lib/components/navigation-buttons/index.d.ts +0 -16
- package/lib/components/section-title/index.d.ts +0 -12
- package/lib/components/segment/index.d.ts +0 -17
- package/lib/components/selection-button/index.d.ts +0 -17
- package/lib/components/stepper/index.d.ts +0 -11
- package/lib/components/tag/index.d.ts +0 -9
- package/lib/components/textarea/index.d.ts +0 -8
- package/lib/components/toggle/index.d.ts +0 -12
- package/lib/components/trace-loader/index.d.ts +0 -6
- package/lib/containers/action-drawer/build-card.d.ts +0 -3
- package/lib/containers/action-drawer/index.d.ts +0 -8
- package/lib/containers/action-form/custom-fields/add-cluster-info.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/delete-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/error-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/index.d.ts +0 -7
- package/lib/containers/action-form/custom-fields/k8s-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/latency-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/pii-masking.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/probabilistic-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/rename-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/service-name-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/span-attribute-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/url-templatization.d.ts +0 -5
- package/lib/containers/action-form/index.d.ts +0 -11
- package/lib/containers/action-modal/index.d.ts +0 -7
- package/lib/containers/action-table/build-spec-cell.d.ts +0 -3
- package/lib/containers/action-table/index.d.ts +0 -7
- package/lib/containers/await-pipeline/index.d.ts +0 -4
- package/lib/containers/data-flow/column/add.d.ts +0 -8
- package/lib/containers/data-flow/column/base.d.ts +0 -21
- package/lib/containers/data-flow/column/frame.d.ts +0 -10
- package/lib/containers/data-flow/column/head.d.ts +0 -15
- package/lib/containers/data-flow/column/index.d.ts +0 -13
- package/lib/containers/data-flow/column/namespace-divider.d.ts +0 -7
- package/lib/containers/data-flow/column/source-visual-state.d.ts +0 -9
- package/lib/containers/data-flow/index.d.ts +0 -12
- package/lib/containers/data-flow-actions-menu/add-entity/index.d.ts +0 -4
- package/lib/containers/data-flow-actions-menu/data-stream-select/index.d.ts +0 -9
- package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -4
- package/lib/containers/data-flow-actions-menu/index.d.ts +0 -9
- package/lib/containers/data-flow-actions-menu/search/index.d.ts +0 -6
- package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +0 -25
- package/lib/containers/data-flow-actions-menu/search/search-results/index.d.ts +0 -6
- package/lib/containers/data-flow-actions-menu/styled.d.ts +0 -10
- package/lib/containers/data-stream-drawer/index.d.ts +0 -10
- package/lib/containers/data-stream-form/index.d.ts +0 -11
- package/lib/containers/data-stream-modal/index.d.ts +0 -7
- package/lib/containers/data-stream-selection-form/index.d.ts +0 -13
- package/lib/containers/destination-drawer/build-card.d.ts +0 -3
- package/lib/containers/destination-drawer/index.d.ts +0 -10
- package/lib/containers/destination-form/dynamic-fields/index.d.ts +0 -10
- package/lib/containers/destination-form/index.d.ts +0 -15
- package/lib/containers/destination-form/test-connection/index.d.ts +0 -12
- package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +0 -10
- package/lib/containers/destination-modal/choose-destination/index.d.ts +0 -11
- package/lib/containers/destination-modal/index.d.ts +0 -13
- package/lib/containers/destination-selection-form/destination-list/index.d.ts +0 -8
- package/lib/containers/destination-selection-form/index.d.ts +0 -12
- package/lib/containers/destination-table/index.d.ts +0 -9
- package/lib/containers/dropdowns/condition-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/error-dropdown/index.d.ts +0 -16
- package/lib/containers/dropdowns/index.d.ts +0 -7
- package/lib/containers/dropdowns/kind-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/language-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/monitor-dropdown/index.d.ts +0 -13
- package/lib/containers/dropdowns/namespace-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/pods-agent-injection-status-dropdown/index.d.ts +0 -16
- package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +0 -3
- package/lib/containers/instrumentation-rule-drawer/index.d.ts +0 -8
- package/lib/containers/instrumentation-rule-form/custom-fields/code-attributes.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/custom-instrumentation.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/headers-collection.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/index.d.ts +0 -7
- package/lib/containers/instrumentation-rule-form/custom-fields/payload-collection.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/index.d.ts +0 -11
- package/lib/containers/instrumentation-rule-modal/index.d.ts +0 -7
- package/lib/containers/instrumentation-rule-table/build-spec-cell.d.ts +0 -3
- package/lib/containers/instrumentation-rule-table/index.d.ts +0 -7
- package/lib/containers/multi-source-control/index.d.ts +0 -10
- package/lib/containers/setup-summary/index.d.ts +0 -10
- package/lib/containers/side-nav/index.d.ts +0 -16
- package/lib/containers/slack-invite/index.d.ts +0 -4
- package/lib/containers/source-modal/index.d.ts +0 -8
- package/lib/containers/source-selection-form/index.d.ts +0 -16
- package/lib/containers/source-selection-form/source-list/index.d.ts +0 -8
- package/lib/containers/source-table/index.d.ts +0 -9
- package/lib/containers/system-overview/describe/index.d.ts +0 -11
- package/lib/containers/system-overview/index.d.ts +0 -7
- package/lib/containers/system-overview/tokens/expires-at.d.ts +0 -6
- package/lib/containers/system-overview/tokens/index.d.ts +0 -8
- package/lib/containers/system-overview/tokens/token-actions.d.ts +0 -7
- package/lib/containers/table-cell-conditions/index.d.ts +0 -8
- package/lib/containers/toggle-dark-mode/index.d.ts +0 -2
- package/lib/containers/trace-view/build-spans.d.ts +0 -2
- package/lib/containers/trace-view/index.d.ts +0 -9
- package/lib/containers/trace-view/span/index.d.ts +0 -38
- package/lib/containers/trace-view/span-drawer/build-details-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-logs-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-process-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-tags-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/index.d.ts +0 -9
- package/lib/snippets/edit-button/index.d.ts +0 -7
- package/lib/snippets/note-back-to-summary/index.d.ts +0 -6
package/lib/containers.js
CHANGED
|
@@ -1,397 +1,14 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
gap: 32px;
|
|
5
|
-
${({$hasError:e})=>e&&m`
|
|
6
|
-
border: 1px solid ${({theme:e})=>e.text.error};
|
|
7
|
-
border-radius: 32px;
|
|
8
|
-
padding: 8px;
|
|
9
|
-
`}
|
|
10
|
-
`,di=[{id:"CREDIT_CARD",label:"Credit Card"}],ui=b.FallbackSamplingRatio,pi=[{value:v.Pod,id:v.Pod},{value:v.Namespace,id:v.Namespace},{value:v.Node,id:v.Node}],mi=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:pi,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],hi=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:pi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gi=b.EndpointsFilters,yi=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:N.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:N.Number}],fi=b.AttributeNamesToDelete,vi=b.Renames,bi=b.UrlTemplatizationRulesGroups,Si=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],xi=b.ServicesNameFilters,Ci=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:N.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:N.Number}],Ei=b.SamplingPercentage,Ti=b.AttributeFilters,Ni=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:N.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:L.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:L.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],ki={[f.K8sAttributes]:({value:i,setValue:a,formErrors:r})=>(o(()=>{i[b.CollectContainerAttributes]||i[b.CollectReplicaSetAttributes]||i[b.CollectWorkloadId]||i[b.CollectClusterId]||i[b.LabelsAttributes]?.length||i[b.AnnotationsAttributes]?.length||(a(b.CollectContainerAttributes,!0),a(b.CollectReplicaSetAttributes,!0),a(b.CollectWorkloadId,!0),a(b.CollectClusterId,!0),a(b.LabelsAttributes,[]),a(b.AnnotationsAttributes,[]))},[]),e(n,{children:[t(C,{title:"Collect Container Attributes",value:i[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t(C,{title:"Collect ReplicaSet Attributes",value:i[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t(C,{title:"Collect Workload ID",value:i[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t(C,{title:"Collect Cluster ID",value:i[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(w,{columns:mi,value:i[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(w,{columns:hi,value:i[b.AnnotationsAttributes]||[],onChange:e=>a(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[f.AddClusterInfo]:({value:i,setValue:a,formErrors:o})=>e(n,{children:[t($,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[b.OverwriteExistingValues]||!1,onChange:e=>a(b.OverwriteExistingValues,e)}),t(D,{title:"Resource Attributes",value:i[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[b.ClusterAttributes]})]}),[f.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[fi],o=e[fi]||[];return t(A,{title:"Attributes to delete",value:o,onChange:e=>n(fi,e),required:!0,errorMessage:a})},[f.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[vi],o=Object.entries(e[vi]||{}).map(([e,t])=>({key:e,value:t}));return t(D,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(vi,t)},required:!0,errorMessage:a})},[f.PiiMasking]:({value:n,setValue:a,formErrors:r})=>{const s=r[li],l=n[li]||[],[c,d]=i(1===l.length);return o(()=>{if(!l.length){const e=di.map(({id:e})=>e);a(li,e),d(1===di.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(ci,{$hasError:!!s,children:di.map(({id:e,label:n})=>t(C,{title:n,disabled:c&&l.includes(e),value:l.includes(e),onChange:t=>((e,t)=>{const n=t?[...l,e]:l.filter(t=>t!==e);a(li,n),d(1===n.length)})(e,t)},e))}),!!s&&t(E,{children:s})]})},[f.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[ui],o=e[ui];return t(T,{title:"Fallback sampling ratio",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(ui,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[f.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ei],o=e[Ei];return t(T,{title:"Sampling percentage",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(Ei,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[f.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[gi],o=e[gi]||[];return t(w,{columns:yi,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(gi,t)},errorMessage:a})},[f.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[xi],o=e[xi]||[];return t(w,{columns:Ci,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n(xi,t)},errorMessage:a})},[f.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ti],o=(e[Ti]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return t(w,{columns:Ni,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:a,expectedValue:o,jsonPath:r})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:a,expectedValue:o}}};return r&&(s.condition[i].jsonPath=r),s});n(Ti,t)},errorMessage:a,limitFieldsPerRow:3})},[f.URLTemplatization]:({value:i,setValue:a,formErrors:o})=>{const s=o[bi],l=i[bi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(bi,e),d=(e,t)=>c(l.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[l.map((n,i)=>e(r,{children:[t(I,{}),e(R,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${i+1}`}),l.length>1&&t(M,{size:30,onClick:()=>{return e=i,c(l.filter((t,n)=>n!==e));var e},children:t(wn,{})})]}),t(T,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(w,{title:"Workload Filters",columns:Si,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(A,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!s&&t(E,{children:s})]},`url-templatization-group-${i}`)),t(F,{label:"Add Rule Group",onClick:()=>c([...l,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},wi=({actionType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=ki[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},$i=p.div`
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
gap: 24px;
|
|
14
|
-
padding: 4px;
|
|
15
|
-
`,Di=p(U)`
|
|
16
|
-
margin-bottom: 12px;
|
|
17
|
-
`,Ai=({isUpdate:n,action:i,formData:a,formErrors:o,handleFormChange:r})=>{const s=h();return e($i,{children:[n&&e("div",{children:[t(Di,{children:"Status"}),t(_,{options:[{icon:$n,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+P["050"]},{icon:Dn,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+P["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!n&&t(K,{title:"",description:i.docsDescription,actionButton:t(j,{endpoint:i.docsEndpoint})}),t(V,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!n&&t(T,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(wi,{actionType:i.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(z,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Ii=p.div`
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: 100%;
|
|
20
|
-
max-height: calc(100vh - 220px);
|
|
21
|
-
overflow: overlay;
|
|
22
|
-
overflow-y: auto;
|
|
23
|
-
`,Ri=p.div`
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
gap: 12px;
|
|
27
|
-
`,Oi=({updateAction:n,deleteAction:a})=>{const{actions:r}=q(),{drawerType:c,drawerEntityId:d}=W(),u=s(null),p=c===Q.Action,[m,h]=i(!1),[y,f]=i(!1),{formData:v,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=B(),T=l(()=>{if(d)return r?.find(e=>H(e)===d)},[d,r]);if(o(()=>{p&&T?E(T):x()},[p,T]),!T)return null;const N=G.find(({type:e})=>e===T.type)||G.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===T.type)||G.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===T.type);return t(ni,{ref:u,title:T.name||T.type,icons:[X(T.type)],isEdit:m,isFormDirty:y,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(C({withAlert:!0,alertTitle:Z.Update})){const t=e!==T.type?e:"";S("name",t),n(d,{...v,name:t}),h(!1),f(!1)}},onDelete:()=>{a(d,T.type),h(!1),f(!1),u.current?.closeDrawer()},onCancel:()=>{h(!1),f(!1),E(T)},children:m&&N?t(Ii,{children:t(Ai,{isUpdate:!0,action:N,formData:v,formErrors:b,handleFormChange:(...e)=>{f(!0),S(...e)}})}):e(Ri,{children:[t(J,{conditions:T.conditions||[]}),t(Y,{title:g.ACTION_DETAILS,data:T?si(T):[]})]})})},Mi=p(R)`
|
|
28
|
-
margin-top: 24px;
|
|
29
|
-
gap: 12px;
|
|
30
|
-
`,Fi=({createAction:n})=>{const{version:a}=ee(),{currentModal:o,setCurrentModal:r}=te(),s=o===Q.Action,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=B(),h=l(()=>{if(!a)return G;const e=ne(a);return G.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[a]),[y,f]=i(void 0),v=()=>{p(),f(void 0),r("")},b=()=>{if(!m({withAlert:!0,alertTitle:Z.Create}))return null;n(c),v()};return ie({key:"Enter",active:s},()=>b()),t(ae,{isOpen:s,onClose:v,header:{title:"Add Action"},actionComponent:t(de,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!y}]}),children:e(oe,{children:[t(K,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Mi,{children:[t(re,{type:se.Warning,message:le.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(ce,{options:h,selectedOption:y,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void f(t);var t},autoFocus:!y?.type})]}),y?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(Ai,{action:y,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Li=e=>{const{type:t,fields:{collectContainerAttributes:n,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:s,clusterAttributes:l,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:S}}=e;let x="";if(t===f.K8sAttributes&&(n&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||v.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),s?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||v.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===s.length-1&&(x+=", ")})),t===f.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,l?.forEach(({attributeName:e,attributeStringValue:t},n)=>{x+=`${e}: ${t}`,n<l.length-1&&(x+=", ")})),t===f.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===f.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,n],i)=>{x+=`${t}: ${n}`,i<e.length-1&&(x+=", ")})}return t===f.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===f.ErrorSampler&&(x+=String(m)),t===f.ProbabilisticSampler&&(x+=String(h),x+="%"),t===f.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${n}`,x+=` Sampling=${i}`,a<g.length-1&&(x+=", ")}),t===f.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===f.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===f.URLTemplatization&&S?.forEach((e,t)=>{const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");x+=`Group ${t+1}: ${n}`,t<S.length-1&&(x+="; ")}),x},_i=({conditions:e,id:n})=>{const{errors:i,warnings:a,disableds:o,hasLoadings:r}=l(()=>ue(e),[e]),s=i.length>0?i:a.length>0?a:o.length>0?o:[];if(s.length>0)return t("div",{style:{lineHeight:1},children:t(Pi,{conditions:s,id:n})});const c=r?me.Loading:se.Success;return t("div",{style:{lineHeight:1},children:t(pe,{status:c,title:c,withBorder:!0,withIcon:!0})})},Pi=({conditions:e,id:n})=>{const i=h();return t(O,{children:he(e).map(({status:e,type:a,reason:o,message:r},s)=>{"loading"!==e&&"disabled"!==e||(e=se.Info);const l=ye(e,i);return t(ge,{titleIcon:l,title:a,text:r||o||"",children:t(pe,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${n}-${e}-${a}-${s}`)})})},Ki=({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,l=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:Q.Source,label:"Sources",count:s.length,entities:[]},{category:Q.Action,label:"Actions",count:l.length,entities:[]},{category:Q.Destination,label:"Destinations",count:c.length,entities:[]},{category:Q.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+s.length+l.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===Q.InstrumentationRule?r:e.category===Q.Source?s:e.category===Q.Action?l:e.category===Q.Destination?c:[]}));return{categories:d,searchResults:u}},ji=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Vi=({maxHeight:n,maxWidth:i})=>{const a=h(),o=fe(),{actions:r,actionsLoading:s}=q(),{setDrawerType:c,setDrawerEntityId:d}=W(),u=l(()=>Ki({instrumentationRules:[],sources:[],actions:ve(r,o),destinations:[],searchText:o.searchText,selectedCategory:Q.Action}).searchResults.find(({category:e})=>e===Q.Action)?.entities||[],[r,o]),p=l(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=ue(e.conditions||[]);return{status:n?se.Error:i?se.Warning:void 0,faded:o,onClick:()=>{c(Q.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:X(e.type)})},{columnKey:"name",value:Se(e,Q.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Li(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(_i,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(pe,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:m,badgeTooltip:y}=l(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Ce,{$maxWidth:i,children:[t(Ee,{children:t(Te,{icon:Ne(Q.Action),title:g.ACTIONS,badge:m,badgeTooltip:y,loading:s})}),t(ke,{$maxHeight:n,children:t(we,{columns:ji,rows:p})}),!u.length&&t($e,{style:{marginTop:"2rem"},children:t(De,{})})]})},zi=p(R)`
|
|
31
|
-
// width: 100vw;
|
|
32
|
-
// height: 100vh;
|
|
33
|
-
gap: 64px;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
`,Ui=p(R)`
|
|
37
|
-
max-width: 400px;
|
|
38
|
-
gap: 12px;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
`,qi=p(U)`
|
|
42
|
-
text-align: center;
|
|
43
|
-
font-size: 24px;
|
|
44
|
-
`,Wi=p(U)`
|
|
45
|
-
text-align: center;
|
|
46
|
-
line-height: 26px;
|
|
47
|
-
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,Bi=()=>{const[n,a]=i(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Re(500),a(e)})()},[]),e(zi,{children:[t(An,{size:100}),t(Ae,{width:400}),e(Ui,{children:[e(O,{$gap:16,children:[t(qi,{children:"Preparing your workspace..."}),t(Ie,{label:`${n}%`})]}),t(Wi,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Hi=p(R)`
|
|
49
|
-
align-items: center !important;
|
|
50
|
-
justify-content: center !important;
|
|
51
|
-
align-self: stretch;
|
|
52
|
-
|
|
53
|
-
min-height: 50px;
|
|
54
|
-
width: calc(100% - 32px);
|
|
55
|
-
padding: 16px;
|
|
56
|
-
gap: 4px;
|
|
57
|
-
|
|
58
|
-
background-color: transparent;
|
|
59
|
-
border-radius: 16px;
|
|
60
|
-
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
|
|
63
|
-
&:hover {
|
|
64
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+P["030"]};
|
|
65
|
-
}
|
|
66
|
-
`,Gi=({entityType:n,description:i})=>{const{setCurrentModal:a}=te();return e(Hi,{onClick:()=>a(n),children:[e(O,{$gap:4,children:[t(In,{}),e(U,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",n]})]}),t(U,{size:12,align:"center",children:i})]})},Ji=p.div`
|
|
67
|
-
position: relative;
|
|
68
|
-
width: 100%;
|
|
69
|
-
padding: 12px 0;
|
|
70
|
-
gap: 16px;
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
`,Yi=p(O)`
|
|
75
|
-
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,Xi=p(Me)`
|
|
77
|
-
width: 24px;
|
|
78
|
-
height: 24px;
|
|
79
|
-
padding: 0;
|
|
80
|
-
`,Qi=p.div`
|
|
81
|
-
position: absolute;
|
|
82
|
-
bottom: -2px;
|
|
83
|
-
left: 0;
|
|
84
|
-
background-color: ${({theme:e})=>e.colors.majestic_blue};
|
|
85
|
-
border-radius: 32px;
|
|
86
|
-
height: 4px;
|
|
87
|
-
width: ${({percent:e})=>`${e}%`};
|
|
88
|
-
transition: width 0.3s;
|
|
89
|
-
`,Zi=({entityType:n,badge:i,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:s,allSelected:l,onSelectAll:c,progressPercent:d})=>{const u=h(),{setCurrentModal:p}=te(),m=Ne(n);return e(Ji,{children:[c&&t(Yi,{$marginLeft:"28px",children:t(C,{partiallyChecked:s,value:l,onChange:c})}),t(Yi,{$marginLeft:n===Q.Source?"0":"28px",children:t(Te,{icon:m,title:`${n}s`,badge:i,badgeTooltip:a,loading:!1})}),e(Yi,{$marginLeft:"auto",children:[t(Xi,{"data-id":`refresh-${n}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Oe,{scale:.8}):t(Rn,{fill:u.colors.secondary,size:18})}),t(Xi,{"data-id":`add-${n}`,variant:"primary",onClick:()=>p(n),children:t(In,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Qi,{percent:d})]})},ea=p.div`
|
|
90
|
-
padding: 2px 6px;
|
|
91
|
-
background-color: ${({theme:e})=>e.colors.primary};
|
|
92
|
-
border-radius: 360px;
|
|
93
|
-
border: 1px solid ${({$isError:e,theme:t})=>e?t.colors.dark_red:t.colors.border};
|
|
94
|
-
color: ${({$isError:e,theme:t})=>e?t.text.error:t.text.light_grey};
|
|
95
|
-
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
96
|
-
font-size: 10px;
|
|
97
|
-
font-weight: 400;
|
|
98
|
-
text-transform: uppercase;
|
|
99
|
-
display: flex;
|
|
100
|
-
gap: 4px;
|
|
101
|
-
align-items: center;
|
|
102
|
-
justify-content: center;
|
|
103
|
-
white-space: nowrap;
|
|
104
|
-
`,ta=({entityId:n,entityType:i,status:a,faded:o,title:r,subTitle:s,tooltip:l,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:m,monitors:g,isActive:y,raw:f})=>{const v=h(),b=i===Q.Source,S="boolean"==typeof y,{setDrawerType:x,setDrawerEntityId:C}=W(),{selectedSources:E,setSelectedSources:T}=Fe(),N={...E},{namespace:k,name:w,kind:$}=f;b&&!N[k]&&(N[k]=[]);const D=b?N[k].findIndex(e=>e.name===w&&e.kind===$):-1;return t(Le,{"data-id":i===Q.Source?`${n.namespace}-${n.name}-${n.kind}`:n,title:r,subTitle:s,onClick:()=>{x(i),C(n)},renderActions:()=>{const n=S&&!y?ye(se.Info,v):a?ye(a,v):void 0,i=n?t(n,{size:14}):null;return c?e(ea,{$isError:a===se.Error,children:[t(ge,{text:l||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),i]}):i||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:m},visualProps:{status:a,faded:o||S&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==D,onCheckboxChange:()=>{-1===D?N[k].push(f):N[k].splice(D,1),T(N)}}})};function na(e){const t=e.conditions?.some(({status:e})=>e===me.Loading);return t?e:{...e,conditions:[{status:me.Loading,type:"Pending",message:""}]}}function ia(e){const t=e.conditions?.filter(({status:e})=>e!==me.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:se.Success,type:"Healthy",message:""}]}}const aa=p.div`
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: 12px;
|
|
107
|
-
left: 12px;
|
|
108
|
-
right: 12px;
|
|
109
|
-
z-index: 1;
|
|
110
|
-
padding: 4px 12px;
|
|
111
|
-
background: ${({theme:e})=>e.colors.primary};
|
|
112
|
-
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
113
|
-
border-radius: 12px 12px 0 0;
|
|
114
|
-
pointer-events: none;
|
|
115
|
-
`,oa=p.span`
|
|
116
|
-
font-family: ${({theme:e})=>e.font_family.primary};
|
|
117
|
-
font-size: 11px;
|
|
118
|
-
font-weight: 600;
|
|
119
|
-
color: ${({theme:e})=>e.text.grey};
|
|
120
|
-
text-transform: uppercase;
|
|
121
|
-
letter-spacing: 0.5px;
|
|
122
|
-
`,ra=p.div`
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
gap: 8px;
|
|
126
|
-
padding: 4px 8px 0;
|
|
127
|
-
`,sa=p.div`
|
|
128
|
-
flex: 1;
|
|
129
|
-
height: 1px;
|
|
130
|
-
background: ${({theme:e})=>e.colors.border};
|
|
131
|
-
`,la=p.span`
|
|
132
|
-
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
133
|
-
font-size: 10px;
|
|
134
|
-
font-weight: 600;
|
|
135
|
-
color: ${({theme:e})=>e.text.grey};
|
|
136
|
-
text-transform: uppercase;
|
|
137
|
-
letter-spacing: 0.5px;
|
|
138
|
-
white-space: nowrap;
|
|
139
|
-
`,ca=({namespace:e})=>t(aa,{children:t(oa,{children:e})}),da=({namespace:n})=>e(ra,{children:[t(sa,{}),t(la,{children:n}),t(sa,{})]}),ua=p.div`
|
|
140
|
-
height: calc(${({$height:e})=>e}px - 24px);
|
|
141
|
-
width: calc(100% - 24px);
|
|
142
|
-
padding: 12px;
|
|
143
|
-
background: transparent;
|
|
144
|
-
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
145
|
-
border-radius: 24px;
|
|
146
|
-
position: relative;
|
|
147
|
-
`,pa=p.div`
|
|
148
|
-
position: absolute;
|
|
149
|
-
bottom: 0;
|
|
150
|
-
left: 0;
|
|
151
|
-
|
|
152
|
-
width: 100%;
|
|
153
|
-
height: 100px;
|
|
154
|
-
|
|
155
|
-
background: ${({theme:e,$hide:t})=>t?"transparent":`linear-gradient(to top, ${e.colors.primary}, transparent)`};
|
|
156
|
-
border-radius: 0 0 24px 24px;
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: flex-end;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
|
|
161
|
-
pointer-events: none;
|
|
162
|
-
`,ma={[Q.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:We(e),icon:Ne(Q.Source)}),withMetrics:!0},[Q.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>qe(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[Q.Action]:{subTitle:e=>e.type,icons:e=>({icon:X(e.type)}),withMonitors:!0,withActive:!0},[Q.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:Ue(e.type)}),withActive:!0},[Q.Namespace]:{subTitle:()=>"",icons:()=>({icon:Ne(Q.Namespace)})},[Q.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:Ne(Q.SamplingRule)})}};function ha(e,t,n,i){const a=H(e);if(!a)return null;const o=ma[t],r=t===Q.Source,s=o.withMonitors?t===Q.Destination?Ve(e.exportedSignals):e.signals:void 0,l=o.withMetrics?i?.get(Ke(a)):void 0,c=o.withActive?!e.disabled:void 0;let d,u,p=!1,m=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case _e.Failure:return{status:se.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case _e.Notice:return{status:se.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case _e.Pending:case _e.Waiting:return{status:void 0,faded:!1,displaySource:na(e)};case _e.Unsupported:case _e.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ia(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,m=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=ue(e.conditions||[]);d=t,p=n}return{entityId:a,namespace:r?e.namespace:void 0,title:Se(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:o.subTitle(e,n),status:d,faded:p,tooltip:u,label:o.withMetrics?ze(l):void 0,...o.icons(e),monitors:s,isActive:c,raw:m}}const ga=({height:n,entityType:a,entities:r,metrics:s})=>{const{isVm:d}=ee(),u=a===Q.Source,[p,m]=i(""),h=l(()=>{if(!s)return;const e=new Map,t=a===Q.Source?s.sources:a===Q.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(Pe(n),n.throughput);return e},[s,a]),g=l(()=>r.map(e=>ha(e,a,d,h)).filter(Boolean),[r,a,h,d]),{elements:y,indexToNamespace:f,multipleNs:v}=l(()=>{const e=[],n=[],i=new Set(g.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const i of g)u&&i.namespace&&i.namespace!==o&&(""!==o&&(n.push(i.namespace),e.push(t(da,{namespace:i.namespace},`ns-divider-${i.namespace}`))),o=i.namespace),n.push(i.namespace||""),e.push(t(ta,{entityType:a,entityId:i.entityId,raw:i.raw,title:i.title,subTitle:i.subTitle,faded:i.faded,status:i.status,tooltip:i.tooltip,label:i.label,icons:i.icons,icon:i.icon,iconSrc:i.iconSrc,monitors:i.monitors,isActive:i.isActive},Ke(i.entityId)));return{elements:e,indexToNamespace:n,multipleNs:i}},[g,a,u]);o(()=>{if(u&&f.length&&!p){const e=f.find(Boolean);e&&m(e)}},[u,f]);const b=c(e=>{if(!f.length)return;const t=f[Math.min(e,f.length-1)];t&&t!==p&&m(t)},[f,p]);return e(ua,{$height:n,children:[v&&p&&t(ca,{namespace:p}),t(je,{gap:8,elements:y,onTopIndexChange:v?b:void 0}),t(pa,{$hide:!0})]})},ya=p.div`
|
|
163
|
-
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
164
|
-
display: flex;
|
|
165
|
-
flex-direction: column;
|
|
166
|
-
gap: 12px;
|
|
167
|
-
`,fa=({entityType:n,entities:i,unfilteredCount:a,metrics:o,loading:r,maxHeight:s,refetch:c})=>{const{isVm:d}=ee(),{frameHeight:u,hasFiltersApplied:p,isSources:m}=l(()=>({frameHeight:Math.min(s,80*i.length+12),hasFiltersApplied:i.length!==a,isSources:n===Q.Source}),[n,i.length,s,a]),{progress:h}=Be(),y=l(()=>m&&(h[He.Instrumenting]||h[He.Uninstrumenting])?h[He.Instrumenting]?.percentage||h[He.Uninstrumenting]?.percentage||0:void 0,[m,h[He.Instrumenting],h[He.Uninstrumenting]]),{selectedSources:f,setSelectedSources:v}=Fe(),b=l(()=>m?Object.values(f).reduce((e,t)=>e+t.length,0):0,[m,f]);return d&&[Q.InstrumentationRule,Q.Action].includes(n)?null:e(ya,{$isVm:d,children:[t(Zi,{entityType:n,badge:"number"==typeof y?`${y}%`:p?`${i.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:c,partiallySelected:b>0&&i?.length!==b,allSelected:b>0&&i?.length===b,onSelectAll:m?e=>{if(m)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),v(e)}else v({})}:void 0,progressPercent:y}),i.length?t(ga,{height:u,entityType:n,entities:i,metrics:o}):r?t(Ge,{size:3}):t(Gi,{entityType:n,description:g.TO_COLLECT_OTEL_DATA})]})},va=p.div`
|
|
168
|
-
width: 100%;
|
|
169
|
-
height: ${({$height:e})=>e};
|
|
170
|
-
display: flex;
|
|
171
|
-
justify-content: space-evenly;
|
|
172
|
-
gap: 24px;
|
|
173
|
-
`,ba=({height:n,metrics:a,refetchSources:r,refetchDestinations:s,refetchActions:c,refetchInstrumentationRules:d})=>{const u=fe(),{selectedStreamName:p}=Je(),{containerRef:m,containerHeight:h}=Ye(),g=q(e=>e.sources),y=q(e=>e.sourcesLoading),f=q(e=>e.destinations),v=q(e=>e.destinationsLoading),b=q(e=>e.actions),S=q(e=>e.actionsLoading),x=q(e=>e.instrumentationRules),C=q(e=>e.instrumentationRulesLoading),E=l(()=>Xe(g,p),[g,p]),T=l(()=>Qe(f,p),[f,p]),[N,k]=i([]),[w,$]=i([]),[D,A]=i([]),[I,R]=i([]);return o(()=>{k(Ze(E,u))},[E,u]),o(()=>{$(et(T,u))},[T,u]),o(()=>{A(ve(b,u))},[b,u]),o(()=>{R(x)},[x]),e(va,{ref:m,$height:n,children:[t(fa,{entityType:Q.InstrumentationRule,entities:I,unfilteredCount:x.length,loading:C,maxHeight:h,refetch:d}),t(fa,{entityType:Q.Source,entities:N,unfilteredCount:E.length,metrics:a,loading:y,maxHeight:h,refetch:r}),t(fa,{entityType:Q.Action,entities:D,unfilteredCount:b.length,loading:S,maxHeight:h,refetch:c}),t(fa,{entityType:Q.Destination,entities:w,unfilteredCount:T.length,metrics:a,loading:v,maxHeight:h,refetch:s})]})},Sa=p.div`
|
|
174
|
-
position: relative;
|
|
175
|
-
max-width: 200px;
|
|
176
|
-
`;p.div`
|
|
177
|
-
position: absolute;
|
|
178
|
-
top: calc(100% + 8px);
|
|
179
|
-
left: 0;
|
|
180
|
-
z-index: 1;
|
|
181
|
-
width: 420px;
|
|
182
|
-
padding: ${({$padding:e})=>e||"unset"};
|
|
183
|
-
display: ${({$hidden:e})=>e?"none":"block"};
|
|
184
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
185
|
-
border: ${({theme:e})=>`1px solid ${e.colors.border}`};
|
|
186
|
-
border-radius: 24px;
|
|
187
|
-
`;const xa=p.div`
|
|
188
|
-
display: flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
overflow-x: scroll;
|
|
191
|
-
`,Ca=({onClose:n})=>{const a=h(),{onClickNode:s}=tt(),{searchText:c}=fe(),{selectedStreamName:d}=Je(),{popupRef:u,popupOpen:p,setPopupOpen:m,popupPosition:g,handlePosition:y}=nt(),f=q(e=>e.sources),v=q(e=>e.destinations),b=q(e=>e.actions),S=q(e=>e.instrumentationRules);o(()=>{p||(y(0,50),m(!0))},[p]);const[x,C]=i("all"),{categories:E,searchResults:T}=l(()=>Ki({instrumentationRules:S,sources:Xe(f,d),actions:b,destinations:Qe(v,d),searchText:c,selectedCategory:x}),[S,f,b,v,d,c,x]);return T.length?t(it,{ref:u,isOpen:p,top:g.top,left:g.left,maxWidth:"420px",header:t(xa,{children:E.map(({category:e,label:n,count:i})=>!!i&&t(ot,{label:n,badgeLabel:i,isSelected:x===e,onClick:()=>C(e)},`category-select-${e}`))}),children:T.map(({category:i,label:o,entities:l},c)=>!!l.length&&e(r,{children:[e(at,{style:{maxHeight:"all"!==x?"240px":"140px",padding:"12px 0"},children:[t(U,{size:12,family:"secondary",color:a.text.darker_grey,style:{marginLeft:"16px"},children:o}),l.map((e,a)=>t(ot,{icon:Ne(i),label:Se(e,i,{extended:!0}),onClick:()=>{const t=H(e);s(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${a}`))]}),t(I,{thickness:c===T.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${i}`))}):t(it,{ref:u,isOpen:p,top:g.top,left:g.left,children:t(De,{})})},Ea=({preventPopup:n=!1})=>{const{searchText:a,setSearchText:o}=fe(),[r,l]=i(!1),c=!!a||r,d=()=>{o(""),l(!1)},u=s(null);return rt(u,d),ie({key:"Escape",active:c},d),e(Sa,{ref:u,children:[t(T,{placeholder:"Search",icon:On,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>l(!0)}),c&&!n?t(Ca,{onClose:d}):null]})},Ta=({sources:e,title:n="Condition",value:i,onSelect:a,onDeselect:o,...r})=>{const s=l(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:n})=>{t.find(t=>t.id===`${e}#${n}`)||t.push({id:`${e}#${n}`,value:`${st(e)} - ${st(n)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(lt,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Na=({sources:e,title:n="Error Message",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const t=[];return e.forEach(({conditions:e})=>{he(e||[]).forEach(({status:e,message:n,reason:i})=>{e!==se.Error||t.find(e=>e.id===n)||(n?t.find(e=>e.id===n)||t.push({id:n,value:n}):i&&(t.find(e=>e.id===i)||t.push({id:i,value:i})))})}),t},[e]);return t(lt,{disabled:r||!c?.length,title:n,placeholder:"All",options:c,value:i,onSelect:a,onDeselect:o,...s})},ka=({sources:e,title:n="Programming Language",value:i,onSelect:a,onDeselect:o,...r})=>{const s=l(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(e=>{const n=e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language;n&&(t.find(e=>e.id===n)||t.push({id:n,value:ct[n]||n}))})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(lt,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},wa=({title:e="Monitors",value:n,onSelect:i,onDeselect:a,...o})=>{const r=l(()=>{const e=[];return dt.forEach(({id:t,value:n})=>{e.find(e=>e.id===t)||e.push({id:t,value:n})}),e},[]);return t(lt,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:n,onSelect:i,onDeselect:a,...o})},$a=({namespaces:e,title:n="Namespace",value:i,onSelect:a,onDeselect:o,...r})=>{const s=l(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(lt,{disabled:!s?.length,title:n,placeholder:"Select namespace",options:s,value:i,onSelect:a,onDeselect:o,...r})},Da=({sources:e,title:n="Kind",value:i,onSelect:a,onDeselect:o,...r})=>{const s=l(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(lt,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Aa=({sources:e,title:n="Agent Injection Status",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:n,message:i}=e||{};if(n){t.find(e=>e.id===n)||t.push({id:n,value:st(n)})}else if(i){t.find(e=>e.id===i)||t.push({id:i,value:i})}}),t},[e]);return t(lt,{disabled:r||!c?.length,title:n,placeholder:"All",options:c,value:i,onSelect:a,onDeselect:o,...s})},Ia=p.div`
|
|
192
|
-
display: flex;
|
|
193
|
-
flex-direction: column;
|
|
194
|
-
gap: 12px;
|
|
195
|
-
padding: 12px;
|
|
196
|
-
`,Ra=p.div`
|
|
197
|
-
padding: 12px 6px 6px 6px;
|
|
198
|
-
`,Oa=p(Me)`
|
|
199
|
-
font-size: 14px;
|
|
200
|
-
${({$color:e})=>`color: ${e};`}
|
|
201
|
-
`,Ma=p.div`
|
|
202
|
-
margin-left: auto;
|
|
203
|
-
`,Fa=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},La=()=>{const n=h(),a=q(e=>e.sources),r=q(e=>e.namespaces),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=pt(),{popupRef:m,popupOpen:g,setPopupOpen:y,popupPosition:f,handlePosition:v}=nt(),{namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:T,onlyErrors:N,podsAgentInjectionStatus:k,setAll:w,clearAll:D,getEmptyState:A}=fe(),I=l(()=>Xe(a,c),[a,c]),[R,M]=i({namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:T,onlyErrors:N,podsAgentInjectionStatus:k}),[F,L]=i(Fa(R));o(()=>{const e=d(ut.OVERVIEW_FILTERS,A());w(e)},[]),o(()=>{if(!g){const e={namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:T,onlyErrors:N,podsAgentInjectionStatus:k};M(e),L(Fa(e))}},[g,b,S,x,C,E,T,N,k]);const _=()=>{y(!1)},P=s(null);return rt(P,_),ie({key:"Escape",active:g},_),e(Sa,{ref:P,children:[t(ot,{label:"Filters",icon:Mn,badgeLabel:F,badgeFilled:!!F,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),y(!0)}}),t(it,{ref:m,isOpen:g,top:f.top,left:f.left,width:"420px",footer:e(O,{children:[t(Oa,{variant:"primary",onClick:()=>{u(ut.OVERVIEW_FILTERS,R),w(R),L(Fa(R)),y(!1)},children:"Apply"}),t(Oa,{variant:"secondary",onClick:_,children:"Cancel"}),t(Ma,{children:t(Oa,{variant:"tertiary",onClick:()=>{p(ut.OVERVIEW_FILTERS),D(),M(A()),L(0),y(!1)},$color:n.text.error,children:"Reset"})})]}),children:e(Ia,{children:[t($a,{namespaces:r,value:R.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Da,{sources:I,value:R.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ka,{sources:I,value:R.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(wa,{value:R.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ta,{sources:I,value:R.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Aa,{sources:I,value:R.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ra,{children:t($,{title:"Show only sources with errors",initialValue:R.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Na,{sources:I,value:R.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!R.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},_a=p.div`
|
|
204
|
-
display: flex;
|
|
205
|
-
flex-direction: column;
|
|
206
|
-
gap: 24px;
|
|
207
|
-
padding: 4px;
|
|
208
|
-
`,Pa=({formData:n,handleFormChange:i,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:s}=Je(),c=o||s,d=l(()=>r.find(e=>e.name===n.name&&e.name!==c),[r,n.name,c]);return e(_a,{children:[t(T,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:n.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:a.name}),d&&t(re,{type:se.Warning,message:g.DATA_STREAM_EXISTS_WARNING(c,d.name)})]})},Ka=p.div`
|
|
209
|
-
width: 100%;
|
|
210
|
-
height: 100%;
|
|
211
|
-
max-height: calc(100vh - 220px);
|
|
212
|
-
overflow: overlay;
|
|
213
|
-
overflow-y: auto;
|
|
214
|
-
`,ja=({isOpen:e,onClose:n,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:r}=Je(),d=s(null),[u,p]=i(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:f,loadFormWithDrawerItem:v}=mt({name:a}),b=l(()=>{if(!e)return f();const t=r?.find(e=>e.name===a);return t?v(t):f(),t},[e,r,a]),S=c((e,t)=>{h(e,t),p(!0)},[h]);if(!b)return null;return t(ni,{ref:d,title:b.name,icons:[Fn],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Z.Update})&&(o(a,m),p(!1),n())},onCancel:()=>{f(),p(!1),n()},children:t(Ka,{children:t(Pa,{formData:m,handleFormChange:S,formErrors:g,editingStreamName:a})})})},Va=p.div`
|
|
215
|
-
position: relative;
|
|
216
|
-
`,za=p(O)`
|
|
217
|
-
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
218
|
-
border-radius: 32px;
|
|
219
|
-
|
|
220
|
-
& button {
|
|
221
|
-
max-height: 28px;
|
|
222
|
-
}
|
|
223
|
-
`,Ua=p(U)`
|
|
224
|
-
text-wrap: nowrap;
|
|
225
|
-
`,qa=p(at)`
|
|
226
|
-
max-height: 240px;
|
|
227
|
-
padding: 0px !important;
|
|
228
|
-
`,Wa=p(O)`
|
|
229
|
-
width: 100%;
|
|
230
|
-
`,Ba=p.div`
|
|
231
|
-
width: 100%;
|
|
232
|
-
`,Ha=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const s=h(),{clearStore:c}=ht(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:g}=nt(),{dataStreams:y,selectedStreamName:f,setSelectedStreamName:v}=Je(),[b,S]=i(""),[x,C]=i(""),[E,N]=i(""),k=l(()=>y.filter(({name:e})=>!E||e.toLowerCase().includes(E.toLowerCase())).map(({name:n})=>e(Wa,{children:[t(Ba,{children:t(ot,{label:n,isSelected:f===n,onClick:()=>{c(),v(n),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),n!==gt&&t(M,{onClick:()=>C(n),tooltip:yt.DELETE,children:t(wn,{})}),t(M,{onClick:()=>S(n),tooltip:yt.EDIT,children:t(Ln,{})})]},`stream-${n}`)),[y,f,E]);return e(n,{children:[e(Va,{children:[e(za,{$gap:0,children:[e(Me,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Fn,{fill:s.text.info}),e(Ua,{children:["Data Stream: ",f]}),t(ft,{extend:u}),t(Ie,{label:y.length})]}),t(I,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(F,{onClick:()=>{c(),a()},label:yt.NEW})]}),t(it,{ref:d,isOpen:u,top:m.top,left:m.left,header:t(T,{placeholder:"Search...",icon:On,value:E,onChange:e=>N(e.target.value)}),children:t(qa,{children:k})})]}),t(vt,{isOpen:""!==x,name:x,onApprove:()=>{r(x),C("")},onDeny:()=>{C("")}}),t(ja,{isOpen:""!==b,onClose:()=>{S("")},dataStreamName:b,updateDataStream:o})]})},Ga=p.div`
|
|
233
|
-
display: flex;
|
|
234
|
-
align-items: center;
|
|
235
|
-
margin: 20px 0;
|
|
236
|
-
padding: 0 16px;
|
|
237
|
-
gap: 8px;
|
|
238
|
-
`,Ja=p.div`
|
|
239
|
-
margin-left: auto;
|
|
240
|
-
`,Ya=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:s}=ee(),{setCurrentModal:l}=te();return e(Ga,{children:[!s&&t(Ha,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(Ea,{preventPopup:i}),t(La,{}),n&&t(Ja,{children:t(F,{"data-id":`add-${n}`,onClick:()=>l(n),label:`${yt.ADD} ${st(n)}`,variant:"primary",textProps:{weight:900}})})]})},Xa=d(({isModal:n,onClickSummary:i},a)=>{const{selectedStreamName:o}=Je(),{formData:r,handleFormChange:s,formErrors:l,validateForm:c}=mt({name:o});return u(a,()=>({validateForm:c,getFormValues:()=>r})),t(oe,{$isNotModal:!n,children:e(R,{$gap:24,children:[i&&t(bt,{onClick:i}),t(K,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Pa,{formData:r,handleFormChange:s,formErrors:l})]})})});Xa.displayName=Xa.name;const Qa=({createDataStream:e})=>{const{currentModal:n,setCurrentModal:i}=te(),{addDataStreams:a,setSelectedStreamName:o}=Je(),r=n===St.DataStream,l=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),l()}},d=s(null);return ie({key:"Enter",active:r},c),t(ae,{isOpen:r,onClose:l,header:{title:"Add Data Stream"},actionComponent:t(de,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(Xa,{ref:d,isModal:!0})})},Za=(e,t)=>{const{destinationType:n,disabled:i,exportedSignals:a}=e,o=[{title:g.TYPE,value:n.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!i)},{type:y.Monitors,title:g.MONITORS,value:Ve(a).join(", ")},{title:g.NAME,value:n.displayName}],r=xt(e,t),s=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:n,value:i})=>{const{secret:r,componentProperties:l,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!(!!c?.length&&Ct(c,Ve(a),s))){const{type:e}=Et(l,{type:""}),t=(r||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:n,value:t||i})}}),o},eo=({signals:e,fields:n,onChange:i,formErrors:a})=>n?.map(o=>{const{componentType:r,renderCondition:s,...l}=o;if(!(!s||Ct(s,e,n)))return null;switch(r){case L.Input:return t(T,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case L.Dropdown:return t(lt,{...l,showSearch:!0,value:{id:l.value||"",value:l.value||""},options:l.options||[],onSelect:e=>i(o.name,e.id),errorMessage:a[o.name]},o.name);case L.MultiInput:return t(A,{...l,value:"string"==typeof l.value?Et(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case L.KeyValuePair:return t(D,{...l,value:"string"==typeof l.value?Et(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case L.TextArea:return t(z,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case L.Checkbox:return t(C,{...l,value:"true"==l.value,onChange:e=>i(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),to=p(Me)`
|
|
241
|
-
display: flex;
|
|
242
|
-
align-items: center;
|
|
243
|
-
gap: 8px;
|
|
244
|
-
|
|
245
|
-
${({$status:e,theme:t})=>e===se.Success?m`
|
|
246
|
-
border-color: transparent;
|
|
247
|
-
background-color: ${t.colors.success};
|
|
248
|
-
`:"error"===e?m`
|
|
249
|
-
border-color: transparent;
|
|
250
|
-
background-color: ${t.colors.error};
|
|
251
|
-
`:m`
|
|
252
|
-
background-color: transparent;
|
|
253
|
-
`}
|
|
254
|
-
`,no=({destination:n,validateForm:a,status:o,testConnection:r,onSuccess:s,onError:l})=>{const c=h(),{selectedStreamName:d}=Je(),[u,p]=i(!1),m=o?ye(o,c):void 0;return e(to,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...n,currentStreamName:d});e&&(e.succeeded?s(e):l(e)),p(!1)}},children:[u?t(Oe,{}):m?t(m,{}):null,t(U,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===se.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},io=p(R)`
|
|
255
|
-
align-items: unset;
|
|
256
|
-
padding: 0 4px;
|
|
257
|
-
`,ao=p.div`
|
|
258
|
-
display: flex;
|
|
259
|
-
flex-direction: column;
|
|
260
|
-
gap: 12px;
|
|
261
|
-
`,oo=p(O)`
|
|
262
|
-
justify-content: space-between;
|
|
263
|
-
`,ro=p(U)`
|
|
264
|
-
margin-bottom: 12px;
|
|
265
|
-
`,so=({isUpdate:n,categoryItem:a,formData:r,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:m,testConnection:y})=>{const{type:f,displayName:v,supportedSignals:b,testConnectionSupported:S}=a||{},x=h(),[C,E]=i(!1),[N,k]=i(!1),[w,$]=i(void 0),D=s(!1);o(()=>{if(p.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:n,value:i}=p[t];if(n){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}E(e)}},[p,N]);const A=l(()=>{const{logs:e,metrics:t,traces:n,profiles:i}=b||{},a=[];return e?.supported&&a.push(Tt.Logs),t?.supported&&a.push(Tt.Metrics),n?.supported&&a.push(Tt.Traces),i?.supported&&a.push(Tt.Profiles),a},[b]),R=l(()=>{const{logs:e,metrics:t,traces:n,profiles:i}=r.exportedSignals||{},a=[];return e&&a.push(Tt.Logs),t&&a.push(Tt.Metrics),n&&a.push(Tt.Traces),i&&a.push(Tt.Profiles),a},[r.exportedSignals]),O=()=>{E(!1),k(!0),$(void 0)};return e(io,{$gap:24,children:[e(io,{$gap:12,children:[t(K,{title:n?"Update destination":"Create destination",description:`Connect ${v} with Odigos.`,actionButton:S&&t(no,{destination:r,validateForm:d,status:w?.type,testConnection:y,onError:e=>{k(!1),$({type:se.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),$({type:se.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ao,{children:[S&&w&&t(re,{type:w.type,title:w.title,message:w.message}),C&&!w&&!n&&t(re,{type:se.Default,message:`Odigos autocompleted ${v} destination details.`})]}),t(I,{})]}),e(oo,{children:[t(V,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:A,selectedSignals:R,setSelectedSignals:e=>{O(),u("exportedSignals",{logs:e.includes(Tt.Logs),metrics:e.includes(Tt.Metrics),traces:e.includes(Tt.Traces),profiles:e.includes(Tt.Profiles)})},errorMessage:c.exportedSignals}),!n&&t(j,{endpoint:`/backends/${f}`})]}),n&&e("div",{children:[t(ro,{children:"Status"}),t(_,{options:[{icon:$n,label:g.ENABLED,value:!1,selectedBgColor:x.text.success+P["050"]},{icon:Dn,label:g.DISABLED,value:!0,selectedBgColor:x.text.error+P["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!n&&t(T,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{O(),u("name",e.target.value)},errorMessage:c.name}),t(eo,{signals:R,fields:p,onChange:(e,t)=>{O(),m(n=>{const i=[...n],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:c})]})},lo=p.div`
|
|
266
|
-
width: 100%;
|
|
267
|
-
height: 100%;
|
|
268
|
-
max-height: calc(100vh - 220px);
|
|
269
|
-
overflow: overlay;
|
|
270
|
-
overflow-y: auto;
|
|
271
|
-
`,co=p.div`
|
|
272
|
-
display: flex;
|
|
273
|
-
flex-direction: column;
|
|
274
|
-
gap: 12px;
|
|
275
|
-
`,uo=({categories:n,updateDestination:a,deleteDestination:r,testConnection:c})=>{const{destinations:d}=q(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:m}=W(),h=l(()=>Qe(d,u),[d,u]),y=s(null),f=p===Q.Destination,[v,b]=i(!1),[S,x]=i(!1),{formData:C,formErrors:E,handleFormChange:T,resetFormData:N,validateForm:k,loadFormWithDrawerItem:w,yamlFields:$,setYamlFields:D,dynamicFields:A,setDynamicFields:I}=Nt({}),R=l(()=>{if(m)return h?.find(e=>H(e)===m)},[m,h]);if(o(()=>{f&&R?(D(kt(n,R)),w(R)):N()},[f,R,n]),!R)return null;const O=n.flatMap(e=>e.items).find(e=>e.type===R.destinationType.type),{icon:M,iconSrc:F}=O?qe(O?.type):{icon:void 0,iconSrc:void 0};return t(ni,{ref:y,title:R.name||R.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:F?[F]:void 0,isEdit:v,isFormDirty:S,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(k({withAlert:!0,alertTitle:Z.Update})){const t=e!==R.destinationType.displayName?e:"";T("name",t),a(m,{...C,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(m),b(!1),x(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),w(R)},isLastItem:1===h.length,children:v?t(lo,{children:t(so,{isUpdate:!0,categoryItem:O,formData:C,formErrors:E,handleFormChange:(...e)=>{x(!0),T(...e)},dynamicFields:A,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:k,testConnection:c})}):e(co,{children:[R.conditions?.length?t(J,{conditions:R.conditions}):null,t(Y,{title:g.DESTINATION_DETAILS,data:R?Za(R,$):[]})]})})},po=p.div`
|
|
276
|
-
display: flex;
|
|
277
|
-
flex-direction: column;
|
|
278
|
-
gap: 12px;
|
|
279
|
-
`,mo=({items:n,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=ht();return n.map(n=>{const s=n.name===Dt.EXISTS;return e(po,{children:[t(K,{size:"small",icon:n.icon,title:wt(n.name),description:n.description}),n.items.map(e=>{const l=`select-${n.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=$t(e.supportedSignals),{icon:d,iconSrc:u}=qe(e.type),p=e.selected||r.some(t=>t.id===e.id),m=!!o.find(t=>t===e.id),h=s?()=>a(e.id):()=>i(e);return t(Le,{"data-id":l,title:e.displayName,hoverText:yt.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:s,isChecked:p,isLoading:m,onCheckboxChange:()=>a(e.id)}},l)})]},`category-${n.name}`)})},ho=p.div`
|
|
280
|
-
display: flex;
|
|
281
|
-
flex-direction: column;
|
|
282
|
-
gap: 24px;
|
|
283
|
-
`,go=p.div`
|
|
284
|
-
display: flex;
|
|
285
|
-
align-items: center;
|
|
286
|
-
gap: 12px;
|
|
287
|
-
`,yo=p.div`
|
|
288
|
-
width: 170px;
|
|
289
|
-
margin-right: 8px;
|
|
290
|
-
`,fo=p.div`
|
|
291
|
-
display: flex;
|
|
292
|
-
flex-direction: column;
|
|
293
|
-
align-self: stretch;
|
|
294
|
-
gap: 24px;
|
|
295
|
-
max-height: calc(100vh - 450px);
|
|
296
|
-
overflow-y: auto;
|
|
297
|
-
|
|
298
|
-
@media (height < 800px) {
|
|
299
|
-
max-height: calc(100vh - 400px);
|
|
300
|
-
}
|
|
301
|
-
`,vo=p(ho)`
|
|
302
|
-
margin-top: 80px;
|
|
303
|
-
`,bo=Object.values(Dt).map(e=>({value:It[e].TITLE,id:e})),So=bo[0],xo=[Tt.Logs,Tt.Metrics,Tt.Traces],Co=(e,t,n)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=n.has(e.id);return{id:e.id,type:i,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces},profiles:{supported:e.exportedSignals.profiles}}}}),Eo=({hidden:n,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:s,isLoadingForDestinationIds:c})=>{const{destinations:d}=q(),{selectedStreamName:u}=Je(),{configuredDestinations:p,configuredDestinationsUpdateOnly:m}=ht(),[h,g]=i(""),[y,f]=i(So),[v,b]=i(xo),S=l(()=>{const e=At(a);return e.unshift({name:Dt.EXISTS,description:It[Dt.EXISTS].DESCRIPTION,icon:_n,items:Co(d,u,new Set(p.concat(m).map(e=>e.id)))}),e.unshift({name:Dt.DETECTED,description:It[Dt.DETECTED].DESCRIPTION,icon:Pn,items:o}),e.map(e=>{const t=e.items.filter(t=>{const n=!h||t.displayName.toLowerCase().includes(h.toLowerCase()),i="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=v.some(e=>t.supportedSignals[Rt[e]]?.supported);return n&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,h,y,v,u,p,m]);return n?null:e(ho,{children:[t(K,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(go,{children:[t(yo,{children:t(T,{placeholder:"Search...",icon:On,value:h,onChange:({target:{value:e}})=>g(e)})}),t(yo,{children:t(lt,{options:bo,value:y,onSelect:f,onDeselect:()=>{}})}),t(V,{title:"",selectedSignals:v,setSelectedSignals:b})]}),t(I,{}),S.length?t(fo,{children:t(mo,{items:S,onSelectNew:e=>r(e,v),onSelectConfigured:s,isLoadingForDestinationIds:c})}):t(vo,{children:t(De,{title:"No destinations found"})})]})},To=p.div`
|
|
304
|
-
display: flex;
|
|
305
|
-
`,No=p.div`
|
|
306
|
-
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
307
|
-
padding: 32px;
|
|
308
|
-
width: 200px;
|
|
309
|
-
@media (max-width: 1050px) {
|
|
310
|
-
display: none;
|
|
311
|
-
}
|
|
312
|
-
`,ko=({isOnboarding:n,categories:a,potentialDestinations:o,createDestination:r,updateDestination:s,deleteDestination:l,testConnection:c})=>{const{destinations:d}=q(),{selectedStreamName:u}=Je(),{currentModal:p,setCurrentModal:m}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:f,configuredDestinationsUpdateOnly:v}=ht(),b=p===Q.Destination,[S,x]=i(void 0),{formData:C,formErrors:E,handleFormChange:T,resetFormData:N,validateForm:k,setYamlFields:w,dynamicFields:$,setDynamicFields:D,loadFormWithDrawerItem:A}=Nt({supportedSignals:S?.supportedSignals,preLoadedFields:S?.fields}),[I,R]=i([]),O=e=>{const t={};return e||$.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:S.type,displayName:S.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1},profiles:{supported:!1}}}}},M=async e=>{if(n&&!e){const e=O();h(e)}else if(n&&e){const t=O(e);v.some(t=>t.id===e.id)?f(e):y(t)}else if(n||e){if(!n&&e){const t=O(e),n=t.dataStreamNames.some(e=>e===u);R(t=>[...t,e.id]),n?await l(e.id):await s(e.id,A(t)),R(t=>t.filter(t=>t!==e.id))}}else r(C)},F=()=>{N(),x(void 0),m("")},L=()=>{N(),x(void 0)},_=async()=>{if(S){if(!k({withAlert:!n,alertTitle:Z.Create}))return null;M()}F()};return ie({key:"Enter",active:b},()=>_()),t(ae,{isOpen:b,onClose:F,header:{title:g.ADD_DESTINATION},actionComponent:t(de,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:_}];return S&&e.unshift({label:"BACK",icon:()=>t(Kn,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(To,{children:[t(No,{children:t(Ot,{currentStep:S?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(oe,{style:{margin:"32px 24px 12px 24px"},children:[t(Eo,{hidden:void 0!==S,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{N(),T("type",e?.type||""),T("currentStreamName",u);const n={logs:!1,metrics:!1,traces:!1,profiles:!1};t.filter(t=>e.supportedSignals[Rt[t]].supported).forEach(e=>n[Rt[e]]=!0),T("exportedSignals",n),w(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:I}),S&&t(so,{categoryItem:S,formData:C,formErrors:E,handleFormChange:T,dynamicFields:$,setDynamicFields:D,validateForm:k,testConnection:c})]})]})})},wo=p.div`
|
|
313
|
-
display: flex;
|
|
314
|
-
flex-direction: column;
|
|
315
|
-
align-items: center;
|
|
316
|
-
gap: 12px;
|
|
317
|
-
width: 100%;
|
|
318
|
-
max-height: calc(100vh - 310px);
|
|
319
|
-
height: fit-content;
|
|
320
|
-
overflow-y: scroll;
|
|
321
|
-
`,$o=({categories:e,withDelete:n})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=ht();return i.length||a.length?t(wo,{children:i.concat(a).map((o,r)=>t(Do,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:kt(e,o),isLastItem:i.length+a.length===1,withDelete:n},`configured-destination-${o.destinationType.type}-${r}`))}):t($e,{children:t(De,{title:"No destinations",subTitle:"Please add a destination"})})},Do=({item:a,yamlFields:o,isLastItem:r,withDelete:s})=>{const[c,d]=i(!1),{icon:u,iconSrc:p}=qe(a.destinationType.type),{removeConfiguredDestination:m,removeConfiguredDestinationUpdateOnly:h}=ht(),g=l(()=>xt(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(n,{children:[t(Le,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Ve(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Mt,{data:g})},renderActions:s?()=>t(M,{onClick:()=>d(!0),children:t(wn,{})}):void 0}),s&&t(vt,{isOpen:c,name:a.destinationType.displayName||a.name,type:Q.Destination,isLastItem:r,onApprove:()=>{a.id?h(a):m(a)},onDeny:()=>d(!1)})]})},Ao=p(Me)`
|
|
322
|
-
display: flex;
|
|
323
|
-
align-items: center;
|
|
324
|
-
justify-content: center;
|
|
325
|
-
gap: 8px;
|
|
326
|
-
width: 100%;
|
|
327
|
-
padding: 32px;
|
|
328
|
-
border-radius: 16px;
|
|
329
|
-
border-style: dashed !important;
|
|
330
|
-
`,Io=({isSourcesListEmpty:i,goToSources:a,categories:o,potentialDestinations:r,testConnection:s,onClickSummary:l})=>{const c=h(),{setCurrentModal:d}=te(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=ht();return e(n,{children:[t(oe,{$isNotModal:!0,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[l&&t(bt,{onClick:l}),t(K,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),i&&t(re,{type:se.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(Ao,{variant:"secondary",onClick:()=>d(Q.Destination),children:[t(In,{}),t(U,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t($o,{categories:o,withDelete:!0})]})}),t(ko,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:s})]})},Ro=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Oo=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),r=fe(),{selectedStreamName:s}=Je(),{setDrawerType:c,setDrawerEntityId:d}=W(),{destinations:u,destinationsLoading:p}=q(),m=l(()=>Qe(u,s),[u,s]),y=l(()=>Ki({instrumentationRules:[],sources:[],actions:[],destinations:et(m,r),searchText:r.searchText,selectedCategory:Q.Destination}).searchResults.find(({category:e})=>e===Q.Destination)?.entities||[],[m,r]),f=l(()=>y.map(e=>{const{hasErrors:i,hasWarnings:a,hasDisableds:r}=ue(e.conditions||[]),{icon:s,iconSrc:l}=qe(e.destinationType.type);return{status:i?se.Error:a?se.Warning:void 0,faded:r,onClick:()=>{c(Q.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:s,src:l})},{columnKey:"name",value:Se(e,Q.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:ze(Ft(n,Q.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:Ve(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(_i,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(pe,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,n]),{badge:v,badgeTooltip:b}=l(()=>y.length!==m.length?{badge:`${y.length}/${m.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[y,m]);return e(Ce,{$maxWidth:a,children:[t(Ee,{children:t(Te,{icon:Ne(Q.Destination),title:g.DESTINATIONS,badge:v,badgeTooltip:b,loading:p})}),t(ke,{$maxHeight:i,children:t(we,{columns:Ro,rows:f})}),!y.length&&t($e,{style:{marginTop:"2rem"},children:t(De,{})})]})},Mo=e=>{const{type:t,ruleName:n,notes:i,disabled:a,profileName:o,payloadCollection:r,codeAttributes:s,headersCollection:l,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:n},{title:g.NOTES,value:i},{title:g.MANAGED_BY_PROFILE,value:o},{type:y.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=Object.entries(s).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=(l[Lt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Pt.Java]||[]).map(e=>new _t(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Pt.Golang]||[]).map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},Fo=p.div`
|
|
331
|
-
display: flex;
|
|
332
|
-
flex-direction: column;
|
|
333
|
-
gap: 12px;
|
|
334
|
-
margin-top: 8px;
|
|
335
|
-
${({$hasError:e})=>e&&m`
|
|
336
|
-
border: 1px solid ${({theme:e})=>e.text.error};
|
|
337
|
-
border-radius: 16px;
|
|
338
|
-
padding: 8px;
|
|
339
|
-
`}
|
|
340
|
-
`,Lo=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],_o=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Po={[Pt.Java]:[new _t("","")],[Pt.Golang]:[new Kt("")]},Ko=["*"],jo=p.div`
|
|
341
|
-
display: flex;
|
|
342
|
-
flex-direction: column;
|
|
343
|
-
gap: 12px;
|
|
344
|
-
margin-top: 8px;
|
|
345
|
-
${({$hasError:e})=>e&&m`
|
|
346
|
-
border: 1px solid ${({theme:e})=>e.text.error};
|
|
347
|
-
border-radius: 16px;
|
|
348
|
-
padding: 8px;
|
|
349
|
-
`}
|
|
350
|
-
`,Vo=[{id:Vt.HttpRequest,label:"Collect HTTP Request"},{id:Vt.HttpResponse,label:"Collect HTTP Response"},{id:Vt.DbQuery,label:"Collect DB Query"},{id:Vt.Messaging,label:"Collect Messaging"}],zo={[zt.CodeAttributes]:({value:a,setValue:r,formErrors:s})=>{const c=s.codeAttributes,d=l(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[u,p]=i(1===d.length);o(()=>{if(!d.length){const e={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const m=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(jt).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});r("codeAttributes",i),p(1===n.length)};return e(n,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(Fo,{$hasError:!!c,children:Lo.map(({id:e,label:n,tooltip:i})=>t(ge,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!c&&t(E,{children:c})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Fo,{$hasError:!!c,children:_o.map(({id:e,label:n,tooltip:i})=>t(ge,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!c&&t(E,{children:c})]})]})},[zt.CustomInstrumentation]:({value:n,setValue:i,formErrors:a})=>{const r=a.customInstrumentations,s=l(()=>(n?.customInstrumentations?.[Pt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[n]),c=l(()=>(n?.customInstrumentations?.[Pt.Golang]||[]).map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=(e,t)=>{const n={};switch(t){case"java":n[Pt.Java]=e.map(e=>new _t(e.className,e.methodName)),n[Pt.Golang]=c.map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":n[Pt.Golang]=e.map(e=>new Kt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),n[Pt.Java]=s.map(({key:e,value:t})=>new _t(e,t))}i("customInstrumentations",n)};return o(()=>{n?.customInstrumentations||i("customInstrumentations",{[Pt.Golang]:Po[Pt.Golang],[Pt.Java]:Po[Pt.Java]})},[i,n]),e("div",{children:[t(w,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:c,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:s,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[zt.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const a=i.headersCollection,r=l(()=>e?.headersCollection?.[Lt.HeaderKeys]||[],[e]),s=e=>{const t={[Lt.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||s(Ko)},[r]),t("div",{children:r.length>0&&t(A,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:a})})},[zt.PayloadCollection]:({value:n,setValue:a,formErrors:r})=>{const s=r.payloadCollection,c=l(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]),[d,u]=i(1===c.length);o(()=>{if(!c.length){const e={[Vt.HttpRequest]:{},[Vt.HttpResponse]:{},[Vt.DbQuery]:{},[Vt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]);return e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(jo,{$hasError:!!s,children:Vo.map(({id:e,label:n})=>t(C,{title:n,disabled:d&&c.includes(e),value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[Vt.HttpRequest]:n.includes(Vt.HttpRequest)?{}:null,[Vt.HttpResponse]:n.includes(Vt.HttpResponse)?{}:null,[Vt.DbQuery]:n.includes(Vt.DbQuery)?{}:null,[Vt.Messaging]:n.includes(Vt.Messaging)?{}:null};a("payloadCollection",i),u(1===n.length)})(e,t)},e))}),!!s&&t(E,{children:s})]})},[zt.UnknownType]:null},Uo=({ruleType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=zo[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},qo=p.div`
|
|
351
|
-
display: flex;
|
|
352
|
-
flex-direction: column;
|
|
353
|
-
gap: 24px;
|
|
354
|
-
padding: 4px;
|
|
355
|
-
`,Wo=p(U)`
|
|
356
|
-
margin-bottom: 12px;
|
|
357
|
-
`,Bo=({isUpdate:i,rule:a,formData:o,formErrors:r,handleFormChange:s})=>{const l=h();return e(qo,{children:[t(O,{children:a.supportedLanguages.map(e=>t(Ut,{icon:qt(e),type:se.Info,children:ct[e]},e))}),i?e("div",{children:[t(Wo,{children:"Status"}),t(_,{options:[{icon:$n,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+P["050"]},{icon:Dn,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+P["050"]}],selected:o.disabled,setSelected:e=>s("disabled",e)})]}):e(n,{children:[t(K,{title:"",description:a.docsDescription,actionButton:t(j,{endpoint:a.docsEndpoint})}),t(T,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:r.ruleName})]}),t(Uo,{ruleType:a.type,value:o,setValue:(e,t)=>s(e,t),formErrors:r}),t(z,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:r.notes})]})},Ho=p.div`
|
|
358
|
-
width: 100%;
|
|
359
|
-
height: 100%;
|
|
360
|
-
max-height: calc(100vh - 220px);
|
|
361
|
-
overflow: overlay;
|
|
362
|
-
overflow-y: auto;
|
|
363
|
-
`,Go=p.div`
|
|
364
|
-
display: flex;
|
|
365
|
-
flex-direction: column;
|
|
366
|
-
gap: 12px;
|
|
367
|
-
`,Jo=({updateInstrumentationRule:n,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=q(),{addNotification:c}=Wt(),{drawerType:d,drawerEntityId:u}=W(),p=s(null),m=d===Q.InstrumentationRule,[h,g]=i(!1),[y,f]=i(!1),{formData:v,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=Bt(),T=l(()=>{if(u)return r?.find(e=>H(e)===u)},[u,r]);if(o(()=>{m&&T?E(T):x()},[m,T]),!T)return null;const N=Ht.find(({type:e})=>e===T.type);return t(ni,{ref:p,title:T.ruleName||T.type,icons:[Ue(T.type)],isEdit:h,isFormDirty:y,onEdit:e=>{T.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):c({type:se.Warning,title:le.FORBIDDEN,message:le.CANNOT_EDIT_RULE,crdType:Q.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(C()){const t=e!==T.type?e:"";S("ruleName",t),n(u,{...v,ruleName:t}),g(!1),f(!1)}},onDelete:()=>{T.mutable?(a(u),g(!1),f(!1),p.current?.closeDrawer()):c({type:se.Warning,title:le.FORBIDDEN,message:le.CANNOT_DELETE_RULE,crdType:Q.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),f(!1),E(T)},children:h&&N?t(Ho,{children:t(Bo,{isUpdate:!0,rule:N,formData:v,formErrors:b,handleFormChange:(...e)=>{f(!0),S(...e)}})}):e(Go,{children:[t(J,{conditions:T.conditions||[]}),t(Y,{title:"Instrumentation Rule Details",data:T?Mo(T):[]})]})})},Yo=p(R)`
|
|
368
|
-
margin-top: 24px;
|
|
369
|
-
gap: 12px;
|
|
370
|
-
`,Xo=Ht,Qo=({createInstrumentationRule:n})=>{const{tier:a}=ee(),o=a===Gt.Onprem,{currentModal:r,setCurrentModal:s}=te(),l=r===Q.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=Bt(),[h,y]=i(void 0),f=()=>{p(),y(void 0),s("")},v=()=>{if(!m())return null;n(c),f()};return ie({key:"Enter",active:l},()=>v()),t(ae,{isOpen:l,onClose:f,header:{title:"Add Instrumentation Rule"},actionComponent:t(de,{buttons:[{variant:"primary",label:"DONE",onClick:v,disabled:!o||!h,tooltip:o?"":le.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(oe,{children:[t(K,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Yo,{children:[t(re,o?{type:se.Warning,message:le.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:se.Default,message:le.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(ce,{options:Xo,selectedOption:h,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!h?.type})]}),h?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(Bo,{rule:h,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Zo=e=>{const{payloadCollection:t,codeAttributes:n,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&(a+=Object.entries(n).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(Pt).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},er=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],tr=({maxHeight:n,maxWidth:i})=>{const a=h(),o=fe(),{setDrawerType:r,setDrawerEntityId:s}=W(),{instrumentationRules:c,instrumentationRulesLoading:d}=q(),u=l(()=>Ki({instrumentationRules:c,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:Q.InstrumentationRule}).searchResults.find(({category:e})=>e===Q.InstrumentationRule)?.entities||[],[c,o]),p=l(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=ue(e.conditions||[]);return{status:n?se.Error:i?se.Warning:void 0,faded:o,onClick:()=>{r(Q.InstrumentationRule),s(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(be,{icon:Ue(e.type)})},{columnKey:"name",value:Se(e,Q.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"profile",value:e.profileName,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Zo(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(_i,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(pe,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(pe,{status:se.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:m,badgeTooltip:y}=l(()=>u.length!==c.length?{badge:`${u.length}/${c.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:c.length,badgeTooltip:void 0},[u,c]);return e(Ce,{$maxWidth:i,children:[t(Ee,{children:t(Te,{icon:Ne(Q.Action),title:g.INSTRUMENTATION_RULES,badge:m,badgeTooltip:y,loading:d})}),t(ke,{$maxHeight:n,children:t(we,{columns:er,rows:p})}),!u.length&&t($e,{style:{marginTop:"2rem"},children:t(De,{})})]})},nr=p.div`
|
|
371
|
-
position: fixed;
|
|
372
|
-
bottom: 0;
|
|
373
|
-
left: 50%;
|
|
374
|
-
transform: translate(-50%, 100%);
|
|
375
|
-
z-index: 1000;
|
|
376
|
-
display: flex;
|
|
377
|
-
align-items: center;
|
|
378
|
-
gap: 12px;
|
|
379
|
-
padding: 8px 24px;
|
|
380
|
-
border-radius: 32px;
|
|
381
|
-
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
|
-
animation-name: ${Yt.in.center};
|
|
384
|
-
`,ir=({totalSourceCount:n,uninstrumentSources:a,restartWorkloads:o})=>{const s=h(),{selectedSources:c,setSelectedSources:d}=Fe(),[u,p]=i(!1),[m,g]=i(!1),y=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),f=()=>{d({})};return y?e(r,{children:[e(nr,{"data-id":"multi-source-control",children:[t(U,{children:"Selected sources"}),t(Ie,{label:y,filled:!0}),t(I,{orientation:"vertical",length:"16px"}),t(Me,{variant:"tertiary",onClick:f,children:t(U,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Me,{variant:"tertiary",onClick:()=>g(!0),children:[t(jn,{}),t(U,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Me,{variant:"tertiary",onClick:()=>p(!0),children:[t(wn,{}),t(U,{family:"secondary",decoration:"underline",color:s.text.error,children:"Uninstrument"})]})]}),t(vt,{isOpen:u,name:`${y} sources`,type:Q.Source,isLastItem:y===n,onApprove:()=>{const e={};Object.entries(c).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),a(e),p(!1),f()},onDeny:()=>p(!1)}),t(Jt,{isOpen:m,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.filter(e=>e.kind!==Xt.StaticPod).map(e=>Qt(e)))}),o(e),g(!1),f()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},ar=p.div`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useTheme as n}from"styled-components";import{c as o,d as s,I as c,P as d,e as l,T as p,F as g,f as h,h as u,i as m,S as y,j as f,k as v,l as x,m as b,n as w,E as N,o as k,p as T,q as $,r as K,s as C,t as M,v as z,w as E,x as I}from"./chunks/ui-components-rpRyPe3l.js";import{NotificationIcon as R,TrashIcon as G,UserIcon as _,ImageErrorIcon as D,ChevronDownIcon as V,ChevronRightIcon as A}from"./icons.js";export{O as OverviewDrawer,S as SourceDrawer,a as SourceForm}from"./chunks/index-ChkHWnzu.js";import{useState as j,useRef as q,useCallback as P,useEffect as B}from"react";import{MarkerType as L,useNodesState as F,useEdgesState as W}from"@xyflow/react";import{E as H}from"./chunks/vendor-C150cdxb.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";import"./chunks/index-D6SlbWIi.js";const U=i.div`
|
|
385
2
|
position: relative;
|
|
386
3
|
width: fit-content;
|
|
387
|
-
`,
|
|
4
|
+
`,X=i(f)`
|
|
388
5
|
gap: 12px;
|
|
389
6
|
padding: 0 12px;
|
|
390
|
-
`,
|
|
7
|
+
`,J=i(g)`
|
|
391
8
|
gap: 12px;
|
|
392
9
|
max-height: 400px;
|
|
393
10
|
overflow-y: auto;
|
|
394
|
-
`,
|
|
11
|
+
`,Q=i.div`
|
|
395
12
|
position: absolute;
|
|
396
13
|
bottom: 0;
|
|
397
14
|
left: 0;
|
|
@@ -400,19 +17,19 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
400
17
|
border-radius: 0 0 24px 24px;
|
|
401
18
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
402
19
|
pointer-events: none;
|
|
403
|
-
`,
|
|
20
|
+
`,Y=i(p)`
|
|
404
21
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
405
22
|
color: ${({theme:e})=>e.text.primary};
|
|
406
23
|
border-radius: 32px;
|
|
407
24
|
width: fit-content;
|
|
408
25
|
padding: 2px 8px;
|
|
409
|
-
`,
|
|
26
|
+
`,Z=()=>{const r=n(),{notifications:i,markAsSeen:a}=o(),g=i.filter(({hideFromHistory:e})=>!e),h=g.filter(({seen:e})=>!e),u=h.length,{popupRef:m,popupOpen:y,setPopupOpen:f,popupPosition:v,handlePosition:x}=s({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{u&&h.forEach(({id:e})=>a(e))}});return e(U,{children:[t(c,{onClick:()=>{x(0,0),f(e=>!e)},tooltip:"Notifications",withPing:!!u,pingColor:r.colors.orange_og,children:t(R,{size:18})}),e(d,{ref:m,isOpen:y,right:v.left,maxWidth:"400px",header:e(X,{children:[t(p,{size:20,children:"Notifications"}),!!u&&e(Y,{size:12,family:"secondary",children:[u," new"]})]}),children:[t(J,{children:g.length?g.map(e=>t(oe,{...e,onClick:()=>f(!1)},`notification-${e.id}`)):t(l,{title:"No notifications",subTitle:""})}),t(Q,{})]})]})},ee=i.div`
|
|
410
27
|
display: flex;
|
|
411
28
|
align-items: flex-start;
|
|
412
29
|
gap: 12px;
|
|
413
30
|
padding: 16px;
|
|
414
31
|
border-radius: 16px;
|
|
415
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
32
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+v["080"]};
|
|
416
33
|
cursor: not-allowed;
|
|
417
34
|
&.click-enabled {
|
|
418
35
|
cursor: pointer;
|
|
@@ -420,30 +37,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
420
37
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
421
38
|
}
|
|
422
39
|
}
|
|
423
|
-
`,
|
|
424
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+
|
|
40
|
+
`,te=i.div`
|
|
41
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+v["015"]};
|
|
425
42
|
border-radius: 8px;
|
|
426
43
|
width: 36px;
|
|
427
44
|
height: 36px;
|
|
428
45
|
display: flex;
|
|
429
46
|
align-items: center;
|
|
430
47
|
justify-content: center;
|
|
431
|
-
`,
|
|
48
|
+
`,re=i.div`
|
|
432
49
|
width: 290px;
|
|
433
|
-
`,
|
|
50
|
+
`,ie=i.div`
|
|
434
51
|
margin-bottom: 6px;
|
|
435
|
-
`,
|
|
52
|
+
`,ne=i.div`
|
|
436
53
|
display: flex;
|
|
437
54
|
align-items: center;
|
|
438
55
|
gap: 6px;
|
|
439
|
-
`,
|
|
56
|
+
`,oe=({id:i,seen:o,type:a,title:s,message:c,time:d,crdType:l,target:g,onClick:f})=>{const v=n(),{formatTimeAgo:b}=h(),{onClickNotification:w}=u(),S=!!l&&!!g,N=s?.toLowerCase().includes(m.Delete.toLowerCase())||!1,k=x(a,v);return e(ee,{className:S?"click-enabled":"",onClick:()=>{S&&(f(),w({id:i,crdType:l,target:g}))},children:[t(te,{$type:N?y.Error:a,children:t(N?G:k,{})}),e(re,{children:[t(ie,{children:t(p,{size:14,children:c})}),e(ne,{children:[t(p,{size:10,color:v.text.grey,children:b(d)}),!o&&e(r,{children:[t(p,{size:10,children:"·"}),t(p,{size:10,color:v.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},ae=e=>`${N.Source}-${e}-${b.MapItem}`,se=(e,t,r)=>{const i=e.isVirtual,n=r?[_]:i?[k(e)]:t?T(t):[D],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:$(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:o,aggService:e}},ce=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),de=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=ae(t.graphKey),o=n.get(r);if(!o)continue;const a=o.data?.status===y.Error;for(const o of t.connections){const s=ae(o.targetGraphKey);n.has(s)&&i.push({id:`${r}-to-${s}`,type:"smoothstep",source:r,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:L.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return i},le=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},pe=new H,ge=`${N.Source}-user-${b.MapItem}`,he={"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"},ue=i.div`
|
|
440
57
|
padding: 8px 0;
|
|
441
|
-
`,
|
|
58
|
+
`,me=i.div`
|
|
442
59
|
display: flex;
|
|
443
60
|
gap: 12px;
|
|
444
61
|
align-items: center;
|
|
445
62
|
padding: 4px 0 4px 16px;
|
|
446
|
-
`,
|
|
63
|
+
`,ye=i.button`
|
|
447
64
|
display: flex;
|
|
448
65
|
align-items: center;
|
|
449
66
|
gap: 4px;
|
|
@@ -457,67 +74,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
457
74
|
&:hover {
|
|
458
75
|
text-decoration: underline;
|
|
459
76
|
}
|
|
460
|
-
`,
|
|
77
|
+
`,fe=i.div`
|
|
461
78
|
padding: 4px 0 8px;
|
|
462
|
-
|
|
79
|
+
`,ve=({conn:r,onToggle:i,isExpanded:n})=>{const o=r.details.length>0;return t(ue,{children:e(f,{$justifyContent:"space-between",$alignItems:"center",children:[t(p,{size:14,weight:500,children:r.targetServiceName}),o&&e(ye,{onClick:i,children:[t(n?V:A,{size:12}),n?"hide attributes":`${r.details.length} attribute${r.details.length>1?"s":""}`]})]})})},xe=({conn:e})=>{const i=n();return t(r,{children:e.details.map(e=>t(me,{children:t(p,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},be=({connections:i,isVirtual:o,attributes:a})=>{const[s,c]=j(new Set),d=n();if(o){const i=Object.entries(a||{});return e(r,{children:[t(p,{size:12,color:d.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(r,{children:[t(fe,{style:{paddingTop:16},children:t(p,{size:11,color:d.text.info,children:"Attributes"})}),i.map(([r,i])=>e(me,{children:[t(p,{size:12,color:d.text.secondary,children:r}),t(p,{size:12,children:i})]},r))]})]})}return i.length?e(r,{children:[t(fe,{children:t(p,{size:11,color:d.text.info,children:"Connected services"})}),i.map(r=>e("div",{children:[t(ve,{conn:r,isExpanded:s.has(r.targetGraphKey),onToggle:()=>{return e=r.targetGraphKey,void c(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e}}),s.has(r.targetGraphKey)&&t(xe,{conn:r}),t(C,{})]},r.targetGraphKey))]}):t(p,{size:12,color:d.text.info,children:"No outgoing connections"})},we=({conn:i})=>{const o=n();return i?t(r,{children:i.details.length>0?e(r,{children:[t(fe,{children:t(p,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(me,{children:t(p,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(p,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(p,{size:12,color:o.text.info,children:"No data for this connection"})},Se=({drawerState:e,aggregatedData:r,onClose:i})=>{if(!e)return null;const n=new Map(r.map(e=>[e.graphKey,e]));let o="",a="",s=null;if("node"===e.type){const r=n.get(e.graphKey);o=r?.serviceName||e.graphKey,a=r?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=t(be,{connections:r?.connections||[],isVirtual:r?.isVirtual,attributes:r?.attributes})}else{const r=n.get(e.sourceKey),i=r?.connections.find(t=>t.targetGraphKey===e.targetKey);o=`${r?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,a="Connection details",s=t(we,{conn:i})}return t(K,{isOpen:!0,width:"420px",position:"right",header:{title:o,subTitle:a,onClose:i},children:s})},Ne=i.div`
|
|
463
80
|
width: 100%;
|
|
464
81
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
465
82
|
position: relative;
|
|
466
|
-
`,
|
|
467
|
-
width: 100%;
|
|
468
|
-
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
469
|
-
border-radius: 16px;
|
|
470
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+P["024"]:t.colors.dropdown_bg_2+P["040"]};
|
|
471
|
-
`,jr=p.div`
|
|
472
|
-
display: flex;
|
|
473
|
-
justify-content: space-between;
|
|
474
|
-
gap: 12px;
|
|
475
|
-
margin: 0;
|
|
476
|
-
padding: 18px;
|
|
477
|
-
border-radius: 16px;
|
|
478
|
-
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
479
|
-
&:hover {
|
|
480
|
-
background-color: ${({$withClick:e,$selected:t,theme:n})=>e&&(t?n.colors.majestic_blue+P["040"]:n.colors.dropdown_bg_2+P["080"])};
|
|
481
|
-
transition: background-color 0.3s;
|
|
482
|
-
}
|
|
483
|
-
`,Vr=p(jr)`
|
|
484
|
-
width: calc(100% - 100px);
|
|
485
|
-
margin: 0 auto;
|
|
486
|
-
padding: 8px;
|
|
487
|
-
`,zr=p.div`
|
|
488
|
-
position: relative;
|
|
489
|
-
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
490
|
-
`,Ur=p.div`
|
|
491
|
-
position: absolute;
|
|
492
|
-
top: 6px;
|
|
493
|
-
left: 18px;
|
|
494
|
-
`,qr=p($e)`
|
|
495
|
-
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
496
|
-
`,Wr=p.div`
|
|
497
|
-
width: ${({$width:e})=>`${e||42}px`};
|
|
498
|
-
display: flex;
|
|
499
|
-
align-items: center;
|
|
500
|
-
justify-content: flex-end;
|
|
501
|
-
text-align: right;
|
|
502
|
-
`,Br=Ne(Q.Namespace),Hr=({isModal:n=!1,withInstances:i=!0,loading:a,filteredNamespacesAndSources:o,selectedNamespace:r,onSelectNamespace:s,selectedSources:l,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=h(),{isVm:m}=ee(),{namespacesLoading:y}=q(),f=Object.entries(o||{});return f?.length?t(je,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:f.map(([n,o])=>{const h=l?.[n]||[],f=d?.[n]?.selected||!1,v=h.filter(({selected:e})=>e),b=h.length>0,S=r===n,x=v.length>0&&v.length===o.length,E=v.length>0&&v.length!==o.length,T=o.length>0,N=1===o.length;return s||T?e(Kr,{"data-id":`namespace-${n}`,$selected:x,$isOpen:S,children:[e(jr,{$selected:x,$withClick:!!s,onClick:()=>s?.(n),children:[e(O,{$gap:12,children:[s&&t(C,{partiallyChecked:E,value:x,onChange:e=>s(n,e)}),t(Br,{}),t(U,{children:n})]}),e(O,{$gap:24,children:[!m&&u&&t($,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,n),flipHorizontally:!0}),t(Wr,{children:t(U,{size:10,color:p.text.grey,children:b?`${v.length}/${o.length}`:null})}),s&&t(ft,{extend:S})]})]}),(S||!s)&&(T?e(zr,{$addPadding:!c,children:[t(Ur,{children:t(I,{orientation:"vertical",length:(N?24:34*o.length)+"px"})}),o.map(e=>{const a=v.some(({name:t})=>t===e.name);return t(Gr,{withInstances:i,source:e,namespace:n,isSelected:a,onSelect:c},`source-${e.name}`)})]}):t(qr,{$addPadding:!c,children:y||a?t(Oe,{}):t(De,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t($e,{children:y||a?t(Oe,{}):t(De,{title:g.NO_SOURCES,subTitle:!m&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},Gr=({withInstances:n,source:i,namespace:a,isSelected:o,onSelect:r})=>{const{tier:s}=ee(),l=s!==Gt.Onprem&&!!i.kind&&sn.has(i.kind);return t(Vr,{"data-id":`source-${i.name}`,$selected:!l&&o,$withClick:!l&&!!r,onClick:()=>!l&&r?.(i),style:l?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(C,{value:!l&&o,onChange:()=>!l&&r(i,a)}),e(O,{$gap:4,children:[t(U,{children:i.name}),e(U,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,l?" • Enterprise only":""]})]})]})})},Jr=p.div`
|
|
503
|
-
display: flex;
|
|
504
|
-
flex-direction: column;
|
|
505
|
-
align-items: center;
|
|
506
|
-
gap: 12px;
|
|
507
|
-
width: 100%;
|
|
508
|
-
max-height: calc(100vh - 200px);
|
|
509
|
-
height: fit-content;
|
|
510
|
-
overflow-y: scroll;
|
|
511
|
-
`,Yr=({onEditStream:n,onEditSources:i,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Je(),{configuredSources:s,configuredDestinations:c,configuredDestinationsUpdateOnly:d}=ht(),u=l(()=>Object.values(s).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[s]);return t(oe,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(K,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Jr,{children:[t(Y,{title:g.STREAM_NAME,action:()=>t(ln,{onClick:n}),data:[{title:"",value:r}]}),t(Y,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ln,{onClick:i}),children:t(Hr,{filteredNamespacesAndSources:s,withInstances:!1})}),t(Y,{title:g.SELECTED_DESTINATIONS,titleBadge:c.length+d.length,action:()=>t(ln,{onClick:a}),children:t($o,{categories:o})})]})]})})};var Xr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Xr||(Xr={}));const Qr=({onClickId:e,defaultSelectedId:n,extendedNavIcons:a})=>{const{isVm:o}=ee(),[r,s]=i(n||""),c=l(()=>[{id:Xr.Overview,icon:Bn,selected:r===Xr.Overview,onClick:()=>{s(Xr.Overview),e(Xr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const t=[{id:Xr.Sources,icon:Hn,selected:r===Xr.Sources,onClick:()=>{s(Xr.Sources),e(Xr.Sources)},tooltip:"Sources"},{id:Xr.Destinations,icon:Gn,selected:r===Xr.Destinations,onClick:()=>{s(Xr.Destinations),e(Xr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:Xr.InstrumentationRules,icon:Jn,selected:r===Xr.InstrumentationRules,onClick:()=>{s(Xr.InstrumentationRules),e(Xr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Xr.Actions,icon:Yn,selected:r===Xr.Actions,onClick:()=>{s(Xr.Actions),e(Xr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(cn,{orientation:"vertical",mainIcons:c,subIcons:d})},Zr=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Xn,{})}),es=p.div`
|
|
512
|
-
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
513
|
-
width: 100%;
|
|
514
|
-
`,ts=d(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:a},o)=>{const r=h(),{isVm:s}=ee(),l=dn({fetchNamespacesWithWorkloads:i}),{selectedSources:c,loading:d,selectedAllNamespaces:p,onSelectAllNamespaces:m,getApiSourcesPayload:y,getApiFutureAppsPayload:f,searchText:v,setSearchText:b,searchBy:S,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:E,showRunningOnly:N,setShowRunningOnly:k}=l;u(o,()=>({getFormValues:()=>({apps:y(),futureApps:f()})}));const w=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(oe,{$isNotModal:!n,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[a&&t(bt,{onClick:a}),t(K,{title:g.SELECT_SOURCES,badgeLabel:w,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(es,{$fullWidth:s,children:t(T,{placeholder:S===Q.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:On,value:v,onChange:e=>b(e.target.value.toLowerCase())})}),!s&&t(_,{options:[{label:g.SOURCE,value:Q.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:Q.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:S,setSelected:x})]}),e(O,{$gap:36,children:[t($,{title:g.SELECT_ALL,initialValue:p,onChange:m,disabled:d}),t($,{title:g.ONLY_SELECTED,initialValue:C,onChange:E}),t($,{title:g.ONLY_RUNNING_INSTANCES,initialValue:N,onChange:k})]})]}),t(I,{}),t(Hr,{isModal:n,...l})]})})});ts.displayName=ts.name;const ns=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:a}=te(),o=i===Q.Source,r=()=>{a("")},l=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=s(null);return ie({key:"Enter",active:o},l),o?t(ae,{isOpen:o,onClose:r,header:{title:"Add Source"},actionComponent:t(de,{buttons:[{label:"DONE",variant:"primary",onClick:l}]}),children:t(ts,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},is=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},as=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),{isVm:r}=ee(),s=fe(),{selectedStreamName:d}=Je(),u=q(e=>e.sources),p=q(e=>e.sourcesLoading),{setDrawerType:m,setDrawerEntityId:y}=W(),{selectedSources:f,setSelectedSources:v}=Fe(),{progress:b}=Be(),S=l(()=>b[He.Instrumenting]||b[He.Uninstrumenting]?b[He.Instrumenting]?.percentage||b[He.Uninstrumenting]?.percentage||0:void 0,[b[He.Instrumenting],b[He.Uninstrumenting]]),x=l(()=>Xe(u,d),[u,d]),E=l(()=>Ki({instrumentationRules:[],sources:Ze(x,s),actions:[],destinations:[],searchText:s.searchText,selectedCategory:Q.Source}).searchResults.find(({category:e})=>e===Q.Source)?.entities||[],[x,s]),[T,N]=l(()=>{let e=0;return Object.values(f).forEach(t=>{e+=t.length}),[0!==e,e]},[f]),k=c(e=>{if(e){const e={};E.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),v(e)}else v({})},[E]),w=c(e=>{const{namespace:t,name:n,kind:i}=e,a={...f};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===n&&e.kind===i);-1===o?a[t].push(e):a[t].splice(o,1),v(a)},[f]),$=l(()=>E.map(i=>{const a=Qt(i),r=Ke(a),{hasErrors:s,hasWarnings:l,hasDisableds:c}=ue(i.conditions||[]),d=!!f[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:s?se.Error:l?se.Warning:void 0,faded:c,onClick:()=>{m(Q.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(C,{value:d,onChange:()=>w(i)}),t(un,{icons:We(i),id:r})]})},{columnKey:"name",value:Se(i,Q.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:o.text.info},{columnKey:"namespace",value:i.namespace,textColor:o.text.info},{columnKey:"throughput",value:ze(Ft(n,Q.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(_i,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(pe,{status:se.Info,title:pn(i.containers),withBorder:!0})})}]}}),[E,f,n,w]),{badge:D,badgeTooltip:A}=l(()=>E.length!==x.length?{badge:`${E.length}/${x.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:x.length,badgeTooltip:void 0},[E,x]);return e(Ce,{$maxWidth:a,children:[e(Ee,{children:[t(C,{partiallyChecked:T&&E?.length!==N,value:T&&E?.length===N,onChange:k,disabled:!E?.length}),t(Te,{icon:Ne(Q.Source),title:g.SOURCES,badge:D,badgeTooltip:A,loading:p||"number"==typeof S})]}),t(ke,{$maxHeight:i,children:t(we,{columns:is(r),rows:$})}),"number"!=typeof S||$.length?$.length?null:t($e,{style:{marginTop:"2rem"},children:t(De,{})}):e($e,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ae,{width:420}),e(O,{$gap:16,children:[e(U,{color:o.text.info,children:[b[He.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Ie,{label:`${S}%`})]})]})]})},os=({expiresAt:t})=>{const n=h(),{formatTimeAgo:i}=Zt(),a=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=mn(t,0)?n.text.error:mn(t,6048e5)?n.text.warning:n.text.success;return e(U,{size:14,color:r,children:[a," (",o,")"]})},rs=p.div`
|
|
515
|
-
position: relative;
|
|
516
|
-
`,ss=({token:n,saveToken:a})=>{const{CopyButton:o}=hn(),{formData:r,handleFormChange:s,resetFormData:l}=gn({token:n}),[c,d]=i(!1),u=()=>{d(!1),l()};return e(O,{$gap:0,children:[t(o,{value:n,size:yn.L}),t(I,{orientation:"vertical",length:"12px"}),e(rs,{children:[t(M,{size:32,onClick:()=>{d(!0)},children:t(Ln,{})}),c&&t(fn,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(T,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)})})]})]})},ls=({tokens:e,saveToken:n})=>t(Y,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:i,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Qn},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(os,{expiresAt:a})},{columnKey:"actions",component:()=>t(ss,{token:i,saveToken:n})}]}))}}]}),cs=({fetchDescribeOdigos:a})=>{const[r,s]=i(null);if(o(()=>{a().then(({data:e})=>s(e?.describeOdigos||null))},[]),!r)return t($e,{children:t(Oe,{})});const l=e=>e?.name?[t(I,{},`divider-${e.name}`),t(vn,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(bn(e.value)?Sn(e.value)?se.Success:se.Error:se.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{children:[t(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(Y,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(l)}),t(Y,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(l)})]})},ds=p.div`
|
|
517
|
-
display: flex;
|
|
518
|
-
flex-direction: column;
|
|
519
|
-
gap: 12px;
|
|
520
|
-
`,us="System Overview",ps=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[s,l]=i(!1),c=()=>l(e=>!e);return e(n,{children:[t(M,{onClick:c,tooltip:us,children:t(Zn,{size:18})},us),t(xn,{width:"750px",isOpen:s,onClose:c,header:{icons:[Zn],title:us},footer:{isOpen:!1},children:e(ds,{children:[!!a?.length&&t(ls,{tokens:a,saveToken:o}),t(cs,{fetchDescribeOdigos:r})]})})]})},ms=p.div`
|
|
83
|
+
`,ke={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Te=`${N.Source}-`,$e=`-${b.MapItem}`,Ke=.15,Ce=({heightToRemove:r,serviceMap:i,onRefresh:o})=>{const a=n(),s=M(e=>e.sources),[c,d,l]=F([]),[p,g,h]=W([]),[u,m]=j(0),[y,f]=j(null),v=q([]);v.current=c;const x=q(a);x.current=a;const S=q([]),k=q([]),T=P(()=>m(e=>e+1),[]),{activeNodeId:$,setActiveNodeType:K,setActiveNodeId:C}=z();B(()=>{if(!$)return;const e=(t=$).startsWith(Te)&&t.endsWith($e)?t.slice(Te.length,-$e.length):null;var t;e&&f({type:"node",graphKey:e})},[$]);const I=P((e,t)=>{const{sourceGraphKey:r,targetGraphKey:i}=t.data||{};r&&i&&(K(null),C(null),f({type:"edge",sourceKey:r,targetKey:i}))},[K,C]),R=P(()=>{f(null),K(null),C(null)},[K,C]),G=P((e,t)=>{const r=t.id;g(e=>e.map(e=>e.source===r||e.target===r?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:Ke},labelStyle:{...e.labelStyle,opacity:Ke},labelBgStyle:{...e.labelBgStyle,opacity:Ke}}))},[g]),O=P(()=>{g(k.current)},[g]);return B(()=>{let e=!1;const t=(e=>{const t=new Map,r=new Set,i=(e,r,i=!1)=>{let n=t.get(e);return n||(n={serviceName:r,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,n)),n},n=(e,t)=>{if(t)for(const{key:r,value:i}of t)r in e||(e[r]=i)};for(const t of e){const{graphKey:e}=le(t.nodeId),o=i(e,t.serviceName);o.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:a}=le(e.nodeId);e.isVirtual&&(r.add(t),n(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=o.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),a){const t=s.details.find(e=>e.value===a);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:a,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[n,o]of e)t.has(n)||i(n,o.targetServiceName,r.has(n));const a=[];for(const[e,{serviceName:r,isVirtual:i,attributes:n,connectionMap:o}]of t){const t=[...o.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),a.push({graphKey:e,serviceName:r,isVirtual:i,connections:t,attributes:n})}return a.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),a})(i);S.current=t;const r=(({sources:e,aggregatedServiceMap:t})=>{const r=[],i={x:0,y:0};if(t.length&&e.length)for(const n of t){const t=ae(n.graphKey),o=e.find(e=>n.serviceName===e.otelServiceName||n.serviceName===e.name);r.push({id:t,type:b.MapItem,position:i,data:se(n,o,ce(o)),measured:{width:80,height:80}})}else r.push({id:`${N.Source}-${b.NoData}`,type:b.NoData,position:i,data:{subTitle:w.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return r})({aggregatedServiceMap:t,sources:[ke].concat(s)});if(1===r.length&&r[0].id===`${N.Source}-${b.NoData}`)return d(r),g([]),void(k.current=[]);const n=new Set(v.current.map(e=>e.id)),o=new Set(r.map(e=>e.id)),a=r.some(e=>!n.has(e.id)),c=v.current.some(e=>!o.has(e.id));if(!(a||c)){const e=new Map(v.current.map(e=>[e.id,e.position]));d(r.map(t=>({...t,position:e.get(t.id)??t.position})));const i=de({theme:x.current,nodes:r,aggregatedServiceMap:t});return k.current=i,void g(i)}return(async(e,t,r={})=>{const i={id:"root",layoutOptions:{...he,...r},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===ge?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},n=await pe.layout(i),o=new Map;return n.children?.forEach(e=>{o.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:o.get(e.id)??e.position})),edges:t}})(r,de({theme:x.current,nodes:r,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;d(t);const r=de({theme:x.current,nodes:t,aggregatedServiceMap:S.current});k.current=r,g(r),T()}),()=>{e=!0}},[i,s]),B(()=>{if(!v.current.length)return;const e=de({theme:a,nodes:v.current,aggregatedServiceMap:S.current});k.current=e,g(e)},[a]),e(Ne,{$heightToRemove:r,children:[t(E,{nodes:c,edges:p,onNodesChange:l,onEdgesChange:h,onEdgeClick:I,onNodeMouseEnter:G,onNodeMouseLeave:O,onRefresh:o,fitViewTrigger:u,zoomOnScroll:!0}),t(Se,{drawerState:y,aggregatedData:S.current,onClose:R})]})},Me=i.div`
|
|
521
84
|
position: fixed;
|
|
522
85
|
bottom: 12px;
|
|
523
86
|
left: 12px;
|
|
@@ -526,104 +89,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
526
89
|
flex-direction: column-reverse;
|
|
527
90
|
gap: 6px;
|
|
528
91
|
max-width: 600px;
|
|
529
|
-
`,
|
|
530
|
-
position: relative;
|
|
531
|
-
display: flex;
|
|
532
|
-
align-items: center;
|
|
533
|
-
width: fit-content;
|
|
534
|
-
padding: 6px;
|
|
535
|
-
gap: 6px;
|
|
536
|
-
border-radius: 32px;
|
|
537
|
-
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
538
|
-
&:hover {
|
|
539
|
-
border: 1px solid ${({theme:e})=>e.colors.secondary};
|
|
540
|
-
}
|
|
541
|
-
& > svg {
|
|
542
|
-
cursor: pointer;
|
|
543
|
-
z-index: 1;
|
|
544
|
-
& > path {
|
|
545
|
-
stroke: ${({theme:e})=>e.text.secondary};
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
`,ys=p.div`
|
|
549
|
-
position: absolute;
|
|
550
|
-
top: 2px;
|
|
551
|
-
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
552
|
-
z-index: 0;
|
|
553
|
-
width: 24px;
|
|
554
|
-
height: 24px;
|
|
555
|
-
background-color: ${({theme:e})=>e.colors.border};
|
|
556
|
-
border-radius: 100%;
|
|
557
|
-
transition: all 0.3s;
|
|
558
|
-
`,fs=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),vs=()=>{const{darkMode:n,setDarkMode:i}=Cn();return e(gs,{onClick:()=>i(!n),children:[t(fs,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(fs,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(ys,{$darkMode:n})]})},bs=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(a=!0)}else a=!0;if(a)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Ss=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},xs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:y.Divider})}),n},Cs=e=>{const{traceID:t,spanID:n,processID:i,operationName:a,duration:o,startTime:r,warnings:s}=e,l=[];return l.push({type:y.CopyText,title:"Trace ID",value:t}),l.push({type:y.CopyText,title:"Span ID",value:n}),l.push({type:y.Divider}),l.push({title:"Service",value:i}),l.push({title:"Operation",value:a}),l.push({title:"Duration",value:En(o)}),l.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),s.length&&(l.push({type:y.Divider}),l.push({title:"Warnings",titleIcon:ei,value:s})),l},Es=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},Ts=p.div`
|
|
559
|
-
display: flex;
|
|
560
|
-
flex-direction: column;
|
|
561
|
-
gap: 12px;
|
|
562
|
-
max-height: 100vh;
|
|
563
|
-
overflow-y: auto;
|
|
564
|
-
`,Ns=({span:n,process:a,onClose:o})=>{const[r,s]=i(!0),[l,c]=i(!0);return t(xn,{width:"750px",isOpen:!0,onClose:o,header:{icons:[ti],title:n.operationName},footer:{isOpen:!1},children:e(Ts,{children:[t(Y,{title:"Details",data:Cs(n)}),n.logs.length>0&&t(Y,{title:"Errors",titleBadge:n.logs.length,titleIcon:ei,data:xs(n)}),t(Y,{title:"Tags",data:Ss(n,r),action:t(Tn,{isPrettyMode:r,setIsPrettyMode:s})}),a&&t(Y,{title:`Process (${a.serviceName})`,data:Es(a,l),action:t(Tn,{isPrettyMode:l,setIsPrettyMode:c})})]})})},ks=370,ws=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),$s=p.div`
|
|
565
|
-
display: flex;
|
|
566
|
-
align-items: center;
|
|
567
|
-
width: ${ks}px;
|
|
568
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+P["042"]:t.colors.dark_grey};
|
|
569
|
-
&:hover {
|
|
570
|
-
${({$withErrors:e,$preventHover:t,theme:n})=>!t&&`background-color: ${e?n.colors.error:n.colors.secondary+P["010"]};`}
|
|
571
|
-
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
572
|
-
}
|
|
573
|
-
`,Ds=p(O)`
|
|
574
|
-
align-items: center;
|
|
575
|
-
justify-content: space-between;
|
|
576
|
-
gap: 4px;
|
|
577
|
-
padding: 12px;
|
|
578
|
-
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
579
|
-
width: calc(${ks}px - ${({$depth:e})=>12*e}px);
|
|
580
|
-
`,As=p(O)`
|
|
581
|
-
align-items: center;
|
|
582
|
-
gap: 4px;
|
|
583
|
-
position: absolute;
|
|
584
|
-
right: 56px;
|
|
585
|
-
width: calc(100% - ${434}px);
|
|
586
|
-
`,Is=p.div`
|
|
587
|
-
position: absolute;
|
|
588
|
-
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:n})=>(e-t)/(n-t)*100+"%"};
|
|
589
|
-
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
590
|
-
height: 12px;
|
|
591
|
-
border-radius: 32px;
|
|
592
|
-
background-color: ${({$indexInMatrix:e})=>ws[e%ws.length]};
|
|
593
|
-
`,Rs=p(U)`
|
|
594
|
-
padding-left: calc(100% + 8px);
|
|
595
|
-
font-size: 10px;
|
|
596
|
-
color: ${({theme:e})=>e.text.darker_grey};
|
|
597
|
-
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
598
|
-
white-space: nowrap;
|
|
599
|
-
`,Os=({span:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:m,onSelect:g})=>{const y=h(),[f,v]=i(!1),b=ks-12*a-20-(c?12:0),S=c&&(1===a||n.logs.length>0);return e($s,{className:"span-container",$withErrors:c,$preventHover:f,onClick:g,children:[e(Ds,{$depth:a,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:t(M,{onClick:e=>{e.stopPropagation(),m?.()},size:24,children:t(ft,{extend:u??!1})})}:{style:{width:"24px"}}),t(kn,{maxWidth:b/2,text:n.processID,textSize:14}),t(U,{size:12,color:y.text.darker_grey,children:"•"}),t(kn,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(S?t(ge,{...d,children:t(ei,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(I,{type:se.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(As,{className:"span-right",children:t(Is,{$indexInMatrix:o,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:s,$maxEndTime:l,children:t(Rs,{children:En(n.duration)})})})]})},Ms=({spans:n,logs:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d})=>{const u=h();return n.map((n,p)=>{const m=n.spanID,h=c.value.includes(m),g=!!n.spans?.length,y=i.length?i:Nn(n,"spans","logs"),f=y.length>0,v=f?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=f?y.length>1?void 0:y[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===a?`1px dotted ${u.colors.border}`:"none"},children:[t(Os,{span:n,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:f,errorTooltip:{titleIcon:ei,title:v,text:b},isOpen:h,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===m)?e.filter(e=>e!=m):[...e,m,...Nn(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===m?null:n)}),h&&g?t(Ms,{spans:n.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${m}`)})},Fs=p.div`
|
|
600
|
-
width: 100%;
|
|
601
|
-
`,Ls=p.div`
|
|
602
|
-
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
603
|
-
overflow: auto;
|
|
604
|
-
|
|
605
|
-
display: flex;
|
|
606
|
-
flex-direction: column;
|
|
607
|
-
|
|
608
|
-
border-radius: 24px;
|
|
609
|
-
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
610
|
-
position: relative;
|
|
611
|
-
`,_s=p.div`
|
|
612
|
-
padding: 12px 12px 12px 24px;
|
|
613
|
-
width: calc(${ks}px - 36px);
|
|
614
|
-
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
615
|
-
`,Ps=p.div`
|
|
616
|
-
width: 1px;
|
|
617
|
-
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
618
|
-
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
619
|
-
|
|
620
|
-
position: absolute;
|
|
621
|
-
left: calc(${ks}px + ((100% - ${ks}px) / ${5}) * ${({index:e})=>e});
|
|
622
|
-
`,Ks=p(U)`
|
|
623
|
-
color: ${({theme:e})=>e.text.darker_grey};
|
|
624
|
-
font-size: 12px;
|
|
625
|
-
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
626
|
-
padding-top: 12px;
|
|
627
|
-
padding-left: 12px;
|
|
628
|
-
white-space: nowrap;
|
|
629
|
-
`,js=({heightToRemove:a,traces:o,isLoading:r})=>{const[s,c]=i([]),[d,u]=i(null),p=l(()=>At(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:bs(e)})),[o]),m=l(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),h=l(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(Fs,{$heightToRemove:a,children:r?t($e,{$height:"50vh",children:t(Oe,{scale:1.5})}):p.length?e(Ls,{$heightToRemove:a,children:[t(_s,{children:t(U,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(Ps,{$heightToRemove:a,index:n,children:t(Ks,{children:En(m/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,a=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Ms,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:m,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:s,set:c},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t($e,{$height:"50vh",children:t(De,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(Ns,{span:d,process:h,onClose:()=>u(null)})]})};export{Oi as ActionDrawer,Ai as ActionForm,Fi as ActionModal,Vi as ActionTable,Bi as AwaitPipeline,Ta as ConditionDropdown,ba as DataFlow,Ya as DataFlowActionsMenu,ja as DataStreamDrawer,Pa as DataStreamForm,Qa as DataStreamModal,Xa as DataStreamSelectionForm,uo as DestinationDrawer,so as DestinationForm,ko as DestinationModal,Io as DestinationSelectionForm,Oo as DestinationTable,Na as ErrorDropdown,Jo as InstrumentationRuleDrawer,Bo as InstrumentationRuleForm,Qo as InstrumentationRuleModal,tr as InstrumentationRuleTable,Da as KindDropdown,ka as LanguageDropdown,wa as MonitorDropdown,ir as MultiSourceControl,$a as NamespaceDropdown,Xr as NavIconIds,cr as NotificationManager,ni as OverviewDrawer,Aa as PodsAgentInjectionStatusDropdown,Pr as ServiceMap,Yr as SetupSummary,Qr as SideNav,Zr as SlackInvite,ns as SourceModal,ts as SourceSelectionForm,as as SourceTable,ps as SystemOverview,_i as TableCellConditions,hs as ToastList,vs as ToggleDarkMode,js as TraceView};
|
|
92
|
+
`,ze=()=>{const{notifications:e,markAsDismissed:r,markAsSeen:i}=o(),{onClickNotification:n}=u();return t(Me,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:a,message:s,crdType:c,target:d})=>t(I,{id:e,type:o,title:a,message:s,action:c&&d?{label:"go to details",onClick:()=>n({id:e,crdType:c,target:d},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{r(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})};export{Z as NotificationManager,Ce as ServiceMap,ze as ToastList};
|