Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Add support to trigger history data retention
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Aug 8, 2023
1 parent 82b53a2 commit 2516aca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export class PortapiService {
return this.http.post(`${this.httpEndpoint}/v1/spn/reinit`, undefined, { observe: 'response', responseType: 'arraybuffer' })
}

/** Cleans up the history database by applying history retention settings */
cleanupHistory(): Observable<any> {
return this.http.post(`${this.httpEndpoint}/v1/netquery/history/cleanup`, undefined, { observe: 'response', responseType: 'arraybuffer' })
}

/**
* Injects an event into a module to trigger certain backend
* behavior.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
<app-menu-item (click)="clearDNSCache($event)">Clear DNS Cache</app-menu-item>
<app-menu-item (click)="openDataDir($event)">Open Data Directory</app-menu-item>
<app-menu-item (click)="copyDebugInfo($event)">Copy Debug Info</app-menu-item>
<app-menu-item (click)="cleanupHistory($event)">Clean History Data</app-menu-item>
</app-menu>

<!-- Power Menu -->
Expand Down
8 changes: 8 additions & 0 deletions modules/portmaster/src/app/layout/navigation/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ export class NavigationComponent implements OnInit {
))
}

cleanupHistory(_: Event) {
this.portapi.cleanupHistory()
.subscribe(this.actionIndicator.httpObserver(
'History Data Cleared',
'Failed to Clear History.'
))
}

/**
* @private
* Trigger downloading of updates
Expand Down

0 comments on commit 2516aca

Please sign in to comment.