Browse Source

Logging fixed.

pull/344/head
Sebastian Stehle 8 years ago
parent
commit
0c11cadfcc
  1. 2
      src/Squidex/Pipeline/RequestLogPerformanceMiddleware.cs
  2. 6
      src/Squidex/app/features/administration/pages/restore/restore-page.component.scss
  3. 4
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.html
  4. 4
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.scss
  5. 8
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts

2
src/Squidex/Pipeline/RequestLogPerformanceMiddleware.cs

@ -66,7 +66,7 @@ namespace Squidex.Pipeline
var clientId = context.User.OpenIdClientId(); var clientId = context.User.OpenIdClientId();
if (!string.IsNullOrWhiteSpace(userId)) if (!string.IsNullOrWhiteSpace(clientId))
{ {
c.WriteProperty(nameof(clientId), clientId); c.WriteProperty(nameof(clientId), clientId);
} }

6
src/Squidex/app/features/administration/pages/restore/restore-page.component.scss

@ -47,15 +47,15 @@ h3 {
color: $color-dark-foreground; color: $color-dark-foreground;
vertical-align: middle; vertical-align: middle;
} }
&-pending { &-pending {
color: inherit; color: inherit;
} }
&-failed { &-failed {
background: $color-theme-error; background: $color-theme-error;
} }
&-success { &-success {
background: $color-theme-green; background: $color-theme-green;
} }

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

@ -73,7 +73,9 @@
API Calls API Calls
<div class="float-right"> <div class="float-right">
<a class="force" (click)="downloadLog()"> <img *ngIf="isLoadingLog" class="loader mr-2" src="/images/loader.gif" />
<a class="force" (click)="downloadLog()" [class.disabled]="isLoadingLog">
<small>Download Log</small> <small>Download Log</small>
</a> </a>
</div> </div>

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

@ -31,6 +31,10 @@
color: $color-text-decent; color: $color-text-decent;
} }
.loader {
height: 12px;
}
.card { .card {
& { & {
margin-right: 1rem; margin-right: 1rem;

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

@ -99,6 +99,8 @@ export class DashboardPageComponent implements OnDestroy, OnInit {
public callsCurrent = 0; public callsCurrent = 0;
public callsMax = 0; public callsMax = 0;
public isLoadingLog = false;
constructor( constructor(
public readonly appsState: AppsState, public readonly appsState: AppsState,
public readonly authState: AuthService, public readonly authState: AuthService,
@ -209,9 +211,15 @@ export class DashboardPageComponent implements OnDestroy, OnInit {
} }
public downloadLog() { public downloadLog() {
this.isLoadingLog = true;
this.usagesService.getLog(this.appsState.appName) this.usagesService.getLog(this.appsState.appName)
.subscribe(buffer => { .subscribe(buffer => {
saveAs(buffer, 'Log.csv'); saveAs(buffer, 'Log.csv');
}, () => {
this.isLoadingLog = false;
}, () => {
this.isLoadingLog = false;
}); });
} }
} }

Loading…
Cancel
Save