diff --git a/@overflow/discovery/component/discovery/discovery.component.html b/@overflow/discovery/component/discovery/discovery.component.html index 402c8de..db6e5b7 100644 --- a/@overflow/discovery/component/discovery/discovery.component.html +++ b/@overflow/discovery/component/discovery/discovery.component.html @@ -5,8 +5,16 @@
- - + + + + + @@ -19,4 +27,4 @@
-
\ No newline at end of file + diff --git a/@overflow/discovery/component/discovery/discovery.component.ts b/@overflow/discovery/component/discovery/discovery.component.ts index 487f8be..0091a82 100644 --- a/@overflow/discovery/component/discovery/discovery.component.ts +++ b/@overflow/discovery/component/discovery/discovery.component.ts @@ -1,5 +1,5 @@ import { - AfterContentInit, Component, + AfterContentInit, Component, Input, OnInit } from '@angular/core'; import {Probe} from '@overflow/commons-typescript/model/probe'; @@ -10,6 +10,8 @@ import {Probe} from '@overflow/commons-typescript/model/probe'; }) export class DiscoveryComponent implements OnInit, AfterContentInit { + @Input() probeHosts; + private tabIdx: number; selectedProbe: Probe; @@ -43,4 +45,8 @@ export class DiscoveryComponent implements OnInit, AfterContentInit { console.log(probe); this.selectedProbe = probe; } + + onProbeSelect(probe) { + console.log(probe); + } } diff --git a/@overflow/discovery/component/discovery/probe-selector/probe-selector.component.ts b/@overflow/discovery/component/discovery/probe-selector/probe-selector.component.ts index 2bd6417..f8cafcd 100644 --- a/@overflow/discovery/component/discovery/probe-selector/probe-selector.component.ts +++ b/@overflow/discovery/component/discovery/probe-selector/probe-selector.component.ts @@ -2,11 +2,9 @@ import { Component, OnInit, Input, AfterContentInit, Output, EventEmitter, OnDestroy, ViewChild } from '@angular/core'; -import { Store, select, StateObservable } from '@ngrx/store'; -import { RPCClientError } from '@loafer/ng-rpc'; import { Subscription } from 'rxjs/Subscription'; -import { Probe } from '@overflow/commons-typescript/model/probe'; +import {Probe, ProbeHost} from '@overflow/commons-typescript/model/probe'; @Component({ selector: 'of-probe-selector', @@ -14,31 +12,18 @@ import { Probe } from '@overflow/commons-typescript/model/probe'; }) export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestroy { - @Input() preProbe: Probe; - probesSubscription$: Subscription; - probes$: StateObservable; + @Input() preProbe: ProbeHost; probes: Probe[]; selected: Probe; @Output() probeSelected = new EventEmitter(); constructor( - // private listStore: Store, ) { - // this.probes$ = listStore.pipe(select(ListSelector.select('probes'))); } ngOnInit() { - this.probesSubscription$ = this.probes$.subscribe ( - (list: Probe[]) => { - if (list !== null) { - this.probes = list; - } - }, - (error: RPCClientError) => { - console.log(error.response.message); - } - ); + } ngAfterContentInit() { @@ -46,26 +31,29 @@ export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestr } ngOnDestroy() { - if (this.probesSubscription$) { - this.probesSubscription$.unsubscribe(); - } this.selected = null; this.probes = null; } getProbes() { - // this.listStore.select(AuthSelector.select('domain')).subscribe( - // (domain: Domain) => { - // this.listStore.dispatch(new ListStore.ReadAllByDomain(domain)); - // }, - // (error) => { - // console.log(error); - // } - // ); + } onProbeSelect(event) { this.selected = event.value; this.probeSelected.emit(this.selected); } + + registerOnChange(fn: any): void { + } + + registerOnTouched(fn: any): void { + } + + setDisabledState(isDisabled: boolean): void { + } + + writeValue(obj: any): void { + } + } diff --git a/@overflow/discovery/component/discovery/search-config/search-config.component.html b/@overflow/discovery/component/discovery/search-config/search-config.component.html index 69e417e..f95b7aa 100644 --- a/@overflow/discovery/component/discovery/search-config/search-config.component.html +++ b/@overflow/discovery/component/discovery/search-config/search-config.component.html @@ -1,21 +1,36 @@
- -
- -
-
- -
+ + + + + + + + + +
- +
- +
@@ -24,23 +39,43 @@
- +
- +
- +
- +
- +
@@ -49,13 +84,26 @@
- +
- +
- +
@@ -66,7 +114,7 @@
- +
diff --git a/@overflow/discovery/component/discovery/search-config/search-config.component.ts b/@overflow/discovery/component/discovery/search-config/search-config.component.ts index 19cca17..c4fa779 100644 --- a/@overflow/discovery/component/discovery/search-config/search-config.component.ts +++ b/@overflow/discovery/component/discovery/search-config/search-config.component.ts @@ -4,7 +4,7 @@ import { } from '@angular/core'; import { FormBuilder, - FormGroup + FormGroup, Validators } from '@angular/forms'; @Component({ @@ -21,7 +21,6 @@ export class SearchConfigComponent implements OnInit, AfterContentInit { discoveryFormGroup: FormGroup; ipVesion: number; - portType: number; startIP: string; endIP: string; @@ -30,12 +29,12 @@ export class SearchConfigComponent implements OnInit, AfterContentInit { endPort: string; excludePort: string; - probe: number; - startHostIp: string; endHostIp: string; excludeHostIp: string; + selectPortTypes: string[] = ['0']; + constructor( private formBuilder: FormBuilder, ) { @@ -43,7 +42,6 @@ export class SearchConfigComponent implements OnInit, AfterContentInit { ngOnInit() { this.ipVesion = 0; - this.portType = 0; this.initForm(); // this.hostIp = '192.168.1.10'; } @@ -53,7 +51,16 @@ export class SearchConfigComponent implements OnInit, AfterContentInit { initForm() { // this.discoveryFormGroup = this.formBuilder.group({ - // + // probeSelect: [null], + // IPType: [null], + // startIP:[null], + // endIP: [null], + // exIP: [null], + // portType: [null], + // startPort: [null], + // endPort: [null], + // exPort: [null], + // services: [null] // }); } @@ -61,11 +68,6 @@ export class SearchConfigComponent implements OnInit, AfterContentInit { this.discoverySearchStartClick.emit(); } - onProbeSelect(probe) { - console.log(probe); - this.selectProbe.emit(probe); - } - onInputIP(event, idx) { console.log(idx); console.log(event.target.data); diff --git a/@overflow/discovery/component/discovery/service-selector/service-selector.component.ts b/@overflow/discovery/component/discovery/service-selector/service-selector.component.ts index 16cf53a..ea86fa4 100644 --- a/@overflow/discovery/component/discovery/service-selector/service-selector.component.ts +++ b/@overflow/discovery/component/discovery/service-selector/service-selector.component.ts @@ -29,25 +29,25 @@ export class ServiceSelectorComponent implements OnInit, AfterContentInit, OnDes constructor( private listStore: Store, ) { - this.crawlers$ = listStore.pipe(select(ReadAllCrawlerSelector.select('metaCrawlerList'))); + // this.crawlers$ = listStore.pipe(select(ReadAllCrawlerSelector.select('metaCrawlerList'))); } ngOnInit() { - this.crawlersSubscription$ = this.crawlers$.subscribe( - (list: MetaCrawler[]) => { - if (list !== null) { - this.crawlers = []; - this.crawlers = list; - } - }, - (error: RPCClientError) => { - console.log(error); - } - ); + // this.crawlersSubscription$ = this.crawlers$.subscribe( + // (list: MetaCrawler[]) => { + // if (list !== null) { + // this.crawlers = []; + // this.crawlers = list; + // } + // }, + // (error: RPCClientError) => { + // console.log(error); + // } + // ); } ngAfterContentInit() { - this.listStore.dispatch(new ListStore.ReadAll()); + // this.listStore.dispatch(new ListStore.ReadAll()); } ngOnDestroy() { diff --git a/@overflow/discovery/container/discovery/discovery-container.component.html b/@overflow/discovery/container/discovery/discovery-container.component.html index 2a56852..363056a 100644 --- a/@overflow/discovery/container/discovery/discovery-container.component.html +++ b/@overflow/discovery/container/discovery/discovery-container.component.html @@ -1 +1 @@ - + diff --git a/@overflow/discovery/container/discovery/discovery-container.component.ts b/@overflow/discovery/container/discovery/discovery-container.component.ts index 7218e90..a513aad 100644 --- a/@overflow/discovery/container/discovery/discovery-container.component.ts +++ b/@overflow/discovery/container/discovery/discovery-container.component.ts @@ -2,8 +2,15 @@ import { AfterContentInit, Component, Input, OnInit } from '@angular/core'; -import { select, StateObservable } from '@ngrx/store'; +import { select, Store} from '@ngrx/store'; import { ActivatedRoute } from '@angular/router'; +import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe'; + +import { AuthSelector } from '@overflow/member/store'; +import { Domain } from '@overflow/commons-typescript/model/domain'; +import * as ProbeEntityStore from '@overflow/probe/store/entity/probe'; +import {Observable} from 'rxjs'; +import { ProbeEntitySelector } from '@overflow/probe/store'; @Component({ selector: 'of-discovery-container', @@ -18,15 +25,26 @@ export class DiscoveryContainerComponent implements OnInit, AfterContentInit { // get service list @Input() hostID; + probeHosts$: Observable; + selectProbes?: Probe[]; + constructor( private activatedRoute: ActivatedRoute, + private store: Store ) { - if (this.hostID > 0 && this.hostID !== undefined ) { - console.log('ddddddddddddddddddddddddddddddddddddddd'); - } + this.probeHosts$ = store.pipe(select(ProbeEntitySelector.selectAll)); + } ngOnInit() { + this.store.select(AuthSelector.select('domain')).subscribe( + (domain: Domain) => { + this.store.dispatch(new ProbeEntityStore.ReadAllByDomainID(domain.id)); + }, + (error) => { + console.log(error); + } + ); } ngAfterContentInit() {