diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index e5ede29b27..7e61cd15ad 100755
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -2719,6 +2719,15 @@ function ui_print_module_status(
* @param string $color Color.
* @param boolean $return Return or paint (if false).
* @param boolean $text Text to be displayed,by default progress %.
+ * @param array $ajax [ 'page' => 'page', 'data' => 'data' ]. Example:
+ * [
+ * 'page' => 'operation/agentes/ver_agente',
+ * 'interval' => 100 / $agent["intervalo"],
+ * 'data' => [
+ * 'id_agente' => $id_agente,
+ * 'refresh_contact' => 1,
+ * ],
+ * ]
*
* @return string HTML code.
*/
@@ -2728,7 +2737,8 @@ function ui_progress(
$height='2.5',
$color='#82b92e',
$return=true,
- $text=''
+ $text='',
+ $ajax=false
) {
if (!$progress) {
$progress = 0;
@@ -2747,10 +2757,56 @@ function ui_progress(
}
ui_require_css_file('progress');
- $output .= '
';
- $output .= '
'.$text.'';
- $output .= '
';
- $output .= '
';
+ $output .= '';
+ $output .= '';
+ $output .= '';
+
+ if ($ajax !== false && is_array($ajax)) {
+ $output .= '';
+ }
if (!$return) {
echo $output;
diff --git a/pandora_console/include/styles/progress.css b/pandora_console/include/styles/progress.css
index ccd75f620a..f263e87fcf 100644
--- a/pandora_console/include/styles/progress.css
+++ b/pandora_console/include/styles/progress.css
@@ -1,18 +1,21 @@
-span.progress_text {
- position: absolute;
- font-family: "lato-bolder", "Open Sans", sans-serif;
- font-size: 2em;
- margin-left: -0.5em;
-}
-
-div.progress_main {
- display: inline-block;
- text-align: center;
+.progress_main {
height: 2.5em;
border: 1px solid #82b92e;
+ position: relative;
+ width: 100%;
+ display: inline-block;
+}
+.progress_main:before {
+ content: attr(data-label);
+ position: absolute;
+ text-align: center;
+ left: 0;
+ right: 0;
+ margin-top: 0.2em;
+ font-family: "lato-bolder", "Open Sans", sans-serif;
}
-div.progress {
+.progress {
width: 0%;
background: #82b92e;
height: 100%;
diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php
index cdf207e455..b7c472e176 100755
--- a/pandora_console/operation/agentes/estado_generalagente.php
+++ b/pandora_console/operation/agentes/estado_generalagente.php
@@ -314,7 +314,16 @@ $data[1] = ui_progress(
1.8,
'#BBB',
true,
- floor(($agent['intervalo'] * (100 - $progress) / 100)).' s'
+ floor(($agent['intervalo'] * (100 - $progress) / 100)).' s',
+ [
+ 'page' => 'operation/agentes/ver_agente',
+ 'interval' => (100 / $agent['intervalo']),
+ 'data' => [
+ 'id_agente' => $id_agente,
+ 'refresh_contact' => 1,
+ ],
+
+ ]
);
if ($progress > 100) {
@@ -739,40 +748,6 @@ if (!empty($network_interfaces)) {
?>