mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-21 21:57:49 +00:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[157],{21157:function(J,g,l){l.r(g),l.d(g,{TopologySummaryComponent:function(){return R}});var m=l(18967),h=l(14105),e=l(83668),v=l(52094),f=l(81856),y=l(64097),C=l(41999),T=l(2856),u=l(86019),x=l(58939),d=l(12605),S=l(16400),_=l(6731),b=l(85694);function E(s,a){if(1&s){var o=e.EpF();e.TgZ(0,"div",2),e.NdJ("mousemove",function(i){return e.CHM(o),e.oxw().dragWidget(i)},!1,e.evT)("mouseup",function(){return e.CHM(o),e.oxw().toggleDragging(!1)},!1,e.evT),e.qZA()}}function Z(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",28),e._UZ(1,"rect",29),e.qZA())}function O(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",28),e._UZ(1,"rect",30),e.qZA())}function M(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",28),e._UZ(1,"rect",31),e.qZA())}function P(s,a){if(1&s&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&s){var o=e.oxw().$implicit;e.xp6(1),e.lnq(" ",o.console_type," ",o.console_host,":",o.console," ")}}function w(s,a){1&s&&(e.TgZ(0,"div"),e._uU(1," none "),e.qZA())}function A(s,a){if(1&s&&(e.TgZ(0,"div",25),e.TgZ(1,"div"),e.YNc(2,Z,2,0,"svg",26),e.YNc(3,O,2,0,"svg",26),e.YNc(4,M,2,0,"svg",26),e._uU(5),e.qZA(),e.YNc(6,P,2,3,"div",27),e.YNc(7,w,2,0,"div",27),e.qZA()),2&s){var o=a.$implicit;e.xp6(2),e.Q6J("ngIf","started"===o.status),e.xp6(1),e.Q6J("ngIf","suspended"===o.status),e.xp6(1),e.Q6J("ngIf","stopped"===o.status),e.xp6(1),e.hij(" ",o.name," "),e.xp6(1),e.Q6J("ngIf",null!=o.console&&null!=o.console&&"none"!=o.console_type),e.xp6(1),e.Q6J("ngIf",null==o.console||"none"===o.console_type)}}function D(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",28),e._UZ(1,"rect",29),e.qZA())}function F(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",28),e._UZ(1,"rect",31),e.qZA())}function k(s,a){if(1&s&&(e.TgZ(0,"div",25),e.TgZ(1,"div"),e.YNc(2,D,2,0,"svg",26),e.YNc(3,F,2,0,"svg",26),e._uU(4),e.qZA(),e.TgZ(5,"div"),e._uU(6),e.qZA(),e.TgZ(7,"div"),e._uU(8),e.qZA(),e.qZA()),2&s){var o=a.$implicit,t=e.oxw(2);e.xp6(2),e.Q6J("ngIf",o.connected),e.xp6(1),e.Q6J("ngIf",!o.connected),e.xp6(1),e.hij(" ",o.name," "),e.xp6(2),e.hij(" ",o.host," "),e.xp6(2),e.hij(" ",t.server.location," ")}}var N=function(a){return{lightTheme:a}},U=function(){return{right:!0,left:!0,bottom:!0,top:!0}};function I(s,a){if(1&s){var o=e.EpF();e.TgZ(0,"div",3),e.NdJ("mousedown",function(){return e.CHM(o),e.oxw().toggleDragging(!0)})("resizeStart",function(){return e.CHM(o),e.oxw().toggleDragging(!1)})("resizeEnd",function(n){return e.CHM(o),e.oxw().onResizeEnd(n)}),e.TgZ(1,"div",4),e.TgZ(2,"mat-tab-group"),e.TgZ(3,"mat-tab",5),e.NdJ("click",function(){return e.CHM(o),e.oxw().toggleTopologyVisibility(!0)}),e.TgZ(4,"div",6),e.TgZ(5,"div",7),e.TgZ(6,"mat-select",8),e.TgZ(7,"mat-optgroup",9),e.TgZ(8,"mat-option",10),e.NdJ("onSelectionChange",function(){return e.CHM(o),e.oxw().applyStatusFilter("started")}),e._uU(9,"started"),e.qZA(),e.TgZ(10,"mat-option",11),e.NdJ("onSelectionChange",function(){return e.CHM(o),e.oxw().applyStatusFilter("suspended")}),e._uU(11,"suspended"),e.qZA(),e.TgZ(12,"mat-option",12),e.NdJ("onSelectionChange",function(){return e.CHM(o),e.oxw().applyStatusFilter("stopped")}),e._uU(13,"stopped"),e.qZA(),e.qZA(),e.TgZ(14,"mat-optgroup",13),e.TgZ(15,"mat-option",14),e.NdJ("onSelectionChange",function(){return e.CHM(o),e.oxw().applyCaptureFilter("capture")}),e._uU(16,"active capture(s)"),e.qZA(),e.TgZ(17,"mat-option",15),e.NdJ("onSelectionChange",function(){return e.CHM(o),e.oxw().applyCaptureFilter("packet")}),e._uU(18,"active packet captures"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"div",16),e.TgZ(20,"mat-select",17),e.NdJ("selectionChange",function(){return e.CHM(o),e.oxw().setSortingOrder()})("valueChange",function(n){return e.CHM(o),e.oxw().sortingOrder=n}),e.TgZ(21,"mat-option",18),e._uU(22,"sort by name ascending"),e.qZA(),e.TgZ(23,"mat-option",19),e._uU(24,"sort by name descending"),e.qZA(),e.qZA(),e.qZA(),e._UZ(25,"mat-divider",20),e.TgZ(26,"div",21),e.YNc(27,A,8,6,"div",22),e.qZA(),e.qZA(),e.qZA(),e.TgZ(28,"mat-tab",23),e.NdJ("click",function(){return e.CHM(o),e.oxw().toggleTopologyVisibility(!1)}),e.TgZ(29,"div",6),e.TgZ(30,"div",24),e.YNc(31,k,9,5,"div",22),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&s){var t=e.oxw();e.Q6J("ngStyle",t.style)("ngClass",e.VKq(9,N,t.isLightThemeEnabled))("validateResize",t.validate)("resizeEdges",e.DdM(11,U))("enableGhostResize",!0),e.xp6(20),e.Q6J("value",t.sortingOrder),e.xp6(6),e.Q6J("ngStyle",t.styleInside),e.xp6(1),e.Q6J("ngForOf",t.filteredNodes),e.xp6(4),e.Q6J("ngForOf",t.computes)}}var R=function(){var s=function(){function a(o,t,i,n,c){(0,m.Z)(this,a),this.nodesDataSource=o,this.projectService=t,this.computeService=i,this.linksDataSource=n,this.themeService=c,this.closeTopologySummary=new e.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,h.Z)(a,[{key:"ngOnInit",value:function(){var t=this;this.isLightThemeEnabled="light"===this.themeService.getActualTheme(),this.subscriptions.push(this.nodesDataSource.changes.subscribe(function(i){t.nodes=i,t.nodes.forEach(function(n){("0.0.0.0"===n.console_host||"0:0:0:0:0:0:0:0"===n.console_host||"::"===n.console_host)&&(n.console_host=t.server.host)}),t.filteredNodes=i.sort("asc"===t.sortingOrder?t.compareAsc:t.compareDesc)})),this.projectService.getStatistics(this.server,this.project.project_id).subscribe(function(i){t.projectsStatistics=i}),this.computeService.getComputes(this.server).subscribe(function(i){t.computes=i}),this.style={top:"60px",right:"0px",width:"320px",height:"400px"}}},{key:"toggleDragging",value:function(t){this.isDraggingEnabled=t}},{key:"dragWidget",value:function(t){var i=Number(t.movementX),n=Number(t.movementY),c=Number(this.style.width.split("px")[0]),r=Number(this.style.height.split("px")[0]),p=Number(this.style.top.split("px")[0])+n;if(this.style.left){var z=Number(this.style.left.split("px")[0])+i;this.style={position:"fixed",left:"".concat(z,"px"),top:"".concat(p,"px"),width:"".concat(c,"px"),height:"".concat(r,"px")}}else{var q=Number(this.style.right.split("px")[0])-i;this.style={position:"fixed",right:"".concat(q,"px"),top:"".concat(p,"px"),width:"".concat(c,"px"),height:"".concat(r,"px")}}}},{key:"validate",value:function(t){return!(t.rectangle.width&&t.rectangle.height&&(t.rectangle.width<290||t.rectangle.height<260))}},{key:"onResizeEnd",value:function(t){this.style={position:"fixed",left:"".concat(t.rectangle.left,"px"),top:"".concat(t.rectangle.top,"px"),width:"".concat(t.rectangle.width,"px"),height:"".concat(t.rectangle.height,"px")},this.styleInside={height:"".concat(t.rectangle.height-120,"px")}}},{key:"toggleTopologyVisibility",value:function(t){this.isTopologyVisible=t}},{key:"compareAsc",value:function(t,i){return t.name<i.name?-1:1}},{key:"compareDesc",value:function(t,i){return t.name<i.name?1:-1}},{key:"ngOnDestroy",value:function(){this.subscriptions.forEach(function(t){return t.unsubscribe()})}},{key:"setSortingOrder",value:function(){this.filteredNodes=this.filteredNodes.sort("asc"===this.sortingOrder?this.compareAsc:this.compareDesc)}},{key:"applyStatusFilter",value:function(t){"started"===t?this.startedStatusFilterEnabled=!this.startedStatusFilterEnabled:"stopped"===t?this.stoppedStatusFilterEnabled=!this.stoppedStatusFilterEnabled:"suspended"===t&&(this.suspendedStatusFilterEnabled=!this.suspendedStatusFilterEnabled),this.applyFilters()}},{key:"applyCaptureFilter",value:function(t){"capture"===t?this.captureFilterEnabled=!this.captureFilterEnabled:"packet"===t&&(this.packetFilterEnabled=!this.packetFilterEnabled),this.applyFilters()}},{key:"applyFilters",value:function(){var t=[];this.startedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(i){return"started"===i.status}))),this.stoppedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(i){return"stopped"===i.status}))),this.suspendedStatusFilterEnabled&&(t=t.concat(this.nodes.filter(function(i){return"suspended"===i.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)}},{key:"checkCapturing",value:function(t){var i=this.linksDataSource.getItems(),n=[];i.forEach(function(r){r.capturing&&r.nodes.forEach(function(p){n.push(p.node_id)})});var c=[];return t.forEach(function(r){n.includes(r.node_id)&&c.push(r)}),c}},{key:"checkPacketFilters",value:function(t){var i=this.linksDataSource.getItems(),n=[];i.forEach(function(r){(r.filters.bpf||r.filters.corrupt||r.filters.corrupt||r.filters.packet_loss||r.filters.frequency_drop)&&r.nodes.forEach(function(p){n.push(p.node_id)})});var c=[];return t.forEach(function(r){n.includes(r.node_id)&&c.push(r)}),c}},{key:"close",value:function(){this.closeTopologySummary.emit(!1)}}]),a}();return s.\u0275fac=function(o){return new(o||s)(e.Y36(v.G),e.Y36(f.Y),e.Y36(y.X),e.Y36(C.F),e.Y36(T.f))},s.\u0275cmp=e.Xpm({type:s,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(o,t){1&o&&(e.YNc(0,E,1,0,"div",0),e.YNc(1,I,32,12,"div",1)),2&o&&(e.Q6J("ngIf",t.isDraggingEnabled),e.xp6(1),e.Q6J("ngIf",t.projectsStatistics))},directives:[u.O5,x.E$,u.PC,u.mk,d.SP,d.uX,S.gD,_.Nv,_.ey,b.d,u.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 #0003,0 6px 20px #00000030;position:fixed;top:60px;right:0px;height:400px;width:320px;background:#263238;color:#fff;overflow:hidden;font-size:12px;margin:20px;border-radius:8px}.lightTheme[_ngcontent-%COMP%]{background-color:#f4f8fcf2;color:#000;margin:20px;border-radius:8px}.summaryHeaderMenu[_ngcontent-%COMP%]{height:24px}.summaryHeader[_ngcontent-%COMP%]{width:100%;display:flex}.summaryFilters[_ngcontent-%COMP%]{height:25px;margin-left:5px;margin-right:5px}.summarySorting[_ngcontent-%COMP%]{height:25px;margin-left:5px;margin-right:5px}.tabContent[_ngcontent-%COMP%]{padding:10px}.summaryContent[_ngcontent-%COMP%]{overflow:auto;scrollbar-color:darkgrey #263238;scrollbar-width:thin}.summaryContentServers[_ngcontent-%COMP%]{max-height:350px;overflow:auto;scrollbar-color:darkgrey #263238;scrollbar-width:thin}.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}"]}),s}()}}]); |