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