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

Commit

Permalink
Fix pin-details in SPN map not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Jul 11, 2023
1 parent 1b83dcf commit 6e1b55b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ <h1 class="flex flex-row items-center gap-2 text-base">
<div class="flex flex-row items-center gap-2 cursor-pointer" [routerLink]="['/monitor']"
[queryParams]="{q: 'exit_node:' + pin.pin.ID}" (click)="dialogRef?.close()">
<pre>{{ exitConnectionCount }}</pre>
<svg viewBox="0 0 24 24" class="w-4 h-4" sfng-tooltip="Show exit connections in monitor.">
<svg viewBox="0 0 24 24" class="w-4 h-4" sfng-tooltip="Show exit connections in monitor."
*ngIf="exitConnectionCount > 0">
<g fill="none" stroke="currentColor">
<path shape-rendering="geometricPrecision" stroke-linecap="round" stroke-linejoin="round"
stroke-width="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ export class PinDetailsComponent implements OnInit, OnChanges, OnDestroy {
}
});

this.exitConnectionCount = result.exitConnections[0].totalCount;
if (result.exitConnections.length) {
// we expect only one row to be returned for the above query.
this.exitConnectionCount = result.exitConnections[0].totalCount;
} else {
this.exitConnectionCount = 0;
}

this.cdr.markForCheck();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ export class PinOverlayComponent implements OnInit {
}

onDragRelease(event: CdkDragRelease) {
if (!this.dragContainer || !this.overlayRef.hostElement || !this.overlayRef.hostElement.parentElement) {
return;
}

const bbox = this.dragContainer.element.nativeElement.getBoundingClientRect();
const parent = this.overlayRef.hostElement.parentElement!.getBoundingClientRect();

Expand Down

0 comments on commit 6e1b55b

Please sign in to comment.