mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-13 06:25:21 +00:00
19 lines
642 B
TypeScript
19 lines
642 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpServer } from './http-server.service';
|
|
import { Server } from '../models/server';
|
|
import { Compute } from '../models/compute';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Injectable()
|
|
export class ComputeService {
|
|
constructor(private httpServer: HttpServer) {}
|
|
|
|
getComputes(server: Server): Observable<Compute[]> {
|
|
return this.httpServer.get<Compute[]>(server, '/computes') as Observable<Compute[]>;
|
|
}
|
|
|
|
getUploadPath(server: Server, emulator: string, filename: string) {
|
|
return `http://${server.host}:${server.port}/v2/${emulator}/images/${filename}`;
|
|
}
|
|
}
|