diff --git a/app/Http/Controllers/Maps/DeviceDependencyController.php b/app/Http/Controllers/Maps/DeviceDependencyController.php index abb97260c3..0df632a84e 100644 --- a/app/Http/Controllers/Maps/DeviceDependencyController.php +++ b/app/Http/Controllers/Maps/DeviceDependencyController.php @@ -25,6 +25,7 @@ namespace App\Http\Controllers\Maps; use App\Models\Device; +use App\Models\DeviceGroup; use Illuminate\Http\Request; use LibreNMS\Util\Url; @@ -155,6 +156,11 @@ class DeviceDependencyController extends MapController array_multisort(array_column($device_list, 'label'), SORT_ASC, $device_list); + $group_name = DeviceGroup::where('id', '=', $group_id)->first('name'); + if (! empty($group_name)) { + $group_name = $group_name->name; + } + $data = [ 'showparentdevicepath' => $show_device_path, 'isolated_device_id' => $this->isolatedDeviceId, @@ -165,6 +171,7 @@ class DeviceDependencyController extends MapController 'options' => $this->visOptions(), 'nodes' => json_encode(array_values($devices_by_id)), 'edges' => json_encode($dependencies), + 'group_name' => $group_name, ]; return view('map.device-dependency', $data); diff --git a/includes/html/print-map.inc.php b/includes/html/print-map.inc.php index 2abbb5d3a4..6337ae23b1 100644 --- a/includes/html/print-map.inc.php +++ b/includes/html/print-map.inc.php @@ -44,8 +44,10 @@ $device_assoc_seen = []; $ports = []; $devices = []; +$group_name = ''; $where = ''; if (is_numeric($group) && $group) { + $group_name = dbFetchCell('SELECT `name` from `device_groups` WHERE `id` = ?', [$group]); $where .= ' AND D1.device_id IN (SELECT `device_id` FROM `device_group_device` WHERE `device_group_id` = ?)'; $sql_array[] = $group; $where .= ' OR D2.device_id IN (SELECT `device_id` FROM `device_group_device` WHERE `device_group_id` = ?)'; @@ -342,6 +344,7 @@ if (count($devices_by_id) > 1 && count($links) > 0) {
+