Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(monitoring service): Fix columns on the list page (#6984)
Browse files Browse the repository at this point in the history
  • Loading branch information
callapa authored Dec 10, 2018
1 parent adc4e8a commit f41e540
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
7 changes: 6 additions & 1 deletion www/include/monitoring/status/Common/commonJS.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,12 @@ function monitoring_play() {
document.getElementById('JS_monitoring_pause_gray').style.display = 'none';
document.getElementById('JS_monitoring_play_gray').style.display = 'block';
_on = 1;
initM(<?php echo $tM?>,"<?php echo $sid?>","<?php echo $o?>");

// Allows to use the new status when click on the play button
if (typeof(_o) == "undefined") {
_o = "<?= $o ?>";
}
initM(<?php echo $tM?>, "<?php echo $sid?>", _o);
}

function monitoring_pause() {
Expand Down
5 changes: 1 addition & 4 deletions www/include/monitoring/status/Services/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,8 @@ function updateSelect()

jQuery(function () {
preInit();
/* Disable to prevent double Ajax call*/
//updateSelect();
});

function preInit()
{
_keyPrefix = '<?php echo $keyPrefix; ?>';
Expand Down Expand Up @@ -544,7 +543,5 @@ function filterCrit(value) {
function statusServices(value, isInit)
{
_o = value;
window.clearTimeout(_timeoutID);
initM(_tm, _sid, _o);
}
</script>
14 changes: 9 additions & 5 deletions www/include/monitoring/status/Services/serviceJS.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* For more information : contact@centreon.com
*
*/

if (!isset($centreon)) {
exit();
}
Expand Down Expand Up @@ -170,7 +169,6 @@ function set_header_title() {
}

function initM(_time_reload,_sid,_o){

// INIT Select objects
construct_selecteList_ndo_instance('instance_selected');
construct_HostGroupSelectList('hostgroups_selected');
Expand Down Expand Up @@ -201,7 +199,6 @@ function initM(_time_reload,_sid,_o){
_criticality_id = document.getElementById("critFilter").value;
viewDebugInfo('service criticality: '+document.getElementById("critFilter").value);
}

if (_first){
mainLoop();
_first = 0;
Expand All @@ -213,6 +210,9 @@ function initM(_time_reload,_sid,_o){
}

function goM(_time_reload,_sid,_o){
if (_on == 0) {
return;
}
_lock = 1;
var proc = new Transformation();

Expand All @@ -223,10 +223,10 @@ function goM(_time_reload,_sid,_o){
document.getElementById("output_search").value = _output_search;
_counter += 1;
}

var statusService = jQuery.trim(jQuery('#statusService').val());
var statusFilter = jQuery.trim(jQuery('#statusFilter').val());

proc.setCallback(monitoringCallBack);
proc.setXml(_addrXML+"?"+'&search='+_search+'&search_host='+_host_search+'&search_output='+_output_search+'&num='+_num+'&limit='+_limit+'&sort_type='+_sort_type+'&order='+_order+'&date_time_format_status='+_date_time_format_status+'&o='+_o+'&p='+_p+'&host_name=<?php echo $host_name; ?>'+'&nc='+_nc+'&criticality='+_criticality_id+'&statusService='+statusService+'&statusFilter='+statusFilter+"&sSetOrderInMemory="+sSetOrderInMemory);
proc.setXslt(_addrXSL);
Expand All @@ -235,7 +235,11 @@ function goM(_time_reload,_sid,_o){
}

_lock = 0;
if (_timeoutID) { // Kill next execution if in queue
clearTimeout(_timeoutID);
}
_timeoutID = cycleVisibilityChange('goM("'+ _time_reload +'","'+ _sid +'","'+_o+'")', _time_reload);

_time_live = _time_reload;
_on = 1;

Expand Down

0 comments on commit f41e540

Please sign in to comment.