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.06e7df4223a3c3ea7e9a.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:"2c7094d16bd3a302c2584dca4b609461a773522e"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3ae9a8ca-bfae-4994-8647-8acc48d0ff65",e._sentryDebugIdIdentifier="sentry-dbid-3ae9a8ca-bfae-4994-8647-8acc48d0ff65")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7214],{79868(e,t,a){a.d(t,{D7:()=>s,Jp:()=>d,NT:()=>h,N_:()=>m,iS:()=>r,vE:()=>c,v_:()=>l,xI:()=>i,z6:()=>u});var n=a(51510),o=a(42358);const l=n.default.img.withConfig({displayName:"styled__Illustration",componentId:"sc-1yhntgl-0"})(["margin:0 auto;"]),s=(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"))},27214(e,t,a){a.r(t),a.d(t,{default:()=>O});a(62953);var n=a(42358),o=a(6304),l=a(41579),s=a(67294),d=a(96540),i=a(41344),r=a(32788),c=a(29263),h=a(47410),u=a(16866),m=a(19186),b=a(24609),g=a(5907),x=a(82418),y=a(38757),f=a(79868),p=a(74848);const w=e=>{let{onClose:t}=e;const a=(0,i.Zp)(),[o,l]=(0,d.useState)(!1),[s,w]=(0,d.useState)(""),{id:j,slug:v}=(0,b.ap)(),A=(0,m.ID)(),D=(0,m.QW)(),T=(0,d.useCallback)((e=>{let{slug:n}=e;t(),a("/spaces/".concat(v,"/rooms/").concat(D,"/dashboards/").concat(n))}),[v,D]),C=(0,g.Dn)(j,A,{onSuccess:T}),k=(0,d.useCallback)((()=>C({name:s})),[s]),S=s.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:k,"data-testid":"addNewDashboardModal-add-button"})}),(0,p.jsx)(h.U,{children:"Create new Dashboard"}),(0,p.jsxs)(r.Yv,{children:[(0,p.jsx)(y.A,{value:s,label:"Name",onChange:e=>{w(e.target.value)},isValid:o,setIsValid:l,isDirty:S,instantFeedback:"all",onKeyDown:e=>e.keyCode===u.I7&&o&&k,"data-testid":"addNewDashboardModal-dashboardName-input",containerStyles:{flex:{grow:0,shrink:0},margin:[0,0,4,0]}}),(0,p.jsxs)(f.D7,{children:[(0,p.jsx)(f.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)(f.xI,{children:[(0,p.jsxs)(f.iS,{children:[(0,p.jsx)(f.vE,{name:"check"}),(0,p.jsx)(n.Text,{children:"Add charts from your infrastructure"})]}),(0,p.jsxs)(f.iS,{children:[(0,p.jsx)(f.vE,{name:"check"}),(0,p.jsx)(n.Text,{children:"Group information in a meaningful way"})]}),(0,p.jsxs)(f.z6,{children:[(0,p.jsx)(f.NT,{name:"help"}),(0,p.jsx)(n.Text,{children:"Learn more about Dashboards"})," ",(0,p.jsx)(f.N_,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/",target:"_blank",rel:"noopener noreferrer",children:"In our documentation"})]})]}),(0,p.jsx)(f.v_,{src:x.$})]})]})};var j=a(63474),v=a(63950),A=a.n(v),D=(a(98992),a(81454),a(37550),a(51262)),T=a(39175);const C=e=>{let{handleOpenAddDashboardModal:t,hasPermissionToAddDashboard:a,hasPermissionToDeleteDashboard:n,refetch:o}=e;const l=(0,m.GJ)(),i=(0,m.XA)("name"),r=(0,g.Ts)(),c=(0,s.q)(),h=(0,d.useMemo)((()=>c.some((e=>e===T.LA))),[c]),{hasLimitations:u,maxDashboards:b}=(0,D.A)(),x=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()},y=(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 ".concat(e.name),declineLabel:"Cancel",handleAction:x,tooltipText:"Delete dashboard",isDisabled:e=>!n||l&&e.id===T.LA,disabledTooltipText:n?"Local dashboard cannot be deleted":"Only admins can delete"}})),[n]),f=(0,d.useMemo)((()=>({addEntry:{handleAction:t,isVisible:a,tooltipText:"Create dashboard",disabledTooltipText:"Your plan does not allow you to create more than ".concat(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?"".concat(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:x,tooltipText:"Delete dashboards",isVisible:n}})));return{rowActions:n?y:[],bulkActions:[a,n].some(Boolean)?f:[]}};var k=a(92726),S=a(45087);const _=e=>{let t=new Date(e);t=t.getTime()===t.getTime()?t:new Date;const[,a,n,o]=t.toDateString().split(" ");return"".concat(a," ").concat(n,", ").concat(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=>{var t;let{getValue:a,row:o}=e;const l="notAvailable"==(null===o||void 0===o||null===(t=o.original)||void 0===t?void 0:t.state),s=a();return l?(0,p.jsx)(S.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:o.original.slug,children:s})};var F=a(99728);const M=e=>{let{refetch:t,handleOpenAddDashboardModal:a}=e;const[,o]=(0,d.useState)(),l=(0,s.q)(),i=(0,k.Sf)(l),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:_(t())})},sortingFn:"datetime"},{id:"createdAt",accessorKey:"createdAt",header:"Created",cell:e=>{let{getValue:t}=e;return(0,p.jsx)(n.TextSmall,{children:_(t())})},sortingFn:"datetime"}]),[]),{rowActions:u,bulkActions:m}=C({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)=>{var n,o,l,s,d,i,r;const c=null===a||void 0===a||null===(n=a.toLowerCase)||void 0===n?void 0:n.call(a),h=null===(o=e.getValue("name"))||void 0===o||null===(l=o.toLowerCase)||void 0===l?void 0:l.call(o),u="".concat(null===(s=_(e.getValue("updatedAt")))||void 0===s||null===(d=s.toLowerCase)||void 0===d?void 0:d.call(s)),m="".concat(null===(i=_(e.getValue("createdAt")))||void 0===i||null===(r=i.toLowerCase)||void 0===r?void 0:r.call(i));return h.includes(c)||u.includes(c)||m.includes(c)}),[]),setGlobalFilter:o}},V=[{id:"updatedAt",desc:!0}],B=e=>{let{refetch:t=A(),handleOpenAddDashboardModal:a}=e;const{enableSelection:o,columns:l,data:s,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:s,dataColumns:l,bulkActions:i,enableSorting:r,globalFilterFn:c,onSearch:h,testPrefixCallback:e=>e.name,sortBy:V,title:"Dashboards"})};var E=a(60908);const O=()=>{const e=(0,l.A)(),[t,,a,d]=(0,o.A)(!1);return(0,s.RQ)()?(0,p.jsx)(E.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)(B,{refetch:e,handleOpenAddDashboardModal:a}),t&&(0,p.jsx)(w,{onClose:d})]})}):(0,p.jsx)(j.Ki,{})}}}]);