Files
root 5476dce882 Add multi-step radio wizard with Shoutcast/Icecast/AzureCast support and multi-language translations
- New 5-step RadioWizardController with session-based wizard flow
- Enhanced RadioStreamService with Shoutcast/Icecast/ AzureCast auto-detection
- Connection test functionality for stream, now-playing, and listeners
- Wizard views for all 5 steps with step indicator navigation
- All 21 language files updated with wizard translation keys (NL/EN + placeholders)
- Wizard link added to existing radio setup page
- Routes registered under /admin/radio/wizard/*
2026-05-24 13:12:57 +02:00

153 lines
9.9 KiB
PHP
Executable File

@extends('layouts.app')
@section('title', __('radio.wizard.title') . ' - ' . __('radio.wizard.step_short') . ' 3 - ' . config('app.name'))
@push('styles')
<style>
.wizard-container { max-width: 900px; margin: 0 auto; padding: 2rem; }
.wizard-card { background: white; border-radius: 16px; padding: 2.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.08); margin-bottom: 2rem; }
.wizard-header { text-align: center; margin-bottom: 2.5rem; }
.wizard-title { font-size: 2rem; font-weight: 800; color: #1a202c; margin-bottom: 0.5rem; }
.wizard-subtitle { color: #4a5568; font-size: 1.1rem; }
.steps-indicator { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 2.5rem; }
.step-dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.step-dot.active { background: #eeb425; color: white; }
.step-dot.inactive { background: #e2e8f0; color: #a0aec0; }
.step-dot.completed { background: #38a169; color: white; }
.step-line { width: 60px; height: 3px; align-self: center; border-radius: 2px; }
.step-line.active { background: #eeb425; }
.step-line.inactive { background: #e2e8f0; }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; color: #2d3748; margin-bottom: 0.5rem; }
.form-input { width: 100%; padding: 0.85rem 1rem; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 1rem; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: #eeb425; box-shadow: 0 0 0 3px rgba(238,180,37,0.1); }
.form-hint { color: #718096; font-size: 0.85rem; margin-top: 0.3rem; }
.toggle-group { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f7fafc; border-radius: 10px; margin-bottom: 1rem; }
.toggle { position: relative; width: 50px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #cbd5e0; border-radius: 26px; transition: 0.3s; }
.toggle-slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .toggle-slider { background: #38a169; }
.toggle input:checked + .toggle-slider:before { transform: translateX(24px); }
.toggle-label { font-weight: 500; color: #2d3748; }
.btn-wizard { background: linear-gradient(135deg, #eeb425, #d4a52a); color: #1a202c; padding: 0.85rem 2rem; border: none; border-radius: 10px; font-weight: 700; font-size: 1.1rem; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 12px rgba(238,180,37,0.3); text-decoration: none; display: inline-block; }
.btn-wizard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(238,180,37,0.4); }
.btn-secondary { background: #e2e8f0; color: #4a5568; padding: 0.85rem 2rem; border: none; border-radius: 10px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-block; }
.btn-secondary:hover { background: #cbd5e0; }
.detected-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; margin-left: 0.5rem; }
.detected-badge.success { background: #f0fff4; color: #38a169; }
.detected-badge.missing { background: #fff5f5; color: #e53e3e; }
.detected-badge.info { background: #ebf8ff; color: #3182ce; }
</style>
@endpush
@section('content')
<div class="wizard-container">
<div class="wizard-header">
<h1 class="wizard-title">🔌 {{ __('radio.wizard.step3_title') }}</h1>
<p class="wizard-subtitle">{{ __('radio.wizard.step_prefix') }} 3 {{ __('radio.wizard.of') }} 5 - {{ __('radio.wizard.step3_subtitle') }}</p>
</div>
<div class="steps-indicator">
<div class="step-dot completed"></div>
<div class="step-line active"></div>
<div class="step-dot completed"></div>
<div class="step-line active"></div>
<div class="step-dot active">3</div>
<div class="step-line inactive"></div>
<div class="step-dot inactive">4</div>
<div class="step-line inactive"></div>
<div class="step-dot inactive">5</div>
</div>
<div style="display: flex; justify-content: center; gap: 3.5rem; margin-top: -1.5rem; margin-bottom: 1rem; font-size: 0.75rem; color: #718096;">
<span style="color: #38a169;"> {{ __('radio.wizard.step1_label') }}</span>
<span style="color: #38a169;"> {{ __('radio.wizard.step2_label') }}</span>
<span style="color: #eeb425; font-weight: 600;">{{ __('radio.wizard.step3_label') }}</span>
<span>{{ __('radio.wizard.step4_label') }}</span>
<span>{{ __('radio.wizard.step5_label') }}</span>
</div>
<div class="wizard-card">
@if($autoDetected && $autoDetected['detected'])
<div style="background: #f0fff4; border: 1px solid #38a169; border-radius: 10px; padding: 1rem 1.5rem; margin-bottom: 2rem;">
<div style="display: flex; align-items: center; gap: 0.75rem;">
<span style="font-size: 1.5rem;"></span>
<div>
<strong style="color: #2f855a;">{{ ucfirst($autoDetected['type']) }} {{ __('radio.wizard.detected') }}</strong>
<p style="color: #4a5568; margin: 0; font-size: 0.9rem;">{{ __('radio.wizard.detected_desc') }}</p>
</div>
</div>
</div>
@elseif($autoDetected)
<div style="background: #fff5f5; border: 1px solid #fc8181; border-radius: 10px; padding: 1rem 1.5rem; margin-bottom: 2rem;">
<div style="display: flex; align-items: center; gap: 0.75rem;">
<span style="font-size: 1.5rem;">⚠️</span>
<div>
<strong style="color: #c53030;">{{ __('radio.wizard.not_detected') }}</strong>
<p style="color: #4a5568; margin: 0; font-size: 0.9rem;">{{ __('radio.wizard.not_detected_desc') }}</p>
</div>
</div>
</div>
@endif
<form action="{{ route('admin.radio.wizard.process-step-3') }}" method="POST">
@csrf
<div class="toggle-group">
<label class="toggle">
<input type="hidden" name="enable_now_playing" value="0">
<input type="checkbox" name="enable_now_playing" value="1" {{ $enableNowPlaying ? 'checked' : '' }}>
<span class="toggle-slider"></span>
</label>
<span class="toggle-label">{{ __('radio.wizard.enable_now_playing') }}</span>
</div>
<div class="form-group">
<label class="form-label" for="now_playing_api">{{ __('radio.wizard.now_playing_api_label') }}</label>
<input type="url" name="now_playing_api" id="now_playing_api" class="form-input" value="{{ old('now_playing_api', $nowPlayingApi) }}" placeholder="https://server.example.com/api/nowplaying">
<div class="form-hint">{{ __('radio.wizard.now_playing_api_hint') }}</div>
</div>
<div class="toggle-group">
<label class="toggle">
<input type="hidden" name="enable_listeners" value="0">
<input type="checkbox" name="enable_listeners" value="1" {{ $enableListeners ? 'checked' : '' }}>
<span class="toggle-slider"></span>
</label>
<span class="toggle-label">{{ __('radio.wizard.enable_listeners') }}</span>
</div>
<div class="form-group">
<label class="form-label" for="listeners_api">{{ __('radio.wizard.listeners_api_label') }}</label>
<input type="url" name="listeners_api" id="listeners_api" class="form-input" value="{{ old('listeners_api', $listenersApi) }}" placeholder="https://server.example.com/api/listeners">
<div class="form-hint">{{ __('radio.wizard.listeners_api_hint') }}</div>
</div>
<div class="toggle-group">
<label class="toggle">
<input type="hidden" name="enable_current_dj" value="0">
<input type="checkbox" name="enable_current_dj" value="1" {{ $enableCurrentDj ? 'checked' : '' }}>
<span class="toggle-slider"></span>
</label>
<span class="toggle-label">{{ __('radio.wizard.enable_current_dj') }}</span>
</div>
@if ($errors->any())
<div style="background: #fff5f5; border: 1px solid #fc8181; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem;">
<ul style="color: #c53030; margin: 0; padding-left: 1.5rem;">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div style="display: flex; justify-content: space-between;">
<a href="{{ route('admin.radio.wizard.step', ['step' => 2]) }}" class="btn-secondary"> {{ __('radio.wizard.previous_step') }}</a>
<button type="submit" class="btn-wizard">{{ __('radio.wizard.next_step') }} </button>
</div>
</form>
</div>
</div>
@endsection