#12067 Aggregated Agents Modules and module group

This commit is contained in:
Jorge Rincon 2023-11-24 12:54:19 +01:00
parent b4e07c8ce7
commit 5213462334
3 changed files with 71 additions and 4 deletions

View File

@ -880,7 +880,7 @@ function mainAgentsModules()
return;
}
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table mrgn_btn_20px">';
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table mrgn_btn_20px" id="agents_modules_table">';
echo '<tr>';

View File

@ -345,6 +345,7 @@ function mainModuleGroups()
$table = new StdClass();
$table->class = 'info_table';
$table->style[0] = 'font-weight: bolder; min-width: 230px;';
$table->id = 'agent_group_module_group';
$table->width = '100%';
$head[0] = __('Groups');

View File

@ -1672,8 +1672,8 @@ require 'include/php_to_js_values.php';
let counter = 0;
$("#keywords").on("click", function(e) {
counter++;
let falEasternEgg = true;
if (counter == 5 && falEasternEgg == true) {
let flagEasternEgg = $("#flagEasternEgg").val();
if (counter == 5 && flagEasternEgg == true) {
easterEggThinkGreen();
}
});
@ -1772,7 +1772,6 @@ require 'include/php_to_js_values.php';
$('#summary_status_groups_detail > tbody > tr > td').each(function(index, fila) {
var hasClassRed = $(fila).hasClass('group_view_crit');
console.log(hasClassRed);
if (hasClassRed) {
$(fila).removeClass('group_view_crit').addClass('group_view_ok');
$(fila).children('a').removeClass('group_view_crit').addClass('group_view_ok');
@ -1798,6 +1797,73 @@ require 'include/php_to_js_values.php';
}
});
// Agents Modules.
$('#agents_modules_table > tbody > tr > td').each(function(index, fila) {
// Change status.
var hasClassRed = $(fila).hasClass('group_view_crit');
var hasClassGrey = $(fila).hasClass('group_view_unk');
if (hasClassRed == true) {
$(fila).removeClass('group_view_crit').addClass('group_view_ok');
$(fila).children('a').removeClass('group_view_crit').addClass('group_view_ok');
} else if (hasClassRed == false) {
var hasClassGroupRed = $(fila).children('a').children('div').attr('style');
if (hasClassGroupRed !== undefined) {
let findedRed = hasClassGroupRed.indexOf('background: #e63c52');
if (findedRed >= 0) {
elementChange.hasClassRed = true;
elementChange.hasClassGrey = false;
elementChange.elementID = $(fila).children('a').children('div');
elementChange.class = false;
setClassGreen(elementChange);
}
}
}
if (hasClassGrey == true) {
$(fila).removeClass('group_view_unk').addClass('group_view_ok');
$(fila).children('a').removeClass('group_view_unk').addClass('group_view_ok');
} else if (hasClassGrey == false) {
var hasClassGroupGrey = $(fila).children('a').children('div').attr('style');
if (hasClassGroupGrey !== undefined) {
let findedGrey = hasClassGroupGrey.indexOf('background: #B2B2B2');
if (findedGrey >= 0) {
elementChange.hasClassRed = false;
elementChange.hasClassGrey = true;
elementChange.elementID = $(fila).children('a').children('div');
elementChange.class = false;
setClassGreen(elementChange);
}
}
}
});
// Combined table of agent group and module group.
$('#agent_group_module_group > tbody > tr > td').each(function(index, fila) {
var hasClassGroupRed = $(fila).children('div').attr('style');
if (hasClassGroupRed !== undefined) {
let findedRed = hasClassGroupRed.indexOf(' background:#e63c52;');
if (findedRed >= 0) {
elementChange.hasClassRed = true;
elementChange.hasClassGrey = false;
elementChange.elementID = $(fila).children('div');
elementChange.class = false;
setClassGreen(elementChange);
}
}
var hasClassGroupGrey = $(fila).children('div').attr('style');
if (hasClassGroupGrey !== undefined) {
let findedGrey = hasClassGroupGrey.indexOf(' background:#B2B2B2;');
if (findedGrey >= 0) {
elementChange.hasClassRed = false;
elementChange.hasClassGrey = true;
elementChange.elementID = $(fila).children('div');
elementChange.class = false;
setClassGreen(elementChange);
}
}
});
}
function setClassGreen(element) {