mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
add pdf to report interfaces
This commit is contained in:
parent
25db947d20
commit
909637c1f8
@ -399,7 +399,8 @@ function reporting_make_reporting_data($report = null, $id_report,
|
|||||||
case 'network_interfaces_report':
|
case 'network_interfaces_report':
|
||||||
$report['contents'][] = reporting_network_interfaces_report(
|
$report['contents'][] = reporting_network_interfaces_report(
|
||||||
$report,
|
$report,
|
||||||
$content);
|
$content,
|
||||||
|
$type);
|
||||||
break;
|
break;
|
||||||
case 'group_configuration':
|
case 'group_configuration':
|
||||||
$report['contents'][] = reporting_group_configuration(
|
$report['contents'][] = reporting_group_configuration(
|
||||||
@ -2583,11 +2584,11 @@ function reporting_group_configuration($report, $content) {
|
|||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_network_interfaces_report($report, $content,
|
function reporting_network_interfaces_report($report, $content, $type = 'dinamic') {
|
||||||
$type = 'dinamic', $force_width_chart = null, $force_height_chart = null) {
|
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
$return['type'] = 'network_interfaces_report';
|
$return['type'] = 'network_interfaces_report';
|
||||||
|
|
||||||
if (empty($content['name'])) {
|
if (empty($content['name'])) {
|
||||||
@ -2646,7 +2647,6 @@ function reporting_network_interfaces_report($report, $content,
|
|||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'dinamic':
|
case 'dinamic':
|
||||||
case 'static':
|
|
||||||
if (!empty($interface['traffic'])) {
|
if (!empty($interface['traffic'])) {
|
||||||
$row_interface['chart'] = custom_graphs_print(0,
|
$row_interface['chart'] = custom_graphs_print(0,
|
||||||
$height,
|
$height,
|
||||||
@ -2665,10 +2665,31 @@ function reporting_network_interfaces_report($report, $content,
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
$ttl);
|
1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
|
case 'static':
|
||||||
|
if (!empty($interface['traffic'])) {
|
||||||
|
$row_interface['chart'] = custom_graphs_print(0,
|
||||||
|
$height,
|
||||||
|
$width,
|
||||||
|
$content['period'],
|
||||||
|
null,
|
||||||
|
true,
|
||||||
|
$report["datetime"],
|
||||||
|
true,
|
||||||
|
'white',
|
||||||
|
array_values($interface['traffic']),
|
||||||
|
$config['homeurl'],
|
||||||
|
array_keys($interface['traffic']),
|
||||||
|
array_fill(0, count($interface['traffic']), __("bytes/s")),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
2);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2678,7 +2699,6 @@ function reporting_network_interfaces_report($report, $content,
|
|||||||
$return['data'][] = $row_data;
|
$return['data'][] = $row_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1871,7 +1871,7 @@ function reporting_html_group_configuration($table, $item) {
|
|||||||
$table->data['group_configuration']['cell'] = $cell;
|
$table->data['group_configuration']['cell'] = $cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_html_network_interfaces_report($table, $item) {
|
function reporting_html_network_interfaces_report($table, $item, $pdf= false) {
|
||||||
|
|
||||||
if (!empty($item['failed'])) {
|
if (!empty($item['failed'])) {
|
||||||
$table->colspan['interfaces']['cell'] = 3;
|
$table->colspan['interfaces']['cell'] = 3;
|
||||||
@ -1891,7 +1891,9 @@ function reporting_html_network_interfaces_report($table, $item) {
|
|||||||
$table_agent->style[0] = 'text-align: center';
|
$table_agent->style[0] = 'text-align: center';
|
||||||
|
|
||||||
$table_agent->data['interfaces'] = "";
|
$table_agent->data['interfaces'] = "";
|
||||||
|
if($pdf){
|
||||||
|
$return_pdf .= __("Agent") . " " . $agent['agent'];
|
||||||
|
}
|
||||||
foreach ($agent['interfaces'] as $interface) {
|
foreach ($agent['interfaces'] as $interface) {
|
||||||
$table_interface = new StdClass();
|
$table_interface = new StdClass();
|
||||||
$table_interface->width = '100%';
|
$table_interface->width = '100%';
|
||||||
@ -1919,7 +1921,10 @@ function reporting_html_network_interfaces_report($table, $item) {
|
|||||||
$table_interface->colspan['graph'][0] = 3;
|
$table_interface->colspan['graph'][0] = 3;
|
||||||
$table_interface->cellstyle['graph'][0] = 'text-align: center;';
|
$table_interface->cellstyle['graph'][0] = 'text-align: center;';
|
||||||
}
|
}
|
||||||
|
if($pdf){
|
||||||
|
$table_interface->class = 'table-beauty';
|
||||||
|
$return_pdf .= html_print_table($table_interface, true);
|
||||||
|
}
|
||||||
$table_agent->data['interfaces'] .= html_print_table($table_interface, true);
|
$table_agent->data['interfaces'] .= html_print_table($table_interface, true);
|
||||||
$table_agent->colspan[$interface_name][0] = 3;
|
$table_agent->colspan[$interface_name][0] = 3;
|
||||||
}
|
}
|
||||||
@ -1927,9 +1932,11 @@ function reporting_html_network_interfaces_report($table, $item) {
|
|||||||
$id = uniqid();
|
$id = uniqid();
|
||||||
$table->colspan[$id][0] = 3;
|
$table->colspan[$id][0] = 3;
|
||||||
$table->data[$id] = html_print_table($table_agent, true);
|
$table->data[$id] = html_print_table($table_agent, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($pdf){
|
||||||
|
return $return_pdf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user