"use strict";(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[465],{2465:function(z,u,l){l.r(u),l.d(u,{TopologySummaryComponent:function(){return p}});var f=l(5671),v=l(3144),t=l(5e3),y=l(5366),C=l(9971),x=l(5542),S=l(6215),T=l(4068),g=l(9808),b=l(2072),d=l(3251),E=l(4107),_=l(508),O=l(4834);function P(s,n){if(1&s){var e=t.EpF();t.TgZ(0,"div",2),t.NdJ("mousemove",function(a){return t.CHM(e),t.oxw().dragWidget(a)},!1,t.evT)("mouseup",function(){return t.CHM(e),t.oxw().toggleDragging(!1)},!1,t.evT),t.qZA()}}function M(s,n){1&s&&(t.O4$(),t.TgZ(0,"svg",28),t._UZ(1,"rect",29),t.qZA())}function w(s,n){1&s&&(t.O4$(),t.TgZ(0,"svg",28),t._UZ(1,"rect",30),t.qZA())}function Z(s,n){1&s&&(t.O4$(),t.TgZ(0,"svg",28),t._UZ(1,"rect",31),t.qZA())}function F(s,n){if(1&s&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&s){var e=t.oxw().$implicit;t.xp6(1),t.lnq(" ",e.console_type," ",e.console_host,":",e.console," ")}}function D(s,n){1&s&&(t.TgZ(0,"div"),t._uU(1," none "),t.qZA())}function I(s,n){if(1&s&&(t.TgZ(0,"div",25)(1,"div"),t.YNc(2,M,2,0,"svg",26),t.YNc(3,w,2,0,"svg",26),t.YNc(4,Z,2,0,"svg",26),t._uU(5),t.qZA(),t.YNc(6,F,2,3,"div",27),t.YNc(7,D,2,0,"div",27),t.qZA()),2&s){var e=n.$implicit;t.xp6(2),t.Q6J("ngIf","started"===e.status),t.xp6(1),t.Q6J("ngIf","suspended"===e.status),t.xp6(1),t.Q6J("ngIf","stopped"===e.status),t.xp6(1),t.hij(" ",e.name," "),t.xp6(1),t.Q6J("ngIf",null!=e.console&&null!=e.console&&"none"!=e.console_type),t.xp6(1),t.Q6J("ngIf",null===e.console||void 0===e.console||"none"===e.console_type)}}function k(s,n){1&s&&(t.O4$(),t.TgZ(0,"svg",28),t._UZ(1,"rect",29),t.qZA())}function A(s,n){1&s&&(t.O4$(),t.TgZ(0,"svg",28),t._UZ(1,"rect",31),t.qZA())}function N(s,n){if(1&s&&(t.TgZ(0,"div",25)(1,"div"),t.YNc(2,k,2,0,"svg",26),t.YNc(3,A,2,0,"svg",26),t._uU(4),t.qZA(),t.TgZ(5,"div"),t._uU(6),t.qZA(),t.TgZ(7,"div"),t._uU(8),t.qZA()()),2&s){var e=n.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("ngIf",e.connected),t.xp6(1),t.Q6J("ngIf",!e.connected),t.xp6(1),t.hij(" ",e.name," "),t.xp6(2),t.hij(" ",e.host," "),t.xp6(2),t.hij(" ",o.controller.location," ")}}var U=function(n){return{lightTheme:n}},W=function(){return{right:!0,left:!0,bottom:!0,top:!0}};function R(s,n){if(1&s){var e=t.EpF();t.TgZ(0,"div",3),t.NdJ("mousedown",function(){return t.CHM(e),t.oxw().toggleDragging(!0)})("resizeStart",function(){return t.CHM(e),t.oxw().toggleDragging(!1)})("resizeEnd",function(i){return t.CHM(e),t.oxw().onResizeEnd(i)}),t.TgZ(1,"div",4)(2,"mat-tab-group")(3,"mat-tab",5),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleTopologyVisibility(!0)}),t.TgZ(4,"div",6)(5,"div",7)(6,"mat-select",8)(7,"mat-optgroup",9)(8,"mat-option",10),t.NdJ("onSelectionChange",function(){return t.CHM(e),t.oxw().applyStatusFilter("started")}),t._uU(9,"started"),t.qZA(),t.TgZ(10,"mat-option",11),t.NdJ("onSelectionChange",function(){return t.CHM(e),t.oxw().applyStatusFilter("suspended")}),t._uU(11,"suspended"),t.qZA(),t.TgZ(12,"mat-option",12),t.NdJ("onSelectionChange",function(){return t.CHM(e),t.oxw().applyStatusFilter("stopped")}),t._uU(13,"stopped"),t.qZA()(),t.TgZ(14,"mat-optgroup",13)(15,"mat-option",14),t.NdJ("onSelectionChange",function(){return t.CHM(e),t.oxw().applyCaptureFilter("capture")}),t._uU(16,"active capture(s)"),t.qZA(),t.TgZ(17,"mat-option",15),t.NdJ("onSelectionChange",function(){return t.CHM(e),t.oxw().applyCaptureFilter("packet")}),t._uU(18,"active packet captures"),t.qZA()()()(),t.TgZ(19,"div",16)(20,"mat-select",17),t.NdJ("selectionChange",function(){return t.CHM(e),t.oxw().setSortingOrder()})("valueChange",function(i){return t.CHM(e),t.oxw().sortingOrder=i}),t.TgZ(21,"mat-option",18),t._uU(22,"sort by name ascending"),t.qZA(),t.TgZ(23,"mat-option",19),t._uU(24,"sort by name descending"),t.qZA()()(),t._UZ(25,"mat-divider",20),t.TgZ(26,"div",21),t.YNc(27,I,8,6,"div",22),t.qZA()()(),t.TgZ(28,"mat-tab",23),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleTopologyVisibility(!1)}),t.TgZ(29,"div",6)(30,"div",24),t.YNc(31,N,9,5,"div",22),t.qZA()()()()()()}if(2&s){var o=t.oxw();t.Q6J("ngStyle",o.style)("ngClass",t.VKq(9,U,o.isLightThemeEnabled))("validateResize",o.validate)("resizeEdges",t.DdM(11,W))("enableGhostResize",!0),t.xp6(20),t.Q6J("value",o.sortingOrder),t.xp6(6),t.Q6J("ngStyle",o.styleInside),t.xp6(1),t.Q6J("ngForOf",o.filteredNodes),t.xp6(4),t.Q6J("ngForOf",o.computes)}}var p=function(){function s(n,e,o,a,i){(0,f.Z)(this,s),this.nodesDataSource=n,this.projectService=e,this.computeService=o,this.linksDataSource=a,this.themeService=i,this.closeTopologySummary=new t.vpe,this.style={},this.styleInside={height:"280px"},this.subscriptions=[],this.nodes=[],this.filteredNodes=[],this.sortingOrder="asc",this.startedStatusFilterEnabled=!1,this.suspendedStatusFilterEnabled=!1,this.stoppedStatusFilterEnabled=!1,this.captureFilterEnabled=!1,this.packetFilterEnabled=!1,this.computes=[],this.isTopologyVisible=!0,this.isDraggingEnabled=!1,this.isLightThemeEnabled=!1}return(0,v.Z)(s,[{key:"ngOnInit",value:function(){var e=this;"light"===this.themeService.getActualTheme()?this.isLightThemeEnabled=!0:this.isLightThemeEnabled=!1,this.subscriptions.push(this.nodesDataSource.changes.subscribe(function(o){e.nodes=o,e.nodes.forEach(function(a){("0.0.0.0"===a.console_host||"0:0:0:0:0:0:0:0"===a.console_host||"::"===a.console_host)&&(a.console_host=e.controller.host)}),"asc"===e.sortingOrder?e.filteredNodes=o.sort(e.compareAsc):e.filteredNodes=o.sort(e.compareDesc)})),this.projectService.getStatistics(this.controller,this.project.project_id).subscribe(function(o){e.projectsStatistics=o}),this.computeService.getComputes(this.controller).subscribe(function(o){e.computes=o}),this.revertPosition()}},{key:"revertPosition",value:function(){var e=localStorage.getItem("leftPosition"),o=localStorage.getItem("rightPosition"),a=localStorage.getItem("topPosition"),i=localStorage.getItem("widthOfWidget"),r=localStorage.getItem("heightOfWidget");this.style=a?{position:"fixed",left:"".concat(+e,"px"),right:"".concat(+o,"px"),top:"".concat(+a,"px"),width:"".concat(+i,"px"),height:"".concat(+r,"px")}:{top:"60px",right:"0px",width:"320px",height:"400px"}}},{key:"toggleDragging",value:function(e){this.isDraggingEnabled=e}},{key:"dragWidget",value:function(e){var o=Number(e.movementX),a=Number(e.movementY),i=Number(this.style.width.split("px")[0]),r=Number(this.style.height.split("px")[0]),c=Number(this.style.top.split("px")[0])+a;if(this.style.left){var m=Number(this.style.left.split("px")[0])+o;this.style={position:"fixed",left:"".concat(m,"px"),top:"".concat(c,"px"),width:"".concat(i,"px"),height:"".concat(r,"px")},localStorage.setItem("leftPosition",m.toString()),localStorage.setItem("topPosition",c.toString()),localStorage.setItem("widthOfWidget",i.toString()),localStorage.setItem("heightOfWidget",r.toString())}else{var h=Number(this.style.right.split("px")[0])-o;this.style={position:"fixed",right:"".concat(h,"px"),top:"".concat(c,"px"),width:"".concat(i,"px"),height:"".concat(r,"px")},localStorage.setItem("rightPosition",h.toString()),localStorage.setItem("topPosition",c.toString()),localStorage.setItem("widthOfWidget",i.toString()),localStorage.setItem("heightOfWidget",r.toString())}}},{key:"validate",value:function(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<290||e.rectangle.height<260))}},{key:"onResizeEnd",value:function(e){this.style={position:"fixed",left:"".concat(e.rectangle.left,"px"),top:"".concat(e.rectangle.top,"px"),width:"".concat(e.rectangle.width,"px"),height:"".concat(e.rectangle.height,"px")},this.styleInside={height:"".concat(e.rectangle.height-120,"px")}}},{key:"toggleTopologyVisibility",value:function(e){this.isTopologyVisible=e,this.revertPosition()}},{key:"compareAsc",value:function(e,o){return e.name