diff --git a/html/includes/table/processor.inc.php b/html/includes/table/processor.inc.php
new file mode 100644
index 0000000000..a7b3d97457
--- /dev/null
+++ b/html/includes/table/processor.inc.php
@@ -0,0 +1,67 @@
+ generate_device_link($processor),
+ 'processor_descr' => $processor['processor_descr'],
+ 'graph' => $mini_graph,
+ 'processor_usage' => $bar_link);
+ if ($_POST['view'] == "graphs") {
+ $graph_array['height'] = "100";
+ $graph_array['width'] = "216";
+ $graph_array['to'] = $config['time']['now'];
+ $graph_array['id'] = $processor['processor_id'];
+ $graph_array['type'] = $graph_type;
+ $return_data = true;
+ include("includes/print-graphrow.inc.php");
+ unset($return_data);
+ $response[] = array('hostname' => $graph_data[0],
+ 'processor_descr' => $graph_data[1],
+ 'graph' => $graph_data[2],
+ 'processor_usage' => $graph_data[3]);
+ } # endif graphs
+}
+$output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$total);
+echo _json_encode($output);
diff --git a/html/pages/health/processor.inc.php b/html/pages/health/processor.inc.php
index cf2cf461be..f0a39b717d 100644
--- a/html/pages/health/processor.inc.php
+++ b/html/pages/health/processor.inc.php
@@ -1,83 +1,37 @@
-
+
+
+
+ Device |
+ Processor |
+ |
+ Usage |
+
+
+
+
-$graph_type = "processor_usage";
-
-echo("");
-echo("
");
-
-echo("
- Device |
- Processor |
- |
- Usage |
-
");
-
-foreach (dbFetchRows("SELECT * FROM `processors` AS P, `devices` AS D WHERE D.device_id = P.device_id ORDER BY D.hostname") as $proc)
-{
- if (device_permitted($proc['device_id']))
- {
- $device = $proc;
-
- // FIXME should that really be done here? :-)
- $text_descr = $proc['processor_descr'];
- $text_descr = str_replace("Routing Processor", "RP", $text_descr);
- $text_descr = str_replace("Switching Processor", "SP", $text_descr);
- $text_descr = str_replace("Sub-Module", "Module ", $text_descr);
- $text_descr = str_replace("DFC Card", "DFC", $text_descr);
-
- $proc_url = "device/device=".$device['device_id']."/tab=health/metric=processor/";
-
- $mini_url = "graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=80&height=20&bg=f4f4f400";
-
- $proc_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$text_descr;
- $proc_popup .= "
";
- $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
-
- $perc = round($proc['processor_usage']);
-
- $background = get_percentage_colours($perc);
-
- echo("
- ".generate_device_link($proc)." |
- " . $text_descr . " |
-  |
-
- ".print_percentage_bar (400, 20, $perc, $perc."%", "ffffff", $background['left'], (100 - $perc)."%" , "ffffff", $background['right']));
- echo(' |
-
');
-
- if ($vars['view'] == "graphs")
- {
- echo(' |
');
-
- $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=211&height=100";
- $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
-
- $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=211&height=100";
- $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=400&height=150";
-
- $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=211&height=100";
- $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=400&height=150";
-
- $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['year']."&to=".$config['time']['now']."&width=211&height=100";
- $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['year']."&to=".$config['time']['now']."&width=400&height=150";
-
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" |
-
");
-
- } #end graphs if
- }
-}
-
-echo("
");
-echo("
");
-
-?>
+