Merge pull request #1334 from GNS3/bugfix/1317

Bugfix/1317
This commit is contained in:
Jeremy Grossmann 2022-06-21 12:17:13 +02:00 committed by GitHub
commit 50de71dc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { DockerImage } from '../models/docker/docker-image';
import { Server } from '../models/server';
@ -18,7 +19,7 @@ export class DockerService {
}
getImages(server: Server): Observable<DockerImage[]> {
return this.httpServer.get<DockerImage[]>(server, '/compute/docker/images') as Observable<DockerImage[]>;
return this.httpServer.get<DockerImage[]>(server, `/computes/${environment.compute_id}/docker/images`) as Observable<DockerImage[]>;
}
addTemplate(server: Server, dockerTemplate: any): Observable<any> {

View File

@ -106,7 +106,7 @@ describe('VirtualBoxService', () => {
it('should get available virtual machines', inject([VirtualBoxService], (service: VirtualBoxService) => {
service.getVirtualMachines(server).subscribe();
const req = httpTestingController.expectOne(`http://127.0.0.1:3080/${environment.current_version}/compute/virtualbox/vms`);
const req = httpTestingController.expectOne(`http://127.0.0.1:3080/${environment.current_version}/computes/${environment.compute_id}/virtualbox/vms`);
expect(req.request.method).toEqual('GET');
}));
});

View File

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { Server } from '../models/server';
import { VirtualBoxTemplate } from '../models/templates/virtualbox-template';
@ -37,6 +38,6 @@ export class VirtualBoxService {
}
getVirtualMachines(server: Server): Observable<VirtualBoxVm[]> {
return this.httpServer.get<VirtualBoxVm[]>(server, '/compute/virtualbox/vms') as Observable<VirtualBoxVm[]>;
return this.httpServer.get<VirtualBoxVm[]>(server, `/computes/${environment.compute_id}/virtualbox/vms`) as Observable<VirtualBoxVm[]>;
}
}

View File

@ -104,7 +104,7 @@ describe('VmwareService', () => {
it('should get available virtual machines', inject([VmwareService], (service: VmwareService) => {
service.getVirtualMachines(server).subscribe();
const req = httpTestingController.expectOne(`http://127.0.0.1:3080/${environment.current_version}/compute/vmware/vms`);
const req = httpTestingController.expectOne(`http://127.0.0.1:3080/${environment.current_version}/computes/${environment.compute_id}/vmware/vms`);
expect(req.request.method).toEqual('GET');
}));
});

View File

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { Server } from '../models/server';
import { VmwareTemplate } from '../models/templates/vmware-template';
@ -30,6 +31,6 @@ export class VmwareService {
}
getVirtualMachines(server: Server): Observable<VmwareVm[]> {
return this.httpServer.get<VmwareVm[]>(server, '/compute/vmware/vms') as Observable<VmwareVm[]>;
return this.httpServer.get<VmwareVm[]>(server, `/computes/${environment.compute_id}/vmware/vms`) as Observable<VmwareVm[]>;
}
}

View File

@ -2,5 +2,6 @@ export const environment = {
solarputty_download_url: '',
production: true,
electron: true,
current_version:'v3'
current_version:'v3',
compute_id:'local'
};

View File

@ -2,5 +2,6 @@ export const environment = {
production: false,
electron: true,
solarputty_download_url: '',
current_version:'v3'
current_version:'v3',
compute_id:'local'
};

View File

@ -3,5 +3,6 @@ export const environment = {
electron: false,
githubio: true,
solarputty_download_url: '',
current_version:'v3'
current_version:'v3',
compute_id:'local'
};

View File

@ -3,5 +3,6 @@ export const environment = {
electron: false,
githubio: false,
solarputty_download_url: '',
current_version:'v3'
current_version:'v3',
compute_id:'local'
};

View File

@ -7,7 +7,8 @@ export const environment = {
electron: false,
githubio: false,
solarputty_download_url: '',
current_version:'v3'
current_version:'v3',
compute_id:'local'
};
/*