mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Misc webui code cleanups (#14242)
* Misc webui cleanups * Style * More * graphing fixes * More graph cleanups * more fixes, graphs and device pages * style
This commit is contained in:
@@ -111,6 +111,7 @@ class DeviceController extends Controller
|
||||
{
|
||||
ob_start();
|
||||
$device = $device->toArray();
|
||||
$device['os_group'] = Config::get("os.{$device['os']}.group");
|
||||
Debug::set(false);
|
||||
chdir(base_path());
|
||||
$init_modules = ['web', 'auth'];
|
||||
|
@@ -279,9 +279,11 @@ class DeviceController extends TableController
|
||||
*/
|
||||
private function getLocation($device)
|
||||
{
|
||||
$location = $device->location ?? '';
|
||||
|
||||
return extension_loaded('mbstring')
|
||||
? mb_substr($device->location, 0, 32, 'utf8')
|
||||
: substr($device->location, 0, 32);
|
||||
? mb_substr($location, 0, 32, 'utf8')
|
||||
: substr($location, 0, 32);
|
||||
}
|
||||
|
||||
private function getActions(Device $device): array
|
||||
|
@@ -77,9 +77,9 @@ class FdbTablesController extends TableController
|
||||
*/
|
||||
protected function search($search, $query, $fields = [])
|
||||
{
|
||||
if ($search = trim(\Request::get('searchPhrase'))) {
|
||||
if ($search = trim(\Request::get('searchPhrase') ?? '')) {
|
||||
$mac_search = '%' . str_replace([':', ' ', '-', '.', '0x'], '', $search) . '%';
|
||||
switch (\Request::get('searchby')) {
|
||||
switch (\Request::get('searchby') ?? '') {
|
||||
case 'mac':
|
||||
return $query->where('ports_fdb.mac_address', 'like', $mac_search);
|
||||
case 'vlan':
|
||||
|
Reference in New Issue
Block a user