diff --git a/src/packages/discovery/component/setting/probe-selector/probe-selector.component.html b/src/packages/discovery/component/setting/probe-selector/probe-selector.component.html
index edb7d39..c4b990d 100644
--- a/src/packages/discovery/component/setting/probe-selector/probe-selector.component.html
+++ b/src/packages/discovery/component/setting/probe-selector/probe-selector.component.html
@@ -1,4 +1,4 @@
\ No newline at end of file
diff --git a/src/packages/discovery/component/setting/probe-selector/probe-selector.component.ts b/src/packages/discovery/component/setting/probe-selector/probe-selector.component.ts
index 294adac..8121eac 100644
--- a/src/packages/discovery/component/setting/probe-selector/probe-selector.component.ts
+++ b/src/packages/discovery/component/setting/probe-selector/probe-selector.component.ts
@@ -1,4 +1,7 @@
-import { Component, OnInit, Input, AfterContentInit, Output, EventEmitter, OnDestroy } from '@angular/core';
+import {
+ Component, OnInit, Input, AfterContentInit, Output,
+ EventEmitter, OnDestroy, OnChanges, SimpleChanges, ViewChild
+} from '@angular/core';
import { Store, select, StateObservable } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import * as ListStore from 'packages/probe/store/list';
@@ -7,18 +10,22 @@ import { Subscription } from 'rxjs/Subscription';
import { Probe } from '@overflow/commons-typescript/model/probe';
import { AuthSelector } from 'packages/member/store';
import { Domain } from '@overflow/commons-typescript/model/domain';
+import { Dropdown } from 'primeng/primeng';
@Component({
selector: 'of-probe-selector',
templateUrl: './probe-selector.component.html',
})
-export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestroy {
+export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {
+ @Input() visible: boolean;
@Input() preProbe: Probe;
probesSubscription$: Subscription;
probes$: StateObservable;
probes: Probe[];
+ selected: Probe;
+
@Output() probeSelected = new EventEmitter();
constructor(
@@ -31,6 +38,7 @@ export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestr
this.probesSubscription$ = this.probes$.subscribe(
(list: Probe[]) => {
if (list !== null) {
+ console.log('what the hell');
this.probes = list;
}
},
@@ -41,6 +49,23 @@ export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestr
}
ngAfterContentInit() {
+ this.getProbes();
+ }
+
+ ngOnDestroy() {
+ if (this.probesSubscription$) {
+ this.probesSubscription$.unsubscribe();
+ }
+ }
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes['visible']) {
+ this.selected = null;
+ this.getProbes();
+ }
+ }
+
+ getProbes() {
this.listStore.select(AuthSelector.select('domain')).subscribe(
(domain: Domain) => {
this.listStore.dispatch(new ListStore.ReadAllByDomain(domain));
@@ -51,13 +76,8 @@ export class ProbeSelectorComponent implements OnInit, AfterContentInit, OnDestr
);
}
- ngOnDestroy() {
- if (this.probesSubscription$) {
- this.probesSubscription$.unsubscribe();
- }
- }
-
onProbeSelect(event) {
- this.probeSelected.emit(event.value);
+ this.selected = event.value;
+ this.probeSelected.emit(this.selected);
}
}
diff --git a/src/packages/discovery/component/setting/setting.component.html b/src/packages/discovery/component/setting/setting.component.html
index 310bb0f..085609b 100644
--- a/src/packages/discovery/component/setting/setting.component.html
+++ b/src/packages/discovery/component/setting/setting.component.html
@@ -3,7 +3,7 @@
-
+
diff --git a/src/packages/discovery/component/setting/setting.component.ts b/src/packages/discovery/component/setting/setting.component.ts
index 607e6a0..5787d06 100644
--- a/src/packages/discovery/component/setting/setting.component.ts
+++ b/src/packages/discovery/component/setting/setting.component.ts
@@ -31,6 +31,7 @@ import { Subscription } from 'rxjs/Subscription';
})
export class SettingComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {
+ @Input() visible: boolean;
@Input() probe: Probe;
@Output() close = new EventEmitter();
private requestStart = false;
@@ -65,8 +66,8 @@ export class SettingComponent implements OnInit, AfterContentInit, OnDestroy, On
}
onDiscoveryStart(discoverZone: DiscoverZone) {
- // this.discoverStore.dispatch(new DiscoverStore.DiscoverZone(
- // { probeID: this.selectedProbe.probeKey, discoverZone: discoverZone }));
+ this.discoverStore.dispatch(new DiscoverStore.DiscoverZone(
+ { probeID: this.selectedProbe.probeKey, discoverZone: discoverZone }));
setTimeout(() => {
this.started = true;
@@ -75,9 +76,10 @@ export class SettingComponent implements OnInit, AfterContentInit, OnDestroy, On
}
onCancel() {
- this.close.emit();
- this.started = false;
this.selectedProbe = null;
+ this.probe = null;
+ this.started = false;
+ this.close.emit();
}
}
diff --git a/src/packages/infra/component/map/map.component.html b/src/packages/infra/component/map/map.component.html
index d209dac..8be7576 100644
--- a/src/packages/infra/component/map/map.component.html
+++ b/src/packages/infra/component/map/map.component.html
@@ -1,5 +1,5 @@
-
+
diff --git a/src/packages/probe/component/detail/detail.component.html b/src/packages/probe/component/detail/detail.component.html
index d23402b..05d8b18 100644
--- a/src/packages/probe/component/detail/detail.component.html
+++ b/src/packages/probe/component/detail/detail.component.html
@@ -1,8 +1,8 @@
Info
-
-
+