mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
fixed styles
This commit is contained in:
parent
302e3c8bf7
commit
c4f4d371cc
@ -444,7 +444,8 @@ $tableBasicThresholds->data = [];
|
|||||||
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
|
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
|
||||||
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
|
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
|
||||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
||||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
|
||||||
|
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
||||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||||
'min_warning',
|
'min_warning',
|
||||||
@ -482,7 +483,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||||
$basicThresholdsIntervalWarning = [];
|
$basicThresholdsIntervalWarning = [];
|
||||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||||
@ -531,7 +532,7 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
|
|||||||
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
|
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
|
||||||
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
|
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
|
||||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' ';
|
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' ';
|
||||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
||||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||||
'min_critical',
|
'min_critical',
|
||||||
@ -569,7 +570,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||||
$basicThresholdsIntervalCritical = [];
|
$basicThresholdsIntervalCritical = [];
|
||||||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||||
@ -1905,80 +1906,65 @@ $(document).ready (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.switch_radio_button label').on('click', function(){
|
$('.switch_radio_button label').on('click', function(){
|
||||||
|
console.log('primero');
|
||||||
var thisLabel = $(this).attr('for');
|
var thisLabel = $(this).attr('for');
|
||||||
$('#'+thisLabel).attr('checked', 'checked');
|
console.log(thisLabel);
|
||||||
$('#'+thisLabel).siblings().attr('checked', false);
|
$('#'+thisLabel).prop('checked', true);
|
||||||
|
$('#'+thisLabel).siblings().prop('checked', false);
|
||||||
|
|
||||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
console.log('++++++++++Los warning++++++++++++++');
|
||||||
//$('#percentage_warning').hide();
|
console.log('normal_warning: '+$('#radius-normal_warning').prop('checked'));
|
||||||
$("#svg_dinamic").show();
|
console.log('warning_inverse: '+$('#radius-warning_inverse').prop('checked'));
|
||||||
}
|
console.log('percentage_warning: '+$('#radius-percentage_warning').prop('checked'));
|
||||||
|
|
||||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
console.log('++++++++++Los critical++++++++++++++');
|
||||||
//$('#percentage_critical').hide();
|
console.log('normal_critical: '+$('#radius-normal_critical').prop('checked'));
|
||||||
|
console.log('critical_inverse: '+$('#radius-critical_inverse').prop('checked'));
|
||||||
|
console.log('percentage_critical: '+$('#radius-percentage_critical').prop('checked'));
|
||||||
|
|
||||||
|
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
|
||||||
|
$("#svg_dinamic").hide();
|
||||||
|
} else {
|
||||||
|
paint_graph_values();
|
||||||
$("#svg_dinamic").show();
|
$("#svg_dinamic").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true) {
|
if ($('#radius-percentage_warning').prop('checked') === true) {
|
||||||
//$('#warning_inverse').hide();
|
$('#radius-warning_inverse').hide();
|
||||||
$("#svg_dinamic").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) {
|
||||||
|
$('#radius-warning_inverse').show();
|
||||||
|
$('#label-radius-warning_inverse').show();
|
||||||
|
$('#radius-percentage_warning').show();
|
||||||
|
$('#label-radius-percentage_warning').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('#radius-percentage_critical').prop('checked') === true) {
|
if ($('#radius-percentage_critical').prop('checked') === true) {
|
||||||
//$('#critical_inverse').hide();
|
$('#radius-critical_inverse').hide();
|
||||||
$("#svg_dinamic").hide();
|
$('#label-radius-critical_inverse').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#radius-warning_inverse').change (function() {
|
if ($('#radius-critical_inverse').prop('checked') === true) {
|
||||||
paint_graph_values();
|
$('#radius-percentage_critical').hide();
|
||||||
if ($('#radius-warning_inverse').prop('checked') === true){
|
$('#label-radius-percentage_critical').hide();
|
||||||
$('#radius-percentage_warning').prop('checked', false);
|
|
||||||
$('#percentage_warning').attr('onClick', 'return false;');
|
|
||||||
$('#percentage_warning>em').addClass('color_666');
|
|
||||||
} else {
|
|
||||||
$('#percentage_warning').removeAttr('onClick');
|
|
||||||
$('#percentage_warning>em').removeClass('color_666');
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
$('#radius-critical_inverse').change (function() {
|
if ($('#radius-normal_critical').prop('checked') === true) {
|
||||||
paint_graph_values();
|
$('#radius-critical_inverse').show();
|
||||||
|
$('#label-radius-critical_inverse').show();
|
||||||
if ($('#radius-critical_inverse').prop('checked') === true){
|
$('#radius-percentage_critical').show();
|
||||||
$('#radius-percentage_critical').prop('checked', false);
|
$('#label-radius-percentage_critical').show();
|
||||||
$('#percentage_critical').attr('onClick', 'return false;');
|
|
||||||
$('#percentage_critical>em').addClass('color_666');
|
|
||||||
} else {
|
|
||||||
$('#percentage_critical').removeAttr('onClick');
|
|
||||||
$('#percentage_critical>em').removeClass('color_666');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#radius-percentage_warning').change (function() {
|
|
||||||
paint_graph_values();
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true){
|
|
||||||
$('#radius-warning_inverse').prop('checked', false);
|
|
||||||
$('#warning_inverse').attr('onClick', 'return false;');
|
|
||||||
$('#warning_inverse>em').addClass('color_666');
|
|
||||||
} else {
|
|
||||||
$('#warning_inverse').removeAttr('onClick');
|
|
||||||
$('#warning_inverse>em').removeClass('color_666');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#radius-percentage_critical').change (function() {
|
|
||||||
paint_graph_values();
|
|
||||||
if ($('#radius-percentage_critical').prop('checked') === true){
|
|
||||||
$('#radius-critical_inverse').prop('checked', false);
|
|
||||||
$('#critical_inverse').attr('onClick', 'return false;');
|
|
||||||
$('#critical_inverse>em').addClass('color_666');
|
|
||||||
} else {
|
|
||||||
$('#critical_inverse').removeAttr('onClick');
|
|
||||||
$('#critical_inverse>em').removeClass('color_666');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -2235,91 +2221,66 @@ function validate_post_process() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//function paint graph
|
//function paint graph.
|
||||||
function paint_graph_values(){
|
function paint_graph_values(){
|
||||||
//Parse integrer
|
|
||||||
var min_w = parseFloat($('#text-min_warning').val());
|
var min_w = parseFloat($('#text-min_warning').val());
|
||||||
if(min_w == '0.00'){ min_w = 0; }
|
if(min_w == '0.00' || isNaN(min_w)){ min_w = 0; }
|
||||||
|
|
||||||
var max_w = parseFloat($('#text-max_warning').val());
|
var max_w = parseFloat($('#text-max_warning').val());
|
||||||
if(max_w == '0.00'){ max_w = 0; }
|
if(max_w == '0.00' || isNaN(max_w)){ max_w = 0; }
|
||||||
|
|
||||||
var min_c = parseFloat($('#text-min_critical').val());
|
var min_c = parseFloat($('#text-min_critical').val());
|
||||||
if(min_c =='0.00'){ min_c = 0; }
|
if(min_c =='0.00' || isNaN(min_c)){ min_c = 0; }
|
||||||
|
|
||||||
var max_c = parseFloat($('#text-max_critical').val());
|
var max_c = parseFloat($('#text-max_critical').val());
|
||||||
if(max_c =='0.00'){ max_c = 0; }
|
if(max_c =='0.00' || isNaN(max_c)){ max_c = 0; }
|
||||||
var inverse_w = $('input:radio[name=warning_inverse]:checked').val();
|
|
||||||
|
var inverse_w = $('input:radio[value=warning_inverse]:checked').val();
|
||||||
if(!inverse_w){ inverse_w = 0; }
|
if(!inverse_w){ inverse_w = 0; }
|
||||||
var inverse_c = $('input:radio[name=critical_inverse]:checked').val();
|
|
||||||
|
var inverse_c = $('input:radio[value=critical_inverse]:checked').val();
|
||||||
if(!inverse_c){ inverse_c = 0; }
|
if(!inverse_c){ inverse_c = 0; }
|
||||||
|
|
||||||
//inicialiced error
|
//inicialiced error.
|
||||||
var error_w = 0;
|
var error_w = 0;
|
||||||
var error_c = 0;
|
var error_c = 0;
|
||||||
//messages legend
|
|
||||||
|
//messages legend.
|
||||||
var legend_normal = '<?php echo __('Normal Status'); ?>';
|
var legend_normal = '<?php echo __('Normal Status'); ?>';
|
||||||
var legend_warning = '<?php echo __('Warning Status'); ?>';
|
var legend_warning = '<?php echo __('Warning Status'); ?>';
|
||||||
var legend_critical = '<?php echo __('Critical Status'); ?>';
|
var legend_critical = '<?php echo __('Critical Status'); ?>';
|
||||||
//messages error
|
|
||||||
|
//messages error.
|
||||||
var message_error_warning = '<?php echo __('Please introduce a maximum warning higher than the minimun warning'); ?>';
|
var message_error_warning = '<?php echo __('Please introduce a maximum warning higher than the minimun warning'); ?>';
|
||||||
var message_error_critical = '<?php echo __('Please introduce a maximum critical higher than the minimun critical'); ?>';
|
var message_error_critical = '<?php echo __('Please introduce a maximum critical higher than the minimun critical'); ?>';
|
||||||
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
||||||
|
|
||||||
|
|
||||||
//Percentage selector
|
|
||||||
var percentage_w = $('#checkbox-percentage_warning').prop('checked');
|
|
||||||
var percentage_c = $('#checkbox-percentage_critical').prop('checked');
|
|
||||||
|
|
||||||
if(percentage_w == true || percentage_c == true) {
|
|
||||||
d3.select("#svg_dinamic rect").remove();
|
|
||||||
//create svg
|
|
||||||
var svg = d3.select("#svg_dinamic");
|
|
||||||
svg.selectAll("g").remove();
|
|
||||||
if (percentage_w === true) {
|
|
||||||
if(max_w < 0 || min_w < 0) {
|
|
||||||
paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
|
|
||||||
} else {
|
|
||||||
$("#text-max_warning").removeClass("input_error");
|
|
||||||
$("#text-min_warning").removeClass("input_error");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(percentage_c === true) {
|
|
||||||
if(max_c < 0 || min_c < 0) {
|
|
||||||
paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
|
|
||||||
} else {
|
|
||||||
$("#text-min-critical").removeClass("input_error");
|
|
||||||
$("#text-max_critical").removeClass("input_error");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$('#svg_dinamic').show();
|
|
||||||
}
|
|
||||||
|
|
||||||
//if haven't error
|
//if haven't error
|
||||||
if(max_w == 0 || max_w > min_w){
|
if(max_w == 0 || max_w > min_w){
|
||||||
if(max_c == 0 || max_c > min_c){
|
if(max_c == 0 || max_c > min_c){
|
||||||
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
|
paint_graph_status(
|
||||||
|
min_w, max_w, min_c, max_c, inverse_w,
|
||||||
inverse_c, error_w, error_c,
|
inverse_c, error_w, error_c,
|
||||||
legend_normal, legend_warning, legend_critical,
|
legend_normal, legend_warning, legend_critical,
|
||||||
message_error_warning, message_error_critical);
|
message_error_warning, message_error_critical
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
error_c = 1;
|
error_c = 1;
|
||||||
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
|
paint_graph_status(
|
||||||
|
0,0,0,0,0,0, error_w, error_c,
|
||||||
legend_normal, legend_warning, legend_critical,
|
legend_normal, legend_warning, legend_critical,
|
||||||
message_error_warning, message_error_critical);
|
message_error_warning, message_error_critical
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error_w = 1;
|
error_w = 1;
|
||||||
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
|
paint_graph_status(
|
||||||
|
0,0,0,0,0,0, error_w, error_c,
|
||||||
legend_normal, legend_warning, legend_critical,
|
legend_normal, legend_warning, legend_critical,
|
||||||
message_error_warning, message_error_critical);
|
message_error_warning, message_error_critical
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* End of relationship javascript */
|
|
||||||
|
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user