mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
STP - various fixes (#13773)
* Filter fix * Add link to device for bridge address and designated root if available
This commit is contained in:
@@ -71,7 +71,7 @@ class StpController implements DeviceTab
|
||||
'vlan' => $active_vlan,
|
||||
'device_id' => $device->device_id,
|
||||
'stpInstances' => $stpInstances->filter(function ($instance) use ($active_vlan) {
|
||||
return $active_vlan == 1 && $instance->vlan !== null || $instance->vlan !== $active_vlan;
|
||||
return $active_vlan == 1 && $instance->vlan !== null || $instance->vlan == $active_vlan;
|
||||
}),
|
||||
'stpPorts' => $device->stpPorts()->where('vlan', $active_vlan)->when($active_vlan == 1, function ($query) {
|
||||
return $query->orWhereNull('vlan');
|
||||
|
@@ -15,7 +15,9 @@
|
||||
<td>{{ trans('stp.bridge_address') }}</td>
|
||||
<td>
|
||||
{{ \LibreNMS\Util\Rewrite::readableMac($instance['bridgeAddress']) }}
|
||||
@if($brVendor = \LibreNMS\Util\Rewrite::readableOUI($instance['bridgeAddress']))
|
||||
@if($url = \LibreNMS\Util\Url::deviceLink(\App\Facades\DeviceCache::get(\App\Models\Stp::where('bridgeAddress', $instance['bridgeAddress'])->value('device_id'))))
|
||||
({!! $url !!})
|
||||
@elseif($brVendor = \LibreNMS\Util\Rewrite::readableOUI($instance['bridgeAddress']))
|
||||
({{ $brVendor }})
|
||||
@endif
|
||||
</td>
|
||||
@@ -40,7 +42,9 @@
|
||||
<td>{{ trans('stp.designated_root') }}</td>
|
||||
<td>
|
||||
{{ \LibreNMS\Util\Rewrite::readableMac($instance['designatedRoot']) }}
|
||||
@if($drVendor = \LibreNMS\Util\Rewrite::readableOUI($instance['designatedRoot']))
|
||||
@if($url = \LibreNMS\Util\Url::deviceLink(\App\Facades\DeviceCache::get(\App\Models\Stp::where('bridgeAddress', $instance['designatedRoot'])->value('device_id'))))
|
||||
({!! $url !!})
|
||||
@elseif($drVendor = \LibreNMS\Util\Rewrite::readableOUI($instance['designatedRoot']))
|
||||
({{ $drVendor }})
|
||||
@endif
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user