Files
FrontOffice/src/FrontOffice.Main/Pages/Network/NetworkStatisticsPage.razor
T
masoodafar-web 6db83ccd90
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 4m55s
feat: full FrontOffice updates - discount store, blog, payment gateway, UI improvements
- Discount store pages (products, cart, orders, order detail)
- Blog pages and services
- Payment gateway callback page
- AppImage component, EmptyState, LoadingState, PageHeader
- DiscountCartService, DiscountOrderService, DiscountProductService
- BlogCategoryService, BlogPostService, SitePageService, ImageCacheService
- PhoneVerifyForm component
- Profile Hub page
- UI/UX improvements across all pages
- landing.js for homepage
- Config and routing updates
2026-02-16 00:51:39 +03:30

146 lines
7.8 KiB
Plaintext

@attribute [Route(RouteConstants.Network.Statistics)]
@using FrontOffice.Main.Utilities
@using MudBlazor
<PageTitle>آمار تیم</PageTitle>
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
<MudStack Spacing="3">
<PageHeader Title="آمار باشگاه توسعه دهندگان" BackHref="@RouteConstants.Profile.Index" />
@if (_isLoading)
{
<LoadingState Message="در حال دریافت آمار..." />
}
else if (_statistics is not null)
{
<!-- کارت‌های آماری -->
<MudGrid Spacing="2">
<MudItem xs="12" sm="6" md="3">
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">اعضای باشگاه توسعه دهندگان</MudText>
<MudText Typo="Typo.h4" Color="Color.Primary">@_statistics.TotalMembers</MudText>
<MudIcon Icon="@Icons.Material.Filled.Groups" Color="Color.Primary" />
</MudStack>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">بخش (A)</MudText>
<MudText Typo="Typo.h4" Color="Color.Info">@_statistics.LeftLegCount</MudText>
<MudIcon Icon="@Icons.Material.Filled.ChevronLeft" Color="Color.Info" />
</MudStack>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">بخش (B)</MudText>
<MudText Typo="Typo.h4" Color="Color.Success">@_statistics.RightLegCount</MudText>
<MudIcon Icon="@Icons.Material.Filled.ChevronRight" Color="Color.Success" />
</MudStack>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">فاصله شعب</MudText>
<MudText Typo="Typo.h4" Color="Color.Secondary">@_statistics.TreeDepth</MudText>
<MudIcon Icon="@Icons.Material.Filled.AccountTree" Color="Color.Secondary" />
</MudStack>
</MudPaper>
</MudItem>
</MudGrid>
<!-- آمار فروش تیم‌ها -->
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudText Typo="Typo.h6" Class="mb-3">آمار جمعی فعالیت</MudText>
<MudStack Spacing="2">
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
<MudText Typo="Typo.body1">بخش (A): <strong>@_statistics.LeftLegCount</strong> عضو</MudText>
<MudProgressLinear Color="Color.Info"
Value="@GetLeftPercentage()"
Size="Size.Medium"
Class="rounded-lg"
Style="width: 200px;" />
</MudStack>
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
<MudText Typo="Typo.body1">بخش (B): <strong>@_statistics.RightLegCount</strong> عضو</MudText>
<MudProgressLinear Color="Color.Success"
Value="@GetRightPercentage()"
Size="Size.Medium"
Class="rounded-lg"
Style="width: 200px;" />
</MudStack>
@if (!string.IsNullOrEmpty(_statistics.WeakerLeg))
{
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
بخش کوچک تر: <strong>@GetLegText(_statistics.WeakerLeg)</strong>
</MudAlert>
}
</MudStack>
</MudPaper>
<!-- نمودار دایره‌ای -->
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudText Typo="Typo.h6" Class="mb-3">توزیع توسعه دهندگان</MudText>
<MudChart ChartType="ChartType.Donut"
Width="300px"
Height="300px"
InputData="@(new double[] { _statistics.LeftLegCount, _statistics.RightLegCount })"
InputLabels="@(new[] { "بخش (A)", "بخش (B)" })"
ChartOptions="@_chartOptions" />
</MudPaper>
<!-- آخرین عضو -->
@if (_statistics.LastMember is not null)
{
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
<MudText Typo="Typo.h6" Class="mb-3">آخرین عضو پیوسته</MudText>
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Center">
<MudAvatar Color="Color.Primary" Size="Size.Large">
@GetInitials(_statistics.LastMember.FullName)
</MudAvatar>
<MudStack Spacing="0">
<MudText Typo="Typo.body1"><strong>@_statistics.LastMember.FullName</strong></MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">
موقعیت: @GetPositionText(_statistics.LastMember.Position)
</MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">
تاریخ عضویت: @_statistics.LastMember.JoinedAt.ToString("yyyy/MM/dd HH:mm")
</MudText>
</MudStack>
</MudStack>
</MudPaper>
}
<!-- دکمه‌های عملیات -->
<MudStack Row="true" Spacing="2">
<MudButton Variant="Variant.Outlined"
Color="Color.Primary"
StartIcon="@Icons.Material.Filled.AccountTree"
Href="@RouteConstants.Profile.Tree"
FullWidth="true">
مشاهده کل توسعه دهندگان
</MudButton>
<MudButton Variant="Variant.Outlined"
Color="Color.Secondary"
StartIcon="@Icons.Material.Filled.Refresh"
OnClick="LoadStatisticsAsync"
FullWidth="true">
بروزرسانی آمار
</MudButton>
</MudStack>
}
else if (_hasError)
{
<MudAlert Severity="Severity.Error" Variant="Variant.Filled">
خطا در دریافت آمار توسعه دهندگان. لطفا دوباره تلاش کنید.
</MudAlert>
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="LoadStatisticsAsync">تلاش مجدد</MudButton>
}
</MudStack>
</MudContainer>