This commit is contained in:
crusader
2018-06-21 18:05:07 +09:00
parent a1b59c519d
commit 33923ef19e
3 changed files with 21 additions and 3 deletions

View File

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