mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove legacy code and fix missing device graphs (#11950)
* removing $graphs global * remove unused things * fix some additional graphs * Fix graphs persisting too soon * correct name for poller module performance graph * only one type of graph is used here
This commit is contained in:
@@ -1315,29 +1315,6 @@ function get_arrays_with_application($device, $app_id, $app_name, $category = nu
|
||||
return $entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all dashboards the user can access
|
||||
* adds in the keys:
|
||||
* username - the username of the owner of each dashboard
|
||||
* default - the default dashboard for the logged in user
|
||||
*
|
||||
* @param int $user_id optionally get list for another user
|
||||
* @return array list of dashboards
|
||||
*/
|
||||
function get_dashboards($user_id = null)
|
||||
{
|
||||
$user = is_null($user_id) ? Auth::user() : \App\Models\User::find($user_id);
|
||||
$default = get_user_pref('dashboard');
|
||||
|
||||
return \App\Models\Dashboard::allAvailable($user)->with('user')->get()->map(function ($dashboard) use ($default) {
|
||||
$dash = $dashboard->toArray();
|
||||
$dash['username'] = $dashboard->user ? $dashboard->user->username : '';
|
||||
$dash['default'] = $default == $dashboard->dashboard_id;
|
||||
|
||||
return $dash;
|
||||
})->keyBy('dashboard_id')->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return stacked graphs information
|
||||
*
|
||||
|
Reference in New Issue
Block a user