mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Copy Dashboard to other User (#11989)
* Copy Dashboard to other User * travis fix * only allow Dashboard Copy to Admins * rewrite query * move Controller to Eloquent * optimize row copy * travis ... * move copy field to edit section * code changes * code changes * limit copy feature to admins * .
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Models\Device;
|
||||
use App\Models\Port;
|
||||
use App\Models\Service;
|
||||
use App\Models\Syslog;
|
||||
use App\Models\User;
|
||||
use App\Models\UserPref;
|
||||
use App\Models\Widget;
|
||||
use Auth;
|
||||
@@ -105,7 +106,15 @@ class OverviewController extends Controller
|
||||
$hide_dashboard_editor = UserPref::getPref($user, 'hide_dashboard_editor');
|
||||
$widgets = Widget::select('widget_id', 'widget_title')->orderBy('widget_title')->get();
|
||||
|
||||
return view('overview.default', compact('bare', 'dash_config', 'dashboard', 'hide_dashboard_editor', 'user_dashboards', 'shared_dashboards', 'widgets'));
|
||||
$user_list = [];
|
||||
if ($user->can('manage', User::class)) {
|
||||
$user_list = User::select(['username', 'user_id'])
|
||||
->where('user_id', '!=', $user->user_id)
|
||||
->orderBy('username')
|
||||
->get();
|
||||
}
|
||||
|
||||
return view('overview.default', compact('bare', 'dash_config', 'dashboard', 'hide_dashboard_editor', 'user_dashboards', 'shared_dashboards', 'widgets', 'user_list'));
|
||||
}
|
||||
|
||||
public function simple(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user