Added a new option to visual setup that configure the interface unit graphs. Ticket#2620

This commit is contained in:
Arturo Gonzalez Diaz 2015-10-23 12:46:17 +02:00
parent d961be1761
commit 8805b4011d
3 changed files with 13 additions and 2 deletions

View File

@ -127,6 +127,11 @@ $table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"]
$row++;
$table->data[$row][0] = __('Value to interface graphics');
$table->data[$row][1] = html_print_input_text ('interface_unit', $config["interface_unit"], '', 20, 20, true);
$row++;
$table->data[$row][0] = __('Interval values');
$units = array(

View File

@ -412,6 +412,8 @@ function config_update_config () {
$error_update[] = __('Graph color #10');
if (!config_update_value ('graph_res', (int) get_parameter ('graph_res')))
$error_update[] = __('Graphic resolution (1-low, 5-high)');
if (!config_update_value ('interface_unit', (string) get_parameter ('interface_unit', __('Bytes') )))
$error_update[] = __('Value to interface graphics');
$style = (string) get_parameter ('style');
if ($style != $config['style'])
$style = substr ($style, 0, strlen ($style) - 4);
@ -1217,6 +1219,10 @@ function config_process_config () {
config_update_value ('gis_label', 0);
}
if (!isset($config['interface_unit'])) {
config_update_value ('interface_unit', __('Bytes'));
}
if (!isset($config['gis_default_icon'])) {
config_update_value ('gis_default_icon', "marker");
}

View File

@ -167,7 +167,7 @@ $interface_traffic_modules = array(
array_values($interface_traffic_modules),
$config['homeurl'],
array_keys($interface_traffic_modules),
array_fill(0, count($interface_traffic_modules),"bytes"),
array_fill(0, count($interface_traffic_modules), $config["interface_unit"]),
false);
echo '</div>';