mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 13:33:06 +00:00
commit
50de71dc5a
@ -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> {
|
||||
|
@ -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');
|
||||
}));
|
||||
});
|
||||
|
@ -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[]>;
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
}));
|
||||
});
|
||||
|
@ -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[]>;
|
||||
}
|
||||
}
|
||||
|
@ -2,5 +2,6 @@ export const environment = {
|
||||
solarputty_download_url: '',
|
||||
production: true,
|
||||
electron: true,
|
||||
current_version:'v3'
|
||||
current_version:'v3',
|
||||
compute_id:'local'
|
||||
};
|
||||
|
@ -2,5 +2,6 @@ export const environment = {
|
||||
production: false,
|
||||
electron: true,
|
||||
solarputty_download_url: '',
|
||||
current_version:'v3'
|
||||
current_version:'v3',
|
||||
compute_id:'local'
|
||||
};
|
||||
|
@ -3,5 +3,6 @@ export const environment = {
|
||||
electron: false,
|
||||
githubio: true,
|
||||
solarputty_download_url: '',
|
||||
current_version:'v3'
|
||||
current_version:'v3',
|
||||
compute_id:'local'
|
||||
};
|
||||
|
@ -3,5 +3,6 @@ export const environment = {
|
||||
electron: false,
|
||||
githubio: false,
|
||||
solarputty_download_url: '',
|
||||
current_version:'v3'
|
||||
current_version:'v3',
|
||||
compute_id:'local'
|
||||
};
|
||||
|
@ -7,7 +7,8 @@ export const environment = {
|
||||
electron: false,
|
||||
githubio: false,
|
||||
solarputty_download_url: '',
|
||||
current_version:'v3'
|
||||
current_version:'v3',
|
||||
compute_id:'local'
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user