Browse Source

App name fixes. Closes #166

pull/170/head
Sebastian Stehle 8 years ago
parent
commit
29873b7d7f
  1. 4
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.html
  2. 10
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts
  3. 2
      src/Squidex/app/shared/components/app-context.ts

4
src/Squidex/app/features/dashboard/pages/dashboard-page.component.html

@ -1,4 +1,4 @@
<sqx-title message="{app} | Dashboard" parameter1="app" [value1]="ctx.appName"></sqx-title>
<sqx-title message="{app} | Dashboard" parameter1="app" [value1]="(app | async).name"></sqx-title>
<div class="dashboard" @fade>
<div class="dashboard-inner">
@ -7,7 +7,7 @@
<h1 class="dashboard-title">Hi {{ctx.user.displayName}}</h1>
<div class="subtext">
Welcome to <span class="app-name">{{ctx.appName}}</span> dashboard.
Welcome to <span class="app-name">{{(app | async).name}}</span> dashboard.
</div>
</div>

10
src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts

@ -35,6 +35,8 @@ export class DashboardPageComponent implements OnInit {
public chartCallsCount: any;
public chartCallsPerformance: any;
public app = this.ctx.appChanges.filter(x => !!x);
public chartOptions = {
responsive: true,
scales: {
@ -66,21 +68,21 @@ export class DashboardPageComponent implements OnInit {
}
public ngOnInit() {
this.ctx.appChanges
this.app
.switchMap(app => this.usagesService.getTodayStorage(app.name))
.subscribe(dto => {
this.assetsCurrent = dto.size;
this.assetsMax = dto.maxAllowed;
});
this.ctx.appChanges
this.app
.switchMap(app => this.usagesService.getMonthCalls(app.name))
.subscribe(dto => {
this.callsCurrent = dto.count;
this.callsMax = dto.maxAllowed;
});
this.ctx.appChanges
this.app
.switchMap(app => this.usagesService.getStorageUsages(app.name, DateTime.today().addDays(-20), DateTime.today()))
.subscribe(dtos => {
this.chartStorageCount = {
@ -114,7 +116,7 @@ export class DashboardPageComponent implements OnInit {
};
});
this.ctx.appChanges
this.app
.switchMap(app => this.usagesService.getCallsUsages(app.name, DateTime.today().addDays(-20), DateTime.today()))
.subscribe(dtos => {
this.chartCallsCount = {

2
src/Squidex/app/shared/components/app-context.ts

@ -58,7 +58,7 @@ export class AppContext implements OnDestroy {
public readonly bus: MessageBus
) {
this.appSubscription =
this.appsStore.selectedApp.subscribe(app => {
this.appsStore.selectedApp.first().subscribe(app => {
this.appField = app;
});
}

Loading…
Cancel
Save