summaryrefslogtreecommitdiffstats
path: root/src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js')
-rw-r--r--src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js b/src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js
new file mode 100644
index 0000000000..450b41533e
--- /dev/null
+++ b/src/web/gui/v2/6008.07f03fb5dba476a12f91.chunk.js
@@ -0,0 +1 @@
+!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d1ab54dd-a2c8-4f14-8eb0-b0c7645441d5",e._sentryDebugIdIdentifier="sentry-dbid-d1ab54dd-a2c8-4f14-8eb0-b0c7645441d5")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"08864407160b3973b9b88c5ae92687282b21e2f4"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6008],{86008:(e,t,r)=>{r.d(t,{A:()=>de});var n=r(58168),o=r(96540),a=(r(62953),r(8711)),i=r(10058),d=r(86652),s=r(38257),l=r(45463),c=r(62302),u=(r(17333),r(3064),r(41393),r(14905),r(98992),r(54520),r(72577),r(81454),r(8872),r(45467)),g=r(65570),m=r(40961),h=r(43375),p=r(43627),f=r(34604),b=r(44554),I=r(42629),v=r(74979),y=r(13692);const x=e=>(0,p.uU)({...e,wasDragging:!0}),E=e=>{var t;let{id:r,items:a,containerWidth:i,rowHeight:d,gutter:s,Component:l,isSortingContainer:c,onRemove:u,onItemRemove:g,Item:m,gridTracks:h,transforming:f,containerDndProps:I,itemProps:E,dragOverlay:C,rootId:w,...k}=e;const{active:A,attributes:D,isDragging:S,listeners:P,over:R,setNodeRef:_,transition:T,transform:O}=(0,p.gl)({id:C?"dragOverlay-".concat(r):r,disabled:C,data:{rootId:w,isContainer:!0,items:a,containerId:r,dropArea:!0,...I},animateLayoutChanges:x}),B=!!R&&(r===R.id&&"container"!==(null===A||void 0===A||null===(t=A.data.current)||void 0===t?void 0:t.type)||a.includes(R.id)),H=(0,b.Hp)(a),N=H*d+(H-1)*s+"px";return o.createElement(l,(0,n.A)({ref:_,style:C?{width:i,height:N}:{transition:T,transform:v.Ks.Translate.toString(O),opacity:S?.5:void 0,width:i,height:N},hover:B,onRemove:u,attributes:D,listeners:P},k,{itemProps:E,id:r,dragOverlay:C}),a.map(((e,t)=>o.createElement(y.A,(0,n.A)({disabled:c,key:e.id},e,{index:t,containerId:r,Item:m,onRemove:g,draggable:!0,containerWidth:i,rowHeight:d,gridTracks:h,gutter:s,transformed:f?a[t]:null,itemProps:E,containerDragOverlay:C,rootId:w,containerDndProps:I,draggableProps:e})))))},C=e=>{let{containers:t,Container:r,containerWidth:n,isSortingContainer:a,items:i,Item:d,transforming:s,onContainerRemove:l,onRemove:c,rowHeight:u,gridTracks:g,gutter:m,containerDndProps:h,itemProps:p,rootId:f}=e;return t.map((e=>o.createElement(E,{key:e,id:e,items:i[e],onRemove:()=>l(e),containerWidth:n,rowHeight:u,gridTracks:g,gutter:m,Component:r,Item:d,isSortingContainer:a,transforming:s,onItemRemove:c,containerDndProps:h,itemProps:p,rootId:f})))},w={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},k="TRASH_ID",A="PLACEHOLDER_ID",D=e=>{let{id:t}=e;const{setNodeRef:r,isOver:n}=(0,h.zM)({id:t,data:{dropArea:!0,isTrash:!0}});return o.createElement("div",{ref:r,style:{display:"flex",alignItems:"center",justifyContent:"center",position:"fixed",left:"50%",marginLeft:-150,bottom:20,width:300,height:60,borderRadius:5,border:"1px solid",borderColor:n?"red":"#DDD"}},"Drop here to delete")},S=e=>{let{rootId:t,items:r,containers:a,trashable:i=!0,onRemove:d,Item:s,containerWidth:l=800,rowHeight:c=40,gridTracks:v=12,gutter:x=4,allowOverlap:S=!1,compactType:P="vertical",maxRows:R=3e5,Container:_=f.A,onDragEnd:T,containerDndProps:O,itemProps:B,updateOnNewProps:H=!1,rearrangeable:N=!0}=e;const{active:F}=(0,h.fF)(),L=(0,o.useRef)(null),[W,M]=(0,o.useState)((()=>(a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{})),{}),[j,z]=(0,o.useState)((()=>a||Object.keys(W)));(0,u.A)((()=>{M((a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{}))}),[v]),(0,u.A)((()=>{H&&((0,g.Ay)(r,W)||(M((a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{})),z(a)))}),[a,r]);const G=null===F||void 0===F?void 0:F.isContainer,[U,q]=(0,o.useState)(null),[J,Z]=(0,o.useState)(null),$=(0,o.useRef)(null),K=e=>e in W?e:null,Q=()=>{U&&M(U),q(null),Z(null),$.current=null},Y=()=>{const e=Object.keys(W),t=e[e.length-1];return String.fromCharCode(t.charCodeAt(0)+1)},V=e=>{let{active:t}=e;const{isContainer:r}=t.data.current;q(W),r||Z(W)};return(0,o.useLayoutEffect)((()=>{if(F)return V({active:F}),Q}),[]),(0,h.E5)({onDragStart:V,onDragMove:e=>{let{active:t,over:r,collisions:n}=e;const{isResizer:o,isContainer:a,itemId:i,itemContainerId:d}=t.data.current;if(a||!J)return;const{initial:s,translated:u}=t.rect.current;let g=(0,b.Su)(J[d]);const m=!J[d],h=(0,b.GN)(m?J:g,i,m)||(0,b.lc)(t.data.current);if(!h||!h.width)return;const p=null===r||void 0===r?void 0:r.id;if(o){if(!p)return;const e=r.rect.width+(u.right-s.right),t=r.rect.height+(u.bottom-s.bottom);let{width:o,height:a}=(0,I.tr)({gutter:x,maxRows:R,gridTracks:v,rowHeight:c,containerWidth:l},e,t,h);if(h.width===o&&h.height===a)return;if(!n)return;return g=g.map((e=>e.id===h.id?{...h,width:o,height:a}:e)),n=n.filter((e=>e.id!==h.id)),g=(0,b.oE)(g,P,v),$.current={...h,itemContainerId:d},void Z((e=>({...e,[d]:[...g]})))}if(p===k)return void Z(U);if(!N)return;const f=K(d),y=K(p)||r&&K(r.data.current.itemContainerId)||f;if(!y)return;if(y&&y===f||(g=[...J[y],h]),!n)return;const E=n.find((e=>e.id===y));if(!E)return;let{left:C,top:w}=(0,I.zA)({gutter:x,maxRows:R,gridTracks:v,rowHeight:c,containerWidth:l},u.top-E.data.droppableContainer.rect.current.top,u.left-E.data.droppableContainer.rect.current.left,h);if(h.top===w&&h.left===C&&f===y)return;g=(0,b.Pe)(g,h,C,w,!0,!1,P,v,S),g=(0,b.oE)(g,P,v);const A=y!==f;A&&(L.current=t.itemContainerId),$.current={...h,itemContainerId:y},Z((e=>({...e,[y]:g.filter((e=>!!e)),...A&&!!e[d]&&{[d]:(0,b.oE)(e[d].filter((e=>e.id!==h.id)),P,v)}})))},onDragEnd:e=>{let{active:t,over:r}=e;if(!J)return;const{isResizer:n,isItem:o}=t.data.current,a=null===r||void 0===r?void 0:r.id;if(null===a)return void Z(null);if(a===k)return M((e=>({...e,[t.containerId]:(0,b.oE)(e[t.containerId].filter((e=>{let{id:r}=e;return r!==t.itemId})),P,v)}))),void Z(null);if(o||n)return J&&M(J),Z(null),void T(J,$.current,j);t.id in W&&null!==r&&void 0!==r&&r.id&&z((e=>{const n=e.indexOf(t.id),o=e.indexOf(r.id),a=(0,p.be)(e,n,o);return T(J,$.current,a),a}));const i=K(t.id);if(i)if(a!==A)J&&M(J),Z(null),T(J,$.current,j);else{const e=Y();(0,m.unstable_batchedUpdates)((()=>{z((t=>[...t,e])),M((r=>({...r,[i]:r[i].filter((e=>e!==t.itemId)),[e]:[t.id]})))}))}},onDragCancel:Q}),J||W?o.createElement(o.Fragment,null,o.createElement(p.gB,{items:[...j,A],strategy:p._G},o.createElement(C,{rootId:t,containers:j,Container:_,containerWidth:l,isSortingContainer:G,items:J||W,transforming:null!==J,Item:s,onContainerRemove:e=>{z((t=>t.filter((t=>t!==e))))},onRemove:d,rowHeight:c,gridTracks:v,gutter:x,itemProps:B,containerDndProps:O})),(0,m.createPortal)(o.createElement(h.Hd,{adjustScale:!1,dropAnimation:w},F&&F.data.current.rootId===t?F.data.current.isContainer?(X=F.data.current,o.createElement(E,{rootId:t,id:X,items:J||W,containerWidth:l,rowHeight:c,gutter:x,Component:_,Item:s,gridTracks:v,containerDndProps:O,itemProps:B,dragOverlay:!0})):F.data.current.isItem?(e=>{const r=(J||W)[e.itemContainerId];if(!r)return null;const a=r.find((t=>t.id===e.itemId));return a?o.createElement(y.A,(0,n.A)({rootId:t},a,{containerId:e.itemContainerId,Item:s,onRemove:d,draggable:!0,containerWidth:l,rowHeight:c,gridTracks:v,gutter:x,dragOverlay:!0,itemProps:B})):null})(F.data.current):null:null),document.body),i&&F&&(F.isContainer||F.isItem)?o.createElement(D,{id:k}):null):null;var X},P=a.default.div.withConfig({displayName:"gridLayout__Div",componentId:"sc-jna1fu-0"})(["position:relative;"]),R=(0,o.forwardRef)(((e,t)=>{let{id:r,onRemove:a,children:s,attributes:l,listeners:c,itemProps:u={},itemProps:{dashboardId:g},style:m,dragOverlay:h,...p}=e;(0,d.QZ)(g,r);return o.createElement(i.Flex,(0,n.A)({},p,{ref:t,column:!0,flex:!0,round:!0,background:"mainBackground",padding:[3],gap:2}),o.createElement(P,{style:m},s))})),_=e=>{let{id:t,Component:r,containerWidth:a,onActiveSubMenuId:u,onActiveMenuGroupId:g,...m}=e;const[h,p]=(0,d.B1)(t),[f,b]=(0,d.Ix)(t),I=(0,l.A)("(max-width: 767px)"),v=(0,s.A)(),y=(0,o.useRef)(),x=(0,o.useMemo)((()=>(y.current&&y.current.cancel(),y.current=(0,c.A)(),()=>{})),[h,u,g]);return o.createElement(i.Flex,{ref:v,column:!0,overflow:{vertical:"auto"},flex:"1","data-testid":"dashboardGrid",height:"100%",onScroll:x},o.createElement(S,(0,n.A)({rootId:t,key:t,Container:R,onDragEnd:(e,t,r)=>{p(e),b(r)},containers:f,items:h,containerWidth:a-(I?16:26)},m,{Item:r,gridTracks:12,itemProps:{dashboardId:t},containerDndProps:{droppable:!0},updateOnNewProps:!0})))};var T=r(27078),O=r(58388),B=r(28973),H=r(80925);const N=(0,a.default)(i.Flex).attrs((e=>({height:"100%",background:"mainChartBg",round:!0,...e}))).withConfig({displayName:"container__Card",componentId:"sc-esi601-0"})(["",""],(e=>{let{dragging:t,theme:r}=e;return t&&"\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: ".concat((0,i.getRgbColor)("primary",.2)({theme:r}),";\n z-index: 10;\n backdrop-filter: blur(3px);\n }\n\n ")}));var F=r(36196);const L={},W=(0,o.memo)((e=>{let{dashboardId:t,id:r,handleProps:a,listeners:i,attributes:d,style:s,dragging:l,dragOverlay:c,...g}=e;const m=(0,H.e)(),{nodesScope:h,...p}=(0,O.bE)(t,r)||L,f=(0,O.v_)(t,r),b=(0,o.useMemo)((()=>{const e=(0,T.My)(m,t);let n=e.getNode({id:c?"dragOverlay-".concat(r):r});return n||(n=m.makeChart({attributes:{id:c?"dragOverlay-".concat(r):r,cardId:r,dashboardId:t,...p,...!!p.nodeId&&!h&&{nodesScope:[p.nodeId]},toolboxProps:{drag:{...a,...i,...d}}},makeTrack:T.qh}),e.appendChild(n),n)}),[t,r]);return(0,u.A)((()=>{b.updateAttributes({height:s.height,width:s.width}),b.trigger("resize")}),[b,s.height,s.width]),(0,u.A)((()=>{b.updateAttributes({toolboxProps:{drag:{...a,...i,...d,dragging:l}}})}),[l]),(0,o.useLayoutEffect)((()=>(0,B.unregister)(b.onAttributesChange(["aggregationMethod","groupBy","groupByLabel","postAggregationMethod","postGroupBy","postGroupByLabel","groupingMethod","groupingTime","chartType","chartLibrary","selectedDimensions","selectedLabels","selectedNodes","selectedInstances","sparkline","selectedLegendDimensions","showingInfo","dimensionsSortBy","instancesSortBy","nodesSortBy","groupBySortBy","labelsSortBy","dimensionsSort","nodesExpanded","groupByExpanded","labelsExpanded","expanded","staticZones","title","description","showPostAggregations"],((e,t,r)=>f((t=>({...t,[r]:e}))))))),[b,f]),(0,u.A)((()=>{b.updateAttributes(p)}),[p]),o.createElement(N,(0,n.A)({"data-testid":"chartCard-".concat((p.contextScope||[]).join(",")),height:s.height,width:"100%"},g,{dragging:l}),o.createElement(F.A,{chart:b,"data-chartid":c?"dragOverlay-".concat(r):r,"data-track":b.track("container"),height:s.height,width:"100%"}))})),M=W;var j=r(46741),z=r(58384),G=r(67544);const U="text",q="customDashboard",J=e=>{let{dashboardId:t,id:r,onClick:n}=e;const a=(0,O.bE)(t,r,"editing"),i=(0,O.v_)(t,r,"editing");return o.createElement(z.t,{icon:"pencilSolid",onClick:()=>{n(),i(!0)},"data-ga":"".concat(U,"-reset::").concat(q),"data-testid":"textCard-edit",disabled:a},"Edit")},Z=e=>{let{dashboardId:t,id:r}=e;const n=(0,G.c6)(t,r);return o.createElement(z.t,{icon:"trashcan",onClick:n,"data-ga":"".concat(U,"-reset::").concat(q),"data-testid":"textCard-remove"},"Remove")},$=e=>{let{dashboardId:t,id:r,children:a,...i}=e;return o.createElement(o.Fragment,null,o.createElement(z.A,(0,n.A)({category:U,context:q,testId:"chartTextDropdown"},i),(e=>{let{close:n}=e;return o.createElement(o.Fragment,null,o.createElement(J,{dashboardId:t,id:r,onClick:n}),o.createElement(Z,{dashboardId:t,id:r}))})),a)};r(25440);const K=(0,a.default)(i.Flex).attrs({as:"form",column:!0,flex:!0,gap:2,height:"100%",padding:[0,0,2],onMouseDown:e=>e.stopPropagation()}).withConfig({displayName:"form__CardContent",componentId:"sc-3tcqxu-0"})(["cursor:auto;"]),Q=(0,a.default)(i.Box).attrs((e=>({as:"textarea",background:"inputBg",height:"100%",round:!0,border:!0,padding:[2],...e}))).withConfig({displayName:"form__Textarea",componentId:"sc-3tcqxu-1"})(["resize:none;font-size:12px;color:",";"],(0,i.getColor)("text")),Y=(0,o.memo)((e=>{let{dashboardId:t,id:r}=e;const n=(0,O.bE)(t,r,"text"),a=(0,O.v_)(t,r,"editing"),d=(0,O.v_)(t,r,"text"),[s,l]=(0,o.useState)(n);return o.createElement(K,{"data-testid":"textCardForm"},o.createElement(Q,{placeholder:"Add some text",value:s.replace(/<\/?[^>]+(>|$)/g,""),onChange:e=>l(e.target.value)}),o.createElement(i.Flex,{position:"absolute",right:"24px",bottom:0,gap:1},o.createElement(i.IconButton,{icon:"check",small:!0,padding:[0],onClick:()=>{d(s),a(!1)},"data-testid":"textCardForm-cancel",neutral:!1,flavour:"default"}),o.createElement(i.IconButton,{icon:"x",small:!0,padding:[0],onClick:()=>a(!1),"data-testid":"textCardForm-done",flavour:"default"})))})),V={h1:i.H2,h2:i.H4,text:i.Text,micro:i.TextNano},X=e=>{let{dashboardId:t,id:r}=e;const n=(0,O.bE)(t,r,"text")||"",a=(0,O.bE)(t,r,"textType"),d=V[a]||V.text;return o.createElement(i.Box,{"data-testid":"textCardContent"},o.createElement(d,{whiteSpace:"pre-wrap"},n.replace(/<\/?[^>]+(>|$)/g,"")))},ee=(0,a.default)(i.Flex).attrs({column:!0}).withConfig({displayName:"text__StyledOptions",componentId:"sc-1f67m9f-0"})([""]),te=e=>{let{dragging:t,...r}=e;const a=(0,j.JT)("dashboard:Update");return o.createElement(i.IconButton,(0,n.A)({position:"absolute",top:0,right:0,padding:[0],width:"12px",height:"12px",icon:"rearrange",title:"Drag & drop","data-testid":"text-drag",disabled:!a,cursor:t?"grabbing":"grab"},r))},re=["h1","h2","text","micro"],ne=e=>{let{id:t,dashboardId:r}=e;const n=(0,j.JT)("dashboard:Update"),a=(0,O.bE)(r,t,"textType")||"text",d=(0,O.v_)(r,t,"textType");return o.createElement(i.IconButton,{padding:[0],width:"12px",height:"12px",icon:"text_add",title:"Change text component","data-testid":"text-component",disabled:!n,onClick:()=>{const e=re.findIndex((e=>e===a)),t=re[e>re.length-2?0:e+1];d(t)}})},oe=(0,a.default)(N).withConfig({displayName:"text__StyledCard",componentId:"sc-1f67m9f-1"})(["","{opacity:0;}&:hover{border:1px solid ",";}&:hover ","{opacity:1;}"],ee,(0,i.getColor)("border"),ee),ae={chart:M,text:(0,o.memo)((e=>{let{dashboardId:t,id:r,listeners:a,handleProps:i,dragging:d}=e;const s=(0,O.bE)(t,r,"editing");return o.createElement(oe,{"data-testid":"textCard",alignItems:"start",overflow:"hidden",dragging:d},o.createElement(ee,null,o.createElement($,{dashboardId:t,id:r}),o.createElement(ne,{dashboardId:t,id:r})),s&&o.createElement(Y,{dashboardId:t,id:r}),!s&&o.createElement(X,{dashboardId:t,id:r}),o.createElement(te,(0,n.A)({},a,i,{dragging:d})))})),placeholder:(0,o.memo)((()=>o.createElement(N,{column:!0,"data-testid":"placeholderCard",background:"secondaryHighlight",width:"100%"})))},ie=(0,o.forwardRef)(((e,t)=>{let{dashboardId:r,id:a,attributes:i,style:d,resizeHandle:s,...l}=e;const c=(0,O.bE)(r,a,"type")||"placeholder",u=ae[c]||ae.chart;return o.createElement("div",(0,n.A)({ref:t},i,{style:d}),o.createElement(u,(0,n.A)({dashboardId:r,id:a,style:d},l)),s)})),de=(0,o.memo)((e=>{let{id:t,...r}=e;return(0,T.Ay)(t),o.createElement(_,(0,n.A)({id:t,Component:ie},r))}))}}]); \ No newline at end of file