:100644 100644 f4aa5ad98 000000000 M app/Http/Controllers/DevicesController.php :100644 100644 f5569a8a9 000000000 M app/Models/Device.php diff --git a/app/Http/Controllers/DevicesController.php b/app/Http/Controllers/DevicesController.php index f4aa5ad98eeb1d7b9cb1ebd08e8c9300498041ff..e6cdf77b00e06d31d467532fc2452c6e2bd66c3d 100644 --- a/app/Http/Controllers/DevicesController.php +++ b/app/Http/Controllers/DevicesController.php @@ -77,6 +77,7 @@ class DevicesController extends Controller 'devices' => $devices, 'deviceGraphs' => $devices->map(function (Device $device) use ($graphTemplate) { $graph = array_merge($graphTemplate, ['device' => $device->device_id]); + return [ 'link' => Url::graphPageUrl($graph['type'], Arr::except($graph, ['height', 'width', 'legend', 'title'])), 'graphTag' => Url::lazyGraphTag($graph, 'tw:w-full tw:h-auto'), diff --git a/app/Models/Device.php b/app/Models/Device.php index f5569a8a900499534bb6d3936eb7a35ebbc00ead..a17cbe6d5363a759faaa5c895721f70afa5aa512 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -565,7 +565,7 @@ class Device extends BaseModel public function filterState(Builder $query, mixed $value, array $config): void { $this->applyMappedFilter($query, $value, $config, fn (Builder $q, $state) => match ($state) { - 'up' => $q->where('status', 1)->where('disabled', 0)->where('disable_notify', 0), + 'up' => $q->where('status', 1)->where('disabled', 0)->where('disable_notify', 0), 'down' => $q->where('status', 0)->where('disabled', 0)->where('disable_notify', 0), default => $q, });