Skip to content

Commit

Permalink
add external connected entities
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Jan 15, 2025
1 parent bab2003 commit 7ef6ea1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/Admin/ExplorerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ public function getData() : array
$this->addLinkEdge($edges, $this->formatId('LAN_', $join->lan_id), $this->formatId('WAN_', $join->wan_id));
}

// External connected entities
$externals = DB::table('external_connected_entities')->select('id','name','network_id', 'entity_id')->get();
foreach ($externals as $external) {
$this->addNode($nodes, 5, $this->formatId('EXT_', $external->id), $external->name, '/images/entity.png', 'external-connected-entities');
$this->addLinkEdge($edges, $this->formatId('EXT_', $external->id), $this->formatId('NETWORK_', $external->network_id));
$this->addLinkEdge($edges, $this->formatId('EXT_', $external->id), $this->formatId('ENTITY_', $external->entity_id));
}

// Subnetworks
foreach ($subnetworks as $subnetwork) {
$this->addNode($nodes, 5, $this->formatId('SUBNETWORK_', $subnetwork->id), $subnetwork->name, '/images/network.png', 'subnetworks', $subnetwork->address);
Expand Down

0 comments on commit 7ef6ea1

Please sign in to comment.