init frontend_management
This commit is contained in:
parent
af58550f7f
commit
62812f2090
23 changed files with 13174 additions and 0 deletions
60
frontend_management/stores/instructor.ts
Normal file
60
frontend_management/stores/instructor.ts
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import { defineStore } from 'pinia';
|
||||
|
||||
interface Course {
|
||||
id: string;
|
||||
title: string;
|
||||
students: number;
|
||||
lessons: number;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
interface DashboardStats {
|
||||
totalCourses: number;
|
||||
totalStudents: number;
|
||||
completedStudents: number;
|
||||
}
|
||||
|
||||
export const useInstructorStore = defineStore('instructor', {
|
||||
state: () => ({
|
||||
stats: {
|
||||
totalCourses: 5,
|
||||
totalStudents: 125,
|
||||
completedStudents: 45
|
||||
} as DashboardStats,
|
||||
|
||||
recentCourses: [
|
||||
{
|
||||
id: '1',
|
||||
title: 'Python เบื้องต้น',
|
||||
students: 45,
|
||||
lessons: 8,
|
||||
icon: '📘'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: 'JavaScript สำหรับเว็บ',
|
||||
students: 32,
|
||||
lessons: 12,
|
||||
icon: '📗'
|
||||
}
|
||||
] as Course[]
|
||||
}),
|
||||
|
||||
getters: {
|
||||
getDashboardStats: (state) => state.stats,
|
||||
getRecentCourses: (state) => state.recentCourses
|
||||
},
|
||||
|
||||
actions: {
|
||||
async fetchDashboardData() {
|
||||
// TODO: Replace with real API call
|
||||
// const { $api } = useNuxtApp();
|
||||
// const data = await $api('/instructor/dashboard');
|
||||
// this.stats = data.stats;
|
||||
// this.recentCourses = data.recentCourses;
|
||||
|
||||
// Using mock data for now
|
||||
console.log('Using mock data for instructor dashboard');
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue