Configurable device display name (#13528)

* Configurable device display name
You can just set the display name in device settings.

It also accepts simple template format with  the variables: hostname, sysName, sysName_fallback, ip

Default controlled by device_display_default, (set from old force_hostname_to_sysname and force_ip_to_sysname settings

* remove second argument to format_hostname()

* Style fixes

* Update schema

* update phpstan baseline

* Improved settings strings (and add for translation)
This commit is contained in:
Tony Murray
2021-11-18 15:46:22 -06:00
committed by GitHub
parent 69d0753ec4
commit 790c4b3402
24 changed files with 196 additions and 159 deletions

View File

@@ -8,8 +8,8 @@ foreach (explode(',', $vars['id']) as $ifid) {
if (Rrd::checkRrdExists($rrd_file)) {
$port = cleanPort($port);
$rrd_list[$i]['filename'] = $rrd_file;
$rrd_list[$i]['descr'] = format_hostname($port, $port['hostname']) . ' ' . $port['ifDescr'];
$rrd_list[$i]['descr_in'] = format_hostname($port, $port['hostname']);
$rrd_list[$i]['descr'] = format_hostname($port) . ' ' . $port['ifDescr'];
$rrd_list[$i]['descr_in'] = format_hostname($port);
$rrd_list[$i]['descr_out'] = makeshortif($port['label']);
$i++;
}