text: !function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function i(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{Hsa7:function(t,a,n){"use strict";n.r(a),n.d(a,"SystemAgentModule",function(){return $});var s=n("ofXK"),r=n("3Pt+"),c=n("tyNb"),o=n("fXoL"),b=n("nBa0"),u=n("7PPe"),d=n("EnSQ"),l=n("limL"),v=n("1ahc"),f=n("KWWs");function g(e,t){if(1&e&&(o.Kb(0,"pre"),o.vc(1),o.Jb()),2&e){var i=o.Vb();o.wb(1),o.wc(i.config)}}var h,p=((h=function(){function t(i,a,n,s,r,c,o){e(this,t),this.sysService=i,this.route=a,this.cmdSvc=n,this.dataService=s,this.metadataSvc=r,this.schedulerSvc=c,this.notiSvc=o,this.service=""}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.route.queryParams.subscribe(function(t){t.svcName&&(e.service=t.svcName,e.getConfigs())})}},{key:"getConfigV2",value:function(e){var t=this;switch(e){case"edgex-core-data":return this.dataService.getConfig().subscribe(function(e){t.config=JSON.stringify(e,null,3)});case"edgex-core-metadata":return this.metadataSvc.getConfig().subscribe(function(e){t.config=JSON.stringify(e,null,3)});case"edgex-core-command":return this.cmdSvc.getConfig().subscribe(function(e){t.config=JSON.stringify(e,null,3)});case"edgex-support-notifications":return this.schedulerSvc.getConfig().subscribe(function(e){t.config=JSON.stringify(e,null,3)});case"edgex-support-scheduler":return this.notiSvc.getConfig().subscribe(function(e){t.config=JSON.stringify(e,null,3)})}}},{key:"getConfigs",value:function(){var e=this;this.sysService.getConfigBySvcName(this.service).subscribe(function(t){e.config=JSON.stringify(t[0].config,null,3)})}},{key:"edit",value:function(){}}]),t}()).\u0275fac=function(e){return new(e||h)(o.Hb(b.a),o.Hb(c.a),o.Hb(u.a),o.Hb(d.a),o.Hb(l.a),o.Hb(v.a),o.Hb(f.a))},h.\u0275cmp=o.Bb({type:h,selectors:[["app-config"]],decls:7,vars:2,consts:[[1,"card"],[1,"card-header"],[1,"fa","fa-file-text","text-danger","mr-2"],[1,"card-body"],[4,"ngIf"]],template:function(e,t){1&e&&(o.Kb(0,"div",0),o.Kb(1,"div",1),o.Kb(2,"span"),o.Ib(3,"i",2),o.vc(4),o.Jb(),o.Jb(),o.Kb(5,"div",3),o.tc(6,g,2,1,"pre",4),o.Jb(),o.Jb()),2&e&&(o.wb(4),o.xc(" ",t.service," Config Inspect"),o.wb(2),o.bc("ngIf",t.config))},directives:[s.l],styles:[".btn[disabled][_ngcontent-%COMP%]:hover{cursor:not-allowed}"]}),h);function m(e,t){if(1&e&&(o.Kb(0,"span",33),o.vc(1),o.Jb()),2&e){var i=o.Vb();o.wb(1),o.xc("",i.metrics.raw.mem_usage," ")}}function y(e,t){if(1&e&&(o.Kb(0,"span",33),o.vc(1),o.Jb()),2&e){var i=o.Vb();o.wb(1),o.xc("",i.metrics.cpuUsedPercent,"%")}}function w(e,t){if(1&e&&(o.Kb(0,"span",33),o.vc(1),o.Jb()),2&e){var i=o.Vb();o.wb(1),o.wc(i.metrics.raw.net_io)}}var J,S,K=((S=function(){function t(i,a,n){e(this,t),this.route=i,this.router=a,this.sysService=n,this.refreshRate=3,this.option={tooltip:{show:!0,trigger:"axis",formatter:"{c0}%"},legend:{data:[""]},dateZoom:{show:!1,start:0,end:100},calculable:!0,xAxis:[{type:"category",boundaryGap:!1,data:[0,0,0,0,0,0,0,0,0,0]}],yAxis:[{type:"value",axisLabel:{formatter:"{value}%"}}],series:[{name:"",type:"line",smooth:!0,itemStyle:{normal:{color:"#425CC7",areaStyle:{type:"default"}}},data:[0,0,0,0,0,0,0,0,0,0]}]},this.netChartOption={tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#922C48"}}},legend:{data:["RX","TX"]},xAxis:[{type:"category",boundaryGap:!1,data:[0,0,0,0,0,0,0,0,0,0]}],yAxis:[{type:"value"}],series:[{name:"RX",type:"line",smooth:!0,stack:"\u603b\u91cf",itemStyle:{normal:{color:"#922C48",areaStyle:{type:"default"}}},data:[0,0,0,0,0,0,0,0,0,0]},{name:"TX",type:"line",smooth:!0,stack:"\u603b\u91cf",itemStyle:{normal:{color:"#425CC7",areaStyle:{type:"default"}}},data:[0,0,0,0,0,0,0,0,0,0]}]}}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.route.queryParams.subscribe(function(t){t.svcName&&(e.service=t.svcName,e.memoryUsageChart=echarts.init(document.getElementById("memory-usage")),e.cpuUsageChart=echarts.init(document.getElementById("cpu-usage")),e.networkUsageChart=echarts.init(document.getElementById("network-usage")),e.option.legend.data.shift(),e.option.legend.data.push("Memory"),e.memoryUsageChart.setOption(e.option),e.option.legend.data.shift(),e.option.legend.data.push("CPU"),e.cpuUsageChart.setOption(e.option),e.networkUsageChart.setOption(e.netChartOption),e.sysService.getMetricsBySvcName(t.svcName).subscribe(function(t){e.metrics=t[0].metrics,e.feedAllCharts()}),e.timer=window.setInterval(e.metricsTimer,1e3*e.refreshRate,e))})}},{key:"metricsTimer",value:function(e){var t=this;e.sysService.getMetricsBySvcName(e.service).subscribe(function(i){t.metrics=i[0].metrics,e.feedAllCharts()})}},{key:"feedAllCharts",value:function(){var e=this.cpuUsageChart.getOption();e.series[0].data.shift(),e.series[0].data.push(this.metrics.cpuUsedPercent),e.xAxis[0].data.shift(),e.xAxis[0].data.push(this.timestamp()),this.cpuUsageChart.setOption(e);var t=this.memoryUsageChart.getOption();t.series[0].data.shift(),t.series[0].data.push(this.metrics.raw.mem_perc.substring(0,this.metrics.raw.mem_perc.length-1)),t.xAxis[0].data.shift(),t.xAxis[0].data.push(this.timestamp()),this.memoryUsageChart.setOption(t);var i=this.networkUsageChart.getOption(),a=this.metrics.raw.net_io.split("/"),n=a[0].trim().replace("kB","").replace("MB",""),s=a[1].trim().replace("kB","").replace("MB","");i.series[0].data.shift(),i.series[0].data.push(n),i.series[1].data.shift(),i.series[1].data.push(s),i.xAxis[0].data.shift(),i.xAxis[0].data.push(this.timestamp()),this.networkUsageChart.setOption(i)}},{key:"onRateSelect",value:function(){console.log(this.refreshRate),clearInterval(this.timer),this.timer=window.setInterval(this.metricsTimer,1e3*this.refreshRate,this)}},{key:"timestamp",value:function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds())}},{key:"ngOnDestroy",value:function(){clearInterval(this.timer)}}]),t}()).\u0275fac=function(e){return new(e||S)(o.Hb(c.a),o.Hb(c.e),o.Hb(b.a))},S.\u0275cmp=o.Bb({type:S,selectors:[["app-metrics"]],decls:60,vars:5,consts:[[1,"card","mb-3"],[1,"card-header","font-weight-bold"],[1,"fa","fa-wrench"],[1,"card-body"],[1,"media"],[1,"align-self-center","mr-3"],[1,"fa","fa-server","fa-3x","color-edgex-red"],[1,"media-body"],[1,"mt-0","font-weight-bold"],[1,"badge","badge-success"],[1,"font-weight-bold","d-inline"],[1,"badge","badge-info","mr-2"],["class","text-weight",4,"ngIf"],[1,"font-weight-bold","ml-2","d-inline"],[1,"badge","badge-warning","mr-1"],[1,"badge","badge-primary","mr-1"],[1,"input-group","mb-3","mt-3",2,"width","200px"],[1,"input-group-prepend"],[1,"input-group-text"],[1,"form-control",3,"ngModel","ngModelChange"],["selected","","value","3"],["value","5"],["value","10"],["value","15"],[1,"row"],[1,"col-lg-4"],[1,"card-header"],[1,"fa","fa-area-chart"],[1,"card-body","overflow-auto"],["id","memory-usage",1,"vw-auto",2,"height","300px"],["id","cpu-usage",1,"vw-auto",2,"height","300px"],[1,"card"],["id","network-usage",1,"vw-auto",2,"height","300px"],[1,"text-weight"]],template:function(e,t){1&e&&(o.Kb(0,"div",0),o.Kb(1,"div",1),o.Ib(2,"i",2),o.vc(3," Setting "),o.Jb(),o.Kb(4,"div",3),o.Kb(5,"div",4),o.Kb(6,"div",5),o.Ib(7,"i",6),o.Jb(),o.Kb(8,"div",7),o.Kb(9,"h5",8),o.vc(10),o.Kb(11,"span",9),o.vc(12,"up"),o.Jb(),o.Jb(),o.Kb(13,"div",10),o.Kb(14,"span",11),o.vc(15,"mem_usage"),o.Jb(),o.tc(16,m,2,1,"span",12),o.Jb(),o.Kb(17,"div",13),o.Kb(18,"span",14),o.vc(19,"cpu_usage"),o.Jb(),o.tc(20,y,2,1,"span",12),o.Jb(),o.Kb(21,"div",13),o.Kb(22,"span",15),o.vc(23,"net_io"),o.Jb(),o.tc(24,w,2,1,"span",12),o.Jb(),o.Jb(),o.Jb(),o.Kb(25,"div",16),o.Kb(26,"div",17),o.Kb(27,"span",18),o.vc(28,"Refresh Rate"),o.Jb(),o.Jb(),o.Kb(29,"select",19),o.Sb("ngModelChange",function(e){return t.refreshRate=e})("ngModelChange",function(){return t.onRateSelect()}),o.Kb(30,"option",20),o.vc(31,"3s"),o.Jb(),o.Kb(32,"option",21),o.vc(33,"5s"),o.Jb(),o.Kb(34,"option",22),o.vc(35,"10s"),o.Jb(),o.Kb(36,"option",23),o.vc(37,"15s"),o.Jb(),o.Jb(),o.Jb(),o.Jb(),o.Jb(),o.Kb(38,"div",24),o.Kb(39,"div",25),o.Kb(40,"div",0),o.Kb(41,"div",26),o.Ib(42,"i",27),o.vc(43,"Memory usage"),o.Jb(),o.Kb(44,"div",28),o.Ib(45,"div",29),o.Jb(),o.Jb(),o.Jb(),o.Kb(46,"div",25),o.Kb(47,"div",0),o.Kb(48,"div",26),o.Ib(49,"i",27),o.vc(50,"CPU usage"),o.Jb(),o.Kb(51,"div",28),o.Ib(52,"div",30),o.Jb(),o.Jb(),o.Jb(),o.Kb(53,"div",25),o.Kb(54,"div",31),o.Kb(55,"div",26),o.Ib(56,"i",27),o.vc(57,"Network traffic"),o.Jb(),o.Kb(58,"div",28),o.Ib(59,"div",32),o.Jb(),o.Jb(),o.Jb(),o.Jb()),2&e&&(o.wb(10),o.xc("",t.service," "),o.wb(6),o.bc("ngIf",t.metrics),o.wb(4),o.bc("ngIf",t.metrics),o.wb(4),o.bc("ngIf",t.metrics),o.wb(5),o.bc("ngModel",t.refreshRate))},directives:[s.l,r.n,r.f,r.i,r.j,r.o],styles:[".btn[disabled][_ngcontent-%COMP%]:hover{cursor:not-allowed}"]}),S),C=((J=function(){function t(i){e(this,t),this.activatedRoute=i}return i(t,[{key:"ngOnInit",value:function(){this.activatedRoute.url.subscribe(function(e){return console.log("The URL changed to: "+e)})}}]),t}()).\u0275fac=function(e){return new(e||J)(o.Hb(c.a))},J.\u0275cmp=o.Bb({type:J,selectors:[["app-system-agent"]],decls:1,vars:0,template:function(e,t){1&e&&o.Ib(0,"router-outlet")},directives:[c.j],styles:[""]}),J),x=n("hsl2"),k=n("9vc0");function I(e,t){1&e&&(o.Kb(0,"button",12),o.Ib(1,"span",13),o.vc(2," Loading... "),o.Jb())}function O(e,t){if(1&e){var i=o.Lb();o.Kb(0,"button",14),o.Sb("click",function(){return o.oc(i),o.Vb().refresh()}),o.Kb(1,"span"),o.Ib(2,"i",15),o.vc(3,"Refresh"),o.Jb(),o.Jb()}if(2&e){var a=o.Vb();o.bc("disabled",a.operationBtnDisabled)}}function B(e,t){1&e&&(o.Kb(0,"span",23),o.vc(1,"running"),o.Jb())}function H(e,t){1&e&&(o.Kb(0,"span",24),o.vc(1,"stopped"),o.Jb())}var N=function(){return["../metric"]},V=function(e){return{svcName:e}};function M(e,t){if(1&e&&(o.Kb(0,"a",25),o.Ib(1,"i",26),o.Jb()),2&e){var i=o.Vb().$implicit;o.bc("routerLink",o.gc(2,N))("queryParams",o.hc(3,V,i.name))}}function P(e,t){1&e&&(o.Kb(0,"a"),o.Ib(1,"i",27),o.Jb())}var D=function(){return["../config"]};function U(e,t){if(1&e&&(o.Kb(0,"a",25),o.Ib(1,"i",28),o.Jb()),2&e){var i=o.Vb().$implicit;o.bc("routerLink",o.gc(2,D))("queryParams",o.hc(3,V,i.name))}}function A(e,t){1&e&&(o.Kb(0,"a"),o.Ib(1,"i",27),o.Jb())}function L(e,t){if(1&e){var i=o.Lb();o.Kb(0,"span"),o.Kb(1,"span",29),o.Sb("click",function(){o.oc(i);var e=o.Vb().$implicit;return o.Vb().start(e.name)}),o.vc(2,"start"),o.Jb(),o.Kb(3,"span",30),o.Sb("click",function(){o.oc(i);var e=o.Vb().$implicit;return o.Vb().restart(e.name)}),o.vc(4,"restart"),o.Jb(),o.Kb(5,"span",31),o.Sb("click",function(){o.oc(i);var e=o.Vb().$implicit;return o.Vb().stop(e.name)}),o.vc(6,"stop"),o.Jb(),o.Jb()}}function R(e,t){1&e&&(o.Kb(0,"div",32),o.Kb(1,"span",33),o.vc(2,"Loading..."),o.Jb(),o.Jb(),o.Kb(3,"div",34),o.Kb(4,"span",33),o.vc(5,"Loading..."),o.Jb(),o.Jb(),o.Kb(6,"div",35),o.Kb(7,"span",33),o.vc(8,"Loading..."),o.Jb(),o.Jb())}function E(e,t){if(1&e&&(o.Kb(0,"tr"),o.Kb(1,"td"),o.vc(2),o.Jb(),o.Kb(3,"td",16),o.tc(4,B,2,0,"span",17),o.tc(5,H,2,0,"span",18),o.Jb(),o.Kb(6,"td",16),o.tc(7,M,2,5,"a",19),o.tc(8,P,2,0,"a",20),o.Jb(),o.Kb(9,"td",16),o.tc(10,U,2,5,"a",19),o.tc(11,A,2,0,"a",20),o.Jb(),o.Kb(12,"td"),o.tc(13,L,7,0,"span",21),o.tc(14,R,9,0,"ng-template",null,22,o.uc),o.Jb(),o.Jb()),2&e){var i=t.$implicit,a=o.lc(15),n=o.Vb();o.wb(2),o.wc(i.name),o.wb(1),o.bc("ngSwitch",i.alive),o.wb(1),o.bc("ngSwitchCase",!0),o.wb(2),o.bc("ngSwitch",i.alive),o.wb(1),o.bc("ngSwitchCase",!0),o.wb(2),o.bc("ngSwitch",i.alive),o.wb(1),o.bc("ngSwitchCase",!0),o.wb(3),o.bc("ngIf",!n.operationBtnDisabled)("ngIfElse",a)}}var T,_,j,q=[{path:"",component:C,children:[{path:"",redirectTo:"service-list",pathMatch:"full"},{path:"service-list",component:(T=function(){function t(i,a,n){e(this,t),this.sysService=i,this.msgSvc=a,this.errorSvc=n,this.defaultServcies=["edgex-core-metadata","edgex-core-data","edgex-core-command","edgex-support-notifications","edgex-support-scheduler","edgex-app-rules-engine"],this.operationBtnDisabled=!1,this.toggleClass="",this.availServices=[]}return i(t,[{key:"ngOnInit",value:function(){this.allSvcHealthCheck()}},{key:"allSvcHealthCheck",value:function(){var e=this;this.sysService.getAllSvcHealth(this.defaultServcies.join(",")).subscribe(function(t){e.availServices=[],t.forEach(function(t,i){var a={name:""+t.serviceName,statusCode:""+t.statusCode};a.alive=200===t.statusCode,e.availServices.push(a)}),e.availServices.sort(function(e,t){return e.name>t.name?1:-1})})}},{key:"refresh",value:function(){var e=this;this.operationBtnDisabled=!0,this.sysService.getAllSvcHealth(this.defaultServcies.join(",")).subscribe(function(t){e.availServices=[],t.forEach(function(t,i){var a={name:""+t.serviceName,statusCode:""+t.statusCode};a.alive=200===t.statusCode,e.availServices.push(a)}),e.operationBtnDisabled=!1,e.availServices.sort(function(e,t){return e.name>t.name?1:-1}),e.msgSvc.success("refresh")})}},{key:"start",value:function(e){var t=this;this.operationBtnDisabled=!0,this.sysService.startV2(e).subscribe(function(e){200===e[0].statusCode?(t.availServices.forEach(function(t){if("edgex-"+t.name===e[0].serviceName)return t.statusCode=String(e[0].statusCode),void(t.alive=!0)}),setTimeout(function(){t.operationBtnDisabled=!1},2e3)):t.msgSvc.errors(e[0].message)})}},{key:"restart",value:function(e){var t=this;this.operationBtnDisabled=!0,this.sysService.restartV2(e).subscribe(function(e){200===e[0].statusCode?setTimeout(function(){t.allSvcHealthCheck(),t.operationBtnDisabled=!1},2e3):t.msgSvc.errors(e[0].message)})}},{key:"stop",value:function(e){var t=this;this.operationBtnDisabled=!0,this.sysService.stopV2(e).subscribe(function(e){200===e[0].statusCode?setTimeout(function(){t.allSvcHealthCheck(),t.operationBtnDisabled=!1},2e3):t.msgSvc.errors(e[0].message)})}}]),t}(),T.\u0275fac=function(e){return new(e||T)(o.Hb(b.a),o.Hb(x.a),o.Hb(k.a))},T.\u0275cmp=o.Bb({type:T,selectors:[["app-service-list"]],decls:25,vars:3,consts:[[1,"card"],[1,"card-header"],[1,"fa","fa-list","text-danger","mr-2"],[1,"card-body","p-0"],[1,"bg-light","px-3","py-2"],["class","btn btn-primary","type","button","disabled","",4,"ngIf"],["class","btn btn-primary btn-sm ",3,"disabled","click",4,"ngIf"],[1,"table-responsive"],[1,"table","table-hover","text-truncate"],[1,"thead-light"],["scope","col"],[4,"ngFor","ngForOf"],["type","button","disabled","",1,"btn","btn-primary"],["role","status","aria-hidden","true",1,"spinner-grow","spinner-grow-sm"],[1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fa","fa-refresh","mr-1"],[3,"ngSwitch"],["class","badge badge-success",4,"ngSwitchCase"],["class","badge badge-danger",4,"ngSwitchDefault"],[3,"routerLink","queryParams",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[4,"ngIf","ngIfElse"],["LoadingTemplate",""],[1,"badge","badge-success"],[1,"badge","badge-danger"],[3,"routerLink","queryParams"],[1,"fa","fa-area-chart"],[1,"fa","fa-ban","fa-stack-lg","text-danger"],[1,"fa","fa-file-text"],["role","button",1,"badge","badge-info","mr-1",3,"click"],["role","button",1,"badge","badge-warning","mr-1",3,"click"],["role","button",1,"badge","badge-danger",3,"click"],["role","status",1,"spinner-grow","spinner-grow-sm","text-info","mr-1"],[1,"sr-only"],["role","status",1,"spinner-grow","spinner-grow-sm","text-warning","mr-1"],["role","status",1,"spinner-grow","spinner-grow-sm","text-danger"]],template:function(e,t){1&e&&(o.Kb(0,"div",0),o.Kb(1,"div",1),o.Ib(2,"i",2),o.Kb(3,"span"),o.vc(4,"System Services List"),o.Jb(),o.Jb(),o.Kb(5,"div",3),o.Kb(6,"div",4),o.tc(7,I,3,0,"button",5),o.tc(8,O,4,1,"button",6),o.Jb(),o.Kb(9,"div",7),o.Kb(10,"table",8),o.Kb(11,"thead",9),o.Kb(12,"tr"),o.Kb(13,"th",10),o.vc(14,"Name"),o.Jb(),o.Kb(15,"th",10),o.vc(16,"State"),o.Jb(),o.Kb(17,"th",10),o.vc(18,"Metric"),o.Jb(),o.Kb(19,"th",10),o.vc(20,"Config"),o.Jb(),o.Kb(21,"th",10),o.vc(22,"Operation"),o.Jb(),o.Jb(),o.Jb(),o.Kb(23,"tbody"),o.tc(24,E,16,9,"tr",11),o.Jb(),o.Jb(),o.Jb(),o.Jb(),o.Jb()),2&e&&(o.wb(7),o.bc("ngIf",t.operationBtnDisabled),o.wb(1),o.bc("ngIf",!t.operationBtnDisabled),o.wb(16),o.bc("ngForOf",t.availServices))},directives:[s.l,s.k,s.n,s.o,s.p,c.h],styles:[".btn[disabled][_ngcontent-%COMP%]:hover{cursor:not-allowed}"]}),T)},{path:"metric",component:K},{path:"config",component:p}]}],X=((j=function t(){e(this,t)}).\u0275mod=o.Fb({type:j}),j.\u0275inj=o.Eb({factory:function(e){return new(e||j)},imports:[[c.i.forChild(q)],c.i]}),j),$=((_=function t(){e(this,t)}).\u0275mod=o.Fb({type:_}),_.\u0275inj=o.Eb({factory:function(e){return new(e||_)},imports:[[s.b,r.b,X]]}),_)}}])}();