Skip to content

Commit

Permalink
[Chore] Added deprecated image warning to admin panel (#1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjustesen authored Apr 15, 2024
1 parent d02452d commit 2e76515
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -64,6 +65,7 @@ protected function getHeaderActions(): array
protected function getHeaderWidgets(): array
{
return [
DeprecatedImage::make(),
StatsOverviewWidget::make(),
RecentDownloadChartWidget::make(),
RecentUploadChartWidget::make(),
Expand Down
18 changes: 18 additions & 0 deletions app/Filament/Widgets/DeprecatedImage.php
Original file line number Diff line number Diff line change
@@ -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');
}
}
14 changes: 14 additions & 0 deletions resources/views/filament/widgets/deprecated-image.blade.php
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 2e76515

Please sign in to comment.