mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
feat(data): update data module, add new mock data (#1960)
This commit is contained in:
parent
773c14e74a
commit
47d232b606
53 changed files with 635 additions and 256 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, OnDestroy} from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
import { takeWhile } from 'rxjs/operators' ;
|
||||
import { SolarService } from '../../@core/data/solar.service';
|
||||
|
||||
interface CardSettings {
|
||||
title: string;
|
||||
|
|
@ -17,6 +18,7 @@ export class DashboardComponent implements OnDestroy {
|
|||
|
||||
private alive = true;
|
||||
|
||||
solarValue: number;
|
||||
lightCard: CardSettings = {
|
||||
title: 'Light',
|
||||
iconClass: 'nb-lightbulb',
|
||||
|
|
@ -74,12 +76,19 @@ export class DashboardComponent implements OnDestroy {
|
|||
],
|
||||
};
|
||||
|
||||
constructor(private themeService: NbThemeService) {
|
||||
constructor(private themeService: NbThemeService,
|
||||
private solarService: SolarService) {
|
||||
this.themeService.getJsTheme()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(theme => {
|
||||
this.statusCards = this.statusCardsByThemes[theme.name];
|
||||
});
|
||||
|
||||
this.solarService.getSolarData()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe((data) => {
|
||||
this.solarValue = data;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue