mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 19:28:07 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(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<e.name?-1:1},t.prototype.compareDesc=function(t,e){return t.name<e.name?1:-1},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach(function(t){return t.unsubscribe()})},t.prototype.setSortingOrder=function(){this.filteredNodes=this.filteredNodes.sort("asc"===this.sortingOrder?this.compareAsc:this.compareDesc)},t.prototype.applyStatusFilter=function(t){"started"===t?this.startedStatusFilterEnabled=!this.startedStatusFilterEnabled:"stopped"===t?this.stoppedStatusFilterEnabled=!this.stoppedStatusFilterEnabled:"suspended"===t&&(this.suspendedStatusFilterEnabled=!this.suspendedStatusFilterEnabled),this.applyFilters()},t.prototype.applyCaptureFilter=function(t){"capture"===t?this.captureFilterEnabled=!this.captureFilterEnabled:"packet"===t&&(this.packetFilterEnabled=!this.packetFilterEnabled),this.applyFilters()},t.prototype.applyFilters=function(){var t=[];this.startedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(t){return"started"===t.status}))),this.stoppedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(t){return"stopped"===t.status}))),this.suspendedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(t){return"suspended"===t.status}))),this.startedStatusFilterEnabled||this.stoppedStatusFilterEnabled||this.suspendedStatusFilterEnabled||(t=t.concat(this.nodes)),this.captureFilterEnabled&&(t=this.checkCapturing(t)),this.packetFilterEnabled&&(t=this.checkPacketFilters(t)),this.filteredNodes=t.sort("asc"===this.sortingOrder?this.compareAsc:this.compareDesc)},t.prototype.checkCapturing=function(t){var e=this.linksDataSource.getItems(),n=[];e.forEach(function(t){t.capturing&&t.nodes.forEach(function(t){n.push(t.node_id)})});var i=[];return t.forEach(function(t){n.includes(t.node_id)&&i.push(t)}),i},t.prototype.checkPacketFilters=function(t){var e=this.linksDataSource.getItems(),n=[];e.forEach(function(t){(t.filters.bpf||t.filters.corrupt||t.filters.corrupt||t.filters.packet_loss||t.filters.frequency_drop)&&t.nodes.forEach(function(t){n.push(t.node_id)})});var i=[];return t.forEach(function(t){n.includes(t.node_id)&&i.push(t)}),i},t.prototype.close=function(){this.closeTopologySummary.emit(!1)},t.\u0275fac=function(e){return new(e||t)(i.Y36(o.G),i.Y36(s.Y),i.Y36(r.X),i.Y36(a.F),i.Y36(p.f))},t.\u0275cmp=i.Xpm({type:t,selectors:[["app-topology-summary"]],inputs:{server:"server",project:"project"},outputs:{closeTopologySummary:"closeTopologySummary"},decls:2,vars:2,consts:[[3,"mousemove","mouseup",4,"ngIf"],["class","summaryWrapper","mwlResizable","",3,"ngStyle","ngClass","validateResize","resizeEdges","enableGhostResize","mousedown","resizeStart","resizeEnd",4,"ngIf"],[3,"mousemove","mouseup"],["mwlResizable","",1,"summaryWrapper",3,"ngStyle","ngClass","validateResize","resizeEdges","enableGhostResize","mousedown","resizeStart","resizeEnd"],[1,"summaryHeader"],["label","Map topology",3,"click"],[1,"tabContent"],[1,"summaryFilters"],["placeholder","Filter nodes","multiple",""],["label","Status filter"],["value","started",3,"onSelectionChange"],["value","suspended",3,"onSelectionChange"],["value","stopped",3,"onSelectionChange"],["label","Capture filter"],["value","capture",3,"onSelectionChange"],["value","packet",3,"onSelectionChange"],[1,"summarySorting"],["placeholder","Sorting",3,"value","selectionChange","valueChange"],["value","asc"],["value","desc"],[1,"divider"],[1,"summaryContent",3,"ngStyle"],["class","nodeRow",4,"ngFor","ngForOf"],["label","Servers",3,"click"],[1,"summaryContentServers"],[1,"nodeRow"],["width","10","height","10",4,"ngIf"],[4,"ngIf"],["width","10","height","10"],["x","0","y","0","width","10","height","10","fill","green",1,"status_started"],["x","0","y","0","width","10","height","10","fill","yellow",1,"status_suspended"],["x","0","y","0","width","10","height","10","fill","red",1,"status_stopped"]],template:function(t,e){1&t&&(i.YNc(0,m,1,0,"div",0),i.YNc(1,E,32,12,"div",1)),2&t&&(i.Q6J("ngIf",e.isDraggingEnabled),i.xp6(1),i.Q6J("ngIf",e.projectsStatistics))},directives:[c.O5,l.E$,c.PC,c.mk,u.SP,u.uX,g.gD,d.Nv,d.ey,h.d,c.sg],styles:["@media screen and (max-width: 600px){.summaryWrapper[_ngcontent-%COMP%]{visibility:hidden}}mat-tab-group[_ngcontent-%COMP%]{width:100%}.summaryWrapper[_ngcontent-%COMP%]{box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);position:fixed;top:60px;right:0;height:400px;width:320px;background:#263238;color:#fff;overflow:hidden;font-size:12px}.lightTheme[_ngcontent-%COMP%], .summaryWrapper[_ngcontent-%COMP%]{margin:20px;border-radius:8px}.lightTheme[_ngcontent-%COMP%]{background-color:rgba(244,248,252,.95);color:#000}.summaryHeaderMenu[_ngcontent-%COMP%]{height:24px}.summaryHeader[_ngcontent-%COMP%]{width:100%;display:flex}.summaryFilters[_ngcontent-%COMP%], .summarySorting[_ngcontent-%COMP%]{height:25px;margin-left:5px;margin-right:5px}.tabContent[_ngcontent-%COMP%]{padding:10px}.summaryContent[_ngcontent-%COMP%], .summaryContentServers[_ngcontent-%COMP%]{overflow:auto;scrollbar-color:#a9a9a9 #263238;scrollbar-width:thin}.summaryContentServers[_ngcontent-%COMP%]{max-height:350px}.titleButton[_ngcontent-%COMP%]{margin-left:5px;margin-top:4px;outline:none;border-radius:0}.marked[_ngcontent-%COMP%]{color:#0097a7;border-bottom:2px solid #0097a7}.divider[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:5px;width:100%;height:2px}.nodeRow[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;padding-right:5px}[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5em}[_ngcontent-%COMP%]::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3)}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#a9a9a9;outline:1px solid #263238}.radio-group-wrapper[_ngcontent-%COMP%]{margin-top:5px}.radio-group[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.closeButton[_ngcontent-%COMP%]{cursor:pointer;font-size:24px;margin-top:8px;margin-right:5px}.filterBox[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.notvisible[_ngcontent-%COMP%]{display:none}"]}),t}()}}]); |