From a2021b84e08ebe22f72426b50fdb2d22e61923bd Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 4 Jun 2018 18:25:48 +0900 Subject: [PATCH] test --- .../discovery/component/discovery.component.ts | 6 +++--- .../component/search-filter.component.html | 2 +- .../component/search-result.component.html | 16 ++++++++++++---- .../component/search-result.component.ts | 16 ++++++++++++---- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/@overflow/discovery/component/discovery.component.ts b/@overflow/discovery/component/discovery.component.ts index 64f5bfb..5bd4155 100644 --- a/@overflow/discovery/component/discovery.component.ts +++ b/@overflow/discovery/component/discovery.component.ts @@ -55,10 +55,10 @@ export class DiscoveryComponent implements OnDestroy { onRequestDiscovery(dz: DiscoverZone) { this.requested = true; this.discoverZone = dz; - // this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz); + + this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz); + this.discoverySubscription = this.discoverySubscriber.observable().pipe( - tap(() => { - }), map((discoveryNotify: DiscoveryNotify) => { switch (discoveryNotify.method) { case 'DiscoveryService.discoveryStart': { diff --git a/@overflow/discovery/component/search-filter.component.html b/@overflow/discovery/component/search-filter.component.html index 9d14779..cfb2bf4 100644 --- a/@overflow/discovery/component/search-filter.component.html +++ b/@overflow/discovery/component/search-filter.component.html @@ -1,6 +1,6 @@
- +
diff --git a/@overflow/discovery/component/search-result.component.html b/@overflow/discovery/component/search-result.component.html index 96b87e1..526d45f 100644 --- a/@overflow/discovery/component/search-result.component.html +++ b/@overflow/discovery/component/search-result.component.html @@ -16,18 +16,26 @@
-
+
+
{{node.label}}
+
+ -
+
- +
+
{{node.label}} {{node.data.portType}}
+
+ + +
diff --git a/@overflow/discovery/component/search-result.component.ts b/@overflow/discovery/component/search-result.component.ts index fe4b4ec..8ee414d 100644 --- a/@overflow/discovery/component/search-result.component.ts +++ b/@overflow/discovery/component/search-result.component.ts @@ -76,11 +76,12 @@ export class SearchResultComponent implements OnInit { } tempService() { + const randStr = Math.random().toString(36).substr(2, 5); const idx = Math.floor(Math.random() * (255)); const hostId = Math.floor(Math.random() * (this.tempHostId - 1)); const service: Service = { id: idx, - serviceName: 'Service', + serviceName: String(randStr), port: { portNumber: idx, portType: idx % 2 === 0 ? 'TCP' : 'UDP', @@ -111,9 +112,10 @@ export class SearchResultComponent implements OnInit { const idx = this.findServiceIndex(targetHostNode.children, service); targetHostNode.children[idx] = { type: 'SERVICE', - label: service.serviceName, + label: service.serviceName + ' (' + service.port.portNumber + ')', data: { id: service.id, + name: service.serviceName, portType: service.port.portType, portNumber: service.port.portNumber, }, @@ -154,6 +156,9 @@ export class SearchResultComponent implements OnInit { if (node.data.portNumber < service.port.portNumber) { index++; } + // if (!node.data.name.toUpperCase().localeCompare(service.serviceName.toUpperCase())) { + // index++; + // } }); return index; } @@ -178,7 +183,10 @@ export class SearchResultComponent implements OnInit { }); } - checkFilter(label: string) { - return label.indexOf(this.filterWord) > 0 ? true : false; + checkUnhighligt(label: string) { + if (this.filterWord && label.indexOf(this.filterWord) === -1) { + return true; + } + return false; } }