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

Commit

Permalink
fix(monitoring) save filter between pages
Browse files Browse the repository at this point in the history
  • Loading branch information
loiclau authored and ganoze committed Oct 10, 2017
1 parent 07bd63d commit 0501531
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
10 changes: 4 additions & 6 deletions www/include/monitoring/status/Hosts/xml/hostXML.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
$statusHost = $obj->checkArgument("statusHost", $_GET, "");
$statusFilter = $obj->checkArgument("statusFilter", $_GET, "");

/* Store in session the last type of call */
$_SESSION['monitoring_host_status'] = $statusHost;
$_SESSION['monitoring_host_status_filter'] = $statusFilter;

if (isset($_GET['sort_type']) && $_GET['sort_type'] == "host_name") {
$sort_type = "name";
} else {
Expand All @@ -95,12 +99,6 @@
}
$criticality_id = $obj->checkArgument('criticality', $_GET, $obj->defaultCriticality);

/* Store in session the last type of call */
if (isset($_GET['sSetOrderInMemory']) && $_GET['sSetOrderInMemory'] == "1") {
$_SESSION['monitoring_host_status'] = $statusHost;
$_SESSION['monitoring_host_status_filter'] = $statusFilter;
}

/*
* Backup poller selection
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
if (isset($_GET["host_search"])) {
$centreon->historySearch[$url] = $_GET["host_search"];
}

if (isset($_SESSION['monitoring_service_groups'])) {
$sg_search = $_SESSION['monitoring_service_groups'];
}

$aTypeAffichageLevel1 = array(
"svcOVSG" => _("Details"),
"svcSumSG" => _("Summary")
Expand All @@ -69,7 +72,6 @@
"ack_1" => _("Acknowledge"),
"ack_0" => _("Not Acknowledged"),
);


$tab_class = array("0" => "list_one", "1" => "list_two");
$rows = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function mainLoopLocal() {
if ((_currentInputFieldValue.length >= 3 || _currentInputFieldValue.length == 0) && _oldInputFieldValue != _currentInputFieldValue){
if (!_lock) {
set_search_host(escapeURI(_currentInputFieldValue));
_search = _currentInputFieldValue;
_host_search = _currentInputFieldValue;

monitoring_refresh();

Expand All @@ -137,30 +137,29 @@ function initM(_time_reload, _sid, _o ){

// INIT Select objects
construct_selecteList_ndo_instance('instance_selected');
construct_HostGroupSelectList('hostgroups_selected');

if (document.getElementById("host_search") && document.getElementById("host_search").value) {
_host_search = document.getElementById("host_search").value;
viewDebugInfo('search: '+document.getElementById("host_search").value);
} else if (document.getElementById("host_search").value.length === 0) {
viewDebugInfo('search: ' + document.getElementById("host_search").value);
} else if (document.getElementById("host_search").length == 0) {
_host_search = "";
}

if (document.getElementById("sg_search") && document.getElementById("sg_search").value) {
_sg_search = document.getElementById("sg_search").value;
viewDebugInfo('search: '+document.getElementById("sg_search").value);
viewDebugInfo('search: ' + document.getElementById("sg_search").value);
} else if (document.getElementById("sg_search").value.length === 0) {
_sg_search = "";
}
if (_first){

if (_first) {
mainLoopLocal();
_first = 0;
}

_time=<?php echo $time; ?>;
_time =<?php echo $time; ?>;
if (_on) {
goM(_time_reload,_sid,_o);
goM(_time_reload, _sid, _o);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<span class="consol_button"><img id="JS_monitoring_play_gray" src='./img/icons/media_play_gray.png' alt='Play' title='Play'></span>
<span class="consol_button"><a class="" id="JS_monitoring_pause" href="#" onclick="javascript:monitoring_pause('');"><img src='./img/icons/media_pause.png' alt='Pause' title='Pause'></a></span>
<span class="consol_button"><img id="JS_monitoring_pause_gray" class="cachediv" src='./img/icons/media_pause_gray.png' alt='Pause' title='Pause'></span>
<span class="consol_button" id="instance_selected"></span>
</div>
</td>
<td id="pagination1" class="ToolbarPagination"></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/*
* Create XML Request Objects
*/
CentreonSession::start(1);
CentreonSession::start();
$obj = new CentreonXMLBGRequest(session_id(), 1, 1, 0, 1);
$svcObj = new CentreonService($obj->DB);

Expand Down Expand Up @@ -83,6 +83,9 @@
*/
$obj->setInstanceHistory($instance);


$_SESSION['monitoring_service_groups'] = $sgSearch;

/** **********************************************
* Prepare pagination
*/
Expand Down

0 comments on commit 0501531

Please sign in to comment.