mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Cleanup Port hover minigraph description when using "Interface Description Parsing" (#13143)
* Cleanup Port hover minigraph description. Use port_descr_descr if exists or ifDescr. Use the same generate_port_link() in: - Devices - Ports - Ports - All/Errored/Ignored - Ports - "Types" * Port-Customers, using Ajax Controller, Util/Url * make https://styleci.io/ check happy
This commit is contained in:
@@ -101,19 +101,9 @@ if ($vars['view'] == 'minigraphs') {
|
||||
echo "<div style='display: block; clear: both; margin: auto; min-height: 500px;'>";
|
||||
unset($seperator);
|
||||
|
||||
// FIXME - FIX THIS. UGLY.
|
||||
foreach (dbFetchRows('select * from ports WHERE device_id = ? AND `disabled` = 0 ORDER BY ifIndex', [$device['device_id']]) as $port) {
|
||||
$port = cleanPort($port, $device);
|
||||
echo "<div class='minigraph-div'><div style='font-weight: bold;'>" . makeshortif($port['ifDescr']) . '</div>
|
||||
<a href="' . generate_port_url($port) . "\" onmouseover=\"return overlib('<div class=\'overlib-content\'>\
|
||||
<div class=\'overlib-text\'>" . $device['hostname'] . ' - ' . $port['ifDescr'] . "</div>\
|
||||
<span class=\'overlib-title\'>" . $port['ifAlias'] . "</span>\
|
||||
<img src=\'graph.php?type=" . $graph_type . '&id=' . $port['port_id'] . '&from=' . $from . '&to=' . \LibreNMS\Config::get('time.now') . "&width=450&height=150\'>\
|
||||
</div>\
|
||||
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >" . "<img src='graph.php?type=" . $graph_type . '&id=' . $port['port_id'] . '&from=' . $from . '&to=' . \LibreNMS\Config::get('time.now') . "&width=180&height=45&legend=no'>
|
||||
</a>
|
||||
<div style='font-size: 9px;'>" . substr(short_port_descr($port['ifAlias']), 0, 32) . '</div>
|
||||
</div>';
|
||||
echo "<div class='minigraph-div'><div style='font-weight: bold;'>" . generate_port_link($port) . '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
Reference in New Issue
Block a user