X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fceph%2Fcluster%2Flogs%2Flogs.component.ts;h=ed8c721eaf3e1f6b3440d091c4c829dc01edf366;hb=2a845540123ad00df2e55947b8080306ebdcf410;hp=04375b1ef7c9606141f7b7fc966549ead13c9c28;hpb=f67539c23b11f3b8a2ecaeeddf7a403ae1c442a8;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts index 04375b1ef..ed8c721ea 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts @@ -2,7 +2,10 @@ import { DatePipe } from '@angular/common'; import { Component, NgZone, OnDestroy, OnInit } from '@angular/core'; import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { CephServiceService } from '~/app/shared/api/ceph-service.service'; import { LogsService } from '~/app/shared/api/logs.service'; import { Icons } from '~/app/shared/enum/icons.enum'; @@ -18,6 +21,8 @@ export class LogsComponent implements OnInit, OnDestroy { icons = Icons; clogText: string; auditLogText: string; + lokiServiceStatus$: Observable; + promtailServiceStatus$: Observable; interval: number; priorities: Array<{ name: string; value: string }> = [ @@ -40,6 +45,7 @@ export class LogsComponent implements OnInit, OnDestroy { constructor( private logsService: LogsService, + private cephService: CephServiceService, private datePipe: DatePipe, private ngZone: NgZone ) {} @@ -47,6 +53,7 @@ export class LogsComponent implements OnInit, OnDestroy { ngOnInit() { this.getInfo(); this.ngZone.runOutsideAngular(() => { + this.getDaemonDetails(); this.interval = window.setInterval(() => { this.ngZone.run(() => { this.getInfo(); @@ -59,6 +66,19 @@ export class LogsComponent implements OnInit, OnDestroy { clearInterval(this.interval); } + getDaemonDetails() { + this.lokiServiceStatus$ = this.cephService.getDaemons('loki').pipe( + map((data: any) => { + return data.length > 0 && data[0].status === 1; + }) + ); + this.promtailServiceStatus$ = this.cephService.getDaemons('promtail').pipe( + map((data: any) => { + return data.length > 0 && data[0].status === 1; + }) + ); + } + getInfo() { this.logsService.getLogs().subscribe((data: any) => { this.contentData = data; @@ -70,8 +90,7 @@ export class LogsComponent implements OnInit, OnDestroy { abstractFilters(): any { const priority = this.priority; - const key = this.search.toLowerCase().replace(/,/g, ''); - + const key = this.search.toLowerCase(); let yearMonthDay: string; if (this.selectedDate) { const m = this.selectedDate.month;