Merge branch 'ent-12539-mostrar-dialogo-con-retardo-de-cierre-en-vista-ppal-de-agente' into 'develop'
Ent 12539 mostrar dialogo con retardo de cierre en vista ppal de agente See merge request artica/pandorafms!6807
This commit is contained in:
commit
30f6e9ea36
|
@ -988,6 +988,10 @@ select:-internal-list-box {
|
|||
display: flex;
|
||||
}
|
||||
|
||||
.flex_important {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
.flex-row-important {
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
|
|
|
@ -535,6 +535,21 @@ echo '</div>';
|
|||
|
||||
ui_require_css_file('cluetip', 'include/styles/js/');
|
||||
ui_require_jquery_file('cluetip');
|
||||
|
||||
$system_higher = false;
|
||||
$modules_agent = db_get_all_rows_sql(sprintf('SELECT id_agente FROM tagente_modulo WHERE id_agente = %s', $id_agente));
|
||||
if (is_array($modules_agent)) {
|
||||
$all_modules = db_get_all_rows_sql('SELECT id_agente FROM tagente_modulo');
|
||||
$all_agents = db_get_all_rows_sql('SELECT id_agente FROM tagente');
|
||||
if (is_array($all_modules) && is_array($all_agents)) {
|
||||
if ((count($all_modules) / count($all_agents)) >= 200) {
|
||||
$system_higher = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '<div id="system_higher" class="invisible_important agent_details_agent_data flex_important"><img src="images/alert-yellow@svg.svg" width="10%" class="mrgn_right_20px">'.__('Your system has a much higher rate of modules per agent than recommended (200 modules per agent). This implies performance problems in the system, please consider reducing the number of modules in this agent.').'</div>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -607,6 +622,36 @@ $('table.alert-status-filter #ag_group').change (function () {
|
|||
}
|
||||
}).change();
|
||||
|
||||
<?php if ($system_higher === true) { ?>
|
||||
$("#system_higher").dialog({
|
||||
title: "<?php echo __('Warning'); ?>",
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
width: 500,
|
||||
height: 150,
|
||||
buttons: [{
|
||||
text: "OK",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
class: 'invisible_important',
|
||||
}],
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
closeOnEscape: false,
|
||||
open: function(event, ui) {
|
||||
$(".ui-dialog-titlebar-close").hide();
|
||||
$("#system_higher").removeClass('invisible_important');
|
||||
setTimeout(() => {
|
||||
$(".ui-dialog-buttonset").find('button').removeClass('invisible_important');
|
||||
}, 4000);
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
function validateAlerts() {
|
||||
var alert_ids = [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue