in geode-pulse/src/main/webapp/scripts/pulsescript/common.js [1013:1175]
function(data) {
$('#pageNumber').val(data.pageNumber);
var recordCount = parseInt(data.pageNumber) * 100;
if ($("#allAlertScrollPane").hasClass("hide-scroll-pane"))
$("#allAlertScrollPane").removeClass("hide-scroll-pane");
var errorAlertsList = data.systemAlerts.errors;
var severeAlertsList = data.systemAlerts.severe;
var warningAlertsList = data.systemAlerts.warnings;
var infoAlertsList = data.systemAlerts.info;
var allListHTML = "";
var allCount = 1;
if (severeAlertsList != null && severeAlertsList != undefined) {
if ($("#severeAlertScrollPane").hasClass("hide-scroll-pane"))
$("#severeAlertScrollPane").removeClass("hide-scroll-pane");
document.getElementById("severeTotalCount").innerHTML = severeAlertsList.length
.toString();
// update global count
numTotalSeverAlerts = severeAlertsList.length;
var severeListHTML = "";
var severeCount = 1;
for ( var i = numTotalSeverAlerts - 1; i >= 0; i--) {
if (severeCount <= recordCount) {
severeListHTML = severeListHTML
+ generateNotificationAlerts(severeAlertsList[i],
"severe");
severeCount++;
severAlerts[severAlerts.length] = severeAlertsList[i];
}
if (allCount <= recordCount) {
allCount++;
allListHTML = severeListHTML;
}
}
document.getElementById("severeList").innerHTML = severeListHTML;
}
if (errorAlertsList != null && errorAlertsList != undefined) {
if ($("#errorAlertScrollPane").hasClass("hide-scroll-pane"))
$("#errorAlertScrollPane").removeClass("hide-scroll-pane");
document.getElementById("errorTotalCount").innerHTML = errorAlertsList.length;
// update global count
numTotalErrorAlerts = errorAlertsList.length;
var errorListHTML = "";
var errorCount = 1;
for ( var i = numTotalErrorAlerts - 1; i >= 0; i--) {
if (errorCount <= recordCount) {
errorListHTML = errorListHTML
+ generateNotificationAlerts(errorAlertsList[i], "error");
errorAlerts[errorAlerts.length] = errorAlertsList[i];
errorCount++;
}
if (allCount <= recordCount) {
allCount++;
allListHTML = allListHTML
+ generateNotificationAlerts(errorAlertsList[i], "error");
}
}
document.getElementById("errorList").innerHTML = errorListHTML;
}
if (warningAlertsList != null && warningAlertsList != undefined) {
if ($("#warningAlertScrollPane").hasClass("hide-scroll-pane"))
$("#warningAlertScrollPane").removeClass("hide-scroll-pane");
document.getElementById("warningTotalCount").innerHTML = warningAlertsList.length;
// update global count
numTotalWarningAlerts = warningAlertsList.length;
var warningListHTML = "";
var warningCount = 1;
for ( var i = numTotalWarningAlerts - 1; i >= 0; i--) {
if (warningCount <= recordCount) {
warningListHTML = warningListHTML
+ generateNotificationAlerts(warningAlertsList[i],
"warning");
warningAlerts[warningAlerts.length] = warningAlertsList[i];
warningCount++;
}
if (allCount <= recordCount) {
allCount++;
allListHTML = allListHTML
+ generateNotificationAlerts(warningAlertsList[i],
"warning");
}
}
document.getElementById("warningList").innerHTML = warningListHTML;
}
if (infoAlertsList != null && infoAlertsList != undefined) {
// update global count
numTotalInfoAlerts = infoAlertsList.length;
var infoCount = 1;
for ( var i = numTotalInfoAlerts - 1; i >= 0; i--) {
if (infoCount <= recordCount) {
infoAlerts[infoAlerts.length] = infoAlertsList[i];
infoCount++;
}
if (allCount <= recordCount) {
allCount++;
allListHTML = allListHTML
+ generateNotificationAlerts(infoAlertsList[i], "info");
}
}
}
// start : for all alerts tab
var allAlertCount = numTotalSeverAlerts + numTotalErrorAlerts
+ numTotalWarningAlerts + numTotalInfoAlerts;
document.getElementById("allAlertCount").innerHTML = allAlertCount
.toString();
// Display Load More only when number of alerts > 100
if (allAlertCount > 100) {
$('#containerLoadMoreAlertsLink').show();
} else {
$('#containerLoadMoreAlertsLink').hide();
}
/*var allAlertHTML = "";
allAlertHTML = allAlertHTML
+ document.getElementById("severeList").innerHTML;
allAlertHTML = allAlertHTML
+ document.getElementById("errorList").innerHTML;
allAlertHTML = allAlertHTML
+ document.getElementById("warningList").innerHTML;*/
document.getElementById("allAlertList").innerHTML = allListHTML;
// end : for all alerts tab
if (severAlerts.length > 0) { // Severe
if ($("#allAlertScrollPane").hasClass("hide-scroll-pane"))
$("#allAlertScrollPane").removeClass("hide-scroll-pane");
$('#clusterStatusText').html("Severe");
$("#clusterStatusIcon").addClass("severeStatus");
} else if (errorAlerts.length > 0) { // Error
if ($("#allAlertScrollPane").hasClass("hide-scroll-pane"))
$("#allAlertScrollPane").removeClass("hide-scroll-pane");
$('#clusterStatusText').html("Error");
$("#clusterStatusIcon").addClass("errorStatus");
} else if (warningAlerts.length > 0) { // Warning
if ($("#allAlertScrollPane").hasClass("hide-scroll-pane"))
$("#allAlertScrollPane").removeClass("hide-scroll-pane");
$('#clusterStatusText').html("Warning");
$("#clusterStatusIcon").addClass("warningStatus");
} else { // Normal
$('#clusterStatusText').html("Normal");
$("#clusterStatusIcon").addClass("normalStatus");
}
$('.scroll-pane').jScrollPane();
}).error(repsonseErrorHandler);