Add ID to Device Table List and to Device Dependencies Table List + Shorten ifname in Device: Recent Events. (#12397)

* Add ID to Device Table List and to Device Dependencies Table List

* wrap interface text to max-width: 100px

* ok, fixed as requested. all tests ok! gui working well... filtering and sort tests ok.
This commit is contained in:
Cupid@zul
2021-03-23 14:07:27 +00:00
committed by GitHub
parent 800ae95b90
commit c05cf4b2fc
4 changed files with 12 additions and 8 deletions

View File

@@ -52,12 +52,13 @@ class DeviceController extends TableController
'disable_notify' => 'nullable|in:0,1',
'group' => 'nullable|int',
'poller_group' => 'nullable|int',
'device_id' => 'nullable|int',
];
}
protected function filterFields($request)
{
return ['os', 'version', 'hardware', 'features', 'type', 'status' => 'state', 'disabled', 'disable_notify', 'ignore', 'location_id' => 'location'];
return ['os', 'version', 'hardware', 'features', 'type', 'status' => 'state', 'disabled', 'disable_notify', 'ignore', 'location_id' => 'location', 'device_id' => 'device_id'];
}
protected function searchFields($request)
@@ -75,6 +76,7 @@ class DeviceController extends TableController
'os' => 'os',
'uptime' => \DB::raw('IF(`status` = 1, `uptime`, `last_polled` - NOW())'),
'location' => 'location',
'device_id' => 'device_id',
];
}
@@ -148,6 +150,7 @@ class DeviceController extends TableController
'uptime' => (! $device->status && ! $device->last_polled) ? __('Never polled') : Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), 'short'),
'location' => $this->getLocation($device),
'actions' => $this->getActions($device),
'device_id' => $device->device_id,
];
}