Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remote node connections to admin panel #646

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ header @html Content-Security-Policy "
connect-src 'self'
media.deso.org
node.deso.org
*.deso.run
amp.deso.org
bithunt.deso.org
bitclout.com:*
Expand Down
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
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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);
}
}