discovery

This commit is contained in:
insanity 2018-06-01 11:47:37 +09:00
parent 0a8dfe35fc
commit ccf9ff53a8
2 changed files with 19 additions and 13 deletions

View File

@ -24,6 +24,7 @@ export class DiscoveryComponent {
selectedProbe: ProbeHost; selectedProbe: ProbeHost;
requested: boolean; requested: boolean;
discoverZone: DiscoverZone;
constructor( constructor(
@ -35,9 +36,7 @@ export class DiscoveryComponent {
onRequestDiscovery(dz: DiscoverZone) { onRequestDiscovery(dz: DiscoverZone) {
this.requested = true; this.requested = true;
this.discoverZone = dz;
this.requested = true;
this.discoverySubscriber.observable().pipe( this.discoverySubscriber.observable().pipe(
tap(() => { tap(() => {
this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz); this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz);
@ -80,13 +79,13 @@ export class DiscoveryComponent {
} }
}), }),
catchError(error => { catchError(error => {
return of(); return of();
}), }),
).subscribe(); ).subscribe();
} }
onRequestDiscoveryStop() { onRequestDiscoveryStop() {
this.discoverZone = null;
this.requested = false; this.requested = false;
} }
} }

View File

@ -3,7 +3,14 @@
<of-key-value [key]="'Port Range'" [value]="portRange"></of-key-value> <of-key-value [key]="'Port Range'" [value]="portRange"></of-key-value>
<span *ngIf="discoverZone.discoverHost.discoverPort.includeTCP">TCP</span> <span *ngIf="discoverZone.discoverHost.discoverPort.includeTCP">TCP</span>
<span *ngIf="discoverZone.discoverHost.discoverPort.includeUDP">UDP</span> <span *ngIf="discoverZone.discoverHost.discoverPort.includeUDP">UDP</span>
<div *ngIf="services.length > 0">
<p-overlayPanel #op>
<div *ngFor="let service of services"> <div *ngFor="let service of services">
<span>{{service}}</span> {{service}}
</div>
</p-overlayPanel>
<button type="text" pButton label="{{services.length}} services has selected." (click)="op.toggle($event)"></button>
</div> </div>
</div> </div>