From 8cb73da74c3a56c83bf0e8f4d0d6fea501b094d4 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Fri, 10 May 2024 11:54:18 +0300 Subject: [PATCH] update --- .../Filament/Clusters/Microweber/Pages/Version.php | 8 ++++++++ .../views/filament/admin/pages/version.blade.php | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php b/web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php index 15f095b..379eb27 100644 --- a/web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php +++ b/web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php @@ -4,6 +4,7 @@ namespace Modules\Microweber\Filament\Clusters\Microweber\Pages; use App\ShellApi; use Filament\Pages\Page; +use Illuminate\Support\Facades\DB; use MicroweberPackages\ComposerClient\Client; use MicroweberPackages\SharedServerScripts\MicroweberAppPathHelper; use MicroweberPackages\SharedServerScripts\MicroweberDownloader; @@ -35,6 +36,8 @@ class Version extends Page public $supportedLanguages = []; + public $downloadingNow = false; + protected function getViewData(): array { $mwComposerClientHelper = new MicroweberComposerClientHelper(); @@ -48,6 +51,11 @@ class Version extends Page $this->currentVersionOfApp = $sharedPath->getCurrentVersion(); $this->latestDownloadDateOfApp = $sharedPath->getCreatedAt(); + $findJob = DB::table('jobs')->where('payload', 'like', '%DownloadMicroweber%')->get(); + if ($findJob->count() > 0) { + $this->downloadingNow = true; + } + return [ 'appVersion' => $this->currentVersionOfApp, 'latestAppVersion' => $this->latestVersionOfApp, diff --git a/web/Modules/Microweber/resources/views/filament/admin/pages/version.blade.php b/web/Modules/Microweber/resources/views/filament/admin/pages/version.blade.php index 19edca9..1057eb5 100644 --- a/web/Modules/Microweber/resources/views/filament/admin/pages/version.blade.php +++ b/web/Modules/Microweber/resources/views/filament/admin/pages/version.blade.php @@ -35,8 +35,20 @@ Your app and templates is up-to-date! --}} + @if($downloadingNow) +
+ + + + + + + Downloading new app version... +
+ @else Check for updates + @endif