Revert "feat: update admin dashboard statistics"
Deploy banu-front / deploy (push) Failing after 1m24s

This reverts commit fe1fb6cfa4.
This commit is contained in:
root
2026-07-30 14:16:10 +00:00
parent fe1fb6cfa4
commit 32e97a7591
2 changed files with 28 additions and 43 deletions
+24 -37
View File
@@ -9,7 +9,7 @@
</template> </template>
</BoxedIconTitleBlock> </BoxedIconTitleBlock>
<SkeletonLoaderBlock v-if="isLoading" :rows="2" :cols-per-row="3" /> <SkeletonLoaderBlock v-if="isLoading" :rows="1" :cols-per-row="3" />
<div v-else class="dashboard__stats"> <div v-else class="dashboard__stats">
<DashboardStatCard <DashboardStatCard
v-for="(stat, i) in institutionStats" v-for="(stat, i) in institutionStats"
@@ -95,50 +95,37 @@ const ACCESS_LABELS = {
limited: 'محدود', limited: 'محدود',
} }
const formatThousands = (value) => {
const n = Number(value ?? 0)
return n >= 1000
? { value: toFaDigits(Math.round(n / 1000)), unit: 'هزار' }
: { value: toFaDigits(n), unit: 'نفر' }
}
const institutionStats = computed(() => { const institutionStats = computed(() => {
const stats = dashboard.value.stats ?? {} const stats = dashboard.value.stats ?? {}
const users = formatThousands(stats.activeUsers)
return [ return [
{ {
icon: 'users-three', icon: 'user',
label: 'مجموع کل متقاضیان', label: 'آمار کلی کاربران',
value: toFaDigits(stats.totalApplicants ?? 0), value: users.value,
unit: 'نفر', unit: users.unit,
subtitle: 'احراز شده و نشده', subtitle: 'کاربر فعال',
}, },
{ {
icon: 'clock', icon: 'video',
label: 'کاربران در انتظار ارزیابی', label: 'دوره های ایجاد شده',
value: toFaDigits(stats.awaitingEvaluation ?? 0), value: toFaDigits(stats.coursesCreated ?? 0),
unit: 'نفر', unit: 'دوره',
subtitle: 'در انتظار ارزیابی', subtitle: 'ایجاد شده',
}, },
{ {
icon: 'book', icon: 'shopping-bag',
label: انشجویان ترم ۱', label: وره های فروش رفته',
value: toFaDigits(stats.term1Students ?? 0), value: toFaDigits(stats.coursesSold ?? 0),
unit: 'نفر', unit: 'عدد',
subtitle: 'ترم اول', subtitle: 'دوره فروش رفته',
},
{
icon: 'book',
label: 'دانشجویان ترم ۲',
value: toFaDigits(stats.term2Students ?? 0),
unit: 'نفر',
subtitle: 'ترم دوم',
},
{
icon: 'book',
label: 'دانشجویان ترم ۳',
value: toFaDigits(stats.term3Students ?? 0),
unit: 'نفر',
subtitle: 'ترم سوم',
},
{
icon: 'certificate',
label: 'فارغ‌التحصیلان',
value: toFaDigits(stats.graduates ?? 0),
unit: 'نفر',
subtitle: 'تکمیل دوره آموزشی',
}, },
] ]
}) })
@@ -11,12 +11,10 @@ export const adminDashboard = {
openTickets: 32, openTickets: 32,
}, },
stats: { stats: {
totalApplicants: 120, activeUsers: 11_000,
awaitingEvaluation: 18, totalUsers: 11_540,
term1Students: 42, coursesCreated: 6,
term2Students: 31, coursesSold: 12,
term3Students: 24,
graduates: 16,
}, },
recentRegistrations: [ recentRegistrations: [
{ {