diff --git a/src/packages/infra/component/map/map.component.html b/src/packages/infra/component/map/map.component.html index de969de..1fe7afd 100644 --- a/src/packages/infra/component/map/map.component.html +++ b/src/packages/infra/component/map/map.component.html @@ -61,20 +61,8 @@ - -
- -
-
- -
-
- -
-
- - + diff --git a/src/packages/infra/component/map/map.component.ts b/src/packages/infra/component/map/map.component.ts index d75c9c7..b958676 100644 --- a/src/packages/infra/component/map/map.component.ts +++ b/src/packages/infra/component/map/map.component.ts @@ -69,6 +69,7 @@ export class MapComponent implements OnInit, AfterContentInit { targetNodeForView: Object = null; sensorSettingDisplay = false; + target: Target = null; constructor(private router: Router, private listStore: Store, @@ -98,10 +99,8 @@ export class MapComponent implements OnInit, AfterContentInit { ngOnInit() { this.infras$.subscribe( (page: Page) => { - console.log(page); if (page !== null) { this.totalList = page.content; - console.log(this.totalList); this.infraTree = this.generateInfraHostData(); } }, @@ -113,7 +112,6 @@ export class MapComponent implements OnInit, AfterContentInit { (page: Page) => { if (page !== null) { const sensorList = page.content; - console.log(sensorList); this.addTreeForSensor(sensorList); } }, @@ -263,9 +261,8 @@ export class MapComponent implements OnInit, AfterContentInit { }; probeMap.forEach((ifhl: InfraHost[], key: number) => { - const tp = { - label: 'Probe - ' + key, + label: ifhl[0].probe.displayName, type: 'probe', expandedIcon: 'fa-folder-open', collapsedIcon: 'fa-folder', @@ -280,7 +277,7 @@ export class MapComponent implements OnInit, AfterContentInit { ifhl.map((ih: InfraHost, idx: number) => { const th = { - label: 'Host - ' + ih.ip, + label: 'Host - ' + ih.ipv4, type: 'host', expandedIcon: 'fa-folder-open', collapsedIcon: 'fa-folder', @@ -291,9 +288,9 @@ export class MapComponent implements OnInit, AfterContentInit { this.targetTreeMap.set(ih.target.id, th); - if (hostMap.has(ih.ip)) { + if (hostMap.has(ih.ipv4)) { - const ifsl = hostMap.get(ih.ip); + const ifsl = hostMap.get(ih.ipv4); @@ -333,7 +330,7 @@ export class MapComponent implements OnInit, AfterContentInit { const infraType = infra.infraType.name; if (infraType === 'HOST') { const infraHost: InfraHost = infra; - if (filterStr && String(infraHost.ip).indexOf(filterStr) < 0) { + if (filterStr && String(infraHost.ipv4).indexOf(filterStr) < 0) { continue; } @@ -351,11 +348,11 @@ export class MapComponent implements OnInit, AfterContentInit { continue; } - if (hostMap.has(infraService.host.ip) === false) { - hostMap.set(infraService.host.ip, []); + if (hostMap.has(infraService.host.ipv4) === false) { + hostMap.set(infraService.host.ipv4, []); } - const isl = hostMap.get(infraService.host.ip); + const isl = hostMap.get(infraService.host.ipv4); isl.push(infraService); } @@ -391,7 +388,7 @@ export class MapComponent implements OnInit, AfterContentInit { getExistHost(infraHost: InfraHost): HostData { let node = null; for (const data of this.hostDataList) { - if (data.host.ip === infraHost.ip) { + if (data.host.ipv4 === infraHost.ipv4) { node = data; } } @@ -432,18 +429,18 @@ export class MapComponent implements OnInit, AfterContentInit { this.selectedNode = event.node; if (nodeType === 'probe') { this.router.navigate(['probe', event.node.obj.id, 'info']); - } else if (nodeType === 'host') { - + } else if (nodeType === 'host' || nodeType === 'service') { + this.router.navigate(['sensors'], { queryParams: { target: event.node.obj.target.id } }); + } else if (nodeType === 'sensor') { + this.router.navigate(['sensor', event.node.obj.id, 'info']); } } viewInfo() { - const nodeType = this.selectedNode.type; - if (nodeType !== 'probe' && nodeType !== 'host' && nodeType !== 'service') { - return; - } - this.targetNodeForView = this.selectedNode['obj']; - this.visibleSidebar = true; + const temp = { + node : this.selectedNode, + }; + this.onNodeSelect(temp); } nodeMenu(event: MouseEvent, node: any) { @@ -489,10 +486,12 @@ export class MapComponent implements OnInit, AfterContentInit { } addSensorWithTarget() { + this.target = this.selectedNode['obj'].target; this.sensorSettingDisplay = true; } onSensorSettingClose() { + this.target = null; this.sensorSettingDisplay = false; } } diff --git a/src/packages/infra/component/probe-summary/probe-summary.component.html b/src/packages/infra/component/probe-summary/probe-summary.component.html index 567718a..7b5b6a3 100644 --- a/src/packages/infra/component/probe-summary/probe-summary.component.html +++ b/src/packages/infra/component/probe-summary/probe-summary.component.html @@ -1,3 +1,13 @@ -
- probe host detail +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/src/packages/infra/component/probe-summary/probe-summary.component.ts b/src/packages/infra/component/probe-summary/probe-summary.component.ts index f7ac4c6..f991d3a 100644 --- a/src/packages/infra/component/probe-summary/probe-summary.component.ts +++ b/src/packages/infra/component/probe-summary/probe-summary.component.ts @@ -13,7 +13,7 @@ import { Probe, ProbeHost } from 'packages/probe/model'; }) export class ProbeSummaryComponent implements OnInit, AfterContentInit, OnChanges { - @Input() probe: Probe; + @Input() probe: Object; @Input() visible: boolean; probeHost$ = this.detailStore.pipe(select(ProbeHostSelector.select('probeHost'))); @@ -27,7 +27,8 @@ export class ProbeSummaryComponent implements OnInit, AfterContentInit, OnChange this.probeHost$.subscribe( (probeHost: ProbeHost) => { if (probeHost) { - this.probe = probeHost; + console.log(probeHost); + this.probeHost = probeHost; } }, (error: RPCClientError) => { @@ -37,6 +38,9 @@ export class ProbeSummaryComponent implements OnInit, AfterContentInit, OnChange } ngAfterContentInit() { + console.log('$$$$$$$$$$'); + console.log(this.probe); + console.log('$$$$$$$$$$'); this.detailStore.dispatch( new DetailStore.ReadByProbe(this.probe) );