diff --git a/desktop/angular/projects/safing/portmaster-api/src/lib/portapi.service.ts b/desktop/angular/projects/safing/portmaster-api/src/lib/portapi.service.ts index a5676dd7..8c195e4f 100644 --- a/desktop/angular/projects/safing/portmaster-api/src/lib/portapi.service.ts +++ b/desktop/angular/projects/safing/portmaster-api/src/lib/portapi.service.ts @@ -167,6 +167,23 @@ export class PortapiService { }); } + /** Triggers a pause of the portmaster or SPN service + * @param duration The duration of the pause in seconds + * @param onlySPN Whether or not only the SPN should be paused + */ + pause(duration: number, onlySPN: boolean): Observable { + return this.http.post(`${this.httpEndpoint}/v1/control/pause`, { duration, onlySPN }, { + observe: 'response', + responseType: 'arraybuffer', + }); + } + /** Triggers a resume of the portmaster (and SPN) service */ + resume(): Observable { + return this.http.post(`${this.httpEndpoint}/v1/control/resume`, undefined, { + observe: 'response', + responseType: 'arraybuffer', + }); + } /** Force the portmaster to check for updates */ checkForUpdates(): Observable { return this.http.post(`${this.httpEndpoint}/v1/updates/check`, undefined, { diff --git a/desktop/angular/src/app/layout/navigation/navigation.html b/desktop/angular/src/app/layout/navigation/navigation.html index 0359b2dd..ae961f6c 100644 --- a/desktop/angular/src/app/layout/navigation/navigation.html +++ b/desktop/angular/src/app/layout/navigation/navigation.html @@ -153,7 +153,7 @@