Browse Source

Added static time on debugAll=true

pull/11861/head
mpetrov 2 years ago
parent
commit
ed6e3f2154
  1. 4
      ui-ngx/src/app/modules/home/components/debug-config/debug-config-button.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/debug-config/debug-config-panel.component.html
  3. 2
      ui-ngx/src/app/modules/home/components/debug-config/debug-config-panel.component.ts

4
ui-ngx/src/app/modules/home/components/debug-config/debug-config-button.component.html

@ -26,7 +26,9 @@
<mat-icon [color]="disabled ? 'inherit' : 'primary'">bug_report</mat-icon>
<span *ngIf="!debugFailures && !(isDebugAllActive$ | async)" translate>common.disabled</span>
<span *ngIf="(isDebugAllActive$ | async) && debugFailures" translate>debug-config.all</span>
<span *ngIf="(isDebugAllActive$ | async) && !debugFailures">{{ debugAllUntil | durationLeft }}</span>
<span *ngIf="(isDebugAllActive$ | async) && !debugFailures">
{{ !debugAll ? (debugAllUntil | durationLeft) : ('debug-config.min' | translate: { number: maxDebugModeDurationMinutes }) }}
</span>
<span *ngIf="!(isDebugAllActive$ | async) && debugFailures" translate>debug-config.failures</span>
</button>
<ng-template #minifiedButton>

4
ui-ngx/src/app/modules/home/components/debug-config/debug-config-panel.component.html

@ -34,10 +34,10 @@
<div class="flex justify-between align-center">
<mat-slide-toggle class="mat-slide" [formControl]="debugAllControl">
<div tb-hint-tooltip-icon="{{ 'debug-config.hint.all-messages' | translate }}">
{{ 'debug-config.all-messages' | translate: { time: (isDebugAllActive$ | async) ? (debugAllUntil | durationLeft) : ('debug-config.min' | translate: { number: maxDebugModeDurationMinutes }) } }}
{{ 'debug-config.all-messages' | translate: { time: (isDebugAllActive$ | async) && !debugAll ? (debugAllUntil | durationLeft) : ('debug-config.min' | translate: { number: maxDebugModeDurationMinutes }) } }}
</div>
</mat-slide-toggle>
<button mat-icon-button *ngIf="(isDebugAllActive$ | async)"
<button mat-icon-button *ngIf="(isDebugAllActive$ | async) && !debugAll"
class="tb-mat-20"
matTooltip="{{ 'action.reset' | translate }}"
matTooltipPosition="above"

2
ui-ngx/src/app/modules/home/components/debug-config/debug-config-panel.component.ts

@ -99,12 +99,14 @@ export class DebugConfigPanelComponent extends PageComponent implements OnInit {
onReset(): void {
this.debugAll = true;
this.debugAllUntil = new Date().getTime() + this.maxDebugModeDurationMinutes * MINUTE;
this.cd.markForCheck();
}
private observeDebugAllChange(): void {
this.debugAllControl.valueChanges.pipe(takeUntilDestroyed()).subscribe(value => {
this.debugAllUntil = value? new Date().getTime() + this.maxDebugModeDurationMinutes * MINUTE : 0;
this.debugAll = value;
this.cd.markForCheck();
});
}
}

Loading…
Cancel
Save