From ab2757c1e70926d3b8db91ce2458f319c6a73d1e Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 22 Mar 2018 13:04:50 +0900 Subject: [PATCH] snoop --- .../component/setting/setting.component.ts | 4 + .../store/discovery/discovery.action.ts | 84 +++++++++++++++++++ .../store/discovery/discovery.effect.spec.ts | 0 .../store/discovery/discovery.effect.ts | 0 .../store/discovery/discovery.reducer.ts | 0 .../store/discovery/discovery.state.ts | 0 .../discovery/store/discovery/index.ts | 0 7 files changed, 88 insertions(+) create mode 100644 src/packages/discovery/store/discovery/discovery.action.ts create mode 100644 src/packages/discovery/store/discovery/discovery.effect.spec.ts create mode 100644 src/packages/discovery/store/discovery/discovery.effect.ts create mode 100644 src/packages/discovery/store/discovery/discovery.reducer.ts create mode 100644 src/packages/discovery/store/discovery/discovery.state.ts create mode 100644 src/packages/discovery/store/discovery/index.ts diff --git a/src/packages/discovery/component/setting/setting.component.ts b/src/packages/discovery/component/setting/setting.component.ts index 441c7f4..cefe0a0 100644 --- a/src/packages/discovery/component/setting/setting.component.ts +++ b/src/packages/discovery/component/setting/setting.component.ts @@ -159,6 +159,10 @@ export class SettingComponent implements OnInit, AfterContentInit { convertTreeView(zone: Zone) { + if (zone === undefined || zone === null) { + return; + } + const treeNodes = this.convertViewHost(zone.hosts); console.log(treeNodes); diff --git a/src/packages/discovery/store/discovery/discovery.action.ts b/src/packages/discovery/store/discovery/discovery.action.ts new file mode 100644 index 0000000..52ac83c --- /dev/null +++ b/src/packages/discovery/store/discovery/discovery.action.ts @@ -0,0 +1,84 @@ +// import { Action } from '@ngrx/store'; + +// import { notificationActionEnum } from 'packages/core/rpc/store/notification'; +// import { RPCError } from 'packages/core/rpc/error'; + +// import { +// Zone, +// Host, +// Port, +// Service, +// DiscoveryZone, +// DiscoveryHost, +// DiscoveryPort, +// DiscoveryService as MDiscoveryService, +// } from '../../model'; + +// export enum ActionType { +// DiscoverZone = '[@@NOTIFICATION] DiscoveryService.discoverZone', +// DiscoverHost = '[@@NOTIFICATION] DiscoveryService.discoverHost', +// DiscoverPort = '[@@NOTIFICATION] DiscoveryService.discoverPort', +// DiscoverService = '[@@NOTIFICATION] DiscoveryService.discoverService', +// DiscoveredZone = '[@@NOTIFICATION] DiscoveryService.discoveredZone', +// DiscoveredHost = '[@@NOTIFICATION] DiscoveryService.discoveredHost', +// DiscoveredPort = '[@@NOTIFICATION] DiscoveryService.discoveredPort', +// DiscoveredService = '[@@NOTIFICATION] DiscoveryService.discoveredService', +// } + +// export class DiscoverZone implements Action { +// readonly type = ActionType.DiscoverZone; + +// constructor(public payload: {probeID: string, discoveryZone: DiscoveryZone}) {} +// } + +// export class DiscoverHost implements Action { +// readonly type = ActionType.DiscoverHost; + +// constructor(public payload: {probeID: string, zone: Zone, discoveryHost: DiscoveryHost}) {} +// } + +// export class DiscoverPort implements Action { +// readonly type = ActionType.DiscoverPort; + +// constructor(public payload: {probeID: string, host: Host, discoveryPort: DiscoveryPort}) {} +// } + +// export class DiscoverService implements Action { +// readonly type = ActionType.DiscoverService; +// constructor(public payload: {probeID: string, port: Port, discoveryService: MDiscoveryService}) {} +// } + + +// export class DiscoveredZone implements Action { +// readonly type = ActionType.DiscoveredZone; + +// constructor(public payload: Zone) {} +// } + +// export class DiscoveredHost implements Action { +// readonly type = ActionType.DiscoveredHost; + +// constructor(public payload: Host) {} +// } + +// export class DiscoveredPort implements Action { +// readonly type = ActionType.DiscoveredPort; + +// constructor(public payload: Port) {} +// } + +// export class DiscoveredService implements Action { +// readonly type = ActionType.DiscoveredService; +// constructor(public payload: Service) {} +// } + +// export type Actions = +// | DiscoverZone +// | DiscoverHost +// | DiscoverPort +// | DiscoverService +// | DiscoveredZone +// | DiscoveredHost +// | DiscoveredPort +// | DiscoveredService +// ; diff --git a/src/packages/discovery/store/discovery/discovery.effect.spec.ts b/src/packages/discovery/store/discovery/discovery.effect.spec.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/discovery/store/discovery/discovery.effect.ts b/src/packages/discovery/store/discovery/discovery.effect.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/discovery/store/discovery/discovery.reducer.ts b/src/packages/discovery/store/discovery/discovery.reducer.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/discovery/store/discovery/discovery.state.ts b/src/packages/discovery/store/discovery/discovery.state.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/discovery/store/discovery/index.ts b/src/packages/discovery/store/discovery/index.ts new file mode 100644 index 0000000..e69de29