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 { Infra } from '@overflow/commons-typescript/model/infra';
import { Page, PageParams } from '@overflow/commons-typescript/core/model'; import { Page, PageParams } from '@overflow/commons-typescript/core/model';
import { Host, Service } from '@overflow/commons-typescript'; import { Host, Service } from '@overflow/commons-typescript';
import { deflate } from 'pako';
@Injectable() @Injectable()
export class InfraService { export class InfraService {
@ -19,7 +22,15 @@ export class InfraService {
} }
public registDiscoverd(probeID: number, hosts: Host[], services: Service[]): Observable<Infra[]> { 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> { public read(id: string): Observable<Infra> {

9
package-lock.json generated
View File

@ -511,6 +511,12 @@
"integrity": "sha512-jRHfWsvyMtXdbhnz5CVHxaBgnV6duZnPlQuRSo/dm/GnmikNcmZhxIES4E9OZjUmQ8C+HCl4KJux+cXN/ErGDQ==", "integrity": "sha512-jRHfWsvyMtXdbhnz5CVHxaBgnV6duZnPlQuRSo/dm/GnmikNcmZhxIES4E9OZjUmQ8C+HCl4KJux+cXN/ErGDQ==",
"dev": true "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": { "@types/q": {
"version": "0.0.32", "version": "0.0.32",
"resolved": "https://nexus.loafle.net/repository/npm-all/@types/q/-/q-0.0.32.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/@types/q/-/q-0.0.32.tgz",
@ -7570,8 +7576,7 @@
"pako": { "pako": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://nexus.loafle.net/repository/npm-all/pako/-/pako-1.0.6.tgz", "resolved": "https://nexus.loafle.net/repository/npm-all/pako/-/pako-1.0.6.tgz",
"integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg=="
"dev": true
}, },
"parallel-transform": { "parallel-transform": {
"version": "1.1.0", "version": "1.1.0",

View File

@ -48,6 +48,7 @@
"jquery": "^3.3.1", "jquery": "^3.3.1",
"ngx-cookie-service": "^1.0.10", "ngx-cookie-service": "^1.0.10",
"openssl": "^1.1.0", "openssl": "^1.1.0",
"pako": "^1.0.6",
"primeng": "^5.2.4", "primeng": "^5.2.4",
"reflect-metadata": "^0.1.12", "reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0", "rxjs": "^6.0.0",
@ -63,6 +64,7 @@
"@types/jasmine": "~2.8.6", "@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4", "@types/node": "~8.9.4",
"@types/pako": "^1.0.0",
"codelyzer": "~4.2.1", "codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1", "jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~4.2.1",