mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added final lost code
This commit is contained in:
parent
42a43b0c4e
commit
9145811d29
@ -1546,6 +1546,15 @@ function hiddenFields(item) {
|
|||||||
$("#percentile_item_row_4").css('display', 'none');
|
$("#percentile_item_row_4").css('display', 'none');
|
||||||
$("#percentile_item_row_4." + item).css('display', '');
|
$("#percentile_item_row_4." + item).css('display', '');
|
||||||
|
|
||||||
|
$("#percentile_item_row_5").css('display', 'none');
|
||||||
|
$("#percentile_item_row_5." + item).css('display', '');
|
||||||
|
|
||||||
|
$("#percentile_item_row_6").css('display', 'none');
|
||||||
|
$("#percentile_item_row_6." + item).css('display', '');
|
||||||
|
|
||||||
|
$("#percentile_bar_row_7").css('display', 'none');
|
||||||
|
$("#percentile_bar_row_7." + item).css('display', '');
|
||||||
|
|
||||||
$("#period_row").css('display', 'none');
|
$("#period_row").css('display', 'none');
|
||||||
$("#period_row." + item).css('display', '');
|
$("#period_row." + item).css('display', '');
|
||||||
|
|
||||||
@ -1638,6 +1647,11 @@ function cleanFields(item) {
|
|||||||
$("input[name='fill_color']").val('#ffffff');
|
$("input[name='fill_color']").val('#ffffff');
|
||||||
$("input[name='line_width']").val(3);
|
$("input[name='line_width']").val(3);
|
||||||
$("input[name='line_color']").val('#000000');
|
$("input[name='line_color']").val('#000000');
|
||||||
|
$("select[name=type_percentile]").val('');
|
||||||
|
$("input[name=percentile_color]").val('');
|
||||||
|
$("input[name=percentile_label_color]").val('');
|
||||||
|
$("input[name=percentile_label]").val('');
|
||||||
|
$(".ColorPickerDivSample").css('background-color', '#FFF');
|
||||||
|
|
||||||
|
|
||||||
$("#preview").empty();
|
$("#preview").empty();
|
||||||
@ -2230,7 +2244,7 @@ function setDonutsGraph (id_data, values) {
|
|||||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||||
parameter.push ({name: "action", value: "get_module_type_string"});
|
parameter.push ({name: "action", value: "get_module_type_string"});
|
||||||
parameter.push ({name: "id_agent", value: values['id_agent']});
|
parameter.push ({name: "id_agent", value: values['id_agent']});
|
||||||
parameter.push ({name: "id_agent_module", value: values['module']});
|
parameter.push ({name: "module", value: values['module']});
|
||||||
parameter.push ({name: "id_element", value: id_data});
|
parameter.push ({name: "id_element", value: id_data});
|
||||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
|
@ -589,6 +589,14 @@ switch ($action) {
|
|||||||
if ($height !== null) {
|
if ($height !== null) {
|
||||||
$values['height'] = $height;
|
$values['height'] = $height;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
if ($width_percentile !== null) {
|
||||||
|
$values['width'] = $width_percentile;
|
||||||
|
$values['height'] = $width_percentile;
|
||||||
|
}
|
||||||
|
$values['type'] = DONUT_GRAPH;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'box_item':
|
case 'box_item':
|
||||||
$values['border_width'] = $border_width;
|
$values['border_width'] = $border_width;
|
||||||
@ -776,6 +784,7 @@ switch ($action) {
|
|||||||
case 'label':
|
case 'label':
|
||||||
case 'icon':
|
case 'icon':
|
||||||
case 'auto_sla_graph':
|
case 'auto_sla_graph':
|
||||||
|
case 'donut_graph':
|
||||||
$elementFields = db_get_row_filter('tlayout_data',
|
$elementFields = db_get_row_filter('tlayout_data',
|
||||||
array('id' => $id_element));
|
array('id' => $id_element));
|
||||||
|
|
||||||
@ -856,6 +865,9 @@ switch ($action) {
|
|||||||
$elementFields['percentile_label_color'] = $elementFields['fill_color'];
|
$elementFields['percentile_label_color'] = $elementFields['fill_color'];
|
||||||
$elementFields['percentile_label'] = $elementFields['label'];
|
$elementFields['percentile_label'] = $elementFields['label'];
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
$elementFields['width_percentile'] = $elementFields['width'];
|
||||||
|
break;
|
||||||
|
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
$elementFields['width_module_graph'] = $elementFields['width'];
|
$elementFields['width_module_graph'] = $elementFields['width'];
|
||||||
@ -969,6 +981,11 @@ switch ($action) {
|
|||||||
$values['width'] = $width_box;
|
$values['width'] = $width_box;
|
||||||
$values['height'] = $height_box;
|
$values['height'] = $height_box;
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
$values['type'] = DONUT_GRAPH;
|
||||||
|
$values['width'] = $width;
|
||||||
|
$values['height'] = $height;
|
||||||
|
break;
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
$values['type'] = MODULE_GRAPH;
|
$values['type'] = MODULE_GRAPH;
|
||||||
|
|
||||||
|
@ -385,6 +385,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
case AUTO_SLA_GRAPH:
|
case AUTO_SLA_GRAPH:
|
||||||
$link = true;
|
$link = true;
|
||||||
break;
|
break;
|
||||||
|
case DONUT_GRAPH:
|
||||||
|
$link = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (!empty($element_enterprise)) {
|
if (!empty($element_enterprise)) {
|
||||||
$link = $element_enterprise['link'];
|
$link = $element_enterprise['link'];
|
||||||
@ -1367,6 +1370,88 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DONUT_GRAPH:
|
||||||
|
if (!empty($id_metaconsole)) {
|
||||||
|
$connection = db_get_row_filter ('tmetaconsole_setup', $id_metaconsole);
|
||||||
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$is_string = db_get_value_filter ('id_tipo_modulo', 'tagente_modulo',
|
||||||
|
array ('id_agente' => $layoutData['id_agent'],
|
||||||
|
'id_agente_modulo' => $id_module));
|
||||||
|
|
||||||
|
if (!empty($id_metaconsole)) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) ||
|
||||||
|
($is_string == 10) || ($is_string == 33)) {
|
||||||
|
$no_data = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$no_data = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($no_data) {
|
||||||
|
if($width == 0){
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/wrong_donut_graph.png">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/wrong_donut_graph.png">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/wrong_donut_graph.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/wrong_donut_graph.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$donut_data = get_donut_module_data($layoutData['id_agente_modulo']);
|
||||||
|
|
||||||
|
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
|
||||||
|
if($width == 0){
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/donut-graph.png">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/donut-graph.png">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/donut-graph.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/donut-graph.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($width == 0) {
|
||||||
|
$img = d3_donut_graph ($layoutData['id'], 400, 400, $donut_data);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = d3_donut_graph ($layoutData['id'], $width, $width, $donut_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Restore db connection
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
|
$z_index = 2 + 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case LABEL:
|
case LABEL:
|
||||||
$z_index = 4 + 1;
|
$z_index = 4 + 1;
|
||||||
break;
|
break;
|
||||||
@ -1437,6 +1522,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
case GROUP_ITEM:
|
case GROUP_ITEM:
|
||||||
$class .= "group_item";
|
$class .= "group_item";
|
||||||
break;
|
break;
|
||||||
|
case DONUT_GRAPH:
|
||||||
|
$class .= "donut_graph";
|
||||||
|
break;
|
||||||
case PERCENTILE_BAR:
|
case PERCENTILE_BAR:
|
||||||
case PERCENTILE_BUBBLE:
|
case PERCENTILE_BUBBLE:
|
||||||
case CIRCULAR_PROGRESS_BAR:
|
case CIRCULAR_PROGRESS_BAR:
|
||||||
@ -1923,6 +2011,10 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
echo io_safe_output($text);
|
echo io_safe_output($text);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DONUT_GRAPH:
|
||||||
|
echo $img;
|
||||||
|
break;
|
||||||
|
|
||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
case SIMPLE_VALUE_MAX:
|
case SIMPLE_VALUE_MAX:
|
||||||
case SIMPLE_VALUE_MIN:
|
case SIMPLE_VALUE_MIN:
|
||||||
@ -2465,6 +2557,55 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_donut_module_data ($id_module) {
|
||||||
|
$mod_values = db_get_value_filter('datos', 'tagente_estado', array('id_agente_modulo' => $id_module));
|
||||||
|
|
||||||
|
if (preg_match("/\r\n/", $mod_values)) {
|
||||||
|
$values = explode("\r\n", $mod_values);
|
||||||
|
}
|
||||||
|
elseif (preg_match("/\n/", $mod_values)) {
|
||||||
|
$values = explode("\n", $mod_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
$colors = array();
|
||||||
|
$colors[] = "#aa3333";
|
||||||
|
$colors[] = "#045FB4";
|
||||||
|
$colors[] = "#8181F7";
|
||||||
|
$colors[] = "#F78181";
|
||||||
|
$colors[] = "#D0A9F5";
|
||||||
|
$colors[] = "#BDBDBD";
|
||||||
|
$colors[] = "#6AB277";
|
||||||
|
|
||||||
|
$max_elements = 6;
|
||||||
|
$values_to_return = array();
|
||||||
|
$index = 0;
|
||||||
|
$total = 0;
|
||||||
|
foreach ($values as $val) {
|
||||||
|
if ($index < $max_elements) {
|
||||||
|
$data = explode(":", $val);
|
||||||
|
$values_to_return[$index]['tag_name'] = $data[0] . ", " . $data[1];
|
||||||
|
$values_to_return[$index]['color'] = $colors[$index];
|
||||||
|
$values_to_return[$index]['value'] = (int)$data[1];
|
||||||
|
$total += (int)$data[1];
|
||||||
|
$index++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$data = explode(":", $val);
|
||||||
|
$values_to_return[$index]['tag_name'] = __('Others') . ", " . $data[1];
|
||||||
|
$values_to_return[$index]['color'] = $colors[$index];
|
||||||
|
$values_to_return[$index]['value'] += (int)$data[1];
|
||||||
|
$total += (int)$data[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($values_to_return as $ind => $donut_data) {
|
||||||
|
$values_to_return[$ind]['percent'] = ($donut_data['value'] * 100) / $total;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $values_to_return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function to save the new elements of agents make as wizard.
|
* The function to save the new elements of agents make as wizard.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user