Skip to content

Commit 2e76515

Browse files
authored
[Chore] Added deprecated image warning to admin panel (alexjustesen#1380)
1 parent d02452d commit 2e76515

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ RUN apt-get update \
2020
\
2121
# Clean up package lists
2222
&& apt-get clean \
23-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
23+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
24+
# Add deprecated image file
25+
&& touch /var/html/www/storage/app/public/.deprecated_image
2426

2527
# Copy package configs
2628
COPY --chmod=755 docker/deploy/etc /etc

app/Filament/Pages/Dashboard.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Filament\Pages;
44

55
use App\Actions\Speedtests\RunOoklaSpeedtest;
6+
use App\Filament\Widgets\DeprecatedImage;
67
use App\Filament\Widgets\RecentDownloadChartWidget;
78
use App\Filament\Widgets\RecentDownloadLatencyChartWidget;
89
use App\Filament\Widgets\RecentJitterChartWidget;
@@ -64,6 +65,7 @@ protected function getHeaderActions(): array
6465
protected function getHeaderWidgets(): array
6566
{
6667
return [
68+
DeprecatedImage::make(),
6769
StatsOverviewWidget::make(),
6870
RecentDownloadChartWidget::make(),
6971
RecentUploadChartWidget::make(),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Filament\Widgets;
4+
5+
use Filament\Widgets\Widget;
6+
use Illuminate\Support\Facades\Storage;
7+
8+
class DeprecatedImage extends Widget
9+
{
10+
protected static string $view = 'filament.widgets.deprecated-image';
11+
12+
protected int|string|array $columnSpan = 'full';
13+
14+
public static function canView(): bool
15+
{
16+
return Storage::disk('public')->exists('.deprecated_image');
17+
}
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<x-filament-widgets::widget>
2+
<x-filament::section icon="heroicon-o-exclamation-triangle" icon-color="danger" icon-size="md">
3+
<x-slot name="heading">
4+
Docker Image Deprecated
5+
</x-slot>
6+
7+
<div class="text-sm font-medium text-gray-500 dark:text-gray-400">
8+
<p>
9+
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
10+
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.
11+
</p>
12+
</div>
13+
</x-filament::section>
14+
</x-filament-widgets::widget>

0 commit comments

Comments
 (0)