mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
#8295 Added ajax call and spinner 2
This commit is contained in:
parent
cacaaa89ae
commit
ae0e4e2826
@ -305,19 +305,23 @@ if ($view_graph) {
|
|||||||
echo "<table id='graph-container' 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>';
|
echo '<tr><td>';
|
||||||
if (!is_ajax()) {
|
if (!is_ajax()) {
|
||||||
echo '<div id="spinner_loading" class="loading invisible">';
|
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);
|
echo html_print_image('images/spinner.gif', true, ['width' => '20px']);
|
||||||
echo __('Loading').'…';
|
echo __('Loading').'…';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
||||||
echo '<div class="w100p height_600px">';
|
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 $graph_return;
|
||||||
|
echo '</div>';
|
||||||
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
if ($stacked == CUSTOM_GRAPH_VBARS) {
|
||||||
echo '<div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</td></tr></table>';
|
echo '</td></tr></table>';
|
||||||
@ -403,6 +407,7 @@ if ($view_graph) {
|
|||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#spinner_loading").hide();
|
||||||
$("#loading").slideUp ();
|
$("#loading").slideUp ();
|
||||||
$("#text-time").timepicker({
|
$("#text-time").timepicker({
|
||||||
showSecond: true,
|
showSecond: true,
|
||||||
@ -431,7 +436,7 @@ if ($view_graph) {
|
|||||||
|
|
||||||
$("#submit-refresh").click(function(e){
|
$("#submit-refresh").click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
$("#spinner_loading").show();
|
||||||
var data = {
|
var data = {
|
||||||
page: "operation/reporting/graph_viewer",
|
page: "operation/reporting/graph_viewer",
|
||||||
view_graph: 1,
|
view_graph: 1,
|
||||||
@ -450,10 +455,9 @@ if ($view_graph) {
|
|||||||
dataType: "html",
|
dataType: "html",
|
||||||
data: data,
|
data: data,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// document.getElementById("graph-container").innerHTML = "";
|
document.getElementById("div-container").innerHTML = "";
|
||||||
// document.getElementById("graph-container").innerHTML = data;
|
$("#spinner_loading").hide();
|
||||||
$("#spinner_loading").show();
|
$("#div-container").append(data);
|
||||||
console.log(data);
|
|
||||||
},
|
},
|
||||||
error: function (data) {
|
error: function (data) {
|
||||||
console.error("Fatal error")
|
console.error("Fatal error")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user