Skip to content

Commit

Permalink
Add remote node connections to admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina committed May 2, 2024
1 parent 78069ea commit b04c4f2
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ COPY ./src/environments/environment.$environment.ts ./src/environments/environme
RUN npm run build_prod

# build minified version of frontend, served using caddy
FROM caddy:2.3.0-alpine
FROM caddy:2.7.6-alpine

WORKDIR /frontend

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class TransferLockupDaoCoinModalComponent {
minute: '2-digit',
hour12: false,
};
//@ts-ignore
return new Intl.DateTimeFormat('default', options).format(date)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class UnlockDaoCoinModalComponent {
minute: '2-digit',
hour12: false,
};
// @ts-ignore
return new Intl.DateTimeFormat('default', options).format(date)
}
}
Expand Down
38 changes: 38 additions & 0 deletions src/app/network-info/network-info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,44 @@
<i *ngIf="isOpen.desoNode" class="fas fa-caret-down"></i>
DeSo Node Info
</span>
<div class="ml-15px">
Remote Node Connections
<table class="fs-12px w-100" style="table-layout: fixed;">
<thead>
<td class="w-25">IP</td>
<td class="w-25">Status</td>
<td class="w-50">Validator Info</td>
</thead>
<tbody>
<tr
*ngFor="let connection of globalVars.nodeInfo.RemoteNodeConnections"
class="border-bottom border-color-grey"
>
<td class="w-25">
{{ connection.PeerResponse ? connection.PeerResponse.IP + ':' + connection.PeerResponse.ProtocolPort : 'N/A' }}</td>
<td class="w-25">
<i [ngClass]="connection.PeerConnected ? 'fas fa-solid fa-check fc-green' : 'fas fa-solid fa-x fc-red'"></i>
<span style="overflow-wrap: break-word">{{ connection.RemoteNodeStatus }}</span>
</td>
<td class="w-50">
<span
(click)="_copyPublicKey(connection.ValidatorResponse.ValidatorPublicKeyBase58Check)"
class="d-block text-truncate"
*ngIf="connection.ValidatorResponse"
>
<i
*ngIf="!pubKeyCopiedMap[connection.ValidatorResponse.ValidatorPublicKeyBase58Check]"
class="fas fa-key"></i>
<i
*ngIf="pubKeyCopiedMap[connection.ValidatorResponse.ValidatorPublicKeyBase58Check]"
class="far fa-check-circle fc-blue"
></i>
{{ connection.ValidatorResponse.ValidatorPublicKeyBase58Check }}
</span>
</td>
</tr>
</table>
</div>
<div *ngIf="isOpen.desoNode && updatingDeSoPeer" class="ml-15px fc-muted">
Updating DeSo peers...
</div>
Expand Down
9 changes: 9 additions & 0 deletions src/app/network-info/network-info.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class NetworkInfoComponent implements OnInit {
updatingDeSoPeer = false;
manualBitcoinPeer = '';
updatingBitcoinPeer = false;
pubKeyCopiedMap = {};

constructor(
public globalVars: GlobalVarsService,
Expand Down Expand Up @@ -324,4 +325,12 @@ export class NetworkInfoComponent implements OnInit {
},
});
}

_copyPublicKey(publicKey: string) {
this.globalVars._copyText(publicKey);
this.pubKeyCopiedMap[publicKey] = true;
setInterval(() => {
delete this.pubKeyCopiedMap[publicKey];
}, 1000);
}
}

0 comments on commit b04c4f2

Please sign in to comment.