From 1599bc4c1457d80448a95552f75f714560de5053 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 13 Sep 2020 07:32:49 -0500 Subject: [PATCH] load stats on deman via ajax --- web/ajax/stats.php | 24 ++++++++++++++++++++++++ web/skins/classic/views/frames.php | 11 ----------- web/skins/classic/views/js/frames.js | 12 +++++++++--- 3 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 web/ajax/stats.php diff --git a/web/ajax/stats.php b/web/ajax/stats.php new file mode 100644 index 000000000..3789ff448 --- /dev/null +++ b/web/ajax/stats.php @@ -0,0 +1,24 @@ + diff --git a/web/skins/classic/views/frames.php b/web/skins/classic/views/frames.php index 9f86866e7..3c2ad9277 100644 --- a/web/skins/classic/views/frames.php +++ b/web/skins/classic/views/frames.php @@ -206,15 +206,4 @@ if ( count($frames) ) { - - - diff --git a/web/skins/classic/views/js/frames.js b/web/skins/classic/views/js/frames.js index 8b3ff28ec..2fd96b8d4 100644 --- a/web/skins/classic/views/js/frames.js +++ b/web/skins/classic/views/js/frames.js @@ -25,10 +25,16 @@ function processClicks(event, field, value, row, $element) { } } -function detailFormatter(index, row, element) { - return $j(element).html($j('#contentStatsTable'+index).clone(true).show()); +// This function handles when the user clicks a "+" link to retrieve stats for a frame +function detailFormatter(index, row, $detail) { + $detail.html('Please wait. Loading from ajax request...'); + $j.get(thisUrl + '?request=stats&eid=' + row.EventId + '&fid=' + row.FrameId + '&row=' + index) + .done(function(data){ $detail.html(data.html) }) + .fail(function(jqxhr, textStatus, error) { + console.log("Request Failed: " + textStatus + ", " + error); + console.log("Response Text: " + jqxhr.responseText); + }); } - function initPage() { var backBtn = $j('#backBtn'); var table = $j('#framesTable');