|
|
@ -6,14 +6,18 @@ |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
import { Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
import { Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
import { Subscription } from 'rxjs'; |
|
|
import { Observable, Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
AppContext, |
|
|
AppContext, |
|
|
AppDto, |
|
|
AppDto, |
|
|
DateTime, |
|
|
DateTime, |
|
|
fadeAnimation, |
|
|
fadeAnimation, |
|
|
UsagesService |
|
|
formatHistoryMessage, |
|
|
|
|
|
HistoryEventDto, |
|
|
|
|
|
HistoryService, |
|
|
|
|
|
UsagesService, |
|
|
|
|
|
UsersProviderService |
|
|
} from 'shared'; |
|
|
} from 'shared'; |
|
|
|
|
|
|
|
|
declare var _urq: any; |
|
|
declare var _urq: any; |
|
|
@ -60,6 +64,8 @@ export class DashboardPageComponent implements OnDestroy, OnInit { |
|
|
maintainAspectRatio: false |
|
|
maintainAspectRatio: false |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public history: HistoryEventDto[] = []; |
|
|
|
|
|
|
|
|
public assetsCurrent = 0; |
|
|
public assetsCurrent = 0; |
|
|
public assetsMax = 0; |
|
|
public assetsMax = 0; |
|
|
|
|
|
|
|
|
@ -67,6 +73,8 @@ export class DashboardPageComponent implements OnDestroy, OnInit { |
|
|
public callsMax = 0; |
|
|
public callsMax = 0; |
|
|
|
|
|
|
|
|
constructor(public readonly ctx: AppContext, |
|
|
constructor(public readonly ctx: AppContext, |
|
|
|
|
|
private readonly historyService: HistoryService, |
|
|
|
|
|
private readonly users: UsersProviderService, |
|
|
private readonly usagesService: UsagesService |
|
|
private readonly usagesService: UsagesService |
|
|
) { |
|
|
) { |
|
|
} |
|
|
} |
|
|
@ -96,6 +104,13 @@ export class DashboardPageComponent implements OnDestroy, OnInit { |
|
|
this.callsMax = dto.maxAllowed; |
|
|
this.callsMax = dto.maxAllowed; |
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
this.subscriptions.push( |
|
|
|
|
|
this.app |
|
|
|
|
|
.switchMap(app => this.historyService.getHistory(app.name, '')) |
|
|
|
|
|
.subscribe(dto => { |
|
|
|
|
|
this.history = dto; |
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
this.subscriptions.push( |
|
|
this.subscriptions.push( |
|
|
this.app |
|
|
this.app |
|
|
.switchMap(app => this.usagesService.getStorageUsages(app.name, DateTime.today().addDays(-20), DateTime.today())) |
|
|
.switchMap(app => this.usagesService.getStorageUsages(app.name, DateTime.today().addDays(-20), DateTime.today())) |
|
|
@ -163,6 +178,10 @@ export class DashboardPageComponent implements OnDestroy, OnInit { |
|
|
})); |
|
|
})); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public format(message: string): Observable<string> { |
|
|
|
|
|
return formatHistoryMessage(message, this.users); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public showForum() { |
|
|
public showForum() { |
|
|
_urq.push(['Feedback_Open']); |
|
|
_urq.push(['Feedback_Open']); |
|
|
} |
|
|
} |
|
|
|