Update for appliances

This commit is contained in:
piotrpekala7 2020-09-07 15:01:32 +02:00
parent 6f991e4885
commit b32fdf4fc2
3 changed files with 11 additions and 0 deletions

View File

@ -106,6 +106,7 @@
<div>
<button mat-button matStepperPrevious>Back</button>
<button mat-button [hidden]="action!=='install'" (click)="updateAppliances()">Update from online registry</button>
<button mat-button (click)="onCloseClick()">Cancel</button>
</div>
</mat-step>

View File

@ -168,6 +168,12 @@ export class NewTemplateDialogComponent implements OnInit {
};
}
updateAppliances() {
this.applianceService.updateAppliances(this.server).subscribe((appliances) => {
this.appliances = appliances;
})
}
refreshImages() {
this.qemuService.getImages(this.server).subscribe((qemuImages) => {
this.qemuImages = qemuImages;

View File

@ -21,4 +21,8 @@ export class ApplianceService {
getUploadPath(server: Server, emulator: string, filename: string) {
return `http://${server.host}:${server.port}/v2/compute/${emulator}/images/${filename}`;
}
updateAppliances(server: Server): Observable<Appliance[]> {
return this.httpServer.get<Appliance[]>(server, '/appliances?update=yes') as Observable<Appliance[]>;
}
}