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:
Tony Murray
2020-07-23 09:57:22 -05:00
committed by GitHub
parent 2fc037ab23
commit 020c5fd7e1
102 changed files with 321 additions and 2385 deletions

View File

@@ -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
*