MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/netdata/usr/local/share/netdata/web/v3/1386.5a356b90ce4b38e8c716.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:"8b1701d6db299c2b7259bc89c3ef365137725d5e"};var o=(new e.Error).stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="482ab00b-25e5-4194-8d7d-f253fb17b942",e._sentryDebugIdIdentifier="sentry-dbid-482ab00b-25e5-4194-8d7d-f253fb17b942")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[1386],{31386(e,o,n){n.r(o),n.d(o,{default:()=>v});var l=n(96540),t=n(76667),i=n(38429),r=n(7960),a=n(19186),s=n(44245),d=n(39484),c=(n(98992),n(72577),n(22337)),g=n(66188),p=n(99728),u=n(53450),h=n(25059),x=n(65259),b=n(74848);const k=e=>{let{onClose:o,showTraffic:n,onToggleTraffic:t,provider:r,setProvider:a,setGoogleApiKey:s,onPinToTab:d,isDrawing:k,pendingNodeId:f,onToggleDrawMode:m,selectedLinkId:v,links:w,nodeById:I,onDeleteLink:y,onUpdateLink:j,onDeselectLink:C,canEdit:S}=e;const[T,L]=(0,l.useState)(!1),D=(0,p.JT)("space:UpdateSettings"),P=v?w?.find(e=>e.id===v):null;return(0,b.jsxs)(i.Flex,{alignItems:"center",justifyContent:"between",padding:[2,4],background:"mainBackground",border:{side:"bottom",color:"borderSecondary"},style:{zIndex:1,flexShrink:0},children:[(0,b.jsxs)(i.Flex,{alignItems:"center",gap:3,children:[(0,b.jsx)(i.Icon,{name:"netdataPress",color:"success",height:"18px",width:"18px"}),(0,b.jsx)(i.Text,{strong:!0,children:"Geo Map"}),k&&f&&(0,b.jsx)(i.TextSmall,{color:"textLite",style:{fontStyle:"italic"},children:"Click another node to connect"}),k&&!f&&(0,b.jsx)(i.TextSmall,{color:"textLite",style:{fontStyle:"italic"},children:"Click a node to start a link"}),P&&!k&&(0,b.jsx)(x.A,{link:P,nodeById:I,onUpdate:j,onDelete:y,onClose:C,canEdit:S})]}),(0,b.jsxs)(i.Flex,{alignItems:"center",gap:2,position:"relative",children:[r===u.mK.google&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i.Button,{flavour:"hollow",small:!0,onClick:t,"aria-label":"Toggle traffic layer",active:n,children:(0,b.jsxs)(i.Flex,{alignItems:"center",gap:1,children:[(0,b.jsx)(c.gc,{icon:g.zC5,size:"sm"}),(0,b.jsx)("span",{children:"Traffic"})]})}),(0,b.jsx)(i.Box,{width:"1px",height:"20px",background:"borderSecondary"})]}),S&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i.Button,{flavour:"hollow",small:!0,onClick:m,"aria-label":"Toggle draw link mode",icon:"pencilOutline",active:k,children:k?"Done":"Draw Links"}),(0,b.jsx)(i.Box,{width:"1px",height:"20px",background:"borderSecondary"})]}),d&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i.IconButton,{icon:"pin_element",onClick:d,flavour:"hollow",tooltip:"Pin to tabs"}),(0,b.jsx)(i.Box,{width:"1px",height:"20px",background:"borderSecondary"})]}),D&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i.IconButton,{icon:"gear",onClick:()=>L(e=>!e),flavour:"hollow",tooltip:"Map settings"}),T&&(0,b.jsx)(h.A,{onClose:()=>L(!1),provider:r,setProvider:a,setGoogleApiKey:s})]}),(0,b.jsx)(i.Box,{width:"1px",height:"20px",background:"borderSecondary"}),(0,b.jsx)(i.IconButton,{icon:"x",neutral:!0,onClick:o,tooltip:"Close"})]})]})},f=(0,r.A)(()=>Promise.all([n.e(2882),n.e(4550),n.e(6839),n.e(2017)]).then(n.bind(n,76839)),"GoogleMapView"),m=(0,r.A)(()=>Promise.all([n.e(2492),n.e(2882),n.e(4795),n.e(2747)]).then(n.bind(n,92747)),"MapLibreView"),v=e=>{let{onClose:o}=e;const n=(0,a.r9)(),r=(0,t.Zp)(),c=(0,s.tV)(),{isGoogle:g,handleNodeClick:p,viewport:u,setViewport:h,showTraffic:x,linkProps:v,settingsProps:w,editProps:I,isDrawing:y,pendingNodeId:j,selectedLinkId:C,setSelectedLinkId:S,toggleDrawMode:T,cancelPending:L}=(0,d.A)({onNodeNavigate:o}),D=(0,l.useCallback)(()=>{c({title:"Geo Map",id:"geo-map",destination:"geo-map",type:"geomap",icon:"node_hollow",tooltip:{title:"Geo Map",description:"Visualize node locations on an interactive map"}}),o(),r(`${n}/geomap/geo-map`)},[c,o,r,n]),P=(0,l.useCallback)(()=>{y&&j?L():y?T():C?S(null):o()},[o,y,j,L,T,C,S]);return(0,b.jsx)(i.Layer,{full:!0,onEsc:P,children:(0,b.jsxs)(i.Flex,{column:!0,width:"100vw",height:"100vh",background:"mainBackground",children:[(0,b.jsx)(k,{onClose:o,onPinToTab:D,...w,...I}),(0,b.jsx)(i.Flex,{flex:!0,position:"relative",overflow:"hidden",children:(0,b.jsx)(l.Suspense,{fallback:(0,b.jsx)(i.Flex,{justifyContent:"center",alignItems:"center",height:"100%",children:(0,b.jsx)(i.Text,{color:"textLite",children:"Loading map..."})}),children:g?(0,b.jsx)(f,{onNodeClick:p,showTraffic:x,savedViewport:u,onViewportChange:h,linkProps:v}):(0,b.jsx)(m,{onNodeClick:p,savedViewport:u,onViewportChange:h,linkProps:v})})})]})})}},65259(e,o,n){n.d(o,{A:()=>a});n(98992),n(81454);var l=n(882),t=n(38429),i=n(53450),r=n(74848);const a=e=>{let{link:o,nodeById:n,onUpdate:a,onDelete:s,onClose:d,canEdit:c}=e;const g=(0,l.useTheme)(),p="Default"!==g.name,u=(0,i.vQ)(p),h=(0,t.getColor)("text")({theme:g}),x=n[o.fromNodeId],b=n[o.toNodeId];return(0,r.jsxs)(t.Flex,{alignItems:"center",gap:2,padding:[0,2],round:1,border:{color:"borderSecondary"},background:"panelBg",children:[(0,r.jsxs)(t.TextSmall,{strong:!0,whiteSpace:"nowrap",children:[x?.name||x?.nm||"?"," \u2192 ",b?.name||b?.nm||"?"]}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.TextInput,{placeholder:"Label",value:o.label||"",onChange:e=>a(o.id,{label:e.target.value}),"aria-label":"Link label",size:"tiny",width:"120px"}),(0,r.jsx)(t.Flex,{alignItems:"center",gap:1,children:u.map(e=>(0,r.jsx)(t.Button,{flavour:"borderless",onClick:()=>a(o.id,{color:e}),"aria-label":`Color ${e}`,style:{width:16,height:16,minWidth:16,minHeight:16,padding:0,borderRadius:3,background:e,border:`2px solid ${o.color===e?h:"transparent"}`,flexShrink:0}},e))}),(0,r.jsx)(t.Button,{flavour:"borderless",small:!0,danger:!0,onClick:()=>{s(o.id),d()},"aria-label":"Delete link",label:"Delete"})]}),(0,r.jsx)(t.Button,{flavour:"borderless",small:!0,neutral:!0,onClick:d,"aria-label":"Deselect link",label:"\u2715"})]})}},25059(e,o,n){n.d(o,{A:()=>c});var l=n(96540),t=n(882),i=n(22337),r=n(66188),a=n(38429),s=n(53450),d=n(74848);const c=e=>{let{onClose:o,provider:n,setProvider:c,setGoogleApiKey:g}=e;const p=(0,t.useTheme)(),u=(0,s.Pq)(),[h,x]=(0,l.useState)(n),[b,k]=(0,l.useState)(u.googleApiKey||""),[f,m]=(0,l.useState)(!1),v=e=>(0,a.getColor)(e)({theme:p}),w=(0,l.useCallback)(()=>{h===s.mK.google&&g(b.trim()),c(h),o()},[h,b,c,g,o]),I=h===s.mK.google&&!b.trim(),y=e=>{return{flex:1,border:`1px solid ${v(e?"primary":"borderSecondary")}`,background:e?(o="primary",n=.1,(0,a.getRgbColor)(o,n)({theme:p})):"transparent"};var o,n};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.Box,{position:"fixed",style:{inset:0,zIndex:9},onClick:o}),(0,d.jsxs)(a.Flex,{column:!0,padding:[3],gap:3,round:2,background:"mainBackground",border:{color:"borderSecondary"},position:"absolute",width:"280px",zIndex:10,style:{top:44,right:10,boxShadow:"0 4px 16px rgba(0,0,0,0.15)"},children:[(0,d.jsx)(a.TextMicro,{strong:!0,color:"textLite",children:"MAP PROVIDER"}),(0,d.jsxs)(a.Flex,{gap:1,children:[(0,d.jsx)(a.Button,{flavour:"borderless",small:!0,onClick:()=>x(s.mK.libre),"aria-label":"Select OpenStreetMap provider",style:y(h===s.mK.libre),children:"OpenStreetMap (Free)"}),(0,d.jsx)(a.Button,{flavour:"borderless",small:!0,onClick:()=>x(s.mK.google),"aria-label":"Select Google Maps provider",style:y(h===s.mK.google),children:"Google Maps"})]}),h===s.mK.google&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.TextMicro,{strong:!0,color:"textLite",children:"GOOGLE MAPS API KEY"}),(0,d.jsx)(a.TextInput,{type:f?"text":"password",value:b,onChange:e=>k(e.target.value),placeholder:"AIzaSy...","aria-label":"Google Maps API key",size:"small",iconRight:(0,d.jsx)(a.Button,{flavour:"borderless",onClick:()=>m(e=>!e),"aria-label":f?"Hide API key":"Show API key",style:{padding:2,minWidth:"auto",height:"auto"},children:(0,d.jsx)(i.gc,{icon:f?r.pS3:r.k6j,size:"sm"})})}),(0,d.jsx)(a.TextMicro,{color:"textLite",children:"Required for Google Maps. Get a key from the Google Cloud Console."})]}),(0,d.jsx)(a.Button,{onClick:w,disabled:I,"aria-label":"Save map settings",children:I?"API key required":"Save"})]})]})}},53450(e,o,n){n.d(o,{DQ:()=>r,DT:()=>p,Ez:()=>s,FU:()=>C,Ii:()=>t,KC:()=>c,Pq:()=>b,RN:()=>k,Sz:()=>f,_s:()=>v,aM:()=>i,ap:()=>S,cE:()=>I,cF:()=>w,dD:()=>m,e9:()=>j,fK:()=>P,jf:()=>T,l6:()=>L,mK:()=>h,nD:()=>a,p9:()=>g,s2:()=>d,vQ:()=>D,z1:()=>y,zc:()=>u});n(33110),n(98992),n(81454);var l=n(81395);const t={lat:30,lng:10},i=2,r=2,a=20,s={live:"#00ab44",stale:"#c59c12",offline:"#8c8c8c",unseen:"#b3b3b3"},d={critical:"#ff4136",warning:"#ffc300"},c=10,g=12,p=18,u=40,h={libre:"libre",google:"google"},x="netdata-geomap-settings",b=()=>{try{const e=localStorage.getItem(x);if(e)return JSON.parse(e)}catch{}return{provider:h.libre,googleApiKey:""}},k=e=>{try{localStorage.setItem(x,JSON.stringify(e))}catch{}},f=()=>{const{googleApiKey:e}=b();return window.NETDATA_GOOGLE_MAPS_API_KEY||e||""},m=()=>!!f(),v=()=>{const{provider:e}=b();return e===h.google&&m()?h.google:h.libre},w=60,I=16,y=.8,j=.5,C=.2,S=1.2,T=1.8,L=300,D=e=>{const o=e?1:0;return l.default.slice(0,8).map(e=>e[o])},P=e=>{const o=e?1:0;return{mixed:l.default[2][o],mostOffline:l.default[9][o]}}},39484(e,o,n){n.d(o,{A:()=>w});var l=n(96540),t=n(76667),i=n(99728),r=n(19186),a=n(53450),s=n(52035),d=n(34843);const c=(0,s.eU)(!1),g=(0,s.eU)(null),p=()=>{const[e,o]=(0,l.useState)(a._s),[n,t]=(0,d.fp)(c),[i,r]=(0,d.fp)(g),s=(0,l.useCallback)(e=>{const n=(0,a.Pq)();n.provider=e,(0,a.RN)(n),o(e===a.mK.google&&(0,a.dD)()?a.mK.google:a.mK.libre),t(!1)},[t]),p=(0,l.useCallback)(e=>{const n=(0,a.Pq)();n.googleApiKey=e,(0,a.RN)(n),e&&n.provider===a.mK.google&&o(a.mK.google),e||n.provider!==a.mK.google||o(a.mK.libre)},[]);return{provider:e,setProvider:s,showTraffic:n,toggleTraffic:(0,l.useCallback)(()=>t(e=>!e),[t]),viewport:i,setViewport:r,setGoogleApiKey:p}};n(33110),n(98992),n(54520),n(81454),n(37550);var u=n(24609);const h=e=>`netdata-geomap-links-${e}`,x=e=>{try{const o=localStorage.getItem(h(e));if(o)return JSON.parse(o)}catch{}return[]},b=(e,o)=>{try{localStorage.setItem(h(e),JSON.stringify(o))}catch{}},k=()=>{const e=(0,u.vt)(),[o,n]=(0,l.useState)(()=>x(e));(0,l.useEffect)(()=>{n(x(e))},[e]);const t=(0,l.useCallback)(function(o,l){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#4A90D9";n(n=>{if(n.some(e=>e.fromNodeId===o&&e.toNodeId===l||e.fromNodeId===l&&e.toNodeId===o))return n;const r=`link-${Math.random().toString(36).slice(2)}`,a=[...n,{id:r,fromNodeId:o,toNodeId:l,label:t,color:i}];return b(e,a),a})},[e]);return{links:o,addLink:t,removeLink:(0,l.useCallback)(o=>{n(n=>{const l=n.filter(e=>e.id!==o);return b(e,l),l})},[e]),updateLink:(0,l.useCallback)((o,l)=>{n(n=>{const t=n.map(e=>e.id===o?{...e,...l}:e);return b(e,t),t})},[e])}},f=e=>{let{addLink:o}=e;const[n,t]=(0,l.useState)(!1),[i,r]=(0,l.useState)(null),[a,s]=(0,l.useState)(null),d=(0,l.useCallback)(()=>{t(e=>!e),r(null),s(null)},[]),c=(0,l.useCallback)(e=>i?i===e?(r(null),!0):(o(i,e),r(null),!0):(r(e),!0),[i,o]),g=(0,l.useCallback)(()=>{r(null)},[]);return{isDrawing:n,pendingNodeId:i,selectedLinkId:a,setSelectedLinkId:s,toggleDrawMode:d,handleNodeClickInDrawMode:c,cancelPending:g}};var m=n(2817),v=n(49519);const w=function(){let{onNodeNavigate:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,r.r9)(),n=(0,t.Zp)(),s=(0,i.JT)("space:UpdateSettings"),{provider:d,setProvider:c,showTraffic:g,toggleTraffic:u,viewport:h,setViewport:x,setGoogleApiKey:b}=p(),{links:w,addLink:I,removeLink:y,updateLink:j}=k(),C=(0,m.A)(),{isDrawing:S,pendingNodeId:T,selectedLinkId:L,setSelectedLinkId:D,toggleDrawMode:P,handleNodeClickInDrawMode:A,cancelPending:N}=f({addLink:I}),M=(0,v.A)(C),K=(0,l.useCallback)(l=>{S?A(l):l&&o&&(e?.(),n(`${o}/nodes/${l}`))},[S,A,o,n,e]),B=(0,l.useCallback)(()=>D(null),[D]),G=d===a.mK.google,F=(0,l.useMemo)(()=>({links:w,selectedLinkId:L,onSelectLink:D,pendingNodeId:T,isDrawing:S}),[w,L,D,T,S]),E=(0,l.useMemo)(()=>({showTraffic:g,onToggleTraffic:u,provider:d,setProvider:c,setGoogleApiKey:b}),[g,u,d,c,b]),_=(0,l.useMemo)(()=>({isDrawing:S,pendingNodeId:T,onToggleDrawMode:P,selectedLinkId:L,links:w,nodeById:M,onDeleteLink:y,onUpdateLink:j,onDeselectLink:B,canEdit:s}),[S,T,P,L,w,M,y,j,B,s]);return{isGoogle:G,handleNodeClick:K,viewport:h,setViewport:x,showTraffic:g,linkProps:F,settingsProps:E,editProps:_,isDrawing:S,pendingNodeId:T,selectedLinkId:L,setSelectedLinkId:D,toggleDrawMode:P,cancelPending:N}}},49519(e,o,n){n.d(o,{A:()=>t});var l=n(96540);const t=e=>(0,l.useMemo)(()=>{const o={};for(const n of e)o[n.id]=n;return o},[e])}}]);