mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2011-07-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php godmode/users/configure_user.php godmode/reporting/visual_console_builder.editor.js godmode/reporting/visual_console_builder.editor.php godmode/reporting/visual_console_builder.constans.php: Added min, max and avg process to simple value items in visual maps. Pending tasks: #3014709 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4541 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dbc7ecb2e8
commit
aec10bea6b
@ -1,3 +1,15 @@
|
|||||||
|
2011-07-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_visual_map.php
|
||||||
|
include/ajax/visual_console_builder.ajax.php
|
||||||
|
godmode/users/configure_user.php
|
||||||
|
godmode/reporting/visual_console_builder.editor.js
|
||||||
|
godmode/reporting/visual_console_builder.editor.php
|
||||||
|
godmode/reporting/visual_console_builder.constans.php: Added min,
|
||||||
|
max and avg process to simple value items in visual maps.
|
||||||
|
|
||||||
|
Pending tasks: #3014709
|
||||||
|
|
||||||
2011-07-11 Junichi Satoh <junichi@rworks.jp>
|
2011-07-11 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* operation/agentes/estado_agente.php,
|
* operation/agentes/estado_agente.php,
|
||||||
|
@ -19,4 +19,7 @@ define('MODULE_GRAPH', 1);
|
|||||||
define('SIMPLE_VALUE', 2);
|
define('SIMPLE_VALUE', 2);
|
||||||
define('LABEL', 4);
|
define('LABEL', 4);
|
||||||
define('ICON', 5);
|
define('ICON', 5);
|
||||||
|
define('SIMPLE_VALUE_MAX', 6);
|
||||||
|
define('SIMPLE_VALUE_MIN', 7);
|
||||||
|
define('SIMPLE_VALUE_AVG', 8);
|
||||||
?>
|
?>
|
@ -266,6 +266,7 @@ function readFields() {
|
|||||||
values['top'] = $("input[name=top]").val();
|
values['top'] = $("input[name=top]").val();
|
||||||
values['agent'] = $("input[name=agent]").val();
|
values['agent'] = $("input[name=agent]").val();
|
||||||
values['module'] = $("select[name=module]").val();
|
values['module'] = $("select[name=module]").val();
|
||||||
|
values['process_simple_value'] = $("select[name=process_value]").val();
|
||||||
values['background'] = $("#background_image").val();
|
values['background'] = $("#background_image").val();
|
||||||
values['period'] = $("select[name=period]").val();
|
values['period'] = $("select[name=period]").val();
|
||||||
values['width'] = $("input[name=width]").val();
|
values['width'] = $("input[name=width]").val();
|
||||||
@ -420,6 +421,7 @@ function loadFieldsFromDB(item) {
|
|||||||
moduleId = val;
|
moduleId = val;
|
||||||
$("select[name=module]").val(val);
|
$("select[name=module]").val(val);
|
||||||
}
|
}
|
||||||
|
if (key == 'process_value') $("select[name=process_value]").val(val);
|
||||||
if (key == 'period') $("select[name=period]").val(val);
|
if (key == 'period') $("select[name=period]").val(val);
|
||||||
if (key == 'width') $("input[name=width]").val(val);
|
if (key == 'width') $("input[name=width]").val(val);
|
||||||
if (key == 'height') $("input[name=height]").val(val);
|
if (key == 'height') $("input[name=height]").val(val);
|
||||||
@ -522,8 +524,8 @@ function hiddenFields(item) {
|
|||||||
$("#agent_row").css('display', 'none');
|
$("#agent_row").css('display', 'none');
|
||||||
$("#agent_row." + item).css('display', '');
|
$("#agent_row." + item).css('display', '');
|
||||||
|
|
||||||
$("#module_row").css('display', 'none');
|
$("#process_value_row").css('display', 'none');
|
||||||
$("#module_row." + item).css('display', '');
|
$("#process_value_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', '');
|
||||||
@ -569,6 +571,7 @@ function cleanFields() {
|
|||||||
$("input[name=top]").val(0);
|
$("input[name=top]").val(0);
|
||||||
$("input[name=agent]").val('');
|
$("input[name=agent]").val('');
|
||||||
$("select[name=module]").val('');
|
$("select[name=module]").val('');
|
||||||
|
$("input[name=process_value]").val('');
|
||||||
$("select[name=background_image]").val('');
|
$("select[name=background_image]").val('');
|
||||||
$("input[name=width_percentile]").val('');
|
$("input[name=width_percentile]").val('');
|
||||||
$("input[name=max_percentile]").val('');
|
$("input[name=max_percentile]").val('');
|
||||||
|
@ -136,6 +136,12 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
|
|||||||
<td><?php echo __('Module');?></td>
|
<td><?php echo __('Module');?></td>
|
||||||
<td><?php html_print_select (array (), 'module', '', '', __('Any'), 0);?></td>
|
<td><?php html_print_select (array (), 'module', '', '', __('Any'), 0);?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id="process_value_row" class="simple_value datos">
|
||||||
|
<td><?php echo '<span>' . __('Process') . '</span>';?></td>
|
||||||
|
<td><?php html_print_select (array ('1' => __('Min value'),
|
||||||
|
'2' => __('Max value'),
|
||||||
|
'3' => __('Avg value')), 'process_value', '', '', __('None'), 0);?></td>
|
||||||
|
</tr>
|
||||||
<tr id="background_row_1" class="background datos">
|
<tr id="background_row_1" class="background datos">
|
||||||
<td><?php echo __('Background');?></td>
|
<td><?php echo __('Background');?></td>
|
||||||
<td><?php html_print_select($backgrounds_list, 'background_image', $background, '', 'None', '');?></td>
|
<td><?php html_print_select($backgrounds_list, 'background_image', $background, '', 'None', '');?></td>
|
||||||
|
@ -391,7 +391,7 @@ echo '<br />';
|
|||||||
if (empty ($id) || $new_user)
|
if (empty ($id) || $new_user)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<h3>'.__('Profiles/Groups assigned to this user').'</h3>';
|
echo '<h4>'.__('Profiles/Groups assigned to this user').'</h4>';
|
||||||
|
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
$table->data = array ();
|
$table->data = array ();
|
||||||
|
@ -57,6 +57,7 @@ $max_percentile = get_parameter('max_percentile', null);
|
|||||||
$height_module_graph = get_parameter('height_module_graph', null);
|
$height_module_graph = get_parameter('height_module_graph', null);
|
||||||
$width_module_graph = get_parameter('width_module_graph', null);
|
$width_module_graph = get_parameter('width_module_graph', null);
|
||||||
$id_agent_module = get_parameter('id_agent_module', 0);
|
$id_agent_module = get_parameter('id_agent_module', 0);
|
||||||
|
$process_simple_value = get_parameter('process_simple_value', 0);
|
||||||
|
|
||||||
$get_element_status = get_parameter('get_element_status', 0);
|
$get_element_status = get_parameter('get_element_status', 0);
|
||||||
$get_image_path_status = get_parameter('get_image_path_status', 0);
|
$get_image_path_status = get_parameter('get_image_path_status', 0);
|
||||||
@ -84,8 +85,35 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
case 'get_module_value':
|
case 'get_module_value':
|
||||||
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
|
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
|
||||||
|
switch ($layoutData['type']){
|
||||||
|
case SIMPLE_VALUE_MAX:
|
||||||
|
$value = reporting_get_agentmodule_data_max ($layoutData['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$returnValue = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$returnValue = format_numeric ($value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_MIN:
|
||||||
|
$value = reporting_get_agentmodule_data_min ($layoutData['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$returnValue = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$returnValue = format_numeric ($value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_AVG:
|
||||||
|
$value = reporting_get_agentmodule_data_average ($layoutData['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$returnValue = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$returnValue = format_numeric ($value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
$returnValue = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
$returnValue = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
$return = array();
|
$return = array();
|
||||||
$return['value'] = $returnValue;
|
$return['value'] = $returnValue;
|
||||||
$return['max_percentile'] = $layoutData['height'];
|
$return['max_percentile'] = $layoutData['height'];
|
||||||
@ -231,6 +259,23 @@ switch ($action) {
|
|||||||
$elementFields['height_module_graph'] = $elementFields['height'];
|
$elementFields['height_module_graph'] = $elementFields['height'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//Support for max, min and svg process on simple value items
|
||||||
|
if ($type == 'simple_value'){
|
||||||
|
switch ($elementFields['type']) {
|
||||||
|
case SIMPLE_VALUE:
|
||||||
|
$elementFields['process_value'] = 0;
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_MAX:
|
||||||
|
$elementFields['process_value'] = 2;
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_MIN:
|
||||||
|
$elementFields['process_value'] = 1;
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_AVG:
|
||||||
|
$elementFields['process_value'] = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
$elementFields['label'] = io_safe_output($elementFields['label']);
|
$elementFields['label'] = io_safe_output($elementFields['label']);
|
||||||
echo json_encode($elementFields);
|
echo json_encode($elementFields);
|
||||||
break;
|
break;
|
||||||
@ -271,8 +316,22 @@ switch ($action) {
|
|||||||
$values['height'] = $height;
|
$values['height'] = $height;
|
||||||
break;
|
break;
|
||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
|
//This allows min, max and avg process in a simple value
|
||||||
|
switch ($process_simple_value){
|
||||||
|
case 0:
|
||||||
$values['type'] = SIMPLE_VALUE;
|
$values['type'] = SIMPLE_VALUE;
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
$values['type'] = SIMPLE_VALUE_MIN;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$values['type'] = SIMPLE_VALUE_MAX;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$values['type'] = SIMPLE_VALUE_AVG;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'label':
|
case 'label':
|
||||||
$values['type'] = LABEL;
|
$values['type'] = LABEL;
|
||||||
break;
|
break;
|
||||||
|
@ -132,9 +132,43 @@ function visual_map_print_item($layoutData) {
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
break;
|
break;
|
||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
|
case SIMPLE_VALUE_MAX:
|
||||||
|
case SIMPLE_VALUE_MIN:
|
||||||
|
case SIMPLE_VALUE_AVG:
|
||||||
echo '<div id="' . $id . '" class="item simple_value" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
|
echo '<div id="' . $id . '" class="item simple_value" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
|
||||||
echo $text;
|
echo $text;
|
||||||
|
switch ($type){
|
||||||
|
case SIMPLE_VALUE:
|
||||||
echo ' <strong>' . db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $id_module) . '</strong>';
|
echo ' <strong>' . db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $id_module) . '</strong>';
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_MAX:
|
||||||
|
$value = reporting_get_agentmodule_data_max ($id_module, 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo ' <strong> ' . $value . '</strong>';
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_MIN:
|
||||||
|
$value = reporting_get_agentmodule_data_min ($id_module, 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo ' <strong> ' . $value . '</strong>';
|
||||||
|
break;
|
||||||
|
case SIMPLE_VALUE_AVG:
|
||||||
|
$value = reporting_get_agentmodule_data_average ($id_module, 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo ' <strong> ' . $value . '</strong>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
break;
|
break;
|
||||||
case LABEL:
|
case LABEL:
|
||||||
@ -731,6 +765,9 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||||||
echo "</div>";
|
echo "</div>";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
// SIMPLE DATA VALUE (type = 2)
|
// SIMPLE DATA VALUE (type = 2)
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
@ -761,7 +798,39 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<strong>'.$layout_data['label']. ' ';
|
echo '<strong>'.$layout_data['label']. ' ';
|
||||||
|
//TODO: change interface to add a period parameter, now is set to 1 day
|
||||||
|
switch ($layout_data['type']){
|
||||||
|
case 2:
|
||||||
echo db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $layout_data['id_agente_modulo']);
|
echo db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $layout_data['id_agente_modulo']);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$value = reporting_get_agentmodule_data_max ($layout_data['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo $value;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
$value = reporting_get_agentmodule_data_min ($layout_data['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo $value;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
$value = reporting_get_agentmodule_data_average($layout_data['id_agente_modulo'], 86400, 0);
|
||||||
|
if ($value === false) {
|
||||||
|
$value = __('Unknown');
|
||||||
|
} else {
|
||||||
|
$value = format_numeric ($value);
|
||||||
|
}
|
||||||
|
echo $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
echo '</strong>';
|
echo '</strong>';
|
||||||
|
|
||||||
if ($endTagA) echo '</a>';
|
if ($endTagA) echo '</a>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user