/**
* @license
-* Copyright (C) 2017-2018 "IoT.bzh"
+* Copyright (C) 2017-2019 "IoT.bzh"
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
import { Component, OnInit, Input } from '@angular/core';
-import { Observable } from 'rxjs/Observable';
-import { Subject } from 'rxjs/Subject';
import { NbThemeService } from '@nebular/theme';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { ConfigService, IConfig } from '../../@core-xds/services/config.service';
-import { SupervisionService } from '../../@core-xds/services/supervision.service';
+import { MonitoringService } from '../../@core-xds/services/monitoring.service';
import { AlertService } from '../../@core-xds/services/alert.service';
export interface GrafanaDashboard {
}
@Component({
- selector: 'xds-supervision',
- styleUrls: ['./supervision.component.scss'],
- templateUrl: './supervision.component.html',
+ selector: 'xds-monitoring',
+ styleUrls: ['./monitoring.component.scss'],
+ templateUrl: './monitoring.component.html',
})
-export class SupervisionComponent implements OnInit {
+export class MonitoringComponent implements OnInit {
/* TODO bind tm_* and refresh in UI */
@Input() theme = 'light';
displayMode = 'dashboard';
private dashboards: Map<string, GrafanaDashboard> = new Map<string, GrafanaDashboard>([
- ['xds_supervisor', { name: 'AGL XDS Supervisor', shortname: 'agl-xds-supervisor' }],
+ ['xds_monitoring', { name: 'AGL XDS Monitoring', shortname: 'agl-xds-monitoring' }],
]);
private panels: Map<string, GrafanaPanel> = new Map<string, GrafanaPanel>([
- ['table', { name: 'Supervisor traces table', index: '2' }],
+ ['table', { name: 'Monitoring traces table', index: '2' }],
['evt_data_bytes', { name: 'Requests & Events per second', index: '5' }],
['req_evts_per_sec', { name: 'Events Data bytes', index: '12' }],
]);
constructor(
- private supervisionSvr: SupervisionService,
+ private monitoringSvr: MonitoringService,
private alert: AlertService,
private themeService: NbThemeService,
private sanitizer: DomSanitizer,
}
private _initDashboard() {
- // http://localhost:3000/d/Lbpwc6Iiz/agl-xds-supervisor?from=now-40s&to=now&refresh=5s
+ // http://localhost:3000/d/Lbpwc6Iiz/agl-xds-monitoring?from=now-40s&to=now&refresh=5s
this.dashboards.forEach(dd => {
dd.url = this._buildDashboardUrl(dd.shortname, this.tm_from, this.tm_to, this.refresh, this.theme);
dd.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(dd.url);
}
private _buildPanelUrl(idx, from, to, refresh, theme: string) {
- let url = 'http://localhost:3000/d-solo/Lbpwc6Iiz/agl-xds-supervisor';
+ let url = 'http://localhost:3000/d-solo/Lbpwc6Iiz/agl-xds-monitoring';
if (this.Config.grafanaDashboardUrl !== '') {
url = this.Config.grafanaDashboardUrl;
}