File: //proc/self/root/opt/netdata/netdata-web-files/v3/7414.85094c9605d2cc081b56.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"924951b7e9646327aedf6a644e4ade24c230a2be"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d3ce4ed1-5945-4fca-94c5-d9eaa4a7663d",e._sentryDebugIdIdentifier="sentry-dbid-d3ce4ed1-5945-4fca-94c5-d9eaa4a7663d")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7414],{7414(e,n,t){t.r(n),t.d(n,{default:()=>R});t(98992),t(54520),t(81454),t(62953);var o=t(96540),l=t(67012),d=t(87083),s=t(24013),i=t(85720),r=t(45087),a=t(6304),c=t(10444),g=t(23459),u=t(71341),h=t(23226),x=t(96184),f=t(89590),b=t(51510),p=t(99191),m=t(67462),j=t(19186),k=t(63950),A=t.n(k),w=t(63589),y=t(3319),C=t(74848);const v=e=>{let{startAddingNodes:n=A(),close:t=A(),children:l}=e;const[s,i]=(0,d.Oj)({merge:!1}),{sendLog:r}=(0,y.A)(),a=(0,o.useCallback)((()=>i([])),[i]),c=(0,o.useCallback)((()=>{t(),n(),r({feature:"NodesFilterAddNodes"})}),[t,n,r]);return(0,C.jsxs)(p.Flex,{column:!0,gap:1,padding:[2,2,1],zIndex:1,border:{side:"top",color:"border"},children:[(0,C.jsxs)(p.Flex,{gap:2,justifyContent:"end",children:[(0,C.jsx)(p.Button,{label:"Clear selected",flavour:"borderless",small:!0,disabled:!s.length,onClick:a}),(0,C.jsx)(w.A,{icon:"nodes_hollow",flavour:"hollow",onClick:c,small:!0,label:"Add Nodes"})]}),l]})};var I=t(73385),T=t(38800),F=t(37356),N=t(24609),_=t(51262),D=t(38773),E=t(95565);const B=e=>{let{onAnchorClick:n}=e;const t=(0,N.dg)(),{loaded:o,hasLimitations:l,maxNodes:d}=(0,_.A)();return o&&l?(0,C.jsxs)(p.Flex,{gap:2,padding:[3],children:[(0,C.jsx)(p.Icon,{name:"warning_triangle",size:"small",color:"warning"}),t?(0,C.jsxs)(p.Text,{children:["Local dashboard is limited to ",d," nodes."," ",(0,C.jsx)(D.A,{onClick:n,children:(0,C.jsx)(p.Text,{color:"primary",children:"Review your Space active Nodes"})})]}):(0,C.jsxs)(p.Text,{children:["Your plan is limited to ",d," nodes."," ",(0,C.jsx)(E.A,{onClick:n,children:(0,C.jsx)(p.Text,{color:"primary",children:"Upgrade for no limitations"})})," ","or"," ",(0,C.jsx)(D.A,{onClick:n,children:(0,C.jsx)(p.Text,{color:"primary",children:"review your Space active Nodes"})}),"."]})]}):null},S=e=>{let{onAnchorClick:n=A()}=e;return(0,C.jsx)(B,{onAnchorClick:n})},L=["filters"],O=(0,b.default)(p.Drop).attrs({backdrop:!0,align:{top:"bottom",right:"right"},animation:!0,background:"modalBackground",column:!0,margin:[2,0,0],padding:[2,0],round:4,width:200}).withConfig({displayName:"dropdown__Dropdown",componentId:"sc-1birv08-0"})([""]),P=(0,o.memo)((e=>{let{target:n,onClose:t,onAddNodes:l}=e;const s=(0,d.w7)(),i=(0,j.ID)(),[,r]=(0,h.A)();return(0,o.useEffect)((()=>{r()}),[]),(0,C.jsx)(O,{target:n,onEsc:t,onClickOutside:t,children:(0,C.jsxs)(p.Flex,{column:!0,height:{max:"60vh"},children:[(0,C.jsxs)(p.Flex,{padding:[2,3],border:{side:"bottom",color:"border"},column:!0,gap:2,children:[(0,C.jsxs)(p.Flex,{alignItems:"center",justifyContent:"between",children:[(0,C.jsxs)(p.Text,{strong:!0,children:["Visualizing data in space from ",s.length||"all"," ",(0,m.su)(s.length)]}),(0,C.jsx)(p.Icon,{"data-testid":"sidebarHeader-icon",name:"x",color:"textLite",onClick:t,cursor:"pointer"})]}),(0,C.jsx)(p.Flex,{padding:[3,0],alignItems:"center",children:(0,C.jsx)(F.A,{})})]}),(0,C.jsxs)(p.Flex,{flex:"1",overflow:"hidden",children:[(0,C.jsxs)(p.Flex,{column:!0,flex:!0,children:[(0,C.jsx)(S,{onAnchorClick:t}),(0,C.jsx)(T.A,{testIdPrefix:"node-ids",baseKey:i,groupProps:{collapsible:!1,background:"modalBackground",padding:[3],flex:"1",overflow:"hidden"},height:"auto",width:"100%"})]}),(0,C.jsx)(I.Ay,{basis:60,baseWidth:60,flex:!1,title:"Dynamic filters",help:"Filter your nodes for this page. Count next to each item refer to the number of nodes that will be selected and used across the page.",includedTabs:L,loaded:!0,groupProps:{background:"modalBackground"},background:"modalBackground",viewFlavour:"nodesDropdown",inModal:!0})]}),(0,C.jsx)(v,{startAddingNodes:l,close:t})]})})})),R=(0,o.memo)((()=>{const e=(0,c.J)(),[n,t,,b]=(0,a.A)(!1),p=(0,o.useRef)(),m=(0,d.w7)(),j=(0,s.BU)().length,k=(0,s.Ig)().length,A=(0,s.GE)().length,w=(0,s.no)().length,y=(0,s.BU)(m.length?m:void 0).length,v=(0,s.Ig)(m.length?m:void 0).length,I=(0,s.GE)(m.length?m:void 0).length,T=(0,s.no)(m.length?m:void 0).length,F=(0,o.useMemo)((()=>({live:{selected:y,total:j,statusText:"Live"},stale:{selected:v,total:k,statusText:"Stale"},offline:{selected:I,total:A,statusText:"Offline"},unseen:{selected:T,total:w,statusText:"Unseen"}})),[j,k,A,w,y,v,I]),[,N]=(0,h.A)();(0,l.A)((()=>{N(n)}),[n]);const[_,,D,E]=(0,a.A)(),B=n?null:{title:"Global Nodes Filter",description:"Slice the dashboard by selecting the nodes of interest."};return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(r.A,{content:B,align:"bottom",isBasic:!1,children:(0,C.jsx)("div",{style:{display:"inline-block"},"data-onboarding-id":"node-filter",children:(0,C.jsx)(i.A,{ref:p,testid:"globalFilter-nodes",icon:"nodes",onClick:t,round:1,padding:e?[1]:[2],width:"auto",cursor:"pointer",selected:n,children:(0,C.jsx)(x.A,{"data-testid":"nodesIndicator",alignItems:"center",justifyContent:"end",gap:2,children:Object.keys(F).filter((e=>F[e].total)).map((n=>(0,C.jsx)(g.A,{statusText:F[n].statusText,total:F[n].total,selected:F[n].selected,statusColor:u.P[n],isScreenSmall:e},n)))})})})}),p.current&&n&&(0,C.jsx)(P,{target:p.current,onClose:b,onAddNodes:D}),_&&(0,C.jsx)(f.A,{onClose:E})]})}))}}]);