mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-18 23:36:53 +00:00
Settings for appliances added
This commit is contained in:
parent
b8e2bb00ac
commit
7a62a7589a
@ -113,7 +113,7 @@
|
||||
<mat-step *ngIf="applianceToInstall">
|
||||
<ng-template matStepLabel>{{secondActionTitle}}</ng-template>
|
||||
|
||||
<mat-card [hidden]="!(action==='install')">
|
||||
<mat-card [hidden]="!applianceToInstall">
|
||||
<div>
|
||||
Server type<br/>
|
||||
<mat-radio-group class="radio-group">
|
||||
|
@ -94,6 +94,7 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
|
||||
this.uploader.onSuccessItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
|
||||
this.toasterService.success('Appliance imported succesfully');
|
||||
this.getAppliance(item.url);
|
||||
};
|
||||
|
||||
this.uploaderImage = new FileUploader({});
|
||||
@ -108,6 +109,16 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
this.uploaderImage.onSuccessItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
|
||||
this.toasterService.success('Image imported succesfully');
|
||||
};
|
||||
|
||||
this.getAppliance('http://127.0.0.1:3080/v2/compute/qemu/images/firefox.gns3a');
|
||||
}
|
||||
|
||||
getAppliance(url: string) {
|
||||
let str = url.split('/v2');
|
||||
let appliancePath = str[str.length-1];
|
||||
this.applianceService.getAppliance(this.server, appliancePath).subscribe((appliance: Appliance) => {
|
||||
this.applianceToInstall = appliance;
|
||||
});
|
||||
}
|
||||
|
||||
addAppliance(event): void {
|
||||
|
@ -14,6 +14,10 @@ export class ApplianceService {
|
||||
return this.httpServer.get<Appliance[]>(server, '/appliances') as Observable<Appliance[]>;
|
||||
}
|
||||
|
||||
getAppliance(server: Server, url): Observable<Appliance> {
|
||||
return this.httpServer.get<Appliance>(server, url) as Observable<Appliance>;
|
||||
}
|
||||
|
||||
getUploadPath(server: Server, emulator: string, filename: string) {
|
||||
return `http://${server.host}:${server.port}/v2/compute/${emulator}/images/${filename}`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user