Merge branch 'ent-10633-pantalla-de-timeout' into 'develop'

Ent 10633 pantalla de timeout

See merge request artica/pandorafms!5600
This commit is contained in:
Matias Didier 2023-03-30 09:01:10 +00:00
commit 6da2d233cc
7 changed files with 35 additions and 6 deletions

View File

@ -704,6 +704,17 @@ $table->data[$i][] = html_print_label_input_block(
)
);
$table->data[$i][] = html_print_label_input_block(
__('Check conexion interval'),
html_print_input_number(
[
'name' => 'check_conexion_interval',
'min' => 90,
'value' => $config['check_conexion_interval'],
]
)
);
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo '<fieldset class="margin-bottom-10">';

View File

@ -386,6 +386,10 @@ function config_update_config()
$error_update[] = __('Enable console report');
}
if (config_update_value('check_conexion_interval', get_parameter('check_conexion_interval'), true) === false) {
$error_update[] = __('Check conexion interval');
}
if (config_update_value('unique_ip', get_parameter('unique_ip'), true) === false) {
$error_update[] = __('Unique IP');
}
@ -2359,6 +2363,10 @@ function config_process_config()
config_update_value('reporting_console_enable', 0);
}
if (!isset($config['check_conexion_interval'])) {
config_update_value('check_conexion_interval', 180);
}
if (!isset($config['elasticsearch_ip'])) {
config_update_value('elasticsearch_ip', '');
}

View File

@ -7076,7 +7076,7 @@ function ui_print_message_dialog($title, $text, $id='', $img='', $text_button=''
echo '<div id="message_dialog_'.$id.'" title="'.$title.'" style="'.$style.'">';
echo '<div class="content_dialog">';
echo '<div class="icon_message_dialog">';
echo html_print_image($img, true, ['alt' => $title, 'border' => 0]);
echo html_print_image($img, true, ['alt' => $title, 'border' => 0, 'class' => 'icon_connection_check']);
echo '</div>';
echo '<div class="content_message_dialog">';
echo '<div class="text_message_dialog">';

View File

@ -4,16 +4,17 @@
* Connection Check
* --------------------------------------
*/
checkConnection(1);
$(document).ready(function() {
checkConnection(get_php_value("check_conexion_interval"));
});
/**
* Performs connection tests every minutes and add connection listeners
* @param {integer} time in minutes
*/
function checkConnection(minutes) {
var cicle = minutes * 60 * 1000;
function checkConnection(seconds) {
var cicle = seconds * 1000;
var checkConnection = setInterval(handleConnection, cicle);
// Connection listeters.
@ -48,7 +49,7 @@ function handleConnection() {
// If test connection file is not found, do not show message.
if (err.status != 404) {
connected = false;
msg = err;
msg = err.statusText;
} else {
connected = true;
}

View File

@ -135,4 +135,6 @@ class Console extends Entity
);
}
}
}

View File

@ -11779,6 +11779,12 @@ span.help_icon_15px > img {
z-index: 1116 !important;
}
.icon_connection_check {
width: 65px !important;
height: 65px !important;
margin-top: 10px;
}
/* ==== Spinner ==== */
.spinner-fixed {
position: fixed;

View File

@ -1487,6 +1487,7 @@ echo html_print_div(
);
// Connection lost alert.
set_js_value('check_conexion_interval', $config['check_conexion_interval']);
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');