diff --git a/pandora_console/extras/mr/35.sql b/pandora_console/extras/mr/35.sql
new file mode 100644
index 0000000000..dd3911a1f6
--- /dev/null
+++ b/pandora_console/extras/mr/35.sql
@@ -0,0 +1,5 @@
+START TRANSACTION;
+
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}');
+
+COMMIT;
\ No newline at end of file
diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php
index fab43724b5..afc959e3af 100755
--- a/pandora_console/godmode/setup/setup_visuals.php
+++ b/pandora_console/godmode/setup/setup_visuals.php
@@ -1003,6 +1003,10 @@ $row++;
$table_other->class = 'databox filters';
$table_other->style[0] = 'font-weight: bold;';
$table_other->size[0] = '50%';
+ $table_other->size[1] = '26%';
+ $table_other->size[2] = '12%';
+ $table_other->size[3] = '12%';
+
$table_other->data = [];
// Enrique (27/01/2017) New feature: Show report info on top of reports
@@ -1134,7 +1138,7 @@ $row++;
'graphviz_bin_dir',
$config['graphviz_bin_dir'],
'',
- 50,
+ 25,
255,
true
);
@@ -1192,16 +1196,15 @@ $row++;
// CUSTOM VALUES POST PROCESS
// ----------------------------------------------------------------------
$table_other->data[$row][0] = __('Custom values post process');
- $table_other->data[$row][1] = '
';
- $table_other->data[$row][1] .= __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true);
- $table_other->data[$row][1] .= ' '.__('Text').': '.html_print_input_text('custom_text', '', '', 25, 50, true);
- $table_other->data[$row][1] .= ' ';
- $table_other->data[$row][1] .= html_print_input_hidden(
+ $table_other->data[$row][1] = __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true);
+ $table_other->data[$row][2] = __('Text').': '.html_print_input_text('custom_text', '', '', 15, 50, true);
+ $table_other->data[$row][2] .= ' ';
+ $table_other->data[$row][2] .= html_print_input_hidden(
'custom_value_add',
'',
true
);
- $table_other->data[$row][1] .= html_print_button(
+ $table_other->data[$row][3] = html_print_button(
__('Add'),
'custom_value_add_btn',
false,
@@ -1210,10 +1213,11 @@ $row++;
true
);
- $table_other->data[$row][1] .= '
';
+ $row++;
- $table_other->data[$row][1] .= __('Delete custom values').': ';
- $table_other->data[$row][1] .= html_print_select(
+ $table_other->data[$row][0] = '';
+ $table_other->data[$row][1] = __('Delete custom values').': ';
+ $table_other->data[$row][2] = html_print_select(
post_process_get_custom_values(),
'custom_values',
'',
@@ -1223,7 +1227,7 @@ $row++;
true
);
$count_custom_postprocess = post_process_get_custom_values();
- $table_other->data[$row][1] .= html_print_button(
+ $table_other->data[$row][3] = html_print_button(
__('Delete'),
'custom_values_del_btn',
empty($count_custom_postprocess),
@@ -1237,7 +1241,8 @@ $row++;
'',
true
);
- $table_other->data[$row][1] .= '
';
+ $table_other->data[$row][3] .= '
';
+
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// CUSTOM INTERVAL VALUES
@@ -1252,22 +1257,51 @@ $row++;
SECONDS_1MONTH => __('months'),
SECONDS_1YEAR => __('years'),
];
- $table_other->data[$row][1] = __('Add new custom value to intervals').': ';
+ $table_other->data[$row][1] = __('Value').': ';
$table_other->data[$row][1] .= html_print_input_text('interval_value', '', '', 5, 5, true);
- $table_other->data[$row][1] .= html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false);
- $table_other->data[$row][1] .= html_print_button(__('Add'), 'interval_add_btn', false, '', 'class="sub next"', true);
- $table_other->data[$row][1] .= '
';
+ $table_other->data[$row][2] = html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false);
+ $table_other->data[$row][3] = html_print_button(__('Add'), 'interval_add_btn', false, '', 'class="sub next"', true);
- $table_other->data[$row][1] .= __('Delete interval').': ';
- $table_other->data[$row][1] .= html_print_select(get_periods(false, false), 'intervals', '', '', '', '', true);
- $table_other->data[$row][1] .= html_print_button(__('Delete'), 'interval_del_btn', empty($config['interval_values']), '', 'class="sub cancel"', true);
+ $row++;
+
+ $table_other->data[$row][0] = '';
+ $table_other->data[$row][1] = __('Delete interval').': ';
+ $table_other->data[$row][2] = html_print_select(get_periods(false, false), 'intervals', '', '', '', '', true);
+ $table_other->data[$row][3] = html_print_button(__('Delete'), 'interval_del_btn', empty($config['interval_values']), '', 'class="sub cancel"', true);
$table_other->data[$row][1] .= html_print_input_hidden('interval_values', $config['interval_values'], true);
// This hidden field will be filled from jQuery before submit
$table_other->data[$row][1] .= html_print_input_hidden('interval_to_delete', '', true);
+ $table_other->data[$row][3] .= '
';
// ----------------------------------------------------------------------
$row++;
+ $table_other->data[$row][0] = __('Module units');
+ $table_other->data[$row][1] = __('Value').': ';
+ $table_other->data[$row][1] .= html_print_input_text('custom_module_unit', '', '', 15, 50, true);
+ $table_other->data[$row][2] = '';
+ $table_other->data[$row][3] = html_print_button(__('Add'), 'module_unit_add_btn', false, '', 'class="sub next"', true);
+
+ $row++;
+ $table_other->data[$row][0] = '';
+ $table_other->data[$row][1] = __('Delete custom values').': ';
+ $table_other->data[$row][2] = html_print_select(get_custom_module_units(), 'module_units', '', '', '', '', true, false, true, 'w100p');
+ $table_other->data[$row][3] = html_print_button(
+ __('Delete'),
+ 'custom_module_unit_del_btn',
+ empty($count_custom_postprocess),
+ '',
+ 'class="sub cancel"',
+ true
+ );
+ $table_other->data[$row][3] .= html_print_input_hidden(
+ 'custom_module_unit_to_delete',
+ '',
+ true
+ );
+
+ $row++;
+
$common_dividers = [
';' => ';',
',' => ',',
@@ -1284,6 +1318,14 @@ $row++;
$row++;
+ $table_other->data[$row][0] = __('Data multiplier to use in graphs/data');
+ $options_data_multiplier = [];
+ $options_data_multiplier[0] = __('Use 1024 when module unit are bytes');
+ $options_data_multiplier[1] = __('Use always 1000');
+ $options_data_multiplier[2] = __('Use always 1024');
+
+ $table_other->data[$row][1] = html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 0, true, false, false);
+
echo '