Repository: alexjustesen/speedtest-tracker (language: php)

Issue:
Add notification to admin panel to update the image



Discussion / hints:

Fix patch:
diff --git a/Dockerfile b/Dockerfile
index 7a28b1c80..79f967f02 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,9 @@ RUN apt-get update \
     \
 # Clean up package lists
     && apt-get clean \
-    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
+    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
+# Add deprecated image file
+    && touch /var/html/www/storage/app/public/.deprecated_image
 
 # Copy package configs
 COPY --chmod=755 docker/deploy/etc /etc
diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php
index 36f5def65..b45aee80d 100644
--- a/app/Filament/Pages/Dashboard.php
+++ b/app/Filament/Pages/Dashboard.php
@@ -3,6 +3,7 @@
 namespace App\Filament\Pages;
 
 use App\Actions\Speedtests\RunOoklaSpeedtest;
+use App\Filament\Widgets\DeprecatedImage;
 use App\Filament\Widgets\RecentDownloadChartWidget;
 use App\Filament\Widgets\RecentDownloadLatencyChartWidget;
 use App\Filament\Widgets\RecentJitterChartWidget;
@@ -64,6 +65,7 @@ protected function getHeaderActions(): array
     protected function getHeaderWidgets(): array
     {
         return [
+            DeprecatedImage::make(),
             StatsOverviewWidget::make(),
             RecentDownloadChartWidget::make(),
             RecentUploadChartWidget::make(),
diff --git a/app/Filament/Widgets/DeprecatedImage.php b/app/Filament/Widgets/DeprecatedImage.php
new file mode 100644
index 000000000..8e5f7886b
--- /dev/null
+++ b/app/Filament/Widgets/DeprecatedImage.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Filament\Widgets;
+
+use Filament\Widgets\Widget;
+use Illuminate\Support\Facades\Storage;
+
+class DeprecatedImage extends Widget
+{
+    protected static string $view = 'filament.widgets.deprecated-image';
+
+    protected int|string|array $columnSpan = 'full';
+
+    public static function canView(): bool
+    {
+        return Storage::disk('public')->exists('.deprecated_image');
+    }
+}
diff --git a/resources/views/filament/widgets/deprecated-image.blade.php b/resources/views/filament/widgets/deprecated-image.blade.php
new file mode 100644
index 000000000..f4d2e5eb2
--- /dev/null
+++ b/resources/views/filament/widgets/deprecated-image.blade.php
@@ -0,0 +1,14 @@
+<x-filament-widgets::widget>
+    <x-filament::section icon="heroicon-o-exclamation-triangle" icon-color="danger" icon-size="md">
+        <x-slot name="heading">
+            Docker Image Deprecated
+        </x-slot>
+
+        <div class="text-sm font-medium text-gray-500 dark:text-gray-400">
+            <p>
+                The Docker image you're using has been deprecated and will be replaced in <code>v0.20.0</code>. To upgrade to the new image
+                follow the steps in the <x-filament::link href="https://github.com/alexjustesen/speedtest-tracker/issues/1117" target="_blank" rel="nofollow">GitHub issue</x-filament::link> to continue to receive updates.
+            </p>
+        </div>
+    </x-filament::section>
+</x-filament-widgets::widget>


Test patch: