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/7214.037361e251107c79fb79.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]="671adcc8-6ca8-4cdc-bc4a-839b00cae3c7",e._sentryDebugIdIdentifier="sentry-dbid-671adcc8-6ca8-4cdc-bc4a-839b00cae3c7")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"4a6f9fc3e5ef7db74fd7e8c2578a2d2965fcfdc1"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7214],{27214:(e,t,a)=>{a.r(t),a.d(t,{default:()=>E});var n=a(63766),o=a(6304),s=a(41579),l=a(67294),d=a(96540),i=a(88934),r=a(32788),c=a(29263),h=a(47410),u=a(16866),m=a(19186),b=a(24609),g=a(5907),f=a(82418),x=a(38757),y=a(79868),p=a(74848);const w=e=>{let{onClose:t}=e;const a=(0,i.Zp)(),[o,s]=(0,d.useState)(!1),[l,w]=(0,d.useState)(""),{id:j,slug:A}=(0,b.ap)(),T=(0,m.ID)(),D=(0,m.QW)(),C=(0,d.useCallback)((e=>{let{slug:n}=e;t(),a(`/spaces/${A}/rooms/${D}/dashboards/${n}`)}),[A,D]),k=(0,g.Dn)(j,T,{onSuccess:C}),S=(0,d.useCallback)((()=>k({name:l})),[l]),_=l.length>0;return(0,p.jsxs)(r.GO,{onClose:t,children:[(0,p.jsx)(c.z,{onClose:t,title:"New Dashboard",children:(0,p.jsx)(n.Button,{label:"Add",icon:"plus",onClick:S,"data-testid":"addNewDashboardModal-add-button"})}),(0,p.jsx)(h.U,{children:"Create new Dashboard"}),(0,p.jsxs)(r.Yv,{children:[(0,p.jsx)(x.A,{value:l,label:"Name",onChange:e=>{w(e.target.value)},isValid:o,setIsValid:s,isDirty:_,instantFeedback:"all",onKeyDown:e=>e.keyCode===u.I7&&o&&S,"data-testid":"addNewDashboardModal-dashboardName-input",containerStyles:{flex:{grow:0,shrink:0},margin:[0,0,4,0]}}),(0,p.jsxs)(y.D7,{children:[(0,p.jsx)(y.Jp,{children:"What can you do with Dashboards?"}),"Combine all the metrics that matter to you, from all the nodes that matter to you, into one clean interface that helps you visually detect anomalies as they\u2019re happening. Building a new dashboard will only take a few minutes, and the metrics are always real-time."]}),(0,p.jsxs)(y.xI,{children:[(0,p.jsxs)(y.iS,{children:[(0,p.jsx)(y.vE,{name:"check"}),(0,p.jsx)(n.Text,{children:"Add charts from your infrastructure"})]}),(0,p.jsxs)(y.iS,{children:[(0,p.jsx)(y.vE,{name:"check"}),(0,p.jsx)(n.Text,{children:"Group information in a meaningful way"})]}),(0,p.jsxs)(y.z6,{children:[(0,p.jsx)(y.NT,{name:"help"}),(0,p.jsx)(n.Text,{children:"Learn more about Dashboards"})," ",(0,p.jsx)(y.N_,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/",target:"_blank",rel:"noopener noreferrer",children:"In our documentation"})]})]}),(0,p.jsx)(y.v_,{src:f.$})]})]})};var j=a(63474),A=a(63950),T=a.n(A),D=(a(98992),a(81454),a(37550),a(51262)),C=a(39175);const k=e=>{let{handleOpenAddDashboardModal:t,hasPermissionToAddDashboard:a,hasPermissionToDeleteDashboard:n,refetch:o}=e;const s=(0,m.GJ)(),i=(0,m.XA)("name"),r=(0,g.Ts)(),c=(0,l.q)(),h=(0,d.useMemo)((()=>c.some((e=>e===C.LA))),[c]),{hasLimitations:u,maxDashboards:b}=(0,D.A)(),f=async(e,t)=>{const a=(Array.isArray(e)?e:[e]).map((e=>{let{id:t}=e;return t}));await r({ids:a},{onSuccess:()=>t.toggleAllRowsSelected(!1)}),o()},x=(0,d.useMemo)((()=>({delete:{confirmLabel:"Yes, delete",confirmationMessage:e=>(0,p.jsxs)(p.Fragment,{children:["You are about to delete ",(0,p.jsx)("strong",{children:e.name})," from ",(0,p.jsx)("strong",{children:i}),".",(0,p.jsx)("br",{}),"Are you sure you want to continue?"]}),confirmationTitle:e=>`Delete ${e.name}`,declineLabel:"Cancel",handleAction:f,tooltipText:"Delete dashboard",isDisabled:e=>!n||s&&e.id===C.LA,disabledTooltipText:n?"Local dashboard cannot be deleted":"Only admins can delete"}})),[n]),y=(0,d.useMemo)((()=>({addEntry:{handleAction:t,isVisible:a,tooltipText:"Create dashboard",disabledTooltipText:`Your plan does not allow you to create more than ${b} dashboards.`,disabled:u&&c.length-(h?1:0)>=b},delete:{confirmLabel:"Yes, delete",confirmationMessage:(e,t)=>(0,p.jsxs)(p.Fragment,{children:["You are about to delete"," ",(0,p.jsx)("strong",{children:t.length>1?`${t.length} dashboards`:t[0].name})," ","from ",(0,p.jsx)("strong",{children:i}),".",(0,p.jsx)("br",{}),"Are you sure you want to continue?"]}),confirmationTitle:()=>"Delete",disabledTooltipText:"Delete is disabled because you haven't selected dashboards",declineLabel:"Cancel",handleAction:f,tooltipText:"Delete dashboards",isVisible:n}})));return{rowActions:n?x:[],bulkActions:[a,n].some(Boolean)?y:[]}};var S=a(92726),_=a(45087);const v=e=>{let t=new Date(e);t=t.getTime()===t.getTime()?t:new Date;const[,a,n,o]=t.toDateString().split(" ");return`${a} ${n}, ${o}`};var I=a(79748);const L=e=>{let{name:t}=e;return(0,p.jsxs)(n.Flex,{width:"300px",column:!0,gap:1,children:[(0,p.jsx)(n.Text,{strong:!0,children:"Locked!"}),(0,p.jsxs)(n.Text,{children:["The dashboard ",(0,p.jsx)(n.Text,{strong:!0,children:t})," is locked."]}),(0,p.jsx)(n.Text,{children:"Your plan is limited to 1 dashboard. You can delete some dashboards or upgrade your plan for no limitations."})]})},N=e=>{let{getValue:t,row:a}=e;const o="notAvailable"==a?.original?.state,s=t();return o?(0,p.jsx)(_.A,{content:(0,p.jsx)(L,{name:s}),align:"bottom",isBasic:!0,children:(0,p.jsxs)(n.Flex,{alignItems:"center",children:[(0,p.jsx)(n.Text,{children:s}),(0,p.jsx)(n.Icon,{name:"padlock",height:"12px",color:"text"})]})}):(0,p.jsx)(I.A,{as:"Link",to:a.original.slug,children:s})};var F=a(99728);const M=e=>{let{refetch:t,handleOpenAddDashboardModal:a}=e;const[,o]=(0,d.useState)(),s=(0,l.q)(),i=(0,S.Sf)(s),r=(0,F.JT)("dashboard:Create"),c=(0,F.JT)("dashboard:Delete"),h=(0,d.useMemo)((()=>[{id:"name",accessorKey:"name",header:"Name",cell:N},{id:"updatedAt",accessorKey:"updatedAt",header:"Last modified",cell:e=>{let{getValue:t}=e;return(0,p.jsx)(n.TextSmall,{children:v(t())})},sortingFn:"datetime"},{id:"createdAt",accessorKey:"createdAt",header:"Created",cell:e=>{let{getValue:t}=e;return(0,p.jsx)(n.TextSmall,{children:v(t())})},sortingFn:"datetime"}]),[]),{rowActions:u,bulkActions:m}=k({dashboards:i,handleOpenAddDashboardModal:a,hasPermissionToAddDashboard:r,hasPermissionToDeleteDashboard:c,refetch:t});return{rowActions:u,bulkActions:m,data:i,enableSelection:c,columns:h,enableSorting:!0,globalFilterFn:(0,d.useCallback)(((e,t,a)=>{const n=a?.toLowerCase?.(),o=e.getValue("name")?.toLowerCase?.(),s=`${v(e.getValue("updatedAt"))?.toLowerCase?.()}`,l=`${v(e.getValue("createdAt"))?.toLowerCase?.()}`;return o.includes(n)||s.includes(n)||l.includes(n)}),[]),setGlobalFilter:o}},$=[{id:"updatedAt",desc:!0}],V=e=>{let{refetch:t=T(),handleOpenAddDashboardModal:a}=e;const{enableSelection:o,columns:s,data:l,rowActions:d,bulkActions:i,enableSorting:r,globalFilterFn:c,setGlobalFilter:h}=M({refetch:t,handleOpenAddDashboardModal:a});return(0,p.jsx)(n.Table,{rowActions:d,enableSelection:o,data:l,dataColumns:s,bulkActions:i,enableSorting:r,globalFilterFn:c,onSearch:h,testPrefixCallback:e=>e.name,sortBy:$,title:"Dashboards"})};var B=a(60908);const E=()=>{const e=(0,s.A)(),[t,,a,d]=(0,o.A)(!1);return(0,l.RQ)()?(0,p.jsx)(B.Ay,{feature:"DashboardOverview",children:(0,p.jsxs)(n.Flex,{position:"relative",width:"100%",height:"100%",flex:"1",column:!0,padding:[3,3,0],overflow:"hidden",children:[(0,p.jsx)(V,{refetch:e,handleOpenAddDashboardModal:a}),t&&(0,p.jsx)(w,{onClose:d})]})}):(0,p.jsx)(j.Ki,{})}},79868:(e,t,a)=>{a.d(t,{D7:()=>l,Jp:()=>d,NT:()=>h,N_:()=>m,iS:()=>r,vE:()=>c,v_:()=>s,xI:()=>i,z6:()=>u});var n=a(33185),o=a(63766);const s=n.default.img.withConfig({displayName:"styled__Illustration",componentId:"sc-1yhntgl-0"})(["margin:0 auto;"]),l=(0,n.default)(o.Text).withConfig({displayName:"styled__StyledText",componentId:"sc-1yhntgl-1"})(["display:block;"]),d=n.default.div.withConfig({displayName:"styled__TextHeader",componentId:"sc-1yhntgl-2"})(["margin-bottom:",";font-weight:700;"],(0,o.getSizeBy)(2)),i=n.default.div.withConfig({displayName:"styled__StaticCheckmarks",componentId:"sc-1yhntgl-3"})(["margin-top:",";margin-bottom:",";"],(0,o.getSizeBy)(2),(0,o.getSizeBy)(5)),r=n.default.div.withConfig({displayName:"styled__CheckmarkLine",componentId:"sc-1yhntgl-4"})(["display:flex;align-items:center;"]),c=(0,n.default)(o.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1yhntgl-5"})(["margin-right:4px;height:18px;> use{fill:",";}"],(0,o.getColor)("primary")),h=(0,n.default)(c).withConfig({displayName:"styled__HelpIcon",componentId:"sc-1yhntgl-6"})(["vertical-align:middle;"]),u=n.default.div.withConfig({displayName:"styled__LearnMoreSection",componentId:"sc-1yhntgl-7"})(["margin-top:",";"],(0,o.getSizeBy)(4)),m=n.default.a.withConfig({displayName:"styled__Link",componentId:"sc-1yhntgl-8"})(["text-decoration:underline;color:",";&:visited{color:",";}"],(0,o.getColor)("success"),(0,o.getColor)("success"))}}]);