Compare commits

..

7 Commits

Author SHA1 Message Date
masoodafar-web 420201e3b8 feat(landing-settings): add toggle switches for steps and features visibility
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 10m48s
- Introduced toggle switches to enable or disable the display of the "How It Works" and "Platform Features" sections in the landing settings.
- Updated the LandingSettingsModel to include properties for managing the visibility of these sections.
2026-10-04 23:34:16 +03:30
masoodafar-web 902cfbeb89 fix(user-order-details): update discount column to total amount in order details table
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 18m50s
- Changed the 'تخفیف واحد' column to 'جمع کل' and updated the calculation to display the total amount based on unit price and count.
2026-10-01 16:15:55 +03:30
masoodafar-web 6d32957236 chore(k8s): deploy staging apps to namespace kbs-stage
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 13s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-24 21:26:22 +03:30
masoodafar-web 7c3ee765d4 feat(reports): enhance weekly and ledger transaction reports with additional package and user details
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 17m28s
- Added 'PackageTitle' to the weekly reports for better clarity on package information.
- Updated CSV export for weekly reports to include package details.
- Introduced 'UserId' and 'UserFullName' columns in ledger transaction reports for improved user tracking.
- Modified CSV export for ledger transactions to reflect new user information.
- Bumped Foursat.CMSMicroservice.Protobuf version to 0.0.214 for compatibility with recent changes.
2026-09-24 19:53:57 +03:30
masoodafar-web 059920e782 chore(staging): point registry and K8S to 185.252.31.44 after server migration
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 21m6s
2026-09-22 22:18:43 +03:30
masoodafar-web fc006ed731 fix(deps): bump CMS Protobuf to 0.0.213 for invitation report types
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 21:41:15 +03:30
masoodafar-web c5e7d1dead feat(nav-menu): add link to Invitations Report in navigation menu
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 6m13s
- Introduced a new navigation link for the Invitations Report page in NavMenu.razor.
- Updated RouteConstance.cs to include the new InvitationsReport constant.
- Made minor adjustments to .gitignore for improved clarity.
2026-09-20 23:35:33 +03:30
20 changed files with 293 additions and 38 deletions
+46
View File
@@ -0,0 +1,46 @@
name: Push nuget and docker image Actions Workflow
on:
push:
branches:
- stage-new
jobs:
Deploy:
runs-on: windows
steps:
- name: Checkout
uses: https://git.afrino.co/actions/checkout@v3
- name: Setup dotnet
uses: https://git.afrino.co/actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Remove Package Source
run: dotnet nuget remove source FourSat
continue-on-error: true
- name: Add Package Source
run: dotnet nuget add source --name FourSat --username systemuser --password sZSA7PTiv3pUSQZ https://git.afrino.co/api/packages/FourSat/nuget/index.json --store-password-in-clear-text
- name: Install dependencies
run: dotnet restore ".\src\BackOffice\BackOffice.csproj"
- name: Build
run: dotnet build ".\src\BackOffice\BackOffice.csproj" --configuration Release --no-restore
- name: Test
run: dotnet test ".\src\BackOffice\BackOffice.csproj" --no-restore --verbosity normal
- name: Recycle Apppool
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" recycle apppool /apppool.name:admin.kbs1.ir
shell: powershell
- name: Stop Website
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" stop site /site.name:admin.kbs1.ir
shell: powershell
- name: Publish
run: dotnet publish ".\src\BackOffice\BackOffice.csproj" -c Release -o publish
- name: Copy Publish To IIS Directory
run: Get-ChildItem -Path "publish\*" | Copy-Item -Destination "E:\kbs1.ir\admin.kbs1.ir\" -Recurse -Force
- name: Start Website
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" start site /site.name:admin.kbs1.ir
shell: powershell
+8 -8
View File
@@ -6,15 +6,15 @@ on:
- kub-stage
env:
REGISTRY: 194.5.195.53:30080
REGISTRY: 185.252.31.44:30080
IMAGE_NAME: admin/backoffice
K8S_SERVER: 194.5.195.53
K8S_SERVER: 185.252.31.44
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: 194.5.195.53:32082/docker-sshpass:latest
image: 185.252.31.44:32082/docker-sshpass:latest
options: --privileged
steps:
- name: Start Docker daemon
@@ -22,7 +22,7 @@ jobs:
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
}
DAEMON
echo "🚀 Starting Docker daemon..."
@@ -52,7 +52,7 @@ jobs:
- name: Login to Docker registries
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
- name: Build Docker Image
@@ -73,9 +73,9 @@ jobs:
# Apply manifests and restart
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} "
kubectl apply -f /tmp/backoffice-deployment.yaml &&
kubectl rollout restart deployment/backoffice &&
kubectl rollout status deployment/backoffice --timeout=180s &&
kubectl apply -n kbs-stage -f /tmp/backoffice-deployment.yaml &&
kubectl -n kbs-stage rollout restart deployment/backoffice &&
kubectl -n kbs-stage rollout status deployment/backoffice --timeout=180s &&
rm -f /tmp/backoffice-deployment.yaml
"
echo "✅ Deployed!"
+7 -8
View File
@@ -6,7 +6,7 @@ on:
- production
env:
REGISTRY: 194.5.195.53:30080
REGISTRY: 185.252.31.44:30080
IMAGE_NAME: admin/backoffice
K8S_SERVER: 45.149.79.127
@@ -14,7 +14,7 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: 194.5.195.53:32082/docker-sshpass:latest
image: 185.252.31.44:32082/docker-sshpass:latest
options: --privileged
steps:
- name: Start Docker daemon
@@ -22,7 +22,7 @@ jobs:
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
}
DAEMON
echo "🚀 Starting Docker daemon..."
@@ -40,7 +40,7 @@ jobs:
done
if ! docker info >/dev/null 2>&1; then
echo "❌ Docker daemon failed to start"
echo "❌ Docker daemon failed to start after 3 minutes"
exit 1
fi
@@ -50,16 +50,15 @@ jobs:
- name: Login to Docker registries
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
- name: Build Docker Image
run: |
cd src
DOCKER_BUILDKIT=0 docker build --network host -f BackOffice/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
DOCKER_BUILDKIT=0 docker build --network host -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:prod \
.
-f BackOffice/Dockerfile .
- name: Push to Registry
run: |
+2 -2
View File
@@ -1,10 +1,10 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
# User-specific files
*.rsuser
*.suo
*.user
+5 -5
View File
@@ -4,7 +4,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: backoffice
namespace: default
namespace: kbs-stage
labels:
app: backoffice
spec:
@@ -19,8 +19,8 @@ spec:
spec:
containers:
- name: backoffice
image: 194.5.195.53:30080/admin/backoffice:latest
imagePullPolicy: Always
image: 185.252.31.44:30080/admin/backoffice:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http
@@ -43,7 +43,7 @@ apiVersion: v1
kind: Service
metadata:
name: backoffice-svc
namespace: default
namespace: kbs-stage
spec:
selector:
app: backoffice
@@ -58,7 +58,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: backoffice-ingress
namespace: default
namespace: kbs-stage
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
+1 -1
View File
@@ -143,7 +143,7 @@
<ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />
</ItemGroup>
<ItemGroup Condition="!Exists('../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj')">
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.209" />
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.214" />
</ItemGroup>
<!-- ============================================================ -->
@@ -8,6 +8,7 @@ public static class RouteConstance
public const string Package = "/PackagePage/";
public const string Role = "/RolePage/";
public const string UserPage = "/UserPage/";
public const string InvitationsReport = "/InvitationsReportPage/";
public const string UserOrder = "/UserOrderPage/";
public const string Orders = "/OrdersPage/";
public const string OrdersSalesReports = "/OrdersSalesReportsPage/";
+3 -3
View File
@@ -1,4 +1,4 @@
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
FROM 185.252.31.44:32082/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy NuGet config and project file
@@ -16,7 +16,7 @@ WORKDIR "/src/BackOffice"
RUN dotnet publish "BackOffice.csproj" -c Release -o /app/publish
# Runtime stage - nginx for Blazor WebAssembly
FROM 194.5.195.53:32082/nginx:alpine AS final
FROM 185.252.31.44:32082/nginx:alpine AS final
WORKDIR /usr/share/nginx/html
# Remove default nginx files
@@ -32,7 +32,7 @@ RUN chmod +x /docker-entrypoint.sh
# Default Blazor environment (override via K8s env var BLAZOR_ENVIRONMENT)
ENV BLAZOR_ENVIRONMENT=Staging
# Default gateway URL for gRPC calls (injected into appsettings at startup)
ENV GW_URL=https://cms.kbs2.ir
ENV GW_URL=https://cms.se.kbs1.ir
EXPOSE 80
CMD ["/docker-entrypoint.sh"]
+1 -3
View File
@@ -2,10 +2,8 @@
<configuration>
<packageSources>
<clear />
<!-- Local packages (dev builds) -->
<!-- <add key="Local" value="/home/masoud/Apps/project/FourSat/nupkg" /> -->
<!-- Nexus (hosts FourSat packages + proxies nuget.org) -->
<add key="Nexus" value="http://194.5.195.53:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
<add key="Nexus" value="http://185.252.31.44:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
</packageSources>
<packageSourceCredentials>
<Nexus>
@@ -65,6 +65,11 @@
SortMode="SortMode.Multiple">
<Columns>
<PropertyColumn Property="x => x.WeekDisplayName" Title="هفته" />
<PropertyColumn Property="x => x.PackageTitle" Title="پکیج">
<CellTemplate>
@(string.IsNullOrEmpty(context.Item.PackageTitle) ? "—" : context.Item.PackageTitle)
</CellTemplate>
</PropertyColumn>
<PropertyColumn Property="x => x.TotalPoolAmount" Title="مبلغ کل استخر" Format="N0">
<CellTemplate>
<MudText>@context.Item.TotalPoolAmount.ToString("N0") تومان</MudText>
@@ -203,6 +208,8 @@
{
WeekDefinitionId = x.WeekDefinitionId,
WeekDisplayName = x.WeekDisplayName,
PackageId = x.PackageId,
PackageTitle = x.PackageTitle,
TotalPoolAmount = x.TotalPoolAmount,
TotalBalances = x.TotalBalances,
ValuePerBalance = x.ValuePerBalance,
@@ -249,6 +256,8 @@
{
public long WeekDefinitionId { get; set; }
public string WeekDisplayName { get; set; } = "";
public long PackageId { get; set; }
public string PackageTitle { get; set; } = "";
public long TotalPoolAmount { get; set; }
public int TotalBalances { get; set; }
public long ValuePerBalance { get; set; }
@@ -18,12 +18,13 @@ public partial class WeeklyReports
try
{
var sb = new StringBuilder();
sb.AppendLine("هفته,مبلغ کل استخر,مجموع موجودی‌ها,ارزش هر موجودی,وضعیت,تاریخ محاسبه");
sb.AppendLine("هفته,پکیج,مبلغ کل استخر,مجموع موجودی‌ها,ارزش هر موجودی,وضعیت,تاریخ محاسبه");
foreach (var r in _reports)
{
sb.AppendLine(string.Join(",",
EscapeCsv(r.WeekDisplayName),
EscapeCsv(r.PackageTitle),
r.TotalPoolAmount,
r.TotalBalances,
r.ValuePerBalance,
@@ -56,6 +56,10 @@
@* ── Steps ── *@
<MudExpansionPanel Text="@($"مراحل ({Model.Steps.Count})")" Icon="@Icons.Material.Filled.FormatListNumbered">
<MudStack Spacing="2" Class="pa-2">
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
<MudSwitch T="bool" @bind-Value="_stepsEnabled" Color="Color.Primary" />
<MudText Typo="Typo.body2">نمایش بخش «چگونه کار می‌کند؟»</MudText>
</MudStack>
<MudTextField @bind-Value="Model.StepsTitle"
Label="عنوان بخش مراحل"
Placeholder="سه گام تا شروع"
@@ -99,6 +103,10 @@
@* ── Features ── *@
<MudExpansionPanel Text="@($"ویژگی‌ها ({Model.Features.Count})")" Icon="@Icons.Material.Filled.Star">
<MudStack Spacing="2" Class="pa-2">
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
<MudSwitch T="bool" @bind-Value="_featuresEnabled" Color="Color.Primary" />
<MudText Typo="Typo.body2">نمایش بخش «امکانات پلتفرم»</MudText>
</MudStack>
<MudTextField @bind-Value="Model.FeaturesTitle"
Label="عنوان بخش ویژگی‌ها"
Placeholder="چرا کارا بازار سلامت؟"
@@ -329,4 +337,16 @@
get => Model.FeaturedBlogEnabled ?? true;
set => Model.FeaturedBlogEnabled = value;
}
private bool _stepsEnabled
{
get => Model.StepsEnabled ?? false;
set => Model.StepsEnabled = value;
}
private bool _featuresEnabled
{
get => Model.FeaturesEnabled ?? false;
set => Model.FeaturesEnabled = value;
}
}
@@ -9,8 +9,10 @@ public class LandingSettingsModel
public string? HeroButtonPrimaryText { get; set; }
public string? HeroButtonSecondaryText { get; set; }
public List<TrustBadgeModel> TrustBadges { get; set; } = new();
public bool? StepsEnabled { get; set; }
public string? StepsTitle { get; set; }
public List<StepModel> Steps { get; set; } = new();
public bool? FeaturesEnabled { get; set; }
public string? FeaturesTitle { get; set; }
public List<FeatureModel> Features { get; set; } = new();
public string? StatsTitle { get; set; }
@@ -96,6 +96,16 @@
</ToolBarContent>
<Columns>
<PropertyColumn Property="x => x.Id" Title="شناسه" />
<TemplateColumn Title="کاربر">
<CellTemplate>
@(context.Item.UserId != null ? context.Item.UserId.ToString() : "—")
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="نام کاربر">
<CellTemplate>
@(string.IsNullOrWhiteSpace(context.Item.UserFullName) ? "—" : context.Item.UserFullName)
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="نوع">
<CellTemplate>
<MudChip T="string" Size="Size.Small" Variant="Variant.Text">
@@ -232,13 +242,13 @@
Filter = BuildFilter()
});
var sb = new System.Text.StringBuilder();
sb.AppendLine("Id,Type,Amount,Description,Status,RefId,PaymentDate,Created");
sb.AppendLine("Id,UserId,UserFullName,Type,Amount,Description,Status,RefId,PaymentDate,Created");
foreach (var r in result.Models)
{
var type = r.HasType ? ReportLabels.GetTransactionTypeLabel(r.Type) : "";
var status = r.HasPaymentStatus ? ReportLabels.GetTransactionPaymentStatusLabel(r.PaymentStatus) : "";
var paymentDate = r.PaymentDate != null ? r.PaymentDate.ToDateTime().ToString("yyyy-MM-dd HH:mm") : "";
sb.AppendLine($"{r.Id},{type},{r.Amount},\"{r.Description}\",{status},{r.RefId},{paymentDate},{r.Created.ToDateTime():yyyy-MM-dd HH:mm}");
sb.AppendLine($"{r.Id},{r.UserId},\"{r.UserFullName}\",{type},{r.Amount},\"{r.Description}\",{status},{r.RefId},{paymentDate},{r.Created.ToDateTime():yyyy-MM-dd HH:mm}");
}
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "ledger-transactions.csv", sb.ToString());
}
@@ -82,6 +82,11 @@
<Columns>
<PropertyColumn Property="x => x.Id" Title="شناسه" />
<PropertyColumn Property="x => x.UserId" Title="کاربر" />
<TemplateColumn Title="نام کاربر">
<CellTemplate>
@(string.IsNullOrWhiteSpace(context.Item.UserFullName) ? "—" : context.Item.UserFullName)
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="x => x.Mobile" Title="موبایل" />
<PropertyColumn Property="x => x.GatewayProvider" Title="درگاه" />
<TemplateColumn Title="مبلغ (تومان)">
@@ -193,9 +198,9 @@
Filter = BuildFilter()
});
var sb = new System.Text.StringBuilder();
sb.AppendLine("Id,UserId,Mobile,Gateway,Amount,Authority,RefId,Status,OrderId,Created");
sb.AppendLine("Id,UserId,UserFullName,Mobile,Gateway,Amount,Authority,RefId,Status,OrderId,Created");
foreach (var r in result.Models)
sb.AppendLine($"{r.Id},{r.UserId},{r.Mobile},{r.GatewayProvider},{r.Amount},{r.Authority},{r.RefId},{r.PaymentStatus},{r.OrderId},{r.CreatedAt.ToDateTime():yyyy-MM-dd HH:mm}");
sb.AppendLine($"{r.Id},{r.UserId},\"{r.UserFullName}\",{r.Mobile},{r.GatewayProvider},{r.Amount},{r.Authority},{r.RefId},{r.PaymentStatus},{r.OrderId},{r.CreatedAt.ToDateTime():yyyy-MM-dd HH:mm}");
await jsRuntime.InvokeVoidAsync("jsSaveAsFile", "payment-transactions.csv", sb.ToString());
}
catch (Exception ex) { Snackbar.Add($"خطا در export: {ex.Message}", Severity.Error); }
@@ -0,0 +1,85 @@
@attribute [Route(RouteConstance.InvitationsReport)]
@using CMSMicroservice.Protobuf.Protos.User
@using BackOffice.Common.BaseComponents
@using DataModel = CMSMicroservice.Protobuf.Protos.User.InvitationReportModel
<BackOffice.Common.BaseComponents.BasePageComponent @ref="_basePage" OnClearFilterClick="OnFilterCleared" OnSubmitClick="OnFilterSubmit">
<Filters>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="موبایل دعوت‌کننده" @bind-Value="@_request.Filter.InviterMobile" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="نام دعوت‌کننده" @bind-Value="@_request.Filter.InviterFirstName" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="نام‌خانوادگی دعوت‌کننده" @bind-Value="@_request.Filter.InviterLastName" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="موبایل دعوت‌شونده" @bind-Value="@_request.Filter.InviteeMobile" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="نام دعوت‌شونده" @bind-Value="@_request.Filter.InviteeFirstName" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudTextField T="string" Clearable="true" Label="نام‌خانوادگی دعوت‌شونده" @bind-Value="@_request.Filter.InviteeLastName" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudItem>
<MudItem xs="12" sm="6" md="3">
<MudSelect T="string" Label="وضعیت باشگاه دعوت‌شونده" @bind-Value="_clubActiveFilter" Clearable="true" Variant="Variant.Outlined" Margin="Margin.Dense">
<MudSelectItem Value="@("")">همه</MudSelectItem>
<MudSelectItem Value="@("true")">فعال</MudSelectItem>
<MudSelectItem Value="@("false")">غیرفعال</MudSelectItem>
</MudSelect>
</MudItem>
</Filters>
<Content>
<MudDataGrid T="DataModel" ServerData="@(new Func<GridState<DataModel>, Task<GridData<DataModel>>>(ServerReload))"
Hover="true" @ref="_gridData" Height="calc(100vh - 240px)">
<ToolBarContent>
<MudText>گزارش دعوت‌ها (جدیدترین اول)</MudText>
</ToolBarContent>
<Columns>
<PropertyColumn Property="x => x.Id" Title="شناسه" />
<TemplateColumn Title="دعوت‌کننده">
<CellTemplate>
<MudText Typo="Typo.body2">@($"{context.Item.InviterFirstName} {context.Item.InviterLastName}".Trim())</MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">@context.Item.InviterMobile</MudText>
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="دعوت‌شونده">
<CellTemplate>
<MudText Typo="Typo.body2">@($"{context.Item.InviteeFirstName} {context.Item.InviteeLastName}".Trim())</MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">@context.Item.InviteeMobile</MudText>
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="ثبت‌نام دعوت‌شونده">
<CellTemplate>
@(context.Item.InviteeRegisteredAt?.ToDateTime().ToLocalTime().ToString("yyyy/MM/dd HH:mm") ?? "—")
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="باشگاه">
<CellTemplate>
@if (context.Item.InviteeClubActive)
{
<MudChip T="string" Size="Size.Small" Color="Color.Success">فعال</MudChip>
}
else
{
<MudChip T="string" Size="Size.Small" Color="Color.Default">غیرفعال</MudChip>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="تاریخ دعوت">
<CellTemplate>
@(context.Item.InvitedAt?.ToDateTime().ToLocalTime().ToString("yyyy/MM/dd HH:mm") ?? "—")
</CellTemplate>
</TemplateColumn>
</Columns>
<PagerContent>
<MudDataGridPager T="DataModel" />
</PagerContent>
<NoRecordsContent>
<MudText>موردی یافت نشد</MudText>
</NoRecordsContent>
</MudDataGrid>
</Content>
</BackOffice.Common.BaseComponents.BasePageComponent>
@@ -0,0 +1,74 @@
using CMSMicroservice.Protobuf.Protos.User;
using BackOffice.Common.BaseComponents;
using Microsoft.AspNetCore.Components;
using MudBlazor;
using DataModel = CMSMicroservice.Protobuf.Protos.User.InvitationReportModel;
namespace BackOffice.Pages.User;
public partial class InvitationsReportPage
{
[Inject] public UserContract.UserContractClient UserContract { get; set; } = default!;
private MudDataGrid<DataModel> _gridData = default!;
private BasePageComponent _basePage = default!;
private GetInvitationsByFilterRequest _request = new() { Filter = new() };
private string _clubActiveFilter = string.Empty;
private async Task<GridData<DataModel>> ServerReload(GridState<DataModel> state)
{
_request.Filter ??= new();
ApplyClubFilter();
_request.PaginationState ??= new();
_request.PaginationState.PageNumber = state.Page + 1;
_request.PaginationState.PageSize = state.PageSize;
_request.SortBy = "newest";
var result = await UserContract.GetInvitationsByFilterAsync(_request);
if (result?.Models != null && result.Models.Any())
{
return new GridData<DataModel>
{
Items = result.Models.ToList(),
TotalItems = (int)result.MetaData.TotalCount
};
}
return new GridData<DataModel>();
}
private void ApplyClubFilter()
{
_request.Filter ??= new();
if (_clubActiveFilter == "true")
_request.Filter.InviteeClubActive = true;
else if (_clubActiveFilter == "false")
_request.Filter.InviteeClubActive = false;
else
_request.Filter.InviteeClubActive = null;
}
private void ReLoadData()
{
_ = _gridData.ReloadServerData();
}
public async Task OnFilterSubmit()
{
ApplyClubFilter();
_basePage.IsFiltered = true;
StateHasChanged();
ReLoadData();
await Task.CompletedTask;
}
public async Task OnFilterCleared()
{
_basePage.IsFiltered = false;
_clubActiveFilter = string.Empty;
_request = new() { Filter = new() };
StateHasChanged();
ReLoadData();
await Task.CompletedTask;
}
}
@@ -148,7 +148,7 @@
<MudTh>محصول</MudTh>
<MudTh>قیمت واحد</MudTh>
<MudTh>تعداد</MudTh>
<MudTh>تخفیف واحد</MudTh>
<MudTh>جمع کل</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>
@@ -157,7 +157,7 @@
<MudTd>@context.ProductTitle</MudTd>
<MudTd>@context.UnitPrice?.ToString("N0")</MudTd>
<MudTd>@context.Count</MudTd>
<MudTd>@context.UnitDiscountPrice?.ToString("N0")</MudTd>
<MudTd>@(((context.UnitPrice ?? 0) * (context.Count ?? 0)).ToString("N0"))</MudTd>
</RowTemplate>
</MudTable>
}
+5
View File
@@ -185,6 +185,11 @@
Icon="@Icons.Material.Filled.People">
کاربران
</MudNavLink>
<MudNavLink Match="NavLinkMatch.Prefix"
Href="@(RouteConstance.InvitationsReport)"
Icon="@Icons.Material.Filled.GroupAdd">
گزارش دعوت‌ها
</MudNavLink>
}
@if (CanManageRoles)
@@ -1,5 +1,5 @@
{
"GwUrl": "https://cms.kbs2.ir",
"GwUrl": "https://cms.kbs1.ir",
"Authentication": {
"Authority": "https://ids.afrino.co/",
"ClientId": "client_backoffice_spa"