Feature/manual db backup (#437)
Added: New button in manage server to manually create a backup of DB (Fixes Add on demand DB backup from Admin Dashboard #322)
This commit is contained in:
parent
66f40656dd
commit
3dbe7eec1f
5 changed files with 43 additions and 1 deletions
|
|
@ -23,4 +23,8 @@ export class ServerService {
|
|||
clearCache() {
|
||||
return this.httpClient.post(this.baseUrl + 'server/clear-cache', {});
|
||||
}
|
||||
|
||||
backupDatabase() {
|
||||
return this.httpClient.post(this.baseUrl + 'server/backup-db', {});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
</ng-container>
|
||||
Clear Cache
|
||||
</button>
|
||||
<button class="btn btn-secondary mr-2" (click)="backupDB()" [disabled]="backupDBInProgress">
|
||||
<ng-container *ngIf="backupDBInProgress">
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
<span class="sr-only">Loading...</span>
|
||||
</ng-container>
|
||||
Backup Database
|
||||
</button>
|
||||
<button class="btn btn-secondary" (click)="downloadService.downloadLogs()">
|
||||
Download Logs
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export class ManageSystemComponent implements OnInit {
|
|||
serverInfo!: ServerInfo;
|
||||
|
||||
clearCacheInProgress: boolean = false;
|
||||
backupDBInProgress: boolean = false;
|
||||
|
||||
constructor(private settingsService: SettingsService, private toastr: ToastrService,
|
||||
private serverService: ServerService, public downloadService: DownloadService) { }
|
||||
|
|
@ -71,4 +72,12 @@ export class ManageSystemComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
backupDB() {
|
||||
this.backupDBInProgress = true;
|
||||
this.serverService.backupDatabase().subscribe(res => {
|
||||
this.backupDBInProgress = false;
|
||||
this.toastr.success('Database has been backed up');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue