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: //proc/self/root/opt/netdata/netdata-web-files/v3/3864.6a779499750cfb033c7e.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="542d5a97-76a1-4808-a969-f8f54fd3662a",e._sentryDebugIdIdentifier="sentry-dbid-542d5a97-76a1-4808-a969-f8f54fd3662a")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"cb606294818e94c7fd75c921384b09c30eacd2ba"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3864],{40298:(t,a,n)=>{n.d(a,{cW:()=>S,gg:()=>I,Vt:()=>E});n(98992),n(54520),n(3949),n(81454),n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var s=n(96540),i=n(52035),l=n(34843),o=n(84929),r=n(30569);const d={id:"",email:""},c=(0,o.Iz)((()=>(0,i.eU)([]))),u=(0,o.Iz)((()=>(0,i.eU)(d)));var m=n(91130);const h=e=>e.map((e=>{let{id:t,email:a}=e;return{id:t,email:a}})),p={member:1,admin:2,manager:3,troubleshooter:4,observer:5,billing:6},f=e=>e.map((e=>{let{role:t,...a}=e;if(void 0===p[t])throw new Error("role not found");return{role:p[t],...a}}));n(8872);var g=n(16866);const v=e=>{let{data:t,invitations:a}=e;return t.reduce(((e,t,n)=>{var s;return(s=t.errorMsgKey)&&s===g.vK&&a[n]?.email&&e.push(a[n].email),e}),[])},b=e=>e.length>1;var y=n(24609),x=n(45187),w=n(57377);const j=(0,o.Iz)((e=>{let{id:t,key:a}=e;return(0,i.eU)((e=>{const n=e(u(t));return a?n[a]:n}))}),w.Ay),C=(0,o.Iz)((e=>{let{ids:t,key:a}=e;return(0,i.eU)((e=>(t||[]).map((t=>{const n=e(j({id:t}));return a?n[a]:n}))))}),w.Ay),k=(0,o.Iz)((e=>(0,i.eU)((t=>t(c(e))),((t,a,n)=>{let{invitations:s,merge:i}=n;a(c(e),(e=>[...new Set([...e,...s.map((e=>{let{id:t}=e;return t}))])])),s.forEach((e=>{a(u(e.id),(t=>({...i&&t,...e})))}))})))),I=t=>{const a=(0,l.md)(k(t)),[n,i]=(0,s.useState)(!1),{activate:o}=(0,x.H)(),p=(0,r.yF)((0,s.useCallback)((async(e,a)=>{if(!(await e(k(t))).length){const{data:e}=await(e=>m.A.get(`/api/v2/spaces/${e}/invitations`,{transform:h}))(t);a(k(t),{invitations:e,merge:!0})}}),[t])),g=(0,s.useCallback)((async(a,n,s)=>{let{onSuccess:l,onError:r}=s;try{i(!0);const{data:e}=await((e,t,a)=>m.A.post(`/api/v1/spaces/${e}/invitations`,{redirectURI:a,requests:f(t)}))(t,a,n),s=v({data:e,invitations:a});if(s.length&&!b(a))return void(r&&r({message:"User has already joined that space!"}));if(s.length&&b(a)){if(s.length===a.length)return void(r&&r({message:"All of the selected users are already meembers of this space"}));if(l)return void l({header:"Invitations partially send",text:"Some of the selected users are already members of this space"})}l&&l()}catch(e){r&&r(e)}finally{i(!1),o()}}),[t,o]),y=(0,r.yF)((0,s.useCallback)((async(a,n,s)=>{const i=await a(k(t)),l=i.filter((e=>e===s));n(c(t),(e=>{const t=new Set(e);return l.forEach((e=>t.delete(e))),[...t]}));try{await((e,t)=>m.A.delete(`/api/v1/spaces/${e}/invitations`,{params:{invitation_ids:t.join(",")}}))(t,[s]),l.forEach((e=>{n(u(e),d)}))}catch(e){n(k(t),{invitations:i,merge:!1})}}),[t]));return(0,s.useEffect)((()=>{p()}),[t,p]),[a,y,g,n]},S=(e,t)=>(0,l.md)(j({id:e,key:t})),E=()=>(e=>{let{key:t}=e;const a=(0,y.vt)(),n=(0,l.md)(k(a));return(0,l.md)(C({ids:n,key:t}))})({key:"email"})},63936:(e,t,a)=>{a.d(t,{A:()=>g});a(98992),a(81454);var n=a(96540),s=a(63766),i=a(33185),l=a(41395),o=a(67935),r=a(24609),d=a(79748),c=a(88934),u=a(99728),m=a(88325),h=a(74848);const p={admin:"Users with this role can control Spaces, Rooms, Nodes, Users and Billing. They can also access any Room in the Space.",member:"Users with this role can create Rooms and invite other Members. They can only see the Rooms they belong to and all Nodes in the All Nodes room",manager:"Users with this role can manage Rooms and Users. They can access any Room in the Space.",troubleshooter:"Users with this role can use Netdata to troubleshoot, not manage entities. They can access any Room in the Space.",observer:"Users with this role can only view data in specific Rooms.",billing:"Users with this role can handle billing options and invoices."},f=(0,i.default)(s.Flex).withConfig({displayName:"rolePicker__PlanBadge",componentId:"sc-szt8jq-0"})(["pointer-events:auto;"]),g=e=>{let{availableRoles:t,dataGA:a,dataTestId:i,onChange:g,value:v}=e;const b=(0,r.ap)("plan"),y=(0,n.useMemo)((()=>(0,o.L_)(b).map((e=>({isChecked:e===v,isEnabled:t.includes(e),role:e}))).sort(((e,t)=>Number(t.isEnabled)-Number(e.isEnabled)))),[t,o.L_,b,v]),x=(0,u.JT)("billing:ReadAll"),{url:w}=(0,m.A)();return(0,h.jsx)(s.Flex,{column:!0,gap:2,"data-testid":`${i}-roleOptions`,children:y.map((e=>{let{isChecked:t,isEnabled:n,role:o}=e;const r=n?void 0:"medium",u="troubleshooter"===o?"pro":"business";return(0,h.jsx)(s.RadioButton,{checked:t,"data-ga":`${a}::select-role-${o}::global-view`,"data-testid":`${i}-${o}Option`,disabled:!n,onChange:g,value:o,alignItems:"start",children:(0,h.jsxs)(s.Flex,{column:!0,children:[(0,h.jsxs)(s.Flex,{gap:2,alignItems:"center",children:[(0,h.jsx)(s.Text,{opacity:r,children:(0,l.Zr)(o)}),!n&&(0,h.jsx)(f,{background:"sideBarMini",border:{side:"all",color:"border"},cursor:"initial",padding:[1],round:!0,children:(0,h.jsx)(d.A,{align:"bottom",as:c.N_,color:"text",Component:s.TextMicro,content:"Upgrade your plan in order to use this role","data-ga":`${a}::click-plan-badge-${u}::global-view`,disabled:!x,hoverColor:"textFocus",showToolTip:!0,strong:!0,to:w,children:"Upgrade now!"})})]}),(0,h.jsx)(s.TextSmall,{color:"textLite",opacity:r,children:p[o]})]})},o)}))})}},64091:(e,t,a)=>{a.d(t,{B9:()=>s});const n=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,s=e=>!!e&&n.test(e)},76238:(e,t,a)=>{a.d(t,{BZ:()=>r,au:()=>o,dE:()=>i,fh:()=>l});var n=a(33185),s=a(63766);const i=(0,n.default)(s.H5).withConfig({displayName:"styled__StyledH5",componentId:"sc-ghsyz5-0"})(["display:flex;align-items:center;"]),l=n.default.div.withConfig({displayName:"styled__FormRow",componentId:"sc-ghsyz5-1"})(["width:100%;display:flex;flex-flow:row no-wrap;justify-content:flex-end;margin-top:",";"],(0,s.getSizeBy)(2)),o=n.default.div.withConfig({displayName:"styled__StyledUserInvitationEmptyListItem",componentId:"sc-ghsyz5-2"})(["display:flex;flex-flow:column nowrap;align-items:center;"]),r=(0,n.default)(s.TextSmall).withConfig({displayName:"styled__StyledSecondaryText",componentId:"sc-ghsyz5-3"})(["margin:2px 0 8px;"])},80269:(e,t,a)=>{a.d(t,{y:()=>u});a(98992),a(54520),a(81454),a(37550);var n=a(96540),s=a(63766),i=a(64091),l=a(40298);const o=(0,a(33185).default)(s.Select).withConfig({displayName:"styled__StyledSelect",componentId:"sc-18k0ifb-0"})(["width:100%;"]);a(71517),a(11379),a(93777),a(14190),a(12359),a(86097),a(17273),a(27415),a(19929),a(37583),a(55122),a(20230),a(57268),a(79733),a(25509),a(65223),a(60321),a(41927),a(11632),a(64377),a(66771),a(12516),a(68931),a(52514),a(35694),a(52774),a(49536),a(21926),a(94483),a(16215);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"name";return e.length?"string"===typeof e[0]?[...new Set(e)]:[...new Map(e.map((e=>[e[t],e]))).values()]:[]};var d=a(74848);const c=[],u=e=>{let{invitations:t,setInvitations:a}=e;const[u,m]=(0,n.useState)(c),[h,p]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),v=(0,n.useCallback)((()=>g("")),[g]),b=(0,l.Vt)(),y=(0,n.useCallback)((e=>{p(e.toLowerCase())}),[p]),x=(0,n.useCallback)((()=>{m(c),a(c)}),[m,a]),w=(0,n.useCallback)((e=>{let{emails:t=c,invitations:n=c,isEmailValid:s}=e;const i=r(t).filter((e=>!b.includes(e)));if(m(i),!s)return void g("Invalid email");const{error:l}=(e=>{let{invitationEmails:t=[],emails:a=[]}=e;return{error:t.some((e=>a.includes(e)))?1===a.length?"Email already invited":"One or more emails have already been invited":void 0}})({invitationEmails:b,emails:t});if(l)return void g(l);const o=r(n);a(o),p(""),v()}),[u,b,a,m,p,v,g]),j=(0,n.useCallback)((e=>(0,i.B9)(e)&&!u.includes(e)),[u]),C=(0,n.useCallback)((()=>{h&&w({emails:[...u,h],invitations:[...t,{email:h,name:h.split("@")[0]}],isEmailValid:j(h)})}),[u,h,t,w,j]),k=(0,n.useCallback)((e=>{w({isEmailValid:!0,emails:e.map((e=>e.value)),invitations:e.map((e=>({email:e.value,name:e.value.split("@")[0]})))})}),[w]),I=(0,n.useCallback)((e=>{const a=e.clipboardData.getData("Text").toLowerCase().replace(/ /g,",").replace(/,,/g,",").split(",").filter((e=>j(e)))||c;w({emails:[...u,...a],invitations:[...t,...a.map((e=>({email:e,name:e.split("@")[0]})))],isEmailValid:a.length>0}),e.preventDefault()}),[u,t,j,w]),S=(0,n.useCallback)((e=>{if(h)switch(v(),e.key){case"Enter":case"Tab":case",":case" ":w({emails:[...u,h],invitations:[...t,{email:h,name:h.split("@")[0]}],isEmailValid:j(h)}),e.preventDefault()}}),[u,h,t,j,w]);return(0,d.jsxs)(s.Flex,{justifyContent:"between",column:!0,onPaste:I,children:[(0,d.jsx)(o,{components:{DropdownIndicator:null},inputValue:h,isClearable:!0,isMulti:!0,menuIsOpen:!1,onBlur:C,onChange:k,onInputChange:y,onKeyDown:S,onClear:x,placeholder:"Enter an email and hit enter",value:u.map((e=>{return{label:t=e,value:t};var t})),autoFocus:!0}),f&&(0,d.jsx)(s.Text,{color:"error",children:f})]})}},83864:(e,t,a)=>{a.d(t,{d:()=>B});a(98992),a(54520),a(81454);var n=a(96540),s=a(63766),i=a(41514),l=a(12724),o=a(51900),r=a(27587),d=a(79748),c=a(80269),u=a(24609),m=a(49916),h=a(40298),p=a(30403),f=a(32788),g=a(29263),v=a(47410),b=a(76238),y=a(74848);const x=e=>{let{id:t,onDelete:a}=e;const i=(0,h.cW)(t,"email"),l=(0,n.useCallback)((()=>a({email:i})),[i,a]);return(0,y.jsxs)(s.Flex,{justifyContent:"between",alignItems:"center",children:[(0,y.jsxs)(s.Flex,{gap:4,children:[(0,y.jsx)(s.Icon,{color:"text",name:"check"}),(0,y.jsx)(s.Text,{children:i})]}),(0,y.jsx)(s.Button,{flavour:"borderless",icon:"trashcan",onClick:l})]})};var w=a(63872),j=a(64091),C=a(99728),k=a(63936),I=a(33821),S=a(56523),E=a(94404),T=a(3319),A=a(60908);const _=e=>{let{email:t}=e;return(0,j.B9)(t)},R=(0,E.A)(s.Button),U={header:"Invitations",text:"Invitations successfully sent!"},B=e=>{let{onClose:t,isSubmodal:a=!1}=e;const{id:j,name:E,slug:B}=(0,u.ap)(),$=(0,m.WW)(),[F,z]=(0,n.useState)($),[D,N]=(0,n.useState)([]),[M,L]=(0,n.useState)([]),[V,O]=(0,n.useState)(),{sendLog:Z,isReady:H}=(0,T.A)(),{recordMilestone:P,defaultMilestones:W}=(0,S.A)(),[Y,G,K,q]=(0,h.gg)(j),[,Q]=(0,w.A)(),J=(0,n.useCallback)((e=>{const{header:a,text:n}=e||U,s=(0,l.UI)({header:a,text:n,success:!0}),r=M.filter(_).map((e=>{let{email:t}=e;return t})).join(",");(0,i.H)("invite","invite-sent",`${V}::${r}::${F.join(",")}`,"","","invite-sent"),o.A.success(s,{context:"manageInvitations"}),P(W.firstTeamMemberInvited),t(),H&&Z({isSuccess:!0},!0)}),[Z,H,P]),X=(0,n.useCallback)((async()=>{const e=M.filter(_).map((e=>{let{email:t,name:a}=e;return{email:t,name:a,role:V,roomIDs:F}})),t=`${window.envSettings.cloudUrl}/spaces/${B}/join-space`;K(e,t,{onSuccess:J,onError:e=>{Q(e),Z({isFailure:!0,error:e.message},!0)}})}),[Y,M,B,K,J,Q,Z]),ee=(0,C._s)(),te=(0,n.useCallback)((e=>t=>{let{email:a}=t;e&&G(e),L(M.filter((e=>e.email!==a))),N(D.filter((e=>e.email!==a)))}),[M,D,G,L,N]),ae=(0,n.useCallback)((()=>{z([])}),[z]),ne="member"===V;return(0,y.jsx)(f.GO,{onClose:t,closeOnClickOutside:!1,children:(0,y.jsxs)(A.Ay,{feature:"ManageInvitationsModal",children:[(0,y.jsx)(g.z,{onClose:t,isSubmodal:a,title:"Invite Users"}),(0,y.jsxs)(v.U,{children:["Invite users to\xa0",E]}),(0,y.jsxs)(f.Yv,{children:[(0,y.jsx)(b.dE,{children:"Send invitations to your team"}),(0,y.jsx)(b.BZ,{children:"TIP: You can send more invitations at once, separate each with a comma."}),(0,y.jsx)(c.y,{invitations:M,setInvitations:L}),(0,y.jsx)("br",{}),(0,y.jsx)(b.dE,{children:"Rooms"}),(0,y.jsxs)(s.Flex,{alignItems:"center",justifyContent:"between",margin:[1,0,2],children:[(0,y.jsx)(s.TextSmall,{children:"Choose one or more rooms you'd like to invite users to."}),!!F.length&&(0,y.jsx)(s.Button,{onClick:ae,padding:[0],flavour:"borderless","data-ga":"rooms-clear",label:"Clear",small:!0,children:"Clear"})]}),(0,y.jsx)(s.Box,{"data-testid":"invite-selectRoom",children:(0,y.jsx)(r.A,{selectedValue:F,onChange:z,...ne?{formatOptions:e=>{let{name:t}=e;return{isDisabled:t===p.Q8}},filterValues:e=>{let{label:t}=e;return t===p.Q8}}:{}})}),(0,y.jsx)("br",{}),(0,y.jsx)(b.dE,{children:"Role"}),(0,y.jsxs)(b.BZ,{children:["Choose a role for invited user."," ",(0,y.jsx)(d.A,{href:I.S0,target:"_blank",rel:"noopener noreferrer",Component:s.TextSmall,children:"Learn more"})]}),(0,y.jsx)(s.Box,{"data-testid":"invite-selectRole",children:(0,y.jsx)(k.A,{availableRoles:ee,dataGA:"invite-to-space",dataTestId:"invite-selectRole",onChange:e=>{O(e.target.value)},value:V})}),(0,y.jsx)(b.fh,{children:(0,y.jsx)(R,{label:"Send",onClick:X,disabled:0===M.length||!V,flavour:"hollow",isLoading:q,"data-ga":"manage-invitations-modal::click-send::modal-footer"})}),(0,y.jsx)(s.H5,{margin:[2,0,0],children:"Invitations awaiting response"}),(0,y.jsx)(s.Flex,{column:!0,children:Y.length>0?Y.map((e=>(0,y.jsx)(x,{onDelete:te(e),id:e},e))):(0,y.jsxs)(b.au,{children:[(0,y.jsx)("br",{}),(0,y.jsx)(b.dE,{children:"You haven't invited any users yet."})]})})]})]})})}}}]);