From 33923ef19ef7ffbd80c1506c213778f073521529 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 21 Jun 2018 18:05:07 +0900 Subject: [PATCH] ing --- @overflow/infra/service/infra.service.ts | 13 ++++++++++++- package-lock.json | 9 +++++++-- package.json | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/@overflow/infra/service/infra.service.ts b/@overflow/infra/service/infra.service.ts index 8f8b2cf..f4d4508 100644 --- a/@overflow/infra/service/infra.service.ts +++ b/@overflow/infra/service/infra.service.ts @@ -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 { - return this.rpcService.call('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('InfraService.registDiscoverd', probeID, base64); } public read(id: string): Observable { diff --git a/package-lock.json b/package-lock.json index 6d8fefa..0ee3372 100644 --- a/package-lock.json +++ b/package-lock.json @@ -511,6 +511,12 @@ "integrity": "sha512-jRHfWsvyMtXdbhnz5CVHxaBgnV6duZnPlQuRSo/dm/GnmikNcmZhxIES4E9OZjUmQ8C+HCl4KJux+cXN/ErGDQ==", "dev": true }, + "@types/pako": { + "version": "1.0.0", + "resolved": "https://nexus.loafle.net/repository/npm-all/@types/pako/-/pako-1.0.0.tgz", + "integrity": "sha1-6q6DZNG391LiY7w/1o3+yY5hNsU=", + "dev": true + }, "@types/q": { "version": "0.0.32", "resolved": "https://nexus.loafle.net/repository/npm-all/@types/q/-/q-0.0.32.tgz", @@ -7570,8 +7576,7 @@ "pako": { "version": "1.0.6", "resolved": "https://nexus.loafle.net/repository/npm-all/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "dev": true + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==" }, "parallel-transform": { "version": "1.1.0", diff --git a/package.json b/package.json index 18968c0..cc9c29b 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "jquery": "^3.3.1", "ngx-cookie-service": "^1.0.10", "openssl": "^1.1.0", + "pako": "^1.0.6", "primeng": "^5.2.4", "reflect-metadata": "^0.1.12", "rxjs": "^6.0.0", @@ -63,6 +64,7 @@ "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", + "@types/pako": "^1.0.0", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1",