diff --git a/@overflow/discovery/component/discovery.component.ts b/@overflow/discovery/component/discovery.component.ts
index f10d5c6..621ae2d 100644
--- a/@overflow/discovery/component/discovery.component.ts
+++ b/@overflow/discovery/component/discovery.component.ts
@@ -59,9 +59,9 @@ export class DiscoveryComponent implements OnDestroy {
// TODO: fix
const zone: Zone = {
network: '192.168.1.0/24', // this.selectedProbe.probe.cidr
- address: '192.168.1.103',
+ address: '192.168.1.101',
iface: 'enp3s0',
- mac: '44:8a:5b:44:8c:e8',
+ mac: '44:8a:5b:f1:f1:f3',
};
this.discoveryService.discoverHost(this.selectedProbe.probe.probeKey, zone, dz.discoverHost);
diff --git a/@overflow/discovery/component/request-summary.component.html b/@overflow/discovery/component/request-summary.component.html
index 33bc686..30e4c5d 100644
--- a/@overflow/discovery/component/request-summary.component.html
+++ b/@overflow/discovery/component/request-summary.component.html
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/@overflow/discovery/component/search-config.component.ts b/@overflow/discovery/component/search-config.component.ts
index 9b19247..1f825af 100644
--- a/@overflow/discovery/component/search-config.component.ts
+++ b/@overflow/discovery/component/search-config.component.ts
@@ -104,10 +104,10 @@ export class SearchConfigComponent implements OnChanges {
if (this.serviceChecked) {
const services = [];
for (const service of this.includeServices) {
- services.push(service.description);
+ services.push(service.key);
}
discoverService = {
- includeServices: services,
+ includeServices: null,
};
}
if (this.portChecked) {
diff --git a/@overflow/discovery/component/search-result.component.html b/@overflow/discovery/component/search-result.component.html
index 26b43c2..77d91fd 100644
--- a/@overflow/discovery/component/search-result.component.html
+++ b/@overflow/discovery/component/search-result.component.html
@@ -44,13 +44,13 @@
-
+
-
Target 지정이 완료되었습니다. 이어서 Sensor를 등록하시면 좋겠다능
@@ -58,4 +58,4 @@
-
\ No newline at end of file
+ -->
\ No newline at end of file
diff --git a/@overflow/discovery/component/search-result.component.ts b/@overflow/discovery/component/search-result.component.ts
index 8771fe1..fc136b9 100644
--- a/@overflow/discovery/component/search-result.component.ts
+++ b/@overflow/discovery/component/search-result.component.ts
@@ -4,17 +4,24 @@ import {
OnInit,
OnChanges,
} from '@angular/core';
-import { Subscription, Observable } from 'rxjs';
import { Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { TreeNode, Message, Tree } from 'primeng/primeng';
import { ProbeHost } from '@overflow/commons-typescript/model/probe';
import { Anim } from './animation';
import { TargetService } from '@overflow/target/service/target.service';
+import { InfraService, InfraHost, MetaTargetHostTypeEnum, toMetaTargetHostType, Infra } from '@overflow/commons-typescript';
+import { InfraService as InfraRegistService } from '../../infra/service/infra.service';
+import { Observable, of, Subscription } from 'rxjs';
+import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
@Component({
selector: 'of-discovery-result',
templateUrl: './search-result.component.html',
animations: Anim,
+ providers: [
+ TargetService,
+ InfraRegistService
+ ]
})
export class SearchResultComponent implements OnInit, OnChanges {
@@ -33,8 +40,14 @@ export class SearchResultComponent implements OnInit, OnChanges {
targetSaveSucceed: boolean;
displayTargetDone: boolean;
+ discoveredHosts: Host[] = [];
+ discoveredServices: Service[] = [];
+
+ pending$: Observable
;
+
constructor(
- private targetService: TargetService
+ private targetService: TargetService,
+ private infraRegistService: InfraRegistService
) {
this.targetSaveSucceed = false;
this.displayTargetDone = false;
@@ -58,9 +71,34 @@ export class SearchResultComponent implements OnInit, OnChanges {
severity: 'success',
summary: 'Discovery가 완료되었습니다. 모니터링 대상(들)을 선택 후 저장하세요.',
});
+ this.saveDiscoveredInfras();
+
}
}
+ saveDiscoveredInfras() {
+ this.infraRegistService.registDiscoverd(
+ this.probeHost.probe.id,
+ this.discoveredHosts,
+ this.discoveredServices)
+ .pipe(
+ tap(() => {
+ this.pending$ = of(true);
+ }),
+ map((infras: Infra[]) => {
+ console.log(infras);
+ }),
+ catchError(error => {
+ this.error$ = of(error);
+ return of();
+ }),
+ tap(() => {
+ this.pending$ = of(false);
+ }),
+ take(1),
+ ).subscribe();
+ }
+
addHost(host: Host) {
// this.targetService.findExistHostTarget(this.probeHost.probe.id, host.ipv4)
@@ -89,6 +127,8 @@ export class SearchResultComponent implements OnInit, OnChanges {
expanded: true,
children: []
});
+
+ this.discoveredHosts.push(host);
}
addService(service: Service) {
@@ -104,6 +144,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
target: service
},
});
+ this.discoveredServices.push(service);
}
addPort(port: Port) {
// this.hostNode.forEach(node => {
@@ -181,16 +222,15 @@ export class SearchResultComponent implements OnInit, OnChanges {
saveTargets() {
- const hosts: Host[] = [];
- const services: Service[] = [];
- this.selectedItems.forEach(value => {
- if (value.ipv4) {
- hosts.push(value);
- } else {
- services.push(value);
- }
- });
-
+ // const hosts: Host[] = [];
+ // const services: Service[] = [];
+ // this.selectedItems.forEach(value => {
+ // if (!value.port) {
+ // hosts.push(value);
+ // } else {
+ // services.push(value);
+ // }
+ // });
// this.targetService.registDiscoveredTargets(this.probeHost.probe.id, hosts, services)
// .pipe(
// tap(() => {
diff --git a/@overflow/discovery/component/service-selector.component.html b/@overflow/discovery/component/service-selector.component.html
index 5bc0913..07f87ac 100644
--- a/@overflow/discovery/component/service-selector.component.html
+++ b/@overflow/discovery/component/service-selector.component.html
@@ -4,9 +4,9 @@
+ (click)="onUnselectAll()">
+ (click)="onSelectAll()">
-->
- {{rowData.description}}
+ {{rowData.key}}
diff --git a/@overflow/probe/component/probe-host.component.html b/@overflow/probe/component/probe-host.component.html
index d8b28b0..05dd1e5 100644
--- a/@overflow/probe/component/probe-host.component.html
+++ b/@overflow/probe/component/probe-host.component.html
@@ -47,7 +47,7 @@