From 05775abcb2b83d796fc0a58fa584a388fb8cc736 Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Mon, 18 Nov 2024 15:12:08 +0100 Subject: [PATCH] Waiting page: activate for Nightly. Make it hideable. --- app/classes/ReleaseInsights/Request.php | 4 ++++ app/models/nightly.php | 5 ++++- app/views/waiting_page.html.php | 30 ++++++++++++------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/classes/ReleaseInsights/Request.php b/app/classes/ReleaseInsights/Request.php index abf21b3..8e7661d 100644 --- a/app/classes/ReleaseInsights/Request.php +++ b/app/classes/ReleaseInsights/Request.php @@ -119,6 +119,7 @@ public function cleanPath(string $path): string public static function waitingPage(string $action): void { if ($action == 'load') { + // This is a long-running process when we fetch and generate data set_time_limit(0); // We need to set the encoding or the browser will wait to parse the content @@ -137,6 +138,9 @@ public static function waitingPage(string $action): void // heavy processing is done, let the browser refresh the page echo ''; exit; + } elseif ($action == 'hide') { + // heavy processing is done, let the browser refresh the page + echo ''; } } } diff --git a/app/models/nightly.php b/app/models/nightly.php index de8b0b0..7575919 100644 --- a/app/models/nightly.php +++ b/app/models/nightly.php @@ -3,7 +3,9 @@ declare(strict_types=1); use BzKarma\Scoring; -use ReleaseInsights\{Bugzilla, Json, URL, Utils}; +use ReleaseInsights\{Bugzilla, Json, URL, Request, Utils}; + +Request::waitingPage('load'); /* We need previous and next days for navigation and changelog @@ -237,6 +239,7 @@ } } +Request::waitingPage('hide'); return [ $display_date, $nightly_pairs, diff --git a/app/views/waiting_page.html.php b/app/views/waiting_page.html.php index 121d325..37aa1fb 100644 --- a/app/views/waiting_page.html.php +++ b/app/views/waiting_page.html.php @@ -2,19 +2,19 @@ // This is a pure old-schol PHP template as the waiting page doesn't depend on Twig ?> - + - Processing data…