diff --git a/app/Livewire/RealtimeConnection.php b/app/Livewire/RealtimeConnection.php new file mode 100644 index 000000000..59fb12ca4 --- /dev/null +++ b/app/Livewire/RealtimeConnection.php @@ -0,0 +1,25 @@ +user()->update(['is_notification_realtime_enabled' => false]); + $this->showNotification = false; + } + public function mount() { + $isRoot = auth()->user()->id === 0; + $showNotification = data_get(auth()->user(), 'is_notification_realtime_enabled'); + $this->checkConnection = $isRoot && $showNotification; + } +} diff --git a/database/migrations/2023_12_11_103611_add_realtime_connection_problem.php b/database/migrations/2023_12_11_103611_add_realtime_connection_problem.php new file mode 100644 index 000000000..285e2f457 --- /dev/null +++ b/database/migrations/2023_12_11_103611_add_realtime_connection_problem.php @@ -0,0 +1,28 @@ +boolean('is_notification_realtime_enabled')->default(true); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('is_notification_realtime_enabled'); + }); + } +}; diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1e7141dec..ee2101449 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -8,34 +8,10 @@ @endpersist + @auth + + @endauth
{{ $slot }}
- @endsection diff --git a/resources/views/livewire/realtime-connection.blade.php b/resources/views/livewire/realtime-connection.blade.php new file mode 100644 index 000000000..46e3a1dfc --- /dev/null +++ b/resources/views/livewire/realtime-connection.blade.php @@ -0,0 +1,36 @@ +
+ @if ($checkConnection) + @script + + @endscript +
+
+ WARNING: Coolify could not connect to the new realtime service introduced in beta.154.
This will cause unusual problems on the UI if not fixed!

Please check the + related documentation or get + help on Discord.
+ Acknowledge the problem and disable this popup +
+
+ @endif +