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/share/netdata/web/v3/4090.92b6008ae8a5c0945aa7.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:"6866bb78c87eb499c83445c224071f481cf2061d"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c572a984-86e8-4bd3-afed-bc30f98e5b02",e._sentryDebugIdIdentifier="sentry-dbid-c572a984-86e8-4bd3-afed-bc30f98e5b02")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[4090],{24868(e,t,r){r.d(t,{R:()=>S,A:()=>R});r(98992),r(54520),r(72577),r(81454);var n=r(96540),s=r(38429),o=r(79997),l=r(81685),i=r(74848);const c=e=>t=>{let{containerProps:r={},...n}=t;return(0,i.jsx)(s.Flex,{alignItems:"center",justifyContent:"center",flex:"grow",...r,children:(0,i.jsx)(e,{...n})})},a=c(()=>(0,i.jsx)(s.Text,{children:"Loading reports..."})),d=c(e=>{let{error:t}=e;const r=(0,n.useMemo)(()=>t?.errorMessage||"Something went wrong",[t]);return(0,i.jsxs)(s.Flex,{alignItems:"center",gap:2,children:[(0,i.jsx)(s.Icon,{name:"warning_triangle",color:"warning"}),(0,i.jsx)(s.Text,{children:r})]})}),u=c(()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Text,{children:"There are no recently generated reports."}),(0,i.jsx)(s.Text,{children:"Create the first one by selecting one of the definitions on the left."})]}));var x=r(24155),p=r(79748),g=r(83341),h=r(42849);r(74423),r(8872);const m=["alertTransition"],j=e=>{let{variables:t={}}=e;return Object.entries(t).reduce((e,t)=>{let[r,n]=t;if(!m.includes(r)){return`${e}-${Array.isArray(n)?"nodes"===r?`${n.length}-nodes`:n.join(","):n}`}return e},"")};var f=r(50100),b=r(64156);const w="(min-width: 1600px)",I="(max-width: 1599px)",v="(max-width: 1299px)",C="(max-width: 1128px)",y=()=>({isLarge:(0,b.A)(w),isMedium:(0,b.A)(I),isSmall:(0,b.A)(v),isSuoerSmall:(0,b.A)(C)});var A=r(6304),T=r(3319);const k=()=>(0,i.jsxs)(s.Flex,{column:!0,gap:2,children:[(0,i.jsx)(x.A,{}),(0,i.jsx)(x.A,{width:"75%"})]}),S=e=>{let{id:t,limitCharacters:r=70}=e;const{loaded:o,report:c,error:a}=(0,l.ef)({id:t}),d=(0,n.useMemo)(()=>o&&!a&&c.data?.blocks?.length?c.data.blocks.find(e=>{let{type:t}=e;return"TEXT"===t})?.data?.substring(0,r):"",[o,c,a]);return o?a?null:(0,i.jsx)(s.Flex,{"data-testid":"insights-report-preview-container",children:(0,i.jsx)(g.A,{children:`${d}...`})}):(0,i.jsx)(k,{})},F=e=>{let{id:t,definitionId:r,createdAt:c,variables:a,itemsNum:d}=e;const{loaded:u,definition:x}=(0,l.fL)({id:r}),g=(0,h.A)({reportDate:new Date(c),dateOptions:{long:!0}}),m=j({variables:a}),{goToReport:b}=(0,f.A)(),{sendLog:w}=(0,T.A)(),I=(0,n.useCallback)(()=>{b(t),w({feature:"Insights",description:"View full report button click",reportId:t})},[t,b,w]);return u?(0,i.jsxs)(o.oQ,{"data-testid":"insights-recent-report-preview",itemsNum:d,children:[(0,i.jsxs)(o.RB,{children:[(0,i.jsxs)(s.Flex,{column:!0,gap:1,children:[(0,i.jsx)(s.Text,{color:"menuItem",children:g}),(0,i.jsx)(s.TextBig,{strong:!0,children:x.name}),m?(0,i.jsxs)(s.TextSmall,{color:"menuItem",children:["(",m.substring(0,30),")"]}):null]}),(0,i.jsx)(S,{id:t}),(0,i.jsx)(o.jI,{})]}),(0,i.jsx)(s.Flex,{justifyContent:"end",children:(0,i.jsx)(p.A,{onClick:I,children:"View full report."})})]}):null},R=e=>{let{collapsed:t}=e;const[r,c]=(0,A.A)(t),{loaded:x,reports:p,error:g}=(0,l.rY)(),h=(()=>{const{isMedium:e,isSmall:t,isSuoerSmall:r}=y();return r?1:t?2:e?3:4})(),m=(0,n.useMemo)(()=>x?(p||[]).filter(e=>{let{status:t}=e;return"COMPLETED"===t}).slice(0,h).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()):[],[x,p,h]);return x?g?(0,i.jsx)(o.Mx,{collapsed:r,children:(0,i.jsx)(d,{error:g})}):m.length?(0,i.jsx)(o.Mx,{collapsed:r,children:(0,i.jsxs)(s.Flex,{"data-testid":"insights-recent-reports-container",width:"100%",column:!0,gap:4,padding:[4],children:[(0,i.jsxs)(s.Flex,{alignItems:"center",gap:2,onClick:c,cursor:"pointer",children:[(0,i.jsx)(s.Text,{color:"primary",children:"Recently generated reports"}),(0,i.jsx)(s.Icon,{name:"chevron_left",size:"small",color:"primary",rotate:r?3:1})]}),r?null:(0,i.jsx)(s.Flex,{gap:4,children:m.map(e=>(0,i.jsx)(F,{...e,itemsNum:h},e.id))})]})}):(0,i.jsx)(o.Mx,{collapsed:r,children:(0,i.jsx)(u,{containerProps:{column:!0,gap:2}})}):(0,i.jsx)(o.Mx,{collapsed:r,children:(0,i.jsx)(a,{})})}},74090(e,t,r){r.d(t,{A:()=>re});var n=r(76667),s=r(81685),o=(r(98992),r(54520),r(96540)),l=r(38429),i=r(75250),c=r(50100),a=r(98476),d=r(79748),u=r(35596),x=r(74848);const p=e=>{let{id:t,status:r,variables:n,scheduledReportId:s,isReportPage:p}=e;const g=(0,i.A)({id:t}),{goToReport:h}=(0,c.A)(),m=(0,a.A)({reportId:t}),j=(0,o.useCallback)(()=>{s&&h(s)},[s,h]);return(0,x.jsxs)(l.Flex,{"data-testid":"insights-report-header",alignItems:"center",justifyContent:"between",padding:[4],children:[(0,x.jsxs)(l.Flex,{alignItems:"center",gap:1,children:[(0,x.jsx)(l.Text,{color:"menuItem",strong:!0,children:g}),s?(0,x.jsxs)(l.Text,{color:"menuItem",children:["- Generated by ",(0,x.jsx)(d.A,{onClick:j,children:"scheduled report"})]}):null]}),(0,x.jsx)(u.A,{reportId:t,status:r,variables:n,isReportPage:p,associateReport:m})]})};var g=r(79997),h=(r(74423),r(81454),r(8872),r(37550),r(41395));const m=e=>{let{id:t,label:r,index:n,hasActiveItem:s,activeId:l}=e;const{hash:i}=window.location,c=l===t||i.includes(t)||!s&&!l&&0===n,a=(0,o.useCallback)(e=>{e.preventDefault(),(e=>{const t=e?document.getElementById(e):null,r=document.getElementById("insights-report-content-scroller");if(t&&r){const e=t.getBoundingClientRect().top,n=r.getBoundingClientRect().top;r.scrollTo({top:e+r.scrollTop-n,behavior:"smooth"})}})(t.replace("#",""))},[t]);return(0,x.jsx)(g.VW,{isActive:c,children:(0,x.jsx)(d.A,{Component:g.DJ,href:`#${t}`,cursor:"pointer",isActive:c,onClick:a,children:r})})},j=e=>{let{data:t={},activeId:r}=e;const{hash:n}=window.location,s=(0,o.useMemo)(()=>(t.blocks||[]).reduce((e,t)=>{let{type:r,data:n}=t;if("HEADER"===r){const t=(0,h.Yv)(n,{noLowerCase:!0}),r=t.replace(/-/g," ").trim();return[...e,{id:t,label:r}]}return e},[]),[t.blocks]),i=(0,o.useMemo)(()=>s.some(e=>{let{id:t}=e;return n.includes(t)}),[s,n]);return(0,x.jsx)(l.Flex,{"data-testid":"insights-report-body-toc",column:!0,padding:[0,0,0,4],children:s.map((e,t)=>(0,x.jsx)(m,{...e,index:t,hasActiveItem:i,activeId:r},e.id))})};var f=r(21996),b=r(63872),w=r(3319);const I=e=>{let{id:t}=e;const[r,n]=(0,o.useState)(!1),[s,i]=(0,o.useState)(null),[c,a]=(0,o.useState)(""),[d,u]=(0,b.A)(),{sendLog:p}=(0,w.A)(),g=(0,o.useCallback)(()=>{i(null),a("")},[i,a]),h=(0,o.useCallback)(e=>{p({feature:"Insights",description:"Report feedback",reportId:t,feedback:e,..."negative"===e?{message:c}:{}}).then(()=>{d({header:"Success",text:"You have successfully submitted your feedback!"})}).catch(u),g(),n(!0)},[t,c,p,g,d,u,n]);return r?null:(0,x.jsxs)(l.Flex,{column:!0,gap:1,alignItems:"center",padding:[0,0,4,0],children:[(0,x.jsx)(l.Text,{color:"primary",children:"Did you find this report helpful?"}),(0,x.jsxs)(l.Flex,{alignItems:"center",justifyContent:"center",children:[(0,x.jsx)(l.Button,{flavour:"borderless",icon:"thumb_up",onClick:()=>h("positive")}),(0,x.jsx)(l.Button,{flavour:"borderless",danger:!0,icon:"thumb_down",onClick:()=>i("negative")})]}),"negative"===s?(0,x.jsxs)(l.Flex,{width:"100%",column:!0,gap:2,padding:[0,2],children:[(0,x.jsx)(f.A,{fontSize:"12px",placeholder:"Do you want to tell us more?",value:c,onChange:a}),(0,x.jsx)(l.Button,{icon:"thumb_down",label:"Submit feedback",small:!0,flavour:"borderless",danger:!0,onClick:()=>h("negative")})]}):null]})};r(72577);var v=r(3066),C=r(63950),y=r.n(C),A=r(73700);const T=function(){let{onCtaClick:e=y()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,r]=(0,o.useState)(null),n=(0,o.useCallback)((0,A.s)(100,()=>{if("function"===typeof window.getSelection){const e=window.getSelection();if("Range"===e.type&&e.rangeCount>0){const t=e.getRangeAt(0),n=document.getElementById("insights-report-content-text-selection");if(!n||!n.contains(t.commonAncestorContainer))return console.warn("Text Selection: Could not find container element"),void r(null);const s=t.getBoundingClientRect();r({top:s.y-30,left:s.x+s.width/2-75,selectedText:e.toString()})}else r(null)}}),[r]),s=(0,o.useCallback)(()=>{r(null),n()},[r,n]),l=(0,o.useCallback)(()=>{e({selectedText:t?.selectedText||""}),r(null),"function"===typeof window.getSelection&&window.getSelection()?.removeAllRanges()},[t,r,e]);return{cta:t,checkSelection:n,onScroll:s,onClick:l}};var k=r(99094);const S=e=>{let{id:t,data:r={},variables:n={},setActiveId:s}=e;const i=(e=>{let{setActiveId:t}=e;const[r,n]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if("function"===typeof t&&r.length){const e=r.sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);t(e[0].id)}},[r,t]),(0,o.useCallback)(e=>{e.isIntersecting?n(t=>t.find(t=>{let{id:r}=t;return r===e.id})?t.map(t=>t.id===e.id?e:t):[...t,e]):n(t=>t.filter(t=>{let{id:r}=t;return r!==e.id}))},[n])})({setActiveId:s}),c=(0,a.A)({reportId:t}),d=(0,o.useCallback)(e=>{let{selectedText:t}=e;c({selection:t})},[c]),{onScroll:u,...p}=T({onCtaClick:d});return(0,x.jsxs)(l.Flex,{id:"insights-report-content-scroller","data-testid":"insights-report-body-contents",column:!0,gap:4,height:"calc(100vh - 145px)",overflow:{vertical:"auto"},padding:[0,4,12,0],onScroll:u,children:[(0,x.jsx)(v.A,{id:t,data:r,variables:n,onIntersection:i,textSelectionProps:p}),(0,x.jsx)(l.Flex,{justifyContent:"center",border:{side:"top",color:"border"},padding:[4,0],children:(0,x.jsx)(l.TextSmall,{children:k.$i})})]})};var F=r(27955),R=r(29022);const E=e=>{let{id:t,status:r}=e;const{title:n,message:s}=(0,o.useMemo)(()=>({title:(0,h.Zr)(r.toLowerCase()),message:"FAILED"===r?"The report failed to be generated":"The report is not yet available"}),[r]);return(0,x.jsxs)(l.Flex,{width:"100%",column:!0,gap:2,children:[(0,x.jsx)(l.Flex,{width:"100%",padding:[0,4],children:(0,x.jsx)(F.A,{id:t,width:"100%"})}),(0,x.jsx)(l.Flex,{"data-testid":"insights-report-status-view",column:!0,flex:"grow",alignItems:"center",justifyContent:"center",children:(0,x.jsx)(R.A,{title:n,testId:"insights-report-status-view",children:(0,x.jsx)(l.Text,{children:s})})})]})},D=e=>{let{id:t,status:r,data:n,variables:s}=e;const[i,c]=(0,o.useState)();return"COMPLETED"!==r?(0,x.jsx)(E,{id:t,status:r}):(0,x.jsxs)(g.yB,{"data-testid":"insights-report-body-container",children:[(0,x.jsxs)(l.Flex,{"data-testid":"insights-report-body-toc-container",column:!0,gap:8,flex:"grow",overflow:"hidden",children:[(0,x.jsx)(j,{data:n,activeId:i}),(0,x.jsx)(I,{id:t})]}),(0,x.jsx)(S,{id:t,data:n,variables:s,setActiveId:c})]})};var M=r(22068),P=r(55048),B=r(44245),L=r(77234);const _=e=>{let{report:t,error:r,isReportPage:n}=e;const[s,i]=(0,M.A)(),[c,a]=(0,P.A)(),[,,d]=(0,B.m0)({tabId:L.x.insights});return(0,o.useEffect)(()=>{const e=s(),r=c();t.id&&(i(e.filter(e=>e!==t.id)),a(r.filter(e=>e!==t.id)),d())},[t.id,s,i,c,a,d]),r?(0,x.jsxs)(l.Flex,{column:!0,gap:4,flex:"grow",alignItems:"center",justifyContent:"center",children:[(0,x.jsx)(l.TextBig,{children:"Error"}),(0,x.jsx)(l.Text,{children:"string"===typeof r?r:r.errorMessage||"Something went wrong."})]}):t?(0,x.jsxs)(l.Flex,{"data-testid":"insights-report-container",column:!0,gap:2,flex:"grow",children:[(0,x.jsx)(p,{isReportPage:n,...t}),(0,x.jsx)(D,{...t})]}):null};var $=r(71211),O=r(64587),V=r(96951),Y=r(85702),z=r(68726),N=r(46256),Q=r(17762),H=r(803);const W=(0,r(74891).A)(l.Icon),X=e=>{let{isEnabled:t,...r}=e;return(0,x.jsx)(W,{name:"clock_hollow",tooltip:"Schedule",tooltipProps:{align:"bottom"},color:t?"primary":"text",cursor:"pointer",noWrapper:!0,...r})},G=e=>{let{status:t}=e;const r=t===H.w.enabled?"clear":"neutral";return(0,x.jsx)(l.Pill,{flavour:r,hollow:!0,size:"small",textProps:{textTransform:"capitalize"},children:t})},J=e=>{let{id:t,name:r,status:n,scheduledAt:s,rrule:i}=e;const c=n===H.w.enabled,{reset:a}=(0,V.A)(),{localeDateString:d,localeTimeString:u,utcOffset:p}=(0,O.$j)(),g=(0,o.useMemo)(()=>i?(0,$.YI)(i)?.toText():"",[i]);return(0,x.jsxs)(l.Flex,{column:!0,gap:2,position:"sticky",top:0,background:"mainBackground",padding:[4,0],border:{side:"bottom",color:"border"},children:[(0,x.jsxs)(l.Flex,{alignItems:"center",justifyContent:"between",children:[(0,x.jsxs)(l.Flex,{alignItems:"center",gap:3,children:[(0,x.jsx)(l.H4,{fontSize:"14px",color:"menuItem",children:r}),(0,x.jsx)(G,{status:n})]}),(0,x.jsxs)(l.Flex,{alignItems:"center",gap:4,children:[(0,x.jsx)(Y.A,{reportId:t,Accessor:e=>(0,x.jsx)(X,{...e,isEnabled:c}),accessorProps:{logPayload:{description:"Open edit scheduled report modal",id:t}}}),(0,x.jsx)(z.A,{reportId:t,tool:Q.Y.delete,flavour:"toolbar",onSuccess:a,getToolVisibility:()=>!0,logPayload:{description:"Delete report"}}),(0,x.jsx)(N.A,{tool:Q.Y.close,flavour:"toolbar",icon:"x",onClick:a,getToolVisibility:()=>!0,tooltip:"Close report",logPayload:{description:"Close scheduled report"}})]})]}),(0,x.jsxs)(l.Flex,{column:!0,gap:1,children:[(0,x.jsxs)(l.Text,{color:"menuItem",children:["Repeats ",g]}),s?(0,x.jsxs)(l.Text,{color:"menuItem",children:["Report scheduled to be generated at"," ",(0,x.jsxs)(l.Text,{color:"menuItem",strong:!0,children:[d(new Date(s))," ",u(new Date(s),{secs:!1})," UTC",p]})]}):null]})]})};var U=r(24868),Z=r(16402);const q=e=>{let{id:t,name:r,status:n}=e;const s="COMPLETED"===n,{goToReport:i}=(0,c.A)(),{sendLog:a}=(0,w.A)(),u=(0,o.useCallback)(()=>{i(t),a({feature:"Insights",description:"View full report button click",reportId:t})},[t,i,a]);return(0,x.jsxs)(l.Flex,{column:!0,gap:2,padding:[4],background:"panelBg",children:[(0,x.jsxs)(l.Flex,{alignItems:"center",justifyContent:"between",children:[(0,x.jsx)(l.Text,{color:"menuItem",children:r}),s?null:(0,x.jsx)(l.Pill,{flavour:Z.T$[n]||"neutral",hollow:!0,children:n})]}),s?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(U.R,{id:t,limitCharacters:200}),(0,x.jsx)(l.Flex,{justifyContent:"end",children:(0,x.jsx)(d.A,{onClick:u,children:"View full report."})})]}):null]})},K=e=>{let{reportId:t}=e;const r=(0,s.CF)({id:t}),{childrenReports:n=[]}=r||{};return n.length?(0,x.jsxs)(l.Flex,{column:!0,gap:4,padding:[0,0,20,0],children:[(0,x.jsx)(l.Text,{color:"menuItem",children:"Reports"}),n.map(e=>(0,x.jsx)(q,{...e},e.id))]}):null},ee=e=>{let{report:t={},error:r}=e;return r?(0,x.jsxs)(l.Flex,{column:!0,gap:4,flex:"grow",alignItems:"center",justifyContent:"center",children:[(0,x.jsx)(l.TextBig,{children:"Error"}),(0,x.jsx)(l.Text,{children:"string"===typeof r?r:r.errorMessage||"Something went wrong."})]}):(0,x.jsxs)(l.Flex,{column:!0,gap:2,padding:[0,4],overflow:{vertical:"auto"},children:[(0,x.jsx)(J,{...t}),(0,x.jsx)(K,{reportId:t?.id})]})};var te=r(62718);const re=()=>{const e=(0,n.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/reports/:reportId"),t=(0,n.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),r=e?.params?.reportId||t?.params?.reportId,{loaded:o,report:l,error:i}=(0,s.ef)({id:r}),{loaded:c,report:a,error:d}=(0,s.Xh)({id:r});return o&&c?o&&l?(0,x.jsx)(_,{report:l,error:i,isReportPage:!!e}):c&&a?(0,x.jsx)(ee,{report:a,error:d}):null:(0,x.jsx)(te.$9,{})}}}]);