|
|
@ -57,7 +57,7 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.store.dispatch(new RTLActions.GetForwardingHistory({}));
|
|
|
|
this.onRoutingPeersFetch();
|
|
|
|
this.store.select('rtlRoot')
|
|
|
|
this.store.select('rtlRoot')
|
|
|
|
.pipe(takeUntil(this.unsub[0]))
|
|
|
|
.pipe(takeUntil(this.unsub[0]))
|
|
|
|
.subscribe((rtlStore: fromRTLReducer.State) => {
|
|
|
|
.subscribe((rtlStore: fromRTLReducer.State) => {
|
|
|
@ -68,6 +68,9 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) {
|
|
|
|
if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) {
|
|
|
|
this.loadRoutingPeersTable(rtlStore.forwardingHistory.forwarding_events);
|
|
|
|
this.loadRoutingPeersTable(rtlStore.forwardingHistory.forwarding_events);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// To reset table after other Forwarding history calls
|
|
|
|
|
|
|
|
this.loadRoutingPeersTable([]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.flgLoading[0] !== 'error') {
|
|
|
|
if (this.flgLoading[0] !== 'error') {
|
|
|
|
this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true;
|
|
|
|
this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true;
|
|
|
@ -96,13 +99,19 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loadRoutingPeersTable(forwardingEvents: ForwardingEvent[]) {
|
|
|
|
loadRoutingPeersTable(forwardingEvents: ForwardingEvent[]) {
|
|
|
|
const results = this.groupRoutingPeers(forwardingEvents);
|
|
|
|
if (forwardingEvents.length > 0) {
|
|
|
|
this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>(results[0]);
|
|
|
|
const results = this.groupRoutingPeers(forwardingEvents);
|
|
|
|
this.RoutingPeersIncoming.sort = this.sortIn;
|
|
|
|
this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>(results[0]);
|
|
|
|
this.logger.info(this.RoutingPeersIncoming);
|
|
|
|
this.RoutingPeersIncoming.sort = this.sortIn;
|
|
|
|
this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>(results[1]);
|
|
|
|
this.logger.info(this.RoutingPeersIncoming);
|
|
|
|
this.RoutingPeersOutgoing.sort = this.sortOut;
|
|
|
|
this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>(results[1]);
|
|
|
|
this.logger.info(this.RoutingPeersOutgoing);
|
|
|
|
this.RoutingPeersOutgoing.sort = this.sortOut;
|
|
|
|
|
|
|
|
this.logger.info(this.RoutingPeersOutgoing);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// To reset table after other Forwarding history calls
|
|
|
|
|
|
|
|
this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>([]);
|
|
|
|
|
|
|
|
this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>([]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
groupRoutingPeers(forwardingEvents: ForwardingEvent[]) {
|
|
|
|
groupRoutingPeers(forwardingEvents: ForwardingEvent[]) {
|
|
|
|