Skip to content

Commit

Permalink
NOISSUE - Fix influx envars and minor dashboard fix (#249)
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Imperiale <[email protected]>
  • Loading branch information
manuio authored Apr 4, 2022
1 parent 05f7b8e commit af7f64b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ services:
MF_INFLUX_WRITER_BATCH_SIZE: ${MF_INFLUX_WRITER_BATCH_SIZE}
MF_INFLUX_WRITER_BATCH_TIMEOUT: ${MF_INFLUX_WRITER_BATCH_TIMEOUT}
MF_INFLUXDB_DB: ${MF_INFLUXDB_DB}
MF_INFLUX_WRITER_DB_HOST: mainflux-influxdb
MF_INFLUXDB_HOST: mainflux-influxdb
MF_INFLUXDB_PORT: ${MF_INFLUXDB_PORT}
MF_INFLUXDB_ADMIN_USER: ${MF_INFLUXDB_ADMIN_USER}
MF_INFLUXDB_ADMIN_PASSWORD: ${MF_INFLUXDB_ADMIN_PASSWORD}
Expand Down Expand Up @@ -459,7 +459,7 @@ services:
MF_INFLUX_READER_LOG_LEVEL: debug
MF_INFLUX_READER_PORT: ${MF_INFLUX_READER_PORT}
MF_INFLUXDB_DB: ${MF_INFLUXDB_DB}
MF_INFLUX_READER_DB_HOST: mainflux-influxdb
MF_INFLUXDB_HOST: mainflux-influxdb
MF_INFLUXDB_PORT: ${MF_INFLUXDB_PORT}
MF_INFLUXDB_ADMIN_USER: ${MF_INFLUXDB_ADMIN_USER}
MF_INFLUXDB_ADMIN_PASSWORD: ${MF_INFLUXDB_ADMIN_PASSWORD}
Expand Down
16 changes: 10 additions & 6 deletions src/app/pages/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ import { User, PageFilters, TablePage, DashboardConf, CardConf } from 'app/commo
})

export class DashboardComponent implements OnInit {
user: User;
user: User = {
metadata: {
dashboardConf: {},
},
};
title: string = STRINGS.home.title;
description: string = STRINGS.home.description;

pageFilters: PageFilters = {};

page: TablePage = {};
dashboardConf: DashboardConf = {
cards: [{}],
cards: [],
mainfluxIntro: true,
};

Expand All @@ -31,9 +35,8 @@ export class DashboardComponent implements OnInit {
ngOnInit() {
this.usersService.getProfile().subscribe(
(resp: User) => {
this.user = resp;
if (this.user.metadata.dashboardConf) {
this.dashboardConf = this.user.metadata.dashboardConf;
if (resp.metadata && resp.metadata.dashboardConf) {
this.dashboardConf = resp.metadata.dashboardConf;
}
},
);
Expand Down Expand Up @@ -65,7 +68,8 @@ export class DashboardComponent implements OnInit {
}

onCloseWelcome() {
this.user.metadata.dashboardConf.mainfluxIntro = false;
this.dashboardConf.mainfluxIntro = false;
this.user.metadata.dashboardConf = this.dashboardConf;
this.usersService.editUser(this.user).subscribe();
}
}

0 comments on commit af7f64b

Please sign in to comment.