(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[26],{91026:function(t,e,n){"use strict";n.r(e),n.d(e,{TopologySummaryComponent:function(){return F}});var i=n(37602),o=n(96852),s=n(14200),r=n(36889),a=n(3941),p=n(15132),c=n(40098),l=n(39095),u=n(88802),g=n(73044),d=n(59412),h=n(93386);function m(t,e){if(1&t){var n=i.EpF();i.TgZ(0,"div",2),i.NdJ("mousemove",function(t){return i.CHM(n),i.oxw().dragWidget(t)},!1,i.evT)("mouseup",function(){return i.CHM(n),i.oxw().toggleDragging(!1)},!1,i.evT),i.qZA()}}function f(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",29),i.qZA())}function y(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",30),i.qZA())}function b(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",31),i.qZA())}function v(t,e){if(1&t&&(i.TgZ(0,"div"),i._uU(1),i.qZA()),2&t){var n=i.oxw().$implicit;i.xp6(1),i.lnq(" ",n.console_type," ",n.console_host,":",n.console," ")}}function x(t,e){1&t&&(i.TgZ(0,"div"),i._uU(1," none "),i.qZA())}function Z(t,e){if(1&t&&(i.TgZ(0,"div",25),i.TgZ(1,"div"),i.YNc(2,f,2,0,"svg",26),i.YNc(3,y,2,0,"svg",26),i.YNc(4,b,2,0,"svg",26),i._uU(5),i.qZA(),i.YNc(6,v,2,3,"div",27),i.YNc(7,x,2,0,"div",27),i.qZA()),2&t){var n=e.$implicit;i.xp6(2),i.Q6J("ngIf","started"===n.status),i.xp6(1),i.Q6J("ngIf","suspended"===n.status),i.xp6(1),i.Q6J("ngIf","stopped"===n.status),i.xp6(1),i.hij(" ",n.name," "),i.xp6(1),i.Q6J("ngIf",null!=n.console&&null!=n.console&&"none"!=n.console_type),i.xp6(1),i.Q6J("ngIf",null==n.console||"none"===n.console_type)}}function C(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",29),i.qZA())}function S(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",31),i.qZA())}function _(t,e){if(1&t&&(i.TgZ(0,"div",25),i.TgZ(1,"div"),i.YNc(2,C,2,0,"svg",26),i.YNc(3,S,2,0,"svg",26),i._uU(4),i.qZA(),i.TgZ(5,"div"),i._uU(6),i.qZA(),i.TgZ(7,"div"),i._uU(8),i.qZA(),i.qZA()),2&t){var n=e.$implicit,o=i.oxw(2);i.xp6(2),i.Q6J("ngIf",n.connected),i.xp6(1),i.Q6J("ngIf",!n.connected),i.xp6(1),i.hij(" ",n.name," "),i.xp6(2),i.hij(" ",n.host," "),i.xp6(2),i.hij(" ",o.server.location," ")}}var w=function(t){return{lightTheme:t}},T=function(){return{right:!0,left:!0,bottom:!0,top:!0}};function E(t,e){if(1&t){var n=i.EpF();i.TgZ(0,"div",3),i.NdJ("mousedown",function(){return i.CHM(n),i.oxw().toggleDragging(!0)})("resizeStart",function(){return i.CHM(n),i.oxw().toggleDragging(!1)})("resizeEnd",function(t){return i.CHM(n),i.oxw().onResizeEnd(t)}),i.TgZ(1,"div",4),i.TgZ(2,"mat-tab-group"),i.TgZ(3,"mat-tab",5),i.NdJ("click",function(){return i.CHM(n),i.oxw().toggleTopologyVisibility(!0)}),i.TgZ(4,"div",6),i.TgZ(5,"div",7),i.TgZ(6,"mat-select",8),i.TgZ(7,"mat-optgroup",9),i.TgZ(8,"mat-option",10),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("started")}),i._uU(9,"started"),i.qZA(),i.TgZ(10,"mat-option",11),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("suspended")}),i._uU(11,"suspended"),i.qZA(),i.TgZ(12,"mat-option",12),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("stopped")}),i._uU(13,"stopped"),i.qZA(),i.qZA(),i.TgZ(14,"mat-optgroup",13),i.TgZ(15,"mat-option",14),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyCaptureFilter("capture")}),i._uU(16,"active capture(s)"),i.qZA(),i.TgZ(17,"mat-option",15),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyCaptureFilter("packet")}),i._uU(18,"active packet captures"),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.TgZ(19,"div",16),i.TgZ(20,"mat-select",17),i.NdJ("selectionChange",function(){return i.CHM(n),i.oxw().setSortingOrder()})("valueChange",function(t){return i.CHM(n),i.oxw().sortingOrder=t}),i.TgZ(21,"mat-option",18),i._uU(22,"sort by name ascending"),i.qZA(),i.TgZ(23,"mat-option",19),i._uU(24,"sort by name descending"),i.qZA(),i.qZA(),i.qZA(),i._UZ(25,"mat-divider",20),i.TgZ(26,"div",21),i.YNc(27,Z,8,6,"div",22),i.qZA(),i.qZA(),i.qZA(),i.TgZ(28,"mat-tab",23),i.NdJ("click",function(){return i.CHM(n),i.oxw().toggleTopologyVisibility(!1)}),i.TgZ(29,"div",6),i.TgZ(30,"div",24),i.YNc(31,_,9,5,"div",22),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.qZA()}if(2&t){var o=i.oxw();i.Q6J("ngStyle",o.style)("ngClass",i.VKq(9,w,o.isLightThemeEnabled))("validateResize",o.validate)("resizeEdges",i.DdM(11,T))("enableGhostResize",!0),i.xp6(20),i.Q6J("value",o.sortingOrder),i.xp6(6),i.Q6J("ngStyle",o.styleInside),i.xp6(1),i.Q6J("ngForOf",o.filteredNodes),i.xp6(4),i.Q6J("ngForOf",o.computes)}}var F=function(){function t(t,e,n,o,s){this.nodesDataSource=t,this.projectService=e,this.computeService=n,this.linksDataSource=o,this.themeService=s,this.closeTopologySummary=new i.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 t.prototype.ngOnInit=function(){var t=this;this.isLightThemeEnabled="light"===this.themeService.getActualTheme(),this.subscriptions.push(this.nodesDataSource.changes.subscribe(function(e){t.nodes=e,t.nodes.forEach(function(e){"0.0.0.0"!==e.console_host&&"0:0:0:0:0:0:0:0"!==e.console_host&&"::"!==e.console_host||(e.console_host=t.server.host)}),t.filteredNodes=e.sort("asc"===t.sortingOrder?t.compareAsc:t.compareDesc)})),this.projectService.getStatistics(this.server,this.project.project_id).subscribe(function(e){t.projectsStatistics=e}),this.computeService.getComputes(this.server).subscribe(function(e){t.computes=e}),this.style={top:"60px",right:"0px",width:"320px",height:"400px"}},t.prototype.toggleDragging=function(t){this.isDraggingEnabled=t},t.prototype.dragWidget=function(t){var e=Number(t.movementX),n=Number(t.movementY),i=Number(this.style.width.split("px")[0]),o=Number(this.style.height.split("px")[0]),s=Number(this.style.top.split("px")[0])+n;if(this.style.left){var r=Number(this.style.left.split("px")[0])+e;this.style={position:"fixed",left:r+"px",top:s+"px",width:i+"px",height:o+"px"}}else{var a=Number(this.style.right.split("px")[0])-e;this.style={position:"fixed",right:a+"px",top:s+"px",width:i+"px",height:o+"px"}}},t.prototype.validate=function(t){return!(t.rectangle.width&&t.rectangle.height&&(t.rectangle.width<290||t.rectangle.height<260))},t.prototype.onResizeEnd=function(t){this.style={position:"fixed",left:t.rectangle.left+"px",top:t.rectangle.top+"px",width:t.rectangle.width+"px",height:t.rectangle.height+"px"},this.styleInside={height:t.rectangle.height-120+"px"}},t.prototype.toggleTopologyVisibility=function(t){this.isTopologyVisible=t},t.prototype.compareAsc=function(t,e){return t.name