UI: update SPN pause menu items and add spnEnabled state management
https://github.com/safing/portmaster/issues/2050
This commit is contained in:
@@ -229,13 +229,13 @@
|
||||
<hr/>
|
||||
</div>
|
||||
|
||||
<app-menu-item (click)="pauseSPN($event, 60*3)" [disabled]="isPausedInterception">Pause SPN for 3 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pauseSPN($event, 60*15)" [disabled]="isPausedInterception">Pause SPN for 15 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pauseSPN($event, 60*60)" [disabled]="isPausedInterception">Pause SPN for 1 hour</app-menu-item>
|
||||
<app-menu-item (click)="pauseSPN($event, 60*3)" *ngIf="spnEnabled" [disabled]="isPausedInterception">Pause SPN for 3 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pauseSPN($event, 60*15)" *ngIf="spnEnabled" [disabled]="isPausedInterception">Pause SPN for 15 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pauseSPN($event, 60*60)" *ngIf="spnEnabled" [disabled]="isPausedInterception">Pause SPN for 1 hour</app-menu-item>
|
||||
<hr/>
|
||||
<app-menu-item (click)="pause($event, 60*3)">Pause for 3 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pause($event, 60*15)">Pause for 15 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pause($event, 60*60)">Pause for 1 hour</app-menu-item>
|
||||
<app-menu-item (click)="pause($event, 60*3)">Pause Portmaster for 3 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pause($event, 60*15)">Pause Portmaster for 15 minutes</app-menu-item>
|
||||
<app-menu-item (click)="pause($event, 60*60)">Pause Portmaster for 1 hour</app-menu-item>
|
||||
<hr/>
|
||||
<app-menu-item (click)="resume($event)" [disabled]="!isPaused">Resume</app-menu-item>
|
||||
</app-menu>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INTEGRATION_SERVICE, IntegrationService } from 'src/app/integration';
|
||||
import { ConnectedPosition } from '@angular/cdk/overlay';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Inject, OnInit, Output, inject } from '@angular/core';
|
||||
import { ConfigService, DebugAPI, PortapiService, SPNService, StringSetting } from '@safing/portmaster-api';
|
||||
import { ConfigService, DebugAPI, PortapiService, SPNService, StringSetting, BoolSetting } from '@safing/portmaster-api';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { AppComponent } from 'src/app/app.component';
|
||||
import { NotificationType, NotificationsService, StatusService, VersionStatus, GetModuleState, ControlPauseStateData } from 'src/app/services';
|
||||
@@ -60,6 +60,9 @@ export class NavigationComponent implements OnInit {
|
||||
/** Whether or not prompting is globally enabled. */
|
||||
globalPromptingEnabled = false;
|
||||
|
||||
/** Whether or not the SPN is currently enabled */
|
||||
spnEnabled = false;
|
||||
|
||||
@Output()
|
||||
sideDashChange = new EventEmitter<'collapsed' | 'expanded' | 'force-overlay'>();
|
||||
|
||||
@@ -120,6 +123,12 @@ export class NavigationComponent implements OnInit {
|
||||
this.globalPromptingEnabled = defaultAction === 'ask';
|
||||
this.cdr.markForCheck();
|
||||
})
|
||||
|
||||
this.configService.watch<BoolSetting>("spn/enable")
|
||||
.subscribe(value => {
|
||||
this.spnEnabled = value;
|
||||
this.cdr.markForCheck();
|
||||
});
|
||||
|
||||
this.notificationService.new$
|
||||
.subscribe(notif => {
|
||||
|
||||
@@ -69,7 +69,7 @@ export class SecurityLockComponent implements OnInit {
|
||||
if (pauseData.Interception === true) {
|
||||
this.lockLevel.displayText = 'Insecure: PAUSED';
|
||||
} else if (pauseData.SPN === true) {
|
||||
this.lockLevel.displayText = 'Secure: SPN Paused';
|
||||
this.lockLevel.displayText = 'Secure (SPN Paused)';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user