2026-01-14 13:58:25 +07:00
|
|
|
<template>
|
|
|
|
|
<div class="min-h-screen bg-gray-50">
|
|
|
|
|
<!-- Sidebar -->
|
|
|
|
|
<aside class="fixed left-0 top-0 h-screen w-64 bg-white shadow-lg">
|
|
|
|
|
<div class="p-6">
|
|
|
|
|
<h2 class="text-xl font-bold text-primary-600">E-Learning</h2>
|
|
|
|
|
<p class="text-sm text-gray-500">Admin Panel</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<nav class="px-4">
|
|
|
|
|
<NuxtLink
|
|
|
|
|
to="/admin"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="dashboard" size="24px" />
|
|
|
|
|
<span>Dashboard</span>
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
|
2026-02-02 09:31:22 +07:00
|
|
|
<!-- <NuxtLink
|
2026-01-14 13:58:25 +07:00
|
|
|
to="/admin/courses"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="school" size="24px" />
|
|
|
|
|
<span>จัดการหลักสูตร</span>
|
2026-02-02 09:31:22 +07:00
|
|
|
</NuxtLink> -->
|
2026-01-14 13:58:25 +07:00
|
|
|
|
2026-01-28 13:38:54 +07:00
|
|
|
<NuxtLink
|
|
|
|
|
to="/admin/courses/pending"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="pending_actions" size="24px" />
|
|
|
|
|
<span>คอร์สรออนุมัติ</span>
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
|
2026-01-14 13:58:25 +07:00
|
|
|
<NuxtLink
|
|
|
|
|
to="/admin/users"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="people" size="24px" />
|
|
|
|
|
<span>จัดการผู้ใช้</span>
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
|
|
|
|
|
<NuxtLink
|
|
|
|
|
to="/admin/categories"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="folder" size="24px" />
|
|
|
|
|
<span>หมวดหมู่</span>
|
|
|
|
|
</NuxtLink>
|
2026-02-13 11:55:12 +07:00
|
|
|
|
|
|
|
|
<NuxtLink
|
|
|
|
|
to="/admin/recommended-courses"
|
|
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="recommend" size="24px" />
|
|
|
|
|
<span>คอร์สแนะนำ</span>
|
|
|
|
|
</NuxtLink>
|
2026-01-14 13:58:25 +07:00
|
|
|
|
|
|
|
|
<NuxtLink
|
2026-02-06 14:58:41 +07:00
|
|
|
to="/admin/audit-logs"
|
2026-01-14 13:58:25 +07:00
|
|
|
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-primary-100 transition mb-2"
|
|
|
|
|
active-class="bg-primary-500 text-white hover:bg-primary-600"
|
|
|
|
|
>
|
|
|
|
|
<q-icon name="settings" size="24px" />
|
2026-02-06 14:58:41 +07:00
|
|
|
<span>Audit logs</span>
|
2026-01-14 13:58:25 +07:00
|
|
|
</NuxtLink>
|
|
|
|
|
</nav>
|
|
|
|
|
|
2026-02-06 14:58:41 +07:00
|
|
|
<div class="absolute bottom-0 left-0 right-0 p-4 border-t">
|
2026-01-14 13:58:25 +07:00
|
|
|
<button
|
|
|
|
|
@click="handleLogout"
|
|
|
|
|
class="w-full flex items-center gap-3 px-4 py-3 text-red-600 hover:bg-red-50 rounded-lg transition"
|
|
|
|
|
>
|
2026-02-06 14:58:41 +07:00
|
|
|
<q-icon name="logout" size="24px" />
|
2026-01-14 13:58:25 +07:00
|
|
|
<span>ออกจากระบบ</span>
|
|
|
|
|
</button>
|
2026-02-06 14:58:41 +07:00
|
|
|
</div>
|
2026-01-14 13:58:25 +07:00
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<!-- Main Content -->
|
|
|
|
|
<main class="ml-64 p-8">
|
|
|
|
|
<slot />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const handleLogout = () => {
|
|
|
|
|
authStore.logout();
|
|
|
|
|
router.push('/login');
|
|
|
|
|
};
|
|
|
|
|
</script>
|