probe store arranging
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { MapComponent } from './map/map.component';
|
||||
import { ProbeSummaryComponent } from './probe-summary/probe-summary.component';
|
||||
// import { ProbeSummaryComponent } from './probe-summary/probe-summary.component';
|
||||
import { HostSummaryComponent } from './host-summary/host-summary.component';
|
||||
import { ServiceSummaryComponent } from './service-summary/service-summary.component';
|
||||
|
||||
export const COMPONENTS = [
|
||||
MapComponent,
|
||||
ProbeSummaryComponent,
|
||||
// ProbeSummaryComponent,
|
||||
HostSummaryComponent,
|
||||
ServiceSummaryComponent
|
||||
];
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
import { Component, OnInit, AfterContentInit, Input, OnChanges } from '@angular/core';
|
||||
import { Store, select } from '@ngrx/store';
|
||||
import { RPCClientError } from '@loafer/ng-rpc';
|
||||
// import { Component, OnInit, AfterContentInit, Input, OnChanges } from '@angular/core';
|
||||
// import { Store, select } from '@ngrx/store';
|
||||
// import { RPCClientError } from '@loafer/ng-rpc';
|
||||
|
||||
import * as DetailStore from '@overflow/probe/store/probe-host';
|
||||
import { ProbeHostSelector } from '@overflow/probe/store';
|
||||
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
|
||||
// import * as DetailStore from '@overflow/probe/store/probe-host';
|
||||
// import { ProbeHostSelector } from '@overflow/probe/store';
|
||||
// import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'of-probe-summary',
|
||||
templateUrl: './probe-summary.component.html',
|
||||
})
|
||||
export class ProbeSummaryComponent implements OnInit, AfterContentInit, OnChanges {
|
||||
// @Component({
|
||||
// selector: 'of-probe-summary',
|
||||
// templateUrl: './probe-summary.component.html',
|
||||
// })
|
||||
// export class ProbeSummaryComponent implements OnInit, AfterContentInit, OnChanges {
|
||||
|
||||
@Input() probe: Object;
|
||||
@Input() visible: boolean;
|
||||
// @Input() probe: Object;
|
||||
// @Input() visible: boolean;
|
||||
|
||||
probeHost$ = this.detailStore.pipe(select(ProbeHostSelector.select('probeHost')));
|
||||
probeHost: ProbeHost;
|
||||
// probeHost$ = this.detailStore.pipe(select(ProbeHostSelector.select('probeHost')));
|
||||
// probeHost: ProbeHost;
|
||||
|
||||
constructor(
|
||||
private detailStore: Store<DetailStore.State>,
|
||||
) { }
|
||||
// constructor(
|
||||
// private detailStore: Store<DetailStore.State>,
|
||||
// ) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.probeHost$.subscribe(
|
||||
(probeHost: ProbeHost) => {
|
||||
if (probeHost) {
|
||||
console.log(probeHost);
|
||||
this.probeHost = probeHost;
|
||||
}
|
||||
},
|
||||
(error: RPCClientError) => {
|
||||
console.log(error.response.message);
|
||||
}
|
||||
);
|
||||
}
|
||||
// ngOnInit() {
|
||||
// this.probeHost$.subscribe(
|
||||
// (probeHost: ProbeHost) => {
|
||||
// if (probeHost) {
|
||||
// console.log(probeHost);
|
||||
// this.probeHost = probeHost;
|
||||
// }
|
||||
// },
|
||||
// (error: RPCClientError) => {
|
||||
// console.log(error.response.message);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
ngAfterContentInit() {
|
||||
console.log('$$$$$$$$$$');
|
||||
console.log(this.probe);
|
||||
console.log('$$$$$$$$$$');
|
||||
// this.detailStore.dispatch(
|
||||
// new DetailStore.ReadByProbe(this.probe)
|
||||
// );
|
||||
}
|
||||
// ngAfterContentInit() {
|
||||
// console.log('$$$$$$$$$$');
|
||||
// console.log(this.probe);
|
||||
// console.log('$$$$$$$$$$');
|
||||
// // this.detailStore.dispatch(
|
||||
// // new DetailStore.ReadByProbe(this.probe)
|
||||
// // );
|
||||
// }
|
||||
|
||||
ngOnChanges() {
|
||||
}
|
||||
// ngOnChanges() {
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user