X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=webapp%2Fsrc%2Fapp%2Fpages%2Fsupervision%2Fsupervision.component.ts;fp=webapp%2Fsrc%2Fapp%2Fpages%2Fsupervision%2Fsupervision.component.ts;h=53fff22e88d0495295164f19eee2a38c44fc2c4a;hb=48739a930ceb0c6a4b843471750da70db2052890;hp=219f28f2465911b2d45cc6b41e2e938ad0f17f39;hpb=ee66af78c42c4d7ff33f104415bc09d60dbdc27b;p=src%2Fxds%2Fxds-agent.git diff --git a/webapp/src/app/pages/supervision/supervision.component.ts b/webapp/src/app/pages/supervision/supervision.component.ts index 219f28f..53fff22 100644 --- a/webapp/src/app/pages/supervision/supervision.component.ts +++ b/webapp/src/app/pages/supervision/supervision.component.ts @@ -22,6 +22,7 @@ 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 { AlertService } from '../../@core-xds/services/alert.service'; @@ -70,10 +71,15 @@ export class SupervisionComponent implements OnInit { private alert: AlertService, private themeService: NbThemeService, private sanitizer: DomSanitizer, + private configSvr: ConfigService, ) { } + Config: IConfig = {}; + ngOnInit() { + this.configSvr.Conf$.subscribe(cfg => this.Config = cfg); + this._initDashboard(); this._initPanels(); @@ -131,16 +137,24 @@ export class SupervisionComponent implements OnInit { } private _buildDashboardUrl(sname: string, from: number, to: number, theme: string) { + // FIXME get sname from config to support several dashboards let url = 'http://localhost:3000/d/Lbpwc6Iiz/' + sname; + if (this.Config.grafanaDashboardUrl !== '') { + url = this.Config.grafanaDashboardUrl; + } url += '?orgId=1'; url += '&from=' + from; url += '&to=' + to; url += '&theme=' + theme; + url += '&sidemenu=close'; return url; } private _buildPanelUrl(idx: string, from: number, to: number, theme: string) { let url = 'http://localhost:3000/d-solo/Lbpwc6Iiz/agl-xds-supervisor'; + if (this.Config.grafanaDashboardUrl !== '') { + url = this.Config.grafanaDashboardUrl; + } url += '?panelId=' + idx; url += '&orgId=1'; url += '&from=' + from;