ing
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user