mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-12424-aviso-en-thresholds-de-tipo-percentage-que-no-deberia-aparecer' into 'develop'
Ent 12424 aviso en thresholds de tipo percentage que no deberia aparecer See merge request artica/pandorafms!6651
This commit is contained in:
commit
33ca5ab4ab
@ -2003,23 +2003,14 @@ ui_require_jquery_file('json');
|
|||||||
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||||
var type_name_selected = type_names[type_selected];
|
var type_name_selected = type_names[type_selected];
|
||||||
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true || type_name_selected == 'generic_data_string') {
|
if (($('#radius-percentage_warning').prop('checked') === true && $('#radius-percentage_critical').prop('checked') === true) || type_name_selected == 'generic_data_string') {
|
||||||
|
paint_graph_values();
|
||||||
$("#svg_dinamic").hide();
|
$("#svg_dinamic").hide();
|
||||||
} else {
|
} else {
|
||||||
paint_graph_values();
|
paint_graph_values();
|
||||||
$("#svg_dinamic").show();
|
$("#svg_dinamic").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true) {
|
|
||||||
$('#radius-warning_inverse').hide();
|
|
||||||
$('#label-radius-warning_inverse').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
|
||||||
$('#radius-percentage_warning').hide();
|
|
||||||
$('#label-radius-percentage_warning').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-normal_warning').prop('checked') === true) {
|
if ($('#radius-normal_warning').prop('checked') === true) {
|
||||||
$('#radius-warning_inverse').show();
|
$('#radius-warning_inverse').show();
|
||||||
$('#label-radius-warning_inverse').show();
|
$('#label-radius-warning_inverse').show();
|
||||||
@ -2027,17 +2018,6 @@ ui_require_jquery_file('json');
|
|||||||
$('#label-radius-percentage_warning').show();
|
$('#label-radius-percentage_warning').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('#radius-percentage_critical').prop('checked') === true) {
|
|
||||||
$('#radius-critical_inverse').hide();
|
|
||||||
$('#label-radius-critical_inverse').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
|
||||||
$('#radius-percentage_critical').hide();
|
|
||||||
$('#label-radius-percentage_critical').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-normal_critical').prop('checked') === true) {
|
if ($('#radius-normal_critical').prop('checked') === true) {
|
||||||
$('#radius-critical_inverse').show();
|
$('#radius-critical_inverse').show();
|
||||||
$('#label-radius-critical_inverse').show();
|
$('#label-radius-critical_inverse').show();
|
||||||
@ -2354,30 +2334,48 @@ ui_require_jquery_file('json');
|
|||||||
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
||||||
|
|
||||||
//if haven't error
|
//if haven't error
|
||||||
if (max_w == 0 || max_w > min_w) {
|
if (max_w == 0 || max_w > min_w || $('#radius-percentage_warning').is(':checked') === true) {
|
||||||
if (max_c == 0 || max_c > min_c) {
|
if (max_c == 0 || max_c > min_c || $('#radius-percentage_critical').is(':checked') === true) {
|
||||||
paint_graph_status(
|
error_c = 0;
|
||||||
min_w, max_w, min_c, max_c, inverse_w,
|
error_w = 0;
|
||||||
inverse_c, error_w, error_c,
|
|
||||||
legend_normal, legend_warning, legend_critical,
|
|
||||||
message_error_warning, message_error_critical
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
error_c = 1;
|
error_c = 1;
|
||||||
paint_graph_status(
|
min_w = 0;
|
||||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
max_w = 0;
|
||||||
legend_normal, legend_warning, legend_critical,
|
min_c = 0;
|
||||||
message_error_warning, message_error_critical
|
max_c = 0;
|
||||||
);
|
inverse_w = 0;
|
||||||
|
inverse_c = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (max_c !== 0 && max_c < min_c && $('#radius-percentage_critical').is(':checked') === false) {
|
||||||
|
error_c = 2;
|
||||||
|
}
|
||||||
error_w = 1;
|
error_w = 1;
|
||||||
paint_graph_status(
|
min_w = 0;
|
||||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
max_w = 0;
|
||||||
legend_normal, legend_warning, legend_critical,
|
min_c = 0;
|
||||||
message_error_warning, message_error_critical
|
max_c = 0;
|
||||||
);
|
inverse_w = 0;
|
||||||
|
inverse_c = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($('#radius-percentage_warning').is(':checked') === true){
|
||||||
|
min_w = 0;
|
||||||
|
max_w = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#radius-percentage_critical').is(':checked') === true){
|
||||||
|
min_c = 0;
|
||||||
|
max_c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
paint_graph_status(
|
||||||
|
min_w, max_w, min_c, max_c, inverse_w,
|
||||||
|
inverse_c, error_w, error_c,
|
||||||
|
legend_normal, legend_warning, legend_critical,
|
||||||
|
message_error_warning, message_error_critical
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
|
@ -1653,6 +1653,10 @@ function paint_graph_status(
|
|||||||
max_c = 0;
|
max_c = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove Error class.
|
||||||
|
$("#text-max_warning").removeClass("input_error");
|
||||||
|
$("#text-max_critical").removeClass("input_error");
|
||||||
|
|
||||||
//if haven't errors
|
//if haven't errors
|
||||||
if (error_w == 0 && error_c == 0) {
|
if (error_w == 0 && error_c == 0) {
|
||||||
//parse element
|
//parse element
|
||||||
@ -1958,6 +1962,9 @@ function paint_graph_status(
|
|||||||
.html(message_error_critical)
|
.html(message_error_critical)
|
||||||
.style("text-anchor", "first");
|
.style("text-anchor", "first");
|
||||||
}
|
}
|
||||||
|
if (error_c == 2) {
|
||||||
|
$("#text-max_critical").addClass("input_error");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user