From 282b02a0a7af2e2983ca63b0f95a91fb8c57e1c9 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 26 Apr 2018 21:18:25 +0900 Subject: [PATCH 1/2] map --- .../infra/component/map/map.component.html | 14 +------ .../infra/component/map/map.component.ts | 41 +++++++++---------- .../probe-summary.component.html | 14 ++++++- .../probe-summary/probe-summary.component.ts | 8 +++- 4 files changed, 39 insertions(+), 38 deletions(-) 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) ); From da0d397c34653670ba23d7376d8efc1631cadb7c Mon Sep 17 00:00:00 2001 From: sunny Date: Thu, 26 Apr 2018 21:27:36 +0900 Subject: [PATCH 2/2] design --- .../component/profile/profile.component.html | 27 +++++++------- src/styles.scss | 35 ++++++++++++++++--- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/src/packages/member/component/profile/profile.component.html b/src/packages/member/component/profile/profile.component.html index be51668..0e69740 100644 --- a/src/packages/member/component/profile/profile.component.html +++ b/src/packages/member/component/profile/profile.component.html @@ -1,36 +1,35 @@
-
-
- -
- -
-
+
+
+
+ +
+
-
+
-
+
-
+
-
+
-
+
@@ -45,6 +44,4 @@
- - - + \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index a28103e..94a889a 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -112,12 +112,30 @@ color: #8BC34A !important; } } - -img.ui-img-profile-responsive { +.ui-img-profile{ + min-width: 250px !important; + @media (max-width: 640px) { + text-align: center; + } +} +.ui-img-profile-box { + width: 244px !important; + padding: 12px; + box-sizing: border-box; + display: block; + background-color: #ffffff; + border: 1px solid #bdbdbd; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + margin: auto; - width : 100%; - height: auto; - + img { + object-fit: cover; + width:220px; + height:220px; + } + @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { } @@ -130,6 +148,7 @@ img.ui-img-profile-responsive { } } + .ui-sensors-datalist { .ui-sensors{ .ui-sensor{ @@ -231,4 +250,10 @@ img.ui-img-profile-responsive { } } } +} +.ui-button-photo-add { + vertical-align: text-bottom; + float: right; + margin-top: -30px; + margin-right: -5px; } \ No newline at end of file