From 29f5e89acfbbf4f5251262f7f92f8ec31efcd543 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Tue, 29 Oct 2024 11:35:43 +0200 Subject: [PATCH] MOves latest data to data page --- app/pages/data.php | 23 +++++++++++++++++++++++ app/templates/page-sidebar.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/pages/data.php b/app/pages/data.php index 6da0725..16a3c29 100644 --- a/app/pages/data.php +++ b/app/pages/data.php @@ -62,6 +62,29 @@ $agentObject = new Agent($dbWeb); include '../app/templates/graphs-combined.php'; break; + case 'latest': + $latestJvbConferences = $agentObject->getLatestData($platform_id, 'jvb', 'conferences'); + $latestJvbParticipants = $agentObject->getLatestData($platform_id, 'jvb', 'participants'); + $latestJicofoConferences = $agentObject->getLatestData($platform_id, 'jicofo', 'conferences'); + $latestJicofoParticipants = $agentObject->getLatestData($platform_id, 'jicofo', 'participants'); + + $widget['records'] = array(); + + // prepare the widget + $widget['full'] = false; + $widget['name'] = 'LatestData'; + $widget['title'] = 'Latest data from Jilo Agents'; + $widget['collapsible'] = false; + $widget['collapsed'] = false; + $widget['filter'] = false; + if (!empty($latestJvbConferences) && !empty($latestJvbParticipants) && !empty($latestJicofoConferences) && !empty($latestJicofoParticipants)) { + $widget['full'] = true; + } + $widget['pagination'] = true; + + include '../app/templates/latest-data.php'; + break; + case 'configjs': $mode = $_REQUEST['mode'] ?? ''; $raw = ($mode === 'raw'); diff --git a/app/templates/page-sidebar.php b/app/templates/page-sidebar.php index 2061380..505240b 100644 --- a/app/templates/page-sidebar.php +++ b/app/templates/page-sidebar.php @@ -45,7 +45,7 @@ $timeNow = new DateTime('now', new DateTimeZone($userTimezone)); combined graphs - +
  • latest data