mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Handle missing device when linking (#16164)
* Handle missing device when linking Sometimes a device is gone, but data still points to it. Prevent error when that happens (even though it should not) * Handle more gracefully * Remove original work around * Allow unsaved devices, we just need device_id really
This commit is contained in:
@@ -46,6 +46,10 @@ class DeviceLink extends Component
|
|||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
if (empty($this->device->device_id)) {
|
||||||
|
return view('components.device-link-missing');
|
||||||
|
}
|
||||||
|
|
||||||
if (! $this->device->canAccess(auth()->user())) {
|
if (! $this->device->canAccess(auth()->user())) {
|
||||||
return view('components.device-link-no-access');
|
return view('components.device-link-no-access');
|
||||||
}
|
}
|
||||||
|
1
resources/views/components/device-link-missing.blade.php
Normal file
1
resources/views/components/device-link-missing.blade.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<span class="tw-font-bold">{{ $slot->isNotEmpty() ? $slot : '' }}</span>
|
Reference in New Issue
Block a user