Skip to content

Commit 2c76c42

Browse files
lazyninatholonious
andauthored
Add remote node connections to admin panel (#646)
* Devnet deployment config * Add remote node connections to admin panel * Revert env changes * Testnet deployment config (#651) * Add remote node connections to admin panel * Testnet deployment config * Revert prod environment changes * Fix merge --------- Co-authored-by: iamsofonias <[email protected]> --------- Co-authored-by: iamsofonias <[email protected]>
1 parent 5f1ae62 commit 2c76c42

File tree

7 files changed

+93
-1
lines changed

7 files changed

+93
-1
lines changed

Caddyfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ header @html Content-Security-Policy "
3030
connect-src 'self'
3131
media.deso.org
3232
node.deso.org
33+
*.deso.run
3334
amp.deso.org
3435
bithunt.deso.org
3536
bitclout.com:*

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ COPY ./src/environments/environment.$environment.ts ./src/environments/environme
4040
RUN npm run build_prod
4141

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

4545
WORKDIR /frontend
4646

package-lock.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/dao-coins/transfer-lockup-dao-coin-modal/transfer-lockup-dao-coin-modal.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export class TransferLockupDaoCoinModalComponent {
162162
minute: '2-digit',
163163
hour12: false,
164164
};
165+
//@ts-ignore
165166
return new Intl.DateTimeFormat('default', options).format(date)
166167
}
167168
}

src/app/dao-coins/unlock-dao-coin-modal/unlock-dao-coin-modal.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class UnlockDaoCoinModalComponent {
8181
minute: '2-digit',
8282
hour12: false,
8383
};
84+
// @ts-ignore
8485
return new Intl.DateTimeFormat('default', options).format(date)
8586
}
8687
}

src/app/network-info/network-info.component.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,44 @@
211211
<i *ngIf="isOpen.desoNode" class="fas fa-caret-down"></i>
212212
DeSo Node Info
213213
</span>
214+
<div class="ml-15px">
215+
Remote Node Connections
216+
<table class="fs-12px w-100" style="table-layout: fixed;">
217+
<thead>
218+
<td class="w-25">IP</td>
219+
<td class="w-25">Status</td>
220+
<td class="w-50">Validator Info</td>
221+
</thead>
222+
<tbody>
223+
<tr
224+
*ngFor="let connection of globalVars.nodeInfo.RemoteNodeConnections"
225+
class="border-bottom border-color-grey"
226+
>
227+
<td class="w-25">
228+
{{ connection.PeerResponse ? connection.PeerResponse.IP + ':' + connection.PeerResponse.ProtocolPort : 'N/A' }}</td>
229+
<td class="w-25">
230+
<i [ngClass]="connection.PeerConnected ? 'fas fa-solid fa-check fc-green' : 'fas fa-solid fa-x fc-red'"></i>
231+
<span style="overflow-wrap: break-word">{{ connection.RemoteNodeStatus }}</span>
232+
</td>
233+
<td class="w-50">
234+
<span
235+
(click)="_copyPublicKey(connection.ValidatorResponse.ValidatorPublicKeyBase58Check)"
236+
class="d-block text-truncate"
237+
*ngIf="connection.ValidatorResponse"
238+
>
239+
<i
240+
*ngIf="!pubKeyCopiedMap[connection.ValidatorResponse.ValidatorPublicKeyBase58Check]"
241+
class="fas fa-key"></i>
242+
<i
243+
*ngIf="pubKeyCopiedMap[connection.ValidatorResponse.ValidatorPublicKeyBase58Check]"
244+
class="far fa-check-circle fc-blue"
245+
></i>
246+
{{ connection.ValidatorResponse.ValidatorPublicKeyBase58Check }}
247+
</span>
248+
</td>
249+
</tr>
250+
</table>
251+
</div>
214252
<div *ngIf="isOpen.desoNode && updatingDeSoPeer" class="ml-15px fc-muted">
215253
Updating DeSo peers...
216254
</div>

src/app/network-info/network-info.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class NetworkInfoComponent implements OnInit {
3434
updatingDeSoPeer = false;
3535
manualBitcoinPeer = '';
3636
updatingBitcoinPeer = false;
37+
pubKeyCopiedMap = {};
3738

3839
constructor(
3940
public globalVars: GlobalVarsService,
@@ -324,4 +325,12 @@ export class NetworkInfoComponent implements OnInit {
324325
},
325326
});
326327
}
328+
329+
_copyPublicKey(publicKey: string) {
330+
this.globalVars._copyText(publicKey);
331+
this.pubKeyCopiedMap[publicKey] = true;
332+
setInterval(() => {
333+
delete this.pubKeyCopiedMap[publicKey];
334+
}, 1000);
335+
}
327336
}

0 commit comments

Comments
 (0)