Display Name in availability map (#13841)

* Display Name option in availability map widget

* fix availability map page and shortDisplayName
This commit is contained in:
Tony Murray
2022-03-12 16:14:09 -06:00
committed by GitHub
parent 964cdfbbc3
commit 6d3bf03074
4 changed files with 9 additions and 10 deletions

View File

@@ -242,7 +242,7 @@ class Device extends BaseModel
$length = \LibreNMS\Config::get('shorthost_target_length', $length);
if ($length < strlen($name)) {
$take = substr_count($name, '.', 0, $length) + 1;
$take = max(substr_count($name, '.', 0, $length), 1);
return implode('.', array_slice(explode('.', $name), 0, $take));
}