Enable app after onboarding

This commit is contained in:
myrmidex 2025-07-10 11:32:07 +02:00
parent 76d642b8ee
commit 761d50706a
4 changed files with 73 additions and 2 deletions

View file

@ -74,7 +74,9 @@ public function complete(): View|RedirectResponse
return redirect()->route('onboarding.index');
}
return view('onboarding.complete');
$systemStatus = resolve(SystemStatusService::class)->getSystemStatus();
return view('onboarding.complete', compact('systemStatus'));
}
private function needsOnboarding(): bool

View file

@ -24,6 +24,12 @@ public function update(Request $request): RedirectResponse
Setting::setArticleProcessingEnabled($request->boolean('article_processing_enabled'));
// If redirected from onboarding, go to dashboard
if ($request->get('from') === 'onboarding') {
return redirect()->route('onboarding.index')
->with('success', 'System activated successfully! Welcome to Lemmy Poster.');
}
return redirect()->route('settings.index')
->with('success', 'Settings updated successfully.');
}

View file

@ -12,7 +12,7 @@
</div>
<h1 class="text-3xl font-bold text-gray-900 mb-2">Setup Complete!</h1>
<p class="text-gray-600 mb-6">
Great! You've successfully configured Lemmy Poster. Your feeds will now be monitored and articles will be automatically posted to your configured channels.
Great! You've successfully configured Lemmy Poster. Now activate the system to start monitoring feeds and posting articles.
</p>
</div>
@ -24,6 +24,63 @@
<div class="w-6 h-6 bg-green-500 text-white rounded-full flex items-center justify-center text-xs font-semibold"></div>
</div>
<!-- System Activation Section -->
<div class="mb-8">
<div class="bg-white border-2 border-gray-200 rounded-lg p-6">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
@if($systemStatus['is_enabled'])
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
<x-heroicon-o-check-circle class="w-5 h-5 text-green-600" />
</div>
<div>
<h3 class="font-semibold text-gray-900">System Status</h3>
<p class="text-sm {{ $systemStatus['status_class'] }}">{{ $systemStatus['status'] }}</p>
</div>
@else
<div class="w-8 h-8 bg-orange-100 rounded-full flex items-center justify-center mr-3">
<x-heroicon-o-exclamation-triangle class="w-5 h-5 text-orange-600" />
</div>
<div>
<h3 class="font-semibold text-gray-900">Ready to Activate</h3>
<p class="text-sm text-orange-600">System is configured but not active</p>
</div>
@endif
</div>
@if(!$systemStatus['is_enabled'])
<form action="{{ route('settings.update') }}" method="POST" class="inline">
@csrf
@method('PUT')
<input type="hidden" name="article_processing_enabled" value="1">
<input type="hidden" name="from" value="onboarding">
<button type="submit" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md font-medium transition-colors">
Activate System
</button>
</form>
@else
<span class="text-green-600 font-medium"> Active</span>
@endif
</div>
@if(!$systemStatus['is_enabled'] && count($systemStatus['reasons']) > 0)
<div class="mt-4 pt-4 border-t border-gray-200">
<p class="text-sm text-gray-600 mb-2">System will be enabled once activated. Current setup status:</p>
<ul class="text-sm text-gray-600 space-y-1">
@foreach($systemStatus['reasons'] as $reason)
@if($reason !== 'Manually disabled by user')
<li class="flex items-center">
<x-heroicon-o-check-circle class="w-4 h-4 text-green-500 mr-2 flex-shrink-0" />
{{ str_replace('No active', 'Active', $reason) . ' ✓' }}
</li>
@endif
@endforeach
</ul>
</div>
@endif
</div>
</div>
<div class="space-y-4 mb-8">
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
<h3 class="font-semibold text-blue-900 mb-2">What happens next?</h3>

View file

@ -7,6 +7,12 @@
<h1 class="text-3xl font-bold text-gray-900">Dashboard</h1>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-6">
{{ session('success') }}
</div>
@endif
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- System Status Card -->
<div class="bg-white overflow-hidden shadow rounded-lg">