custom port view fix (#14637)

* custom port view fix

* .

* code adjustment

* code adjustment

* .
This commit is contained in:
SourceDoctor 2022-11-18 23:28:39 +01:00 committed by GitHub
parent 752bbc1531
commit df0c41672a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,10 +19,15 @@ unset($seperator);
// show title from config file (but ucwords it)
$ctypes = collect(\LibreNMS\Config::get('custom_descr', []))->keyBy(function ($descr) {
if (is_array($descr)) {
return strtolower($descr[0]);
}
return strtolower($descr);
});
array_walk($types_array, function (&$type) use ($ctypes) {
$type = ucwords($ctypes->get(strtolower($type), $type));
$name = $ctypes->get(strtolower($type), $type);
$type = ucwords(is_array($name) ? $name[0] : $name);
});
$types = implode(' + ', $types_array);