in progress

This commit is contained in:
insanity 2018-05-28 21:12:11 +09:00
parent 51162f3c53
commit cc45f35959
12 changed files with 1865 additions and 1883 deletions

View File

@ -1,15 +1,20 @@
<h1>Discovery</h1> <div class="ui-g">
<div class="ui-g-12 ui-md-3">
<of-discovery-search-config (discoverySearchStartClick)="onDiscoveryStart()"></of-discovery-search-config>
</div>
<div class="ui-g-12 ui-md-9">
bb
</div>
</div>
<!-- <div class="ui-g-12"> <!-- <div class="ui-g-12">
<p-panel [showHeader]="false" >Temp Area</p-panel> <p-panel [showHeader]="false" >Temp Area</p-panel>
</div> --> </div> -->
<div class="ui-g"> <!-- <div class="ui-g">
<div class="ui-g-12 ui-md-3"> <div class="ui-g-12 ui-md-3">
<p-accordion (onClose)="onTabClose($event)" (onOpen)="OnTabOpen($event)"> <p-accordion (onClose)="onTabClose($event)" (onOpen)="OnTabOpen($event)">
<p-accordionTab header="Probe Select Area" [selected]="true"> <p-accordionTab header="Probe Select Area" [selected]="true">
<!-- <of-probe-selector
[preProbe]="selectedProbeHost"
[probeHosts]="probeHosts"></of-probe-selector> -->
</p-accordionTab> </p-accordionTab>
<p-accordionTab header="Discovery Search Config Area" > <p-accordionTab header="Discovery Search Config Area" >
<of-discovery-search-config <of-discovery-search-config
@ -27,4 +32,4 @@
<of-discovery-search-result [probe]="selectedProbe"></of-discovery-search-result> <of-discovery-search-result [probe]="selectedProbe"></of-discovery-search-result>
</p-panel> </p-panel>
</div> </div>
</div> </div> -->

View File

@ -1,6 +1,5 @@
import { import {
AfterContentInit, Component, Input, Component, Input,
OnInit
} from '@angular/core'; } from '@angular/core';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe'; import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
@ -8,48 +7,14 @@ import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
selector: 'of-discovery', selector: 'of-discovery',
templateUrl: './discovery.component.html', templateUrl: './discovery.component.html',
}) })
export class DiscoveryComponent implements OnInit, AfterContentInit { export class DiscoveryComponent {
@Input() probeHostID: number;
private tabIdx: number; private tabIdx: number;
selectedProbeHost: ProbeHost; @Input() selectedProbe: ProbeHost;
constructor( constructor(
) { ) {
} }
ngOnInit() {
// if (this.probeHostID) {
// this.selectedProbeHost = this.probeHosts.find(probeHost => probeHost.id === this.probeHostID);
// }
}
ngAfterContentInit() {
}
onTabClose(event) {
}
OnTabOpen(event) {
this.tabIdx = event.index;
}
onFilterResultOpen() {
}
onDiscoveryStart() {
console.log('dddddddddddddd');
}
onSelectedProbe(probe) {
console.log(probe);
// this.selectedProbe = probe;
}
onProbeSelect(probe) {
console.log(probe);
}
} }

View File

@ -14,7 +14,7 @@ import {
export class SearchConfigComponent implements OnInit, AfterContentInit { export class SearchConfigComponent implements OnInit, AfterContentInit {
@Output() discoverySearchStartClick = new EventEmitter(); @Output() discoverySearchStartClick = new EventEmitter();
@Output() selectProbe = new EventEmitter(); @Output() selectedProbe = new EventEmitter();
includeServices = []; includeServices = [];

View File

@ -10,7 +10,7 @@ import { Probe } from '@overflow/commons-typescript/model/probe';
}) })
export class SearchResultComponent implements OnInit, AfterContentInit { export class SearchResultComponent implements OnInit, AfterContentInit {
@Input() probe: Probe; @Input() selectedProbe: Probe;
constructor( constructor(
) { ) {

View File

@ -1,2 +1,2 @@
<of-probe-selector-container [probeHostID]="probeHostID"></of-probe-selector-container> <of-probe-selector-container [probeHostID]="probeHostID" (select)="selectedProbe = $event"></of-probe-selector-container>
<of-discovery [probeHostID]="probeHostID"></of-discovery> <of-discovery [selectedProbe]="selectedProbe"></of-discovery>

View File

@ -2,6 +2,7 @@ import {
Component, Component,
Input, Input,
} from '@angular/core'; } from '@angular/core';
import { ProbeHost } from '@overflow/commons-typescript/model/probe';
@Component({ @Component({
selector: 'of-discovery-container', selector: 'of-discovery-container',
@ -10,10 +11,10 @@ import {
export class DiscoveryContainerComponent { export class DiscoveryContainerComponent {
@Input() probeHostID; @Input() probeHostID;
selectedProbe: ProbeHost;
constructor( constructor(
) { ) {
} }
} }

View File

@ -1 +1,5 @@
<p-dropdown *ngIf="probeHosts.length > 0" [options]="options" [(ngModel)]="selected" optionLabel="displayName" placeholder="Select a Probe"></p-dropdown> <div *ngIf="probeHostID else dropdown"></div>
<ng-template #dropdown>
<p-dropdown *ngIf="options.length > 0" [options]="options" [(ngModel)]="selected" optionLabel="displayName" placeholder="Select a Probe"
(onChange)="onSelect($event.data)"></p-dropdown>
</ng-template>

View File

@ -1,11 +1,11 @@
import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges, OnInit } from '@angular/core';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe'; import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
@Component({ @Component({
selector: 'of-probe-selector', selector: 'of-probe-selector',
templateUrl: './selector.component.html', templateUrl: './selector.component.html',
}) })
export class ProbeSelectorComponent implements OnChanges { export class ProbeSelectorComponent implements OnInit, OnChanges {
@Output() select = new EventEmitter<ProbeHost>(); @Output() select = new EventEmitter<ProbeHost>();
@Input() probeHosts: ProbeHost[]; @Input() probeHosts: ProbeHost[];
@ -16,6 +16,10 @@ export class ProbeSelectorComponent implements OnChanges {
constructor() { constructor() {
} }
ngOnInit() {
this.onPreselected();
}
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
this.options = []; this.options = [];
for (const ph of this.probeHosts) { for (const ph of this.probeHosts) {
@ -23,7 +27,16 @@ export class ProbeSelectorComponent implements OnChanges {
} }
} }
onProbeSelect(event) { onPreselected() {
this.select.emit(event.data); if (this.probeHostID) {
const preselected: ProbeHost = this.probeHosts.find(probeHost => probeHost.id === this.probeHostID);
this.select.emit(preselected);
} }
}
onSelect(probe: Probe) {
const optionselected = this.probeHosts.find(probeHost => probeHost.id === probe.id);
this.select.emit(optionselected);
}
} }

View File

@ -1 +1 @@
<of-probe-selector (select)="onSelect($event)" [probeHosts]="probeHosts$ | async" [probeHostID]="probeHostID"></of-probe-selector> <of-probe-selector (select)="select.emit($event)" [probeHosts]="probeHosts$ | async" [probeHostID]="probeHostID"></of-probe-selector>

View File

@ -3,7 +3,7 @@ import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import * as ProbeEntityStore from '@overflow/probe/store/entity/probe'; import * as ProbeEntityStore from '@overflow/probe/store/entity/probe';
import { ProbeListContainerSelector } from '@overflow/probe/store'; import { ProbeSelectorContainerSelector } from '@overflow/probe/store';
import { AuthContainerSelector } from '@overflow/shared/auth/store'; import { AuthContainerSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { DomainMember } from '@overflow/commons-typescript/model/domain';
@ -23,17 +23,11 @@ export class ProbeSelectorContainerComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.probeHosts$ = this.store.pipe(select(ProbeListContainerSelector.selectAll)); this.probeHosts$ = this.store.pipe(select(ProbeSelectorContainerSelector.selectAll));
this.store.select(AuthContainerSelector.selectDomainMember).subscribe( this.store.select(AuthContainerSelector.selectDomainMember).subscribe(
(domainMember: DomainMember) => { (domainMember: DomainMember) => {
this.store.dispatch(new ProbeEntityStore.ReadAllByDomainID(domainMember.domain.id)); this.store.dispatch(new ProbeEntityStore.ReadAllByDomainID(domainMember.domain.id));
} }
); );
} }
onSelect(probeHost: ProbeHost) {
alert(probeHost.probe.displayName);
// this.select.emit(probeHost);
}
} }

3638
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{ {
"name": "member-webapp-prototype", "name": "member-webapp",
"version": "0.0.0", "version": "0.0.0",
"license": "COMMERCIAL", "license": "COMMERCIAL",
"description": "Webapp for overflow", "description": "Webapp for overflow",