mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-13 22:13:20 +00:00
commit
50de71dc5a
@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { DockerImage } from '../models/docker/docker-image';
|
import { DockerImage } from '../models/docker/docker-image';
|
||||||
import { Server } from '../models/server';
|
import { Server } from '../models/server';
|
||||||
@ -18,7 +19,7 @@ export class DockerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getImages(server: Server): Observable<DockerImage[]> {
|
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> {
|
addTemplate(server: Server, dockerTemplate: any): Observable<any> {
|
||||||
|
@ -106,7 +106,7 @@ describe('VirtualBoxService', () => {
|
|||||||
it('should get available virtual machines', inject([VirtualBoxService], (service: VirtualBoxService) => {
|
it('should get available virtual machines', inject([VirtualBoxService], (service: VirtualBoxService) => {
|
||||||
service.getVirtualMachines(server).subscribe();
|
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');
|
expect(req.request.method).toEqual('GET');
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Server } from '../models/server';
|
import { Server } from '../models/server';
|
||||||
import { VirtualBoxTemplate } from '../models/templates/virtualbox-template';
|
import { VirtualBoxTemplate } from '../models/templates/virtualbox-template';
|
||||||
@ -37,6 +38,6 @@ export class VirtualBoxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getVirtualMachines(server: Server): Observable<VirtualBoxVm[]> {
|
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) => {
|
it('should get available virtual machines', inject([VmwareService], (service: VmwareService) => {
|
||||||
service.getVirtualMachines(server).subscribe();
|
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');
|
expect(req.request.method).toEqual('GET');
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Server } from '../models/server';
|
import { Server } from '../models/server';
|
||||||
import { VmwareTemplate } from '../models/templates/vmware-template';
|
import { VmwareTemplate } from '../models/templates/vmware-template';
|
||||||
@ -30,6 +31,6 @@ export class VmwareService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getVirtualMachines(server: Server): Observable<VmwareVm[]> {
|
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: '',
|
solarputty_download_url: '',
|
||||||
production: true,
|
production: true,
|
||||||
electron: true,
|
electron: true,
|
||||||
current_version:'v3'
|
current_version:'v3',
|
||||||
|
compute_id:'local'
|
||||||
};
|
};
|
||||||
|
@ -2,5 +2,6 @@ export const environment = {
|
|||||||
production: false,
|
production: false,
|
||||||
electron: true,
|
electron: true,
|
||||||
solarputty_download_url: '',
|
solarputty_download_url: '',
|
||||||
current_version:'v3'
|
current_version:'v3',
|
||||||
|
compute_id:'local'
|
||||||
};
|
};
|
||||||
|
@ -3,5 +3,6 @@ export const environment = {
|
|||||||
electron: false,
|
electron: false,
|
||||||
githubio: true,
|
githubio: true,
|
||||||
solarputty_download_url: '',
|
solarputty_download_url: '',
|
||||||
current_version:'v3'
|
current_version:'v3',
|
||||||
|
compute_id:'local'
|
||||||
};
|
};
|
||||||
|
@ -3,5 +3,6 @@ export const environment = {
|
|||||||
electron: false,
|
electron: false,
|
||||||
githubio: false,
|
githubio: false,
|
||||||
solarputty_download_url: '',
|
solarputty_download_url: '',
|
||||||
current_version:'v3'
|
current_version:'v3',
|
||||||
|
compute_id:'local'
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,8 @@ export const environment = {
|
|||||||
electron: false,
|
electron: false,
|
||||||
githubio: false,
|
githubio: false,
|
||||||
solarputty_download_url: '',
|
solarputty_download_url: '',
|
||||||
current_version:'v3'
|
current_version:'v3',
|
||||||
|
compute_id:'local'
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user