Implement nice admin panel
This commit is contained in:
parent
62c0938018
commit
085fa85fcd
4 changed files with 127 additions and 50 deletions
|
|
@ -1,10 +1,30 @@
|
|||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Lemmy Poster</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>@yield('title', 'Lemmy Poster Admin')</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
@include('partials.navbar')
|
||||
<body class="bg-gray-100">
|
||||
<div class="flex h-screen">
|
||||
@include('partials.sidebar')
|
||||
|
||||
@yield('content')
|
||||
<!-- Main Content -->
|
||||
<div class="flex-1 flex flex-col overflow-hidden">
|
||||
<!-- Header -->
|
||||
<header class="bg-white shadow-sm border-b border-gray-200">
|
||||
<div class="px-6 py-4">
|
||||
<h1 class="text-2xl font-semibold text-gray-800">@yield('page-title', 'Dashboard')</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Content -->
|
||||
<main class="flex-1 overflow-y-auto p-6">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,49 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('page-title', 'Articles')
|
||||
|
||||
@section('content')
|
||||
<h1>Articles</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>URL</th>
|
||||
<th>Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($articles as $article)
|
||||
<tr>
|
||||
<td>{{ $article->id }}</td>
|
||||
<td>{{ $article->url }}</td>
|
||||
<td>{{ $article->created_at->format('Y-m-d H:i') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="pagination-wrapper">
|
||||
{{ $articles->links() }}
|
||||
<div class="bg-white rounded-lg shadow">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h2 class="text-lg font-medium text-gray-900">Article Feed</h2>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URL</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach($articles as $article)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $article->id }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-900">
|
||||
<a href="{{ $article->url }}" target="_blank" class="text-blue-600 hover:text-blue-900 hover:underline">
|
||||
{{ Str::limit($article->url, 60) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full
|
||||
{{ $article->articlePublication ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800' }}">
|
||||
{{ $article->articlePublication ? 'Published' : 'Pending' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $article->created_at->format('Y-m-d H:i') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if($articles->hasPages())
|
||||
<div class="px-6 py-4 border-t border-gray-200">
|
||||
{{ $articles->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,26 +1,40 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<h1>Logs</h1>
|
||||
@section('page-title', 'System Logs')
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Level</th>
|
||||
<th>Message</th>
|
||||
<th>Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($logs as $log)
|
||||
<tr>
|
||||
<td>{{ $log->id }}</td>
|
||||
<td>{{ ucfirst($log->level->value) }}</td>
|
||||
<td>{{ $log->message }}</td>
|
||||
<td>{{ $log->created_at->format('Y-m-d H:i') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@section('content')
|
||||
<div class="bg-white rounded-lg shadow">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h2 class="text-lg font-medium text-gray-900">Recent Logs</h2>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Level</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Message</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach($logs as $log)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $log->id }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full
|
||||
{{ $log->level->value === 'error' ? 'bg-red-100 text-red-800' :
|
||||
($log->level->value === 'warning' ? 'bg-yellow-100 text-yellow-800' : 'bg-green-100 text-green-800') }}">
|
||||
{{ ucfirst($log->level->value) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-900">{{ Str::limit($log->message, 100) }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $log->created_at->format('Y-m-d H:i') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
22
resources/views/partials/sidebar.blade.php
Normal file
22
resources/views/partials/sidebar.blade.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Sidebar -->
|
||||
<div class="bg-gray-800 text-white w-64 flex-shrink-0">
|
||||
<div class="p-4">
|
||||
<h2 class="text-xl font-bold">Lemmy Poster</h2>
|
||||
<p class="text-gray-400 text-sm">Admin Panel</p>
|
||||
</div>
|
||||
|
||||
<nav class="mt-8">
|
||||
<a href="/articles" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 hover:text-white transition-colors {{ request()->is('articles') ? 'bg-gray-700 text-white' : '' }}">
|
||||
<i class="fas fa-newspaper mr-3"></i>
|
||||
Articles
|
||||
</a>
|
||||
<a href="/logs" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 hover:text-white transition-colors {{ request()->is('logs') ? 'bg-gray-700 text-white' : '' }}">
|
||||
<i class="fas fa-list mr-3"></i>
|
||||
Logs
|
||||
</a>
|
||||
<a href="/horizon" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 hover:text-white transition-colors">
|
||||
<i class="fas fa-chart-line mr-3"></i>
|
||||
Queue Monitor
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
Loading…
Reference in a new issue