diff --git a/src/packages/discovery/component/setting/setting.component.html b/src/packages/discovery/component/setting/setting.component.html index 85f436f..cfc47a9 100644 --- a/src/packages/discovery/component/setting/setting.component.html +++ b/src/packages/discovery/component/setting/setting.component.html @@ -122,7 +122,7 @@
- +
diff --git a/src/packages/discovery/component/setting/setting.component.ts b/src/packages/discovery/component/setting/setting.component.ts index 1d8cb16..d358812 100644 --- a/src/packages/discovery/component/setting/setting.component.ts +++ b/src/packages/discovery/component/setting/setting.component.ts @@ -332,28 +332,35 @@ export class SettingComponent implements OnInit, AfterContentInit { // this.registStore.dispatch(new DiscoverStore.DiscoverZone( // {probeID: '52abd6fd57e511e7ac52080027658d13', discoveryZone: discoveryZone})); + console.log(this.zones); + // isTarget Check + this.zones.forEach((zone: Zone, key: string) => { if (zone.hosts !== undefined && zone.hosts !== null && zone.hosts.size > 0) { // FIXME: getHosts const hosts: Host[] = []; zone.hosts.forEach((h: Host, hKey: string) => { - // if (h.ports !== undefined && h.ports !== null) { - // h.portList = []; - // h.ports.forEach((p: Port, pKey: number) => { + h.zone = null; + if (h.ports !== undefined && h.ports !== null) { + h.portList = []; + h.ports.forEach((p: Port, pKey: number) => { - // if (p.services !== undefined && p.services !== null) { - // p.serviceList = []; + p.host = null; + if (p.services !== undefined && p.services !== null) { + p.serviceList = []; - // p.services.forEach((s: Service, sKey: string) => { - // p.serviceList.push(s); - // }); + p.services.forEach((s: Service, sKey: string) => { + s.port = null; - // } + p.serviceList.push(s); + }); - // h.portList.push(p); - // }); - // } + } + + h.portList.push(p); + }); + } hosts.push(h); }); @@ -450,7 +457,7 @@ export class SettingComponent implements OnInit, AfterContentInit { convertViewPort(ports): any[] { - if (ports === undefined || ports === null || ports.length === undefined) { + if (ports === undefined || ports === null || ports.size < 0) { return null; } diff --git a/src/packages/discovery/store/discover/discover.reducer.ts b/src/packages/discovery/store/discover/discover.reducer.ts index ad5bd21..2adb364 100644 --- a/src/packages/discovery/store/discover/discover.reducer.ts +++ b/src/packages/discovery/store/discover/discover.reducer.ts @@ -186,7 +186,12 @@ export function reducer(state = initialState, action: Actions): State { host.ports.set(service.port.portNumber, service.port); } - const port: Port = host.ports.get(service.port.portNumber); + let port: Port = null; + port = host.ports.get(service.port.portNumber); + + if (undefined === port || null === port) { + port = service.port; + } if ( undefined === port.services || null === port.services) { port.services = new Map();