This commit is contained in:
crusader
2018-07-02 16:04:53 +09:00
parent 36471f2f12
commit 025ce74596
6 changed files with 208 additions and 275 deletions

View File

@@ -3,9 +3,6 @@ import { Observable } from 'rxjs';
import { RPCService } from '@loafer/ng-rpc';
import { Infra } from '@overflow/commons-typescript/model/infra';
import { Host, Service } from '@overflow/commons-typescript';
import { gzip } from 'pako';
@Injectable()
export class InfraService {
@@ -21,15 +18,7 @@ export class InfraService {
}
public registDiscoverd(probeID: number, hosts: Host[], services: Service[]): Observable<Infra[]> {
const discoverd = {
hosts: hosts,
services: services,
};
const json = JSON.stringify(discoverd);
const compressed = gzip(json, { to: 'string' });
const base64 = btoa(compressed);
return this.rpcService.call<Infra[]>('InfraService.registDiscoverd', probeID, base64);
return this.rpcService.call<Infra[]>('InfraService.registDiscoverd', probeID, hosts, services);
}
public read(id: string): Observable<Infra> {