From fecb42a6916f312ffb9f1cd7d41f162be0c45892 Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Thu, 6 Nov 2025 18:42:24 +0200 Subject: [PATCH] UI: update SPN pause menu items and add spnEnabled state management https://github.com/safing/portmaster/issues/2050 --- .../src/app/layout/navigation/navigation.html | 12 ++++++------ .../angular/src/app/layout/navigation/navigation.ts | 11 ++++++++++- .../src/app/shared/security-lock/security-lock.ts | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/desktop/angular/src/app/layout/navigation/navigation.html b/desktop/angular/src/app/layout/navigation/navigation.html index f18dc955..57f7e516 100644 --- a/desktop/angular/src/app/layout/navigation/navigation.html +++ b/desktop/angular/src/app/layout/navigation/navigation.html @@ -229,13 +229,13 @@
- Pause SPN for 3 minutes - Pause SPN for 15 minutes - Pause SPN for 1 hour + Pause SPN for 3 minutes + Pause SPN for 15 minutes + Pause SPN for 1 hour
- Pause for 3 minutes - Pause for 15 minutes - Pause for 1 hour + Pause Portmaster for 3 minutes + Pause Portmaster for 15 minutes + Pause Portmaster for 1 hour
Resume diff --git a/desktop/angular/src/app/layout/navigation/navigation.ts b/desktop/angular/src/app/layout/navigation/navigation.ts index f5650456..bc7f4cd9 100644 --- a/desktop/angular/src/app/layout/navigation/navigation.ts +++ b/desktop/angular/src/app/layout/navigation/navigation.ts @@ -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("spn/enable") + .subscribe(value => { + this.spnEnabled = value; + this.cdr.markForCheck(); + }); this.notificationService.new$ .subscribe(notif => { diff --git a/desktop/angular/src/app/shared/security-lock/security-lock.ts b/desktop/angular/src/app/shared/security-lock/security-lock.ts index a18e0f47..2172ebdb 100644 --- a/desktop/angular/src/app/shared/security-lock/security-lock.ts +++ b/desktop/angular/src/app/shared/security-lock/security-lock.ts @@ -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)'; } }