Merge branch 'ent-8295-Meter-spinner-en-visualizador-de-graficas-combinadas' into 'develop'
Ent 8295 meter spinner en visualizador de graficas combinadas See merge request artica/pandorafms!4563
This commit is contained in:
commit
7c09ce1a6d
|
@ -246,6 +246,7 @@ if ($view_graph) {
|
|||
];
|
||||
}
|
||||
|
||||
if (!is_ajax()) {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$graph['name'],
|
||||
|
@ -265,6 +266,7 @@ if ($view_graph) {
|
|||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$width = null;
|
||||
$height = null;
|
||||
|
@ -294,16 +296,32 @@ if ($view_graph) {
|
|||
$params_combined
|
||||
);
|
||||
|
||||
if (is_ajax()) {
|
||||
echo $graph_return;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($graph_return) {
|
||||
echo "<table class='databox filters' cellpadding='0' cellspacing='0' width='100%'>";
|
||||
echo "<table id='graph-container' class='databox filters' cellpadding='0' cellspacing='0' width='100%'>";
|
||||
echo '<tr><td>';
|
||||
if (!is_ajax()) {
|
||||
echo '<div id="spinner_loading" class="loading invisible" style="display:flex;flex-direction:column-reverse;justify-content:center;align-items:center">';
|
||||
echo html_print_image('images/spinner.gif', true, ['width' => '20px']);
|
||||
echo __('Loading').'…';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
||||
echo '<div class="w100p height_600px">';
|
||||
echo '<div id="div-container" class="w100p height_600px">';
|
||||
} else {
|
||||
echo '<div id="div-container">';
|
||||
}
|
||||
|
||||
echo $graph_return;
|
||||
echo '</div>';
|
||||
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
||||
echo '<div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</td></tr></table>';
|
||||
|
@ -316,12 +334,12 @@ if ($view_graph) {
|
|||
}
|
||||
|
||||
$period_label = human_time_description_raw($period);
|
||||
echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph'>";
|
||||
echo '<form method="POST" action="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph">';
|
||||
echo "<table class='databox filters w100p' cellpadding='4' cellspacing='4'>";
|
||||
echo '<tr>';
|
||||
|
||||
echo '<td>';
|
||||
echo '<b>'.__('Date').'</b>'.' ';
|
||||
echo '<b>'.__('Date').'</b>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td>';
|
||||
|
@ -372,15 +390,17 @@ if ($view_graph) {
|
|||
echo '</td>';
|
||||
|
||||
echo "<td class='datos'>";
|
||||
echo "<input type=submit value='".__('Refresh')."' class='sub upd'>";
|
||||
echo "<input id='submit-refresh' type=submit value='".__('Refresh')."' class='sub upd'>";
|
||||
echo '</td>';
|
||||
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
|
||||
/*
|
||||
We must add javascript here. Otherwise, the date picker won't
|
||||
work if the date is not correct because php is returning. */
|
||||
work if the date is not correct because php is returning.
|
||||
*/
|
||||
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
|
@ -389,6 +409,7 @@ if ($view_graph) {
|
|||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
$("#spinner_loading").hide();
|
||||
$("#loading").slideUp ();
|
||||
$("#text-time").timepicker({
|
||||
showSecond: true,
|
||||
|
@ -415,6 +436,40 @@ if ($view_graph) {
|
|||
$("#thresholdDiv").hide();
|
||||
}
|
||||
|
||||
$("#submit-refresh").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#spinner_loading").show();
|
||||
var data = {
|
||||
page: "operation/reporting/graph_viewer",
|
||||
view_graph: 1,
|
||||
id: '<?php echo $id_graph; ?>',
|
||||
zoom: $('#zoom').val(),
|
||||
date: $('#text-date').val(),
|
||||
time: $('#text-time').val(),
|
||||
period: $('select[id^=period][id$=select]').val(),
|
||||
stacked: $('#stacked').val(),
|
||||
}
|
||||
|
||||
if (data['stacked'] == 4 && $('#checkbox-threshold').is(':checked')) {
|
||||
data['threshold'] = 1;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
dataType: "html",
|
||||
data: data,
|
||||
success: function (data) {
|
||||
document.getElementById("div-container").innerHTML = "";
|
||||
$("#spinner_loading").hide();
|
||||
$("#div-container").append(data);
|
||||
},
|
||||
error: function (data) {
|
||||
console.error("Fatal error")
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
@ -442,7 +497,7 @@ if ($view_graph) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(__('Reporting').' » '.__('Custom graph viewer'), 'images/op_reporting.png', false, '', false, '');
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue