Add radio embed widget, SSE real-time, song history, moderation panel, and Auto DJ

- Embed widget: standalone iframe player with dark/light/transparent themes, copy-paste embed code admin page
- Real-time SSE: streaming now-playing/listeners/dj events, replaces polling in radio-player and embed
- Song history: auto-records song changes to radio_song_plays table, Filament resource to view
- DJ moderation: unified panel for shouts approval, song request queue, DJ applications
- Auto DJ: playlist management with round-robin playback when no DJ is live
- Refactored radio-player Alpine component to use EventSource API with auto-reconnect
This commit is contained in:
root
2026-05-24 14:07:32 +02:00
parent 5476dce882
commit 0c6c558a59
32 changed files with 2236 additions and 29 deletions
+38 -1
View File
@@ -83,6 +83,12 @@ final class RadioSettings extends Page implements HasForms
'radio_widget_enabled' => $this->getSettingBool('radio_widget_enabled'),
'radio_widget_show_globally' => $this->getSettingBool('radio_widget_show_globally'),
'radio_widget_position' => $this->getSetting('radio_widget_position', 'bottom-right'),
'radio_embed_enabled' => $this->getSettingBool('radio_embed_enabled'),
'radio_embed_allowed_domains' => $this->getSetting('radio_embed_allowed_domains', ''),
'radio_embed_theme' => $this->getSetting('radio_embed_theme', 'dark'),
'radio_embed_height' => (int) $this->getSetting('radio_embed_height', '400'),
'radio_embed_width' => $this->getSetting('radio_embed_width', '100%'),
'radio_embed_auto_play' => $this->getSettingBool('radio_embed_auto_play'),
'radio_shouts_enabled' => $this->getSettingBool('radio_shouts_enabled'),
'radio_shouts_max_length' => (int) $this->getSetting('radio_shouts_max_length', '280'),
'radio_shouts_cooldown' => (int) $this->getSetting('radio_shouts_cooldown', '30'),
@@ -626,6 +632,32 @@ final class RadioSettings extends Page implements HasForms
'top-left' => 'Links Boven',
])
->default('bottom-right'),
Toggle::make('radio_embed_enabled')
->label('Externe Embed Inschakelen')
->columnSpanFull()
->helperText('Sta toe dat de radio als iframe op externe sites wordt geplaatst.'),
TextInput::make('radio_embed_allowed_domains')
->label('Toegestane Domeinen')
->placeholder('voorbeeld.nl, anderedomein.com')
->helperText('Komma-gescheiden lijst. Leeg = alle domeinen toegestaan.'),
Select::make('radio_embed_theme')
->label('Embed Thema')
->options([
'dark' => 'Donker',
'light' => 'Licht',
'transparent' => 'Transparant',
])
->default('dark'),
TextInput::make('radio_embed_height')
->label('Embed Hoogte (px)')
->numeric()
->default(400),
TextInput::make('radio_embed_width')
->label('Embed Breedte')
->placeholder('100% of 400px')
->default('100%'),
Toggle::make('radio_embed_auto_play')
->label('Auto-Play in Embed'),
]),
Section::make('Offline Pagina')
->description('Instellingen voor wanneer de radio offline is')
@@ -890,6 +922,9 @@ final class RadioSettings extends Page implements HasForms
$this->saveSettings([
'radio_widget_enabled', 'radio_widget_show_globally',
'radio_widget_position',
'radio_embed_enabled', 'radio_embed_allowed_domains',
'radio_embed_theme', 'radio_embed_height',
'radio_embed_width', 'radio_embed_auto_play',
]);
}
@@ -1475,7 +1510,8 @@ final class RadioSettings extends Page implements HasForms
'radio_stats_show_weekly', 'radio_stats_show_monthly',
'radio_stats_show_top_djs', 'radio_stats_show_top_songs',
'radio_show_offline_message', 'radio_widget_enabled',
'radio_widget_show_globally', 'radio_applications_enabled',
'radio_widget_show_globally', 'radio_embed_enabled',
'radio_embed_auto_play', 'radio_applications_enabled',
'radio_applications_require_approval', 'radio_discord_enabled',
'radio_discord_dj_live', 'radio_discord_song_changes',
'radio_listener_alerts_enabled', 'radio_azurecast_use_proxy',
@@ -1488,6 +1524,7 @@ final class RadioSettings extends Page implements HasForms
'radio_dj_avatar_size', 'radio_dj_detection_interval',
'radio_shouts_max_length', 'radio_shouts_cooldown',
'radio_chat_width', 'radio_chat_height', 'radio_chat_messages_count',
'radio_embed_height',
'radio_request_max_per_user', 'radio_request_cooldown',
'radio_min_listeners_threshold', 'radio_listener_alert_threshold_high',
'radio_listener_alert_threshold_low', 'radio_applications_max_per_day',