Small fixes

This commit is contained in:
Djuri Baars 2022-02-07 14:23:17 +01:00
parent 3f8f3b602e
commit 42bc54e446
4 changed files with 39 additions and 16 deletions

View file

@ -77,9 +77,8 @@ export class NodeConnectionsComponent implements OnInit {
buildNodes() {
for (let node of this.nodeOwners) {
let data = this.lnData
.getNodeInfo(node.pub_key)
.subscribe((data: NodeInfo) => {
let data = this.lnData.getNodeInfo(node.pub_key).subscribe({
next: (data: NodeInfo) => {
let label;
//if (this.viewMode == 'node') {
@ -114,7 +113,11 @@ export class NodeConnectionsComponent implements OnInit {
continue channelloop;
}
}
});
},
error: (err) => {
console.log('Error', err);
},
});
}
}
}

View file

@ -12,7 +12,7 @@
</thead>
<tbody>
<ng-container *ngFor="let item of participants; let i = index">
<tr [class.error]="item.channel_id && (!item.initiator_fee || !item.receiver_fee)">
<tr [class.error]="item[2] && (!item[3][0]|| !item[3][1] || item[3][0].disabled === true || item[3][1].disabled === true)">
<ng-template #popTitle let-title="title">Node policy <strong>{{title}}</strong></ng-template>
<ng-template #popContent let-value="value">
<pre><code [innerHTML]="value"></code></pre>
@ -27,22 +27,22 @@
<td *ngIf="item[0]" class="node_key"><span>{{ item[0].nodename }}</span></td>
<td *ngIf="item[1]" class="node_key"><span>{{ item[1].nodename }}</span></td>
</ng-template>
<td>
<td [class.error]="item[3][0] && item[3][0].disabled === true">
<div *ngIf="item[3] && item[3][0]" [ngbPopover]="popContent" [popoverTitle]="popTitle"
#p1="ngbPopover" triggers="manual" (click)="routingPolicyPopover(p1, item[3][0], item[0])">
<span>{{ item[3][0].fee_base_msat }}</span></div>
</td>
<td>
<td [class.error]="item[3][0] && item[3][0].disabled === true">
<div *ngIf="item[3] && item[3][0]" [ngbPopover]="popContent" [popoverTitle]="popTitle"
#p1="ngbPopover" triggers="manual" (click)="routingPolicyPopover(p1, item[3][0], item[0])">
<span>{{ item[3][0].fee_rate_milli_msat }}</span></div>
</td>
<td>
<td [class.error]="item[3][1] && item[3][1].disabled === true">
<div *ngIf="item[3] && item[3][1]" [ngbPopover]="popContent" [popoverTitle]="popTitle"
#p1="ngbPopover" triggers="manual" (click)="routingPolicyPopover(p1, item[3][1], item[1])">
<span>{{ item[3][1].fee_base_msat }}</span></div>
</td>
<td>
<td [class.error]="item[3][1] && item[3][1].disabled === true">
<div *ngIf="item[3] && item[3][1]" [ngbPopover]="popContent" [popoverTitle]="popTitle"
#p1="ngbPopover" triggers="manual" (click)="routingPolicyPopover(p1, item[3][1], item[1])">
<span>{{ item[3][1].fee_rate_milli_msat }}</span></div>

View file

@ -1 +1,14 @@
@import "~highlight.js/styles/github-dark.css";
@import "~highlight.js/styles/github-dark.css";
.error {
th {
border-left: 5px dotted #f00;
}
}
td.error {
background: #f00;
}

View file

@ -67,17 +67,24 @@ export class RingDataService {
let ring: IRing = [];
for (const [i, node] of this.nodeOwners.entries()) {
let nextIndex = (i + 1) % this.nodeOwners.length;
const nodeInfo = Object.assign(
new NodeInfo(),
await this.lnData.getNodeInfoAsync(this.nodeOwners[i].pub_key)
);
let channel = nodeInfo.hasChannelWith(this.nodeOwners[nextIndex].pub_key);
let nodeInfo, channel;
try {
nodeInfo = Object.assign(
new NodeInfo(),
await this.lnData.getNodeInfoAsync(this.nodeOwners[i].pub_key)
);
} catch {}
if (nodeInfo) {
channel = nodeInfo.hasChannelWith(this.nodeOwners[nextIndex].pub_key);
}
ring.push([
Object.assign(new NodeOwner(), this.nodeOwners[i]),
Object.assign(new NodeOwner(), this.nodeOwners[nextIndex]),
channel,
channel
channel && nodeInfo
? nodeInfo.getChannelPolicies(
this.nodeOwners[nextIndex].pub_key,
channel