Added report_limit token and functionality TICKETS #3577

This commit is contained in:
fermin831 2016-04-25 12:20:12 +02:00
parent c194cae846
commit 0538621ace
3 changed files with 20 additions and 3 deletions

View File

@ -602,7 +602,14 @@ switch ($action) {
$data[1] = $report['description'];
if (!$report['non_interactive']) {
//Remove html and xml button if items are larger than limit
$item_count = db_get_num_rows ('SELECT * FROM treport_content WHERE id_report=' . $report['id_report']);
$report['overload'] = $item_count >= $config['report_limit'];
if ($report['overload']) {
$data[2] = html_print_image("images/application_not_writable.png", true, array('title' => __('This report exceeds the item limit for realtime operations')));
$data[3] = null;
}
else if (!$report['non_interactive']) {
$data[2] = '<a href="' . $config['homeurl'] . 'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'&pure='.$pure.'">' .
html_print_image("images/html.png", true, array('title' => __('HTML view'))) . '</a>';
$data[3] = '<a href="'. ui_get_full_url(false, false, false, false) . 'ajax.php?page=' . $config['homedir'] . '/operation/reporting/reporting_xml&id='.$report['id_report'].'">' . html_print_image("images/xml.png", true, array('title' => __('Export to XML'))) . '</a>'; //I chose ajax.php because it's supposed to give XML anyway

View File

@ -77,8 +77,12 @@ $table_other->style[0] = "font-weight: bold";
$table_other->size[0] = '70%';
$table_other->size[1] = '30%';
$table_other->data[1][0] = __('Compact interpolation in hours (1 Fine-20 bad)') . ui_print_help_tip(__('Data will be compacted in intervals of the specified length.'), true);
$table_other->data[1][1] = html_print_input_text ('step_compact',
$table_other->data[1][0] = __('Item limit for realtime reports') . ui_print_help_tip(__('Set a value too high cause a slowdown on console and a performance penalty in the system.'), true);
$table_other->data[1][1] = html_print_input_text ('report_limit',
$config["report_limit"], '', 5, 5, true);
$table_other->data[2][0] = __('Compact interpolation in hours (1 Fine-20 bad)') . ui_print_help_tip(__('Data will be compacted in intervals of the specified length.'), true);
$table_other->data[2][1] = html_print_input_text ('step_compact',
$config["step_compact"], '', 5, 5, true);
$intervals = array ();

View File

@ -376,6 +376,8 @@ function config_update_config () {
$error_update[] = __('Max. days before delete unknown modules');
if (!config_update_value ('days_compact', (int) get_parameter ('days_compact')))
$error_update[] = __('Max. days before compact data');
if (!config_update_value ('report_limit', (int) get_parameter ('report_limit')))
$error_update[] = __('Item limit for realtime reports)');
if (!config_update_value ('step_compact', (int) get_parameter ('step_compact')))
$error_update[] = __('Compact interpolation in hours (1 Fine-20 bad)');
if (!config_update_value ('event_view_hr', (int) get_parameter ('event_view_hr')))
@ -708,6 +710,10 @@ function config_process_config () {
config_update_value ('event_view_hr', 8);
}
if (!isset ($config['report_limit'])) {
config_update_value ('report_limit', 100);
}
if (!isset ($config['loginhash_pwd'])) {
config_update_value ('loginhash_pwd', io_input_password(rand (0, 1000) * rand (0, 1000)."pandorahash"));
}