Merge pull request #1296 from SaaldjorMike/fix-legend-iflabels

Fix legend iflabels
This commit is contained in:
Daniel Preussker 2015-06-18 14:15:59 +00:00
commit 559d6960c7
2 changed files with 3 additions and 3 deletions

View File

@ -763,8 +763,8 @@ function get_client_ip() {
function shorten_interface_type($string) { function shorten_interface_type($string) {
return str_ireplace( return str_ireplace(
array('FastEthernet','GigbitEthernet','TenGigabitEthernet','Port-Channel','Ethernet'), array('FastEthernet','TenGigabitEthernet','GigabitEthernet','Port-Channel','Ethernet'),
array('Fa','Gi','Te','Po','Eth'), array('Fa','Te','Gi','Po','Eth'),
$string $string
); );
} }

View File

@ -36,7 +36,7 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($devic
$rrd_filenames[] = $rrd_filename; $rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename; $rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $port['label']; $rrd_list[$i]['descr'] = shorten_interface_type($port['label']);
$rrd_list[$i]['descr_in'] = $port['label']; $rrd_list[$i]['descr_in'] = $port['label'];
$rrd_list[$i]['descr_out'] = $port['ifAlias']; $rrd_list[$i]['descr_out'] = $port['ifAlias'];
$rrd_list[$i]['ds_in'] = $ds_in; $rrd_list[$i]['ds_in'] = $ds_in;