196 lines
6.6 KiB
PHP
196 lines
6.6 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="ms">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
<title>@yield('title', 'Panel Admin') — Sistem Pangkalan Pengetahuan</title>
|
|
|
|
<!-- Bootstrap 5 -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Bootstrap Icons -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
|
|
|
|
<style>
|
|
body { background-color: #f8f9fa; }
|
|
|
|
.sidebar {
|
|
min-height: 100vh;
|
|
background: #1e293b;
|
|
width: 260px;
|
|
position: fixed;
|
|
top: 0; left: 0;
|
|
z-index: 1000;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
color: #94a3b8;
|
|
padding: .6rem 1.25rem;
|
|
border-radius: .375rem;
|
|
margin: 0 .5rem .125rem;
|
|
font-size: .9rem;
|
|
transition: all .15s;
|
|
}
|
|
|
|
.sidebar .nav-link:hover,
|
|
.sidebar .nav-link.active {
|
|
background: #334155;
|
|
color: #fff;
|
|
}
|
|
|
|
.sidebar .nav-link i { width: 1.25rem; }
|
|
|
|
.sidebar .nav-section {
|
|
color: #475569;
|
|
font-size: .7rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: .05em;
|
|
padding: .75rem 1.25rem .25rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.main-content {
|
|
margin-left: 260px;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.topbar {
|
|
background: #fff;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
padding: .75rem 1.5rem;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 999;
|
|
}
|
|
|
|
.badge-processing { background: #f59e0b; }
|
|
.badge-indexed { background: #10b981; }
|
|
.badge-failed { background: #ef4444; }
|
|
.badge-pending { background: #6b7280; }
|
|
.badge-inactive { background: #94a3b8; }
|
|
</style>
|
|
|
|
@stack('styles')
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Sidebar -->
|
|
<nav class="sidebar p-0">
|
|
<div class="p-3 border-bottom border-secondary">
|
|
<div class="d-flex align-items-center gap-2">
|
|
<i class="bi bi-database-fill-gear text-primary fs-4"></i>
|
|
<div>
|
|
<div class="text-white fw-bold small">Pangkalan Pengetahuan</div>
|
|
<div class="text-muted" style="font-size:.7rem">Panel Admin</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pt-2 pb-4">
|
|
<div class="nav-section">Utama</div>
|
|
<a href="{{ route('admin.dashboard') }}"
|
|
class="nav-link {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">
|
|
<i class="bi bi-grid-1x2 me-2"></i>Dashboard
|
|
</a>
|
|
|
|
@if(auth()->user()->isAdmin())
|
|
<div class="nav-section mt-2">Kandungan</div>
|
|
<a href="{{ route('admin.categories.index') }}"
|
|
class="nav-link {{ request()->routeIs('admin.categories.*') ? 'active' : '' }}">
|
|
<i class="bi bi-folder2 me-2"></i>Kategori
|
|
</a>
|
|
@endif
|
|
|
|
<a href="{{ route('admin.documents.index') }}"
|
|
class="nav-link {{ request()->routeIs('admin.documents.*') ? 'active' : '' }}">
|
|
<i class="bi bi-file-pdf me-2"></i>Dokumen PDF
|
|
</a>
|
|
|
|
<a href="{{ route('admin.knowledge-items.index') }}"
|
|
class="nav-link {{ request()->routeIs('admin.knowledge-items.*') ? 'active' : '' }}">
|
|
<i class="bi bi-lightbulb me-2"></i>FAQ & Pengetahuan
|
|
</a>
|
|
|
|
<div class="nav-section mt-2">Chat & Audit</div>
|
|
<a href="{{ route('admin.chat-feedback.index') }}"
|
|
class="nav-link {{ request()->routeIs('admin.chat-feedback.*') ? 'active' : '' }}">
|
|
<i class="bi bi-chat-dots me-2"></i>Semakan Chat
|
|
@php $flagged = cache()->remember('flagged_chat_count', 60, fn() => \App\Models\ChatLog::where('is_flagged', true)->count()); @endphp
|
|
@if($flagged > 0)
|
|
<span class="badge bg-danger ms-1">{{ $flagged }}</span>
|
|
@endif
|
|
</a>
|
|
|
|
@if(auth()->user()->isAdmin())
|
|
<a href="{{ route('admin.audit-logs.index') }}"
|
|
class="nav-link {{ request()->routeIs('admin.audit-logs.*') ? 'active' : '' }}">
|
|
<i class="bi bi-journal-text me-2"></i>Log Audit
|
|
</a>
|
|
@endif
|
|
|
|
<div class="nav-section mt-2">Awam</div>
|
|
<a href="{{ route('chatbot.index') }}" target="_blank"
|
|
class="nav-link">
|
|
<i class="bi bi-robot me-2"></i>Buka Chatbot
|
|
<i class="bi bi-box-arrow-up-right ms-1 small"></i>
|
|
</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main Content -->
|
|
<div class="main-content">
|
|
|
|
<!-- Topbar -->
|
|
<div class="topbar d-flex align-items-center justify-content-between">
|
|
<div>
|
|
<nav aria-label="breadcrumb" class="mb-0">
|
|
<ol class="breadcrumb mb-0 small">
|
|
@yield('breadcrumb')
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<div class="d-flex align-items-center gap-3">
|
|
<span class="small text-muted">
|
|
<i class="bi bi-person-circle me-1"></i>
|
|
{{ auth()->user()->name }}
|
|
<span class="badge bg-secondary ms-1">{{ auth()->user()->role_label }}</span>
|
|
</span>
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button type="submit" class="btn btn-sm btn-outline-secondary">
|
|
<i class="bi bi-box-arrow-right"></i> Log Keluar
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Page Content -->
|
|
<div class="p-4">
|
|
@if(session('success'))
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
<i class="bi bi-check-circle me-2"></i>{{ session('success') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('error'))
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
<i class="bi bi-exclamation-triangle me-2"></i>{{ session('error') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
@endif
|
|
|
|
@yield('content')
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- jQuery -->
|
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
|
|
|
@stack('scripts')
|
|
</body>
|
|
</html>
|