feat(WIP): add pause and resume functionality for Portmaster/SPN

https://github.com/safing/portmaster/issues/2050
This commit is contained in:
Alexandr Stelnykovych
2025-10-24 18:15:27 +03:00
parent 287c498bf1
commit c063bda700
9 changed files with 404 additions and 10 deletions

View File

@@ -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<any> {
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<any> {
return this.http.post(`${this.httpEndpoint}/v1/control/resume`, undefined, {
observe: 'response',
responseType: 'arraybuffer',
});
}
/** Force the portmaster to check for updates */
checkForUpdates(): Observable<any> {
return this.http.post(`${this.httpEndpoint}/v1/updates/check`, undefined, {