Added item in button palette with default fields

This commit is contained in:
Arturo Gonzalez 2017-07-12 11:51:00 +02:00
parent f907f3cdb7
commit 9db5669f16
8 changed files with 49 additions and 15 deletions

View File

@ -1346,6 +1346,9 @@ function hiddenFields(item) {
$("#process_value_row").css('display', 'none'); $("#process_value_row").css('display', 'none');
$("#process_value_row." + item).css('display', ''); $("#process_value_row." + item).css('display', '');
$("#event_max_time_row").css('display', 'none');
$("#event_max_time_row." + item).css('display', '');
$("#background_row_1").css('display', 'none'); $("#background_row_1").css('display', 'none');
$("#background_row_1." + item).css('display', ''); $("#background_row_1." + item).css('display', '');
@ -3218,6 +3221,10 @@ function click_button_toolbox(id) {
toolbuttonActive = creationItem = 'module_graph'; toolbuttonActive = creationItem = 'module_graph';
toggle_item_palette(); toggle_item_palette();
break; break;
case 'auto_sla_graph':
toolbuttonActive = creationItem = 'auto_sla_graph';
toggle_item_palette();
break;
case 'simple_value': case 'simple_value':
toolbuttonActive = creationItem = 'simple_value'; toolbuttonActive = creationItem = 'simple_value';
toggle_item_palette(); toggle_item_palette();

View File

@ -152,6 +152,11 @@ foreach ($layoutDatas as $layoutData) {
html_print_image('images/chart_curve.png', true, html_print_image('images/chart_curve.png', true,
array('title' => __('Module Graph'))); array('title' => __('Module Graph')));
break; break;
case AUTO_SLA_GRAPH:
$table->data[$i + 1]['icon'] =
html_print_image('images/auto_sla_graph.png', true,
array('title' => __('Auto SLA Graph')));
break;
case SIMPLE_VALUE: case SIMPLE_VALUE:
$table->data[$i + 1]['icon'] = $table->data[$i + 1]['icon'] =
html_print_image('images/binary.png', true, html_print_image('images/binary.png', true,

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

View File

@ -185,6 +185,7 @@ define('AGENT_STATUS_WARNING', 2);
define('STATIC_GRAPH', 0); define('STATIC_GRAPH', 0);
define('PERCENTILE_BAR', 3); define('PERCENTILE_BAR', 3);
define('MODULE_GRAPH', 1); define('MODULE_GRAPH', 1);
define('AUTO_SLA_GRAPH', 14);
define('SIMPLE_VALUE', 2); define('SIMPLE_VALUE', 2);
define('LABEL', 4); define('LABEL', 4);
define('ICON', 5); define('ICON', 5);

View File

@ -2746,6 +2746,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
case MODULE_GRAPH: case MODULE_GRAPH:
$text = __('Module graph'); $text = __('Module graph');
break; break;
case 'auto_sla_graph':
case AUTO_SLA_GRAPH:
$text = __('Auto SLA Graph');
break;
case 'percentile_bar': case 'percentile_bar':
case PERCENTILE_BAR: case PERCENTILE_BAR:
$text = __('Percentile bar'); $text = __('Percentile bar');

View File

@ -54,6 +54,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'static_graph' => __('Static Graph'), 'static_graph' => __('Static Graph'),
'percentile_item' => __('Percentile Item'), 'percentile_item' => __('Percentile Item'),
'module_graph' => __('Graph'), 'module_graph' => __('Graph'),
'auto_sla_graph' => __('Auto SLA Graph'),
'simple_value' => __('Simple value') . ui_print_help_tip(__("To use 'label'field, you should write 'simple_value' => __('Simple value') . ui_print_help_tip(__("To use 'label'field, you should write
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true), a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
'label' => __('Label'), 'label' => __('Label'),
@ -276,7 +277,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['agent_row'] = array(); $form_items['agent_row'] = array();
$form_items['agent_row']['items'] = array('static_graph', $form_items['agent_row']['items'] = array('static_graph',
'percentile_bar', 'percentile_item', 'module_graph', 'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'datos'); 'simple_value', 'datos', 'auto_sla_graph');
$form_items['agent_row']['html'] = '<td align="left">' . $form_items['agent_row']['html'] = '<td align="left">' .
__('Agent') . '</td>'; __('Agent') . '</td>';
$params = array(); $params = array();
@ -306,28 +307,38 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
ui_print_agent_autocomplete_input($params) . ui_print_agent_autocomplete_input($params) .
'</td>'; '</td>';
$form_items['module_row'] = array(); $form_items['module_row'] = array();
$form_items['module_row']['items'] = array('static_graph', $form_items['module_row']['items'] = array('static_graph',
'percentile_bar', 'percentile_item', 'module_graph', 'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'datos'); 'simple_value', 'datos', 'auto_sla_graph');
$form_items['module_row']['html'] = '<td align="left">' . $form_items['module_row']['html'] = '<td align="left">' .
__('Module') . '</td> __('Module') . '</td>
<td align="left">' . <td align="left">' .
html_print_select(array(), 'module', '', '', __('Any'), 0, true) . html_print_select(array(), 'module', '', '', __('Any'), 0, true) .
'</td>'; '</td>';
$event_times = array(86400 => __('24h'),
28800 => __('8h'),
7200 => __('2h'),
3600 => __('1h'),);
$form_items['event_max_time_row'] = array();
$form_items['event_max_time_row']['items'] = array('auto_sla_graph');
$form_items['event_max_time_row']['html'] = '<td align="left">' .
__('Max. Time') . '</td>
<td align="left">' .
html_print_select($event_times, 'event_max_time_row', '', '', 0, 86400, true, false, false) .
'</td>';
$form_items['type_graph'] = array(); $form_items['type_graph'] = array();
$form_items['type_graph']['items'] = array( $form_items['type_graph']['items'] = array(
'Line', 'Line',
'Area'); 'Area');
$form_items['type_graph']['html'] = '<td align="left"><span>' . $form_items['type_graph']['html'] = '<td align="left"><span>' .
__('Type of graph') . '</span></td> __('Type of graph') . '</span></td>
<td align="left">'. html_print_select ( <td align="left">'. html_print_select (
array ('line' => __('Line'), array ('line' => __('Line'),
'area' => __('Area')), 'area' => __('Area')),
'type_graph', '', '', 0, 'area', true, false, false) . '</td>'; 'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM")) if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
@ -654,6 +665,7 @@ function visual_map_editor_print_toolbox() {
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true); visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true); visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true); visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
visual_map_print_button_editor('auto_sla_graph', __('Auto SLA Graph'), 'left', false, 'auto_sla_graph_min', true);
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true); visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true); visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true); visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
@ -672,7 +684,6 @@ function visual_map_editor_print_toolbox() {
$text_autosave = html_print_input_hidden ('auto_save', true, true); $text_autosave = html_print_input_hidden ('auto_save', true, true);
visual_map_print_item_toolbox('auto_save', $text_autosave, 'right'); visual_map_print_item_toolbox('auto_save', $text_autosave, 'right');
//visual_map_print_button_editor('save_visualmap', __('Save'), 'right', true, 'save_min', true);
visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true); visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true);
visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true); visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true);
visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true); visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true);

View File

@ -778,6 +778,12 @@ input.percentile_item_min {
input.percentile_item_min[disabled] { input.percentile_item_min[disabled] {
background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat center !important; background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat center !important;
} }
input.auto_sla_graph_min {
background: #fefefe url(../../images/auto_sla_graph.png) no-repeat center !important;
}
input.auto_sla_graph_min[disabled] {
background: #fefefe url(../../images/auto_sla_graph.disabled.png) no-repeat center !important;
}
input.binary_min { input.binary_min {
background: #fefefe url(../../images/binary.png) no-repeat center !important; background: #fefefe url(../../images/binary.png) no-repeat center !important;
} }