Sort Settings by translated names (#11280)

If browser language is different from the language set in LibreNMS, it might sort slightly incorrectly.
This commit is contained in:
Tony Murray
2020-03-12 11:39:06 -05:00
committed by GitHub
parent 36e2dc4bdc
commit 82eddfcf27
5 changed files with 19 additions and 10 deletions

View File

@@ -17,17 +17,16 @@ class SettingsController extends Controller
* @param DynamicConfig $dynamicConfig
* @param string $tab
* @param string $section
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response|\Illuminate\View\View
*/
public function index(DynamicConfig $dynamicConfig, $tab = 'global', $section = '')
{
$data = [
'active_tab' => $tab,
'active_section' => $section,
'groups' => $dynamicConfig->getGroups()->reduce(function ($groups, $group) {
/** @var Collection $groups */
return $groups->put($group, []);
}, new Collection())->forget('global'),
'groups' => $dynamicConfig->getGroups()->reject(function ($group) {
return $group == 'global';
}),
];
return view('settings.index', $data);