Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Show bandwidth data for connections when available
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Jul 21, 2023
1 parent f4a06ca commit f580d0d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ export interface NetqueryConnection {

profile_name: string;
active: boolean;
bytes_received: number;
bytes_sent: number;
}

export interface ChartResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
<span>{{ conn.tunneled ? 'yes' : 'no' }}</span>
</span>

<span *ngIf="conn.bytes_received > 0">
<span>Data Received:</span>
<span>{{ (conn.bytes_received / 1024) | number:'1.1-1' }} kB</span>
</span>
<span *ngIf="conn.bytes_sent > 0">
<span>Data Sent:</span>
<span>{{ (conn.bytes_sent / 1024) | number:'1.1-1' }} kB</span>
</span>

<ng-container *ngIf="conn.extra_data?.tls as tls">
<span>
<span>TLS Version:</span>
Expand Down Expand Up @@ -217,33 +226,34 @@
<div *ngIf="conn.scope === scopes.Global">
<h3 class="text-primary text-xxs">SPN Tunnel</h3>
<ng-container [ngSwitch]="true">
<span *ngSwitchCase="!conn.tunneled" class="inline-flex items-center gap-2 text-secondary">
This connection has not been routed through the Safing Privacy Network.
<sfng-tipup key="spn"></sfng-tipup>
</span>
<span *ngSwitchCase="!conn.tunneled" class="inline-flex items-center gap-2 text-secondary">
This connection has not been routed through the Safing Privacy Network.
<sfng-tipup key="spn"></sfng-tipup>
</span>

<div *ngSwitchCase="!!conn.extra_data?.tunnel" class="meta">
<div *ngIf="conn.extra_data?.tunnel as tunnel">
<span>
<span></span>
<sfng-spn-pin-route [route]="tunnel.Path"></sfng-spn-pin-route>
</span>
</div>
<div *appExpertiseLevel="'developer'" class="flex flex-col items-start justify-start gap-1 mt-2">
<span class="flex flex-row items-center gap-2">
<span class="text-secondary">Path Costs:</span>
<span>{{ conn.extra_data?.tunnel?.PathCost }}</span>
</span>
<span class="flex flex-row items-center gap-2">
<span class="text-secondary">Routing Algorithm:</span>
<span>{{ conn.extra_data?.tunnel?.RoutingAlg }}</span>
</span>
<div *ngSwitchCase="!!conn.extra_data?.tunnel" class="meta">
<div *ngIf="conn.extra_data?.tunnel as tunnel">
<span>
<span></span>
<sfng-spn-pin-route [route]="tunnel.Path"></sfng-spn-pin-route>
</span>
</div>
<div *appExpertiseLevel="'developer'" class="flex flex-col items-start justify-start gap-1 mt-2">
<span class="flex flex-row items-center gap-2">
<span class="text-secondary">Path Costs:</span>
<span>{{ conn.extra_data?.tunnel?.PathCost }}</span>
</span>
<span class="flex flex-row items-center gap-2">
<span class="text-secondary">Routing Algorithm:</span>
<span>{{ conn.extra_data?.tunnel?.RoutingAlg }}</span>
</span>
</div>
</div>
</div>

<span *ngSwitchDefault class="inline-flex items-center gap-2 text-secondary">
The connection was routed through the Safing Privacy Network, but the tunnel information is not available. Try reloading the connections.
</span>

<span *ngSwitchDefault class="inline-flex items-center gap-2 text-secondary">
The connection was routed through the Safing Privacy Network, but the tunnel information is not available. Try
reloading the connections.
</span>
</ng-container>
</div>

Expand Down

0 comments on commit f580d0d

Please sign in to comment.