mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Display custom types as in the config file (with ucwords) (#11367)
* Display custom types as in the config file (with ucwords) * filter same line
This commit is contained in:
@ -83,11 +83,7 @@ class MenuComposer
|
||||
$vars['port_counts']['pseudowire'] = Config::get('enable_pseudowires') ? ObjectCache::portCounts(['pseudowire'])['pseudowire'] : 0;
|
||||
|
||||
$vars['port_counts']['alerted'] = 0; // not actually supported on old...
|
||||
$vars['custom_port_descr'] = collect(Config::get('custom_descr', []))
|
||||
->filter()
|
||||
->map(function ($descr) {
|
||||
return strtolower($descr);
|
||||
});
|
||||
$vars['custom_port_descr'] = collect(Config::get('custom_descr', []))->filter();
|
||||
$vars['port_groups_exist'] = Config::get('int_customers') ||
|
||||
Config::get('int_transit') ||
|
||||
Config::get('int_peering') ||
|
||||
|
@ -17,10 +17,13 @@ foreach ($ports as $port) {
|
||||
|
||||
unset($seperator);
|
||||
|
||||
for ($i = 0; $i < count($types_array);
|
||||
$i++) {
|
||||
$types_array[$i] = ucfirst($types_array[$i]);
|
||||
}
|
||||
// show title from config file (but ucwords it)
|
||||
$ctypes = collect(\LibreNMS\Config::get('custom_descr', []))->keyBy(function ($descr) {
|
||||
return strtolower($descr);
|
||||
});
|
||||
array_walk($types_array, function (&$type) use ($ctypes) {
|
||||
$type = ucwords($ctypes->get(strtolower($type), $type));
|
||||
});
|
||||
|
||||
$types = implode(' + ', $types_array);
|
||||
|
||||
|
Reference in New Issue
Block a user