mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Toggle visibilty of Dashboard Editor (#11321)
* Toggle visibilty of Dashboard Editor
* code climate
* reposition Menu point
* add Dashboard Menu
* unclickability ob Dashboard menu
* Global Settings - Alert Default Settings
* Revert "Global Settings - Alert Default Settings"
This reverts commit a1af62b146.
* update to Frontend rewrite
* globalize hide_dashboard_editor variable
* .
* .
* remove legacy code
* update link path to laravel routing
* Travis ...
* Travis ...
This commit is contained in:
@@ -73,7 +73,7 @@ class UserPreferencesController extends Controller
|
||||
'site_style' => UserPref::getPref($user, 'site_style'),
|
||||
'site_style_default' => $styles[$default_style] ?? $default_style,
|
||||
'site_styles' => $styles,
|
||||
|
||||
'hide_dashboard_editor' => UserPref::getPref($user, 'hide_dashboard_editor') ?? 0,
|
||||
];
|
||||
|
||||
if (Config::get('twofactor')) {
|
||||
@@ -110,6 +110,7 @@ class UserPreferencesController extends Controller
|
||||
'required',
|
||||
Rule::in(array_merge(['default'], array_keys($this->getValidStyles()))),
|
||||
],
|
||||
'hide_dashboard_editor' => 'required|integer',
|
||||
];
|
||||
|
||||
$this->validate($request, [
|
||||
@@ -122,6 +123,13 @@ class UserPreferencesController extends Controller
|
||||
return response()->json(['status' => 'success']);
|
||||
}
|
||||
|
||||
public function toggleDashboardEditor(Request $request)
|
||||
{
|
||||
$hide_dashboard_editor = UserPref::getPref(Auth::user(), 'hide_dashboard_editor') ? 0 : 1;
|
||||
UserPref::setPref(Auth::user(), 'hide_dashboard_editor', $hide_dashboard_editor);
|
||||
return redirect('overview');
|
||||
}
|
||||
|
||||
private function getValidLocales()
|
||||
{
|
||||
return array_reduce(glob(resource_path('lang') . '/*', GLOB_ONLYDIR), function ($locales, $locale) {
|
||||
|
||||
Reference in New Issue
Block a user