feat: Add initial e-learning frontend setup including admin and instructor services, layouts, and pages.
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 46s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 6s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 46s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 6s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s
This commit is contained in:
parent
01d249c19a
commit
031ca5c984
12 changed files with 135 additions and 36 deletions
|
|
@ -263,7 +263,8 @@ const statusOptions = [
|
|||
{ label: 'เผยแพร่แล้ว', value: 'APPROVED' },
|
||||
{ label: 'รอตรวจสอบ', value: 'PENDING' },
|
||||
{ label: 'แบบร่าง', value: 'DRAFT' },
|
||||
{ label: 'ถูกปฏิเสธ', value: 'REJECTED' }
|
||||
{ label: 'ถูกปฏิเสธ', value: 'REJECTED' },
|
||||
//{ label: 'เก็บถาวร', value: 'ARCHIVED' }
|
||||
];
|
||||
|
||||
// Stats
|
||||
|
|
@ -275,7 +276,7 @@ const stats = computed(() => ({
|
|||
rejected: courses.value.filter(c => c.status === 'REJECTED').length
|
||||
}));
|
||||
|
||||
// Filtered courses
|
||||
// Filtered courses (search only, status is handled server-side)
|
||||
const filteredCourses = computed(() => {
|
||||
let result = courses.value;
|
||||
|
||||
|
|
@ -287,10 +288,6 @@ const filteredCourses = computed(() => {
|
|||
);
|
||||
}
|
||||
|
||||
if (filterStatus.value) {
|
||||
result = result.filter(course => course.status === filterStatus.value);
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
|
|
@ -298,7 +295,7 @@ const filteredCourses = computed(() => {
|
|||
const fetchCourses = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
courses.value = await instructorService.getCourses();
|
||||
courses.value = await instructorService.getCourses(filterStatus.value || undefined);
|
||||
} catch (error) {
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
|
|
@ -310,12 +307,18 @@ const fetchCourses = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
// Re-fetch when status filter changes
|
||||
watch(filterStatus, () => {
|
||||
fetchCourses();
|
||||
});
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
const colors: Record<string, string> = {
|
||||
APPROVED: 'green',
|
||||
PENDING: 'orange',
|
||||
DRAFT: 'grey',
|
||||
REJECTED: 'red'
|
||||
REJECTED: 'red',
|
||||
ARCHIVED: 'blue-grey'
|
||||
};
|
||||
return colors[status] || 'grey';
|
||||
};
|
||||
|
|
@ -325,7 +328,8 @@ const getStatusLabel = (status: string) => {
|
|||
APPROVED: 'เผยแพร่แล้ว',
|
||||
PENDING: 'รอตรวจสอบ',
|
||||
DRAFT: 'แบบร่าง',
|
||||
REJECTED: 'ถูกปฏิเสธ'
|
||||
REJECTED: 'ถูกปฏิเสธ',
|
||||
ARCHIVED: 'เก็บถาวร'
|
||||
};
|
||||
return labels[status] || status;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue