249 lines
No EOL
13 KiB
PHP
249 lines
No EOL
13 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
|
<div class="px-4 py-6 sm:px-0">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h1 class="text-3xl font-bold text-gray-900">Dashboard</h1>
|
|
|
|
<!-- Time Period Selector -->
|
|
<form method="GET" class="flex items-center space-x-2">
|
|
<label for="period" class="text-sm font-medium text-gray-700">Period:</label>
|
|
<select name="period" id="period" onchange="this.form.submit()"
|
|
class="border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
|
|
@foreach($availablePeriods as $key => $label)
|
|
<option value="{{ $key }}" {{ $period === $key ? 'selected' : '' }}>
|
|
{{ $label }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</form>
|
|
</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
|
|
|
|
<!-- Article Stats -->
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
|
|
<!-- Articles Fetched -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="p-5">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-arrow-down-tray class="w-6 h-6 text-blue-600" />
|
|
</div>
|
|
<div class="ml-5 w-0 flex-1">
|
|
<dl>
|
|
<dt class="text-sm font-medium text-gray-500 truncate">Articles Fetched</dt>
|
|
<dd class="text-lg font-medium text-gray-900">{{ number_format($stats['articles_fetched']) }}</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Articles Published -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="p-5">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-paper-airplane class="w-6 h-6 text-green-600" />
|
|
</div>
|
|
<div class="ml-5 w-0 flex-1">
|
|
<dl>
|
|
<dt class="text-sm font-medium text-gray-500 truncate">Articles Published</dt>
|
|
<dd class="text-lg font-medium text-gray-900">{{ number_format($stats['articles_published']) }}</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Published Percentage -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="p-5">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-chart-pie class="w-6 h-6 text-purple-600" />
|
|
</div>
|
|
<div class="ml-5 w-0 flex-1">
|
|
<dl>
|
|
<dt class="text-sm font-medium text-gray-500 truncate">Published Rate</dt>
|
|
<dd class="text-lg font-medium text-gray-900">{{ $stats['published_percentage'] }}%</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<!-- System Status Card -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
@if($systemStatus['is_enabled'])
|
|
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center">
|
|
<x-heroicon-o-check-circle class="w-5 h-5 text-green-600" />
|
|
</div>
|
|
@else
|
|
<div class="w-8 h-8 bg-red-100 rounded-full flex items-center justify-center">
|
|
<x-heroicon-o-x-circle class="w-5 h-5 text-red-600" />
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<div class="ml-5 w-0 flex-1">
|
|
<dl>
|
|
<dt class="text-sm font-medium text-gray-500 truncate">System Status</dt>
|
|
<dd class="text-lg font-medium {{ $systemStatus['status_class'] }}">
|
|
{{ $systemStatus['status'] }}
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
@if(!$systemStatus['is_enabled'] && count($systemStatus['reasons']) > 0)
|
|
<div class="mt-4 pt-4 border-t border-gray-200">
|
|
<h4 class="text-sm font-medium text-gray-700 mb-2">Reasons for being disabled:</h4>
|
|
<ul class="text-sm text-gray-600 space-y-1">
|
|
@foreach($systemStatus['reasons'] as $reason)
|
|
<li class="flex items-center">
|
|
<x-heroicon-o-exclamation-triangle class="w-4 h-4 text-yellow-500 mr-2 flex-shrink-0" />
|
|
{{ $reason }}
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
@if(!$systemStatus['is_enabled'])
|
|
<div class="mt-4 pt-4 border-t border-gray-200">
|
|
<div class="flex space-x-3">
|
|
<a href="{{ route('settings.index') }}" class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700">
|
|
<x-heroicon-o-cog-6-tooth class="w-4 h-4 mr-1" />
|
|
Settings
|
|
</a>
|
|
<a href="{{ route('feeds.index') }}" class="inline-flex items-center px-3 py-2 border border-gray-300 text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
|
|
<x-heroicon-o-rss class="w-4 h-4 mr-1" />
|
|
Feeds
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<!-- System Configuration -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center mb-4">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-chart-bar class="w-6 h-6 text-gray-400" />
|
|
</div>
|
|
<div class="ml-5">
|
|
<h3 class="text-sm font-medium text-gray-500">System Configuration</h3>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="text-sm text-gray-600">Feeds</span>
|
|
<span class="text-sm font-medium text-gray-900">{{ $systemStats['active_feeds'] }}/{{ $systemStats['total_feeds'] }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="text-sm text-gray-600">Channels</span>
|
|
<span class="text-sm font-medium text-gray-900">{{ $systemStats['active_channels'] }}/{{ $systemStats['total_channels'] }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="text-sm text-gray-600">Routes</span>
|
|
<span class="text-sm font-medium text-gray-900">{{ $systemStats['active_routes'] }}/{{ $systemStats['total_routes'] }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recent Activity -->
|
|
<div class="bg-white overflow-hidden shadow rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-clock class="w-6 h-6 text-gray-400" />
|
|
</div>
|
|
<div class="ml-5 w-0 flex-1">
|
|
<dl>
|
|
<dt class="text-sm font-medium text-gray-500 truncate">Recent Activity</dt>
|
|
<dd class="text-lg font-medium text-gray-900">
|
|
<a href="{{ route('logs') }}" class="text-blue-600 hover:text-blue-800">View Logs</a>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Navigation Cards -->
|
|
<div class="mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
<a href="{{ route('feeds.index') }}" class="bg-white overflow-hidden shadow rounded-lg hover:shadow-md transition-shadow">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-rss class="w-8 h-8 text-orange-500" />
|
|
</div>
|
|
<div class="ml-5">
|
|
<h3 class="text-lg font-medium text-gray-900">Feeds</h3>
|
|
<p class="text-sm text-gray-500">Manage content sources</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{{ route('platforms.index') }}" class="bg-white overflow-hidden shadow rounded-lg hover:shadow-md transition-shadow">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-share class="w-8 h-8 text-blue-500" />
|
|
</div>
|
|
<div class="ml-5">
|
|
<h3 class="text-lg font-medium text-gray-900">Platforms</h3>
|
|
<p class="text-sm text-gray-500">Manage platform accounts</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{{ route('channels.index') }}" class="bg-white overflow-hidden shadow rounded-lg hover:shadow-md transition-shadow">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-hashtag class="w-8 h-8 text-purple-500" />
|
|
</div>
|
|
<div class="ml-5">
|
|
<h3 class="text-lg font-medium text-gray-900">Channels</h3>
|
|
<p class="text-sm text-gray-500">Manage publishing channels</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
<a href="{{ route('routing.index') }}" class="bg-white overflow-hidden shadow rounded-lg hover:shadow-md transition-shadow">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center">
|
|
<div class="flex-shrink-0">
|
|
<x-heroicon-o-arrow-path class="w-8 h-8 text-green-500" />
|
|
</div>
|
|
<div class="ml-5">
|
|
<h3 class="text-lg font-medium text-gray-900">Routing</h3>
|
|
<p class="text-sm text-gray-500">Configure feed routing</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |