diff --git a/src/app/components/dashboard/dashboard.component.html b/src/app/components/dashboard/dashboard.component.html index 8abbacf..0b7af4c 100644 --- a/src/app/components/dashboard/dashboard.component.html +++ b/src/app/components/dashboard/dashboard.component.html @@ -74,10 +74,9 @@
- - - + diff --git a/src/app/components/dashboard/dashboard.component.ts b/src/app/components/dashboard/dashboard.component.ts index e4ab7cf..bbe845a 100644 --- a/src/app/components/dashboard/dashboard.component.ts +++ b/src/app/components/dashboard/dashboard.component.ts @@ -1,5 +1,6 @@ -import { Component } from '@angular/core'; +import { AfterViewInit, Component, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { Table } from 'primeng/table'; import { map, Observable, shareReplay } from 'rxjs'; import { HashSuffixPipe } from '../../pipes/hash-suffix.pipe'; @@ -11,7 +12,7 @@ import { ClientService } from '../../services/client.service'; templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'] }) -export class DashboardComponent { +export class DashboardComponent implements AfterViewInit { public address: string; @@ -22,6 +23,10 @@ export class DashboardComponent { public networkInfo$: Observable; + @ViewChild('dataTable') dataTable!: Table; + + public expandedRows$: Observable; + constructor( private clientService: ClientService, @@ -30,6 +35,8 @@ export class DashboardComponent { ) { + + this.networkInfo$ = this.appService.getNetworkInfo(); this.address = this.route.snapshot.params['address']; @@ -37,6 +44,13 @@ export class DashboardComponent { shareReplay({ refCount: true, bufferSize: 1 }) ); + this.expandedRows$ = this.clientInfo$.pipe(map((info: any) => { + + return info.workers.reduce((pre: any, cur: any) => { pre[cur.name] = true; return pre; }, {}); + + })); + + const documentStyle = getComputedStyle(document.documentElement); const textColor = documentStyle.getPropertyValue('--text-color'); @@ -138,6 +152,11 @@ export class DashboardComponent { } + + ngAfterViewInit() { + + } + public getSessionCount(name: string, workers: any[]) { const workersByName = workers.filter(w => w.name == name); return workersByName.length;