#8365 Added html report for ncm backups
This commit is contained in:
parent
ad81b26556
commit
7db3e3bb2b
|
@ -480,6 +480,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
|||
reporting_html_ncm_config($table, $item);
|
||||
break;
|
||||
|
||||
case 'ncm_backups':
|
||||
reporting_html_ncm_backups($table, $item);
|
||||
break;
|
||||
|
||||
case 'top_n_agents_sh':
|
||||
reporting_html_top_n_agents_sh($table, $item);
|
||||
break;
|
||||
|
@ -7380,3 +7384,49 @@ function reporting_html_ncm_config($table, $item, $pdf=0)
|
|||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML content for ncm backup report.
|
||||
*
|
||||
* @param array $item Content generated by reporting_ncm_config.
|
||||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
function reporting_html_ncm_backups($table, $item, $pdf=0)
|
||||
{
|
||||
ui_require_javascript_file('diff2html-ui.min');
|
||||
ui_require_css_file('diff2html.min');
|
||||
ui_require_css_file('highlight.min');
|
||||
ui_require_css_file('highlight/vs.min');
|
||||
ui_require_javascript_file('highlight.min');
|
||||
ui_require_javascript_file('highlightjs-line-numbers.min');
|
||||
ui_require_javascript_file('languages/plaintext.min');
|
||||
ui_require_javascript_file('functions_ncm', ENTERPRISE_DIR.'/include/javascript/');
|
||||
|
||||
// Create table info.
|
||||
$table_ncm = new stdClass();
|
||||
$table_ncm->width = '100%';
|
||||
$table_ncm->class = 'info_table';
|
||||
$table_ncm->styleTable = 'table-layout: fixed;';
|
||||
$table_ncm->rowstyle['title'] = 'text-align: center; font-weight: bolder';
|
||||
$table_ncm->head = [];
|
||||
$table_ncm->head[0] = __('Date');
|
||||
$table_ncm->head[1] = __('Diff');
|
||||
|
||||
$table_ncm->data = [];
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$table_ncm->data[] = [
|
||||
$row['updated_at'],
|
||||
$row['diff'],
|
||||
];
|
||||
}
|
||||
|
||||
if ($pdf === 0) {
|
||||
return $table->data[] = html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue