mirror of https://github.com/Squidex/squidex.git
18 changed files with 119 additions and 46 deletions
@ -0,0 +1,14 @@ |
|||||
|
<div class="card card"> |
||||
|
<div class="card-header">{{ 'dashboard.trafficHeader' | sqxTranslate }}</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="aggregation" *ngIf="bytesTotal >= 0"> |
||||
|
<div class="aggregation-label">{{ 'dashboard.currentMonthLabel' | sqxTranslate }}</div> |
||||
|
|
||||
|
<div class="aggregation-value">{{bytesTotal | sqxFileSize}}</div> |
||||
|
|
||||
|
<div class="aggregation-label" *ngIf="bytesAllowed > 0"> |
||||
|
{{ 'dashboard.trafficLimitLabel' | sqxTranslate }}: {{bytesAllowed | sqxFileSize}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
@ -0,0 +1,37 @@ |
|||||
|
|
||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
||||
|
*/ |
||||
|
|
||||
|
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; |
||||
|
import { AppDto, CallsUsageDto, fadeAnimation } from '@app/shared'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'sqx-api-traffic-summary-card', |
||||
|
styleUrls: ['./api-traffic-summary-card.component.scss'], |
||||
|
templateUrl: './api-traffic-summary-card.component.html', |
||||
|
animations: [ |
||||
|
fadeAnimation |
||||
|
], |
||||
|
changeDetection: ChangeDetectionStrategy.OnPush |
||||
|
}) |
||||
|
export class ApiTrafficSummaryCardComponent implements OnChanges { |
||||
|
@Input() |
||||
|
public app: AppDto; |
||||
|
|
||||
|
@Input() |
||||
|
public usage: CallsUsageDto; |
||||
|
|
||||
|
public bytesTotal = 0; |
||||
|
public bytesAllowed = 0; |
||||
|
|
||||
|
public ngOnChanges() { |
||||
|
if (this.usage) { |
||||
|
this.bytesTotal = this.usage.totalBytes; |
||||
|
this.bytesAllowed = this.usage.allowedBytes; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue