Index: html/pages/iftype.inc.php
===================================================================
--- html/pages/iftype.inc.php (revision 15414)
+++ html/pages/iftype.inc.php (working copy)
@@ -16,7 +16,7 @@
$where = generate_where_clause(generate_query_values($vars['type'], 'port_descr_type', 'LIKE'), $cache['where']['ports_permitted']);
-$ports = dbFetchRows('SELECT * FROM `ports` ' . $where . ' ORDER BY `ifAlias`');
+$ports = dbFetchRows('SELECT * FROM `ports` ' . $where . ' ORDER BY `port_descr_type`, `port_descr_descr`, `ifAlias`');
$port_list = [];
foreach ($ports as $port) {
@@ -73,7 +73,8 @@
$port) {
$done = 'yes';
unset($class);
$port['ifAlias'] = str_ireplace($type . ': ', '', $port['ifAlias']);
@@ -95,16 +96,27 @@
' . $port['port_descr_circuit'] . ' |
' . escape_html($port['port_descr_notes']) . ' | ');
+ $rrdfile = get_port_rrdfilename($port, NULL, TRUE);
+ if (rrd_is_file($rrdfile, TRUE)) {
+ $graph_ids[] = $port['port_id'];
+ }
+
+ // Stack ports with the same description into one graph, like on the customers page
+ if (isset($ports[$i + 1]) && $ports[$i + 1]['port_descr_descr'] === $port['port_descr_descr']) {
+ echo('');
+ continue;
+ }
+
echo('| ');
- $rrdfile = get_port_rrdfilename($port, NULL, TRUE);
- if (rrd_is_file($rrdfile, TRUE)) {
- $graph_array['type'] = 'port_bits';
+ if ($graph_ids) {
+ $graph_array['type'] = 'multi-port_bits_separate';
$graph_array['to'] = get_time();
- $graph_array['id'] = $port['port_id'];
+ $graph_array['id'] = implode(',', $graph_ids);
print_graph_row($graph_array);
}
+ $graph_ids = [];
echo(' |
');
}