u
This commit is contained in:
46
.gitea/workflows/fo-stage.yml
Normal file
46
.gitea/workflows/fo-stage.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
name: Push nuget and docker image Actions Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- stage
|
||||
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\FrontOffice.Main\FrontOffice.Main.csproj"
|
||||
- name: Build
|
||||
run: dotnet build ".\src\FrontOffice.Main\FrontOffice.Main.csproj" --configuration Release --no-restore
|
||||
- name: Test
|
||||
run: dotnet test ".\src\FrontOffice.Main\FrontOffice.Main.csproj" --no-restore --verbosity normal
|
||||
- name: Recycle Apppool
|
||||
run: |
|
||||
& "C:\Windows\System32\inetsrv\appcmd.exe" recycle apppool /apppool.name:kbs1.ir
|
||||
shell: powershell
|
||||
- name: Stop Website
|
||||
run: |
|
||||
& "C:\Windows\System32\inetsrv\appcmd.exe" stop site /site.name:kbs1.ir
|
||||
shell: powershell
|
||||
- name: Publish
|
||||
run: dotnet publish ".\src\FrontOffice.Main\FrontOffice.Main.csproj" -c Release -o publish
|
||||
- name: Copy Publish To IIS Directory
|
||||
run: Get-ChildItem -Path "publish\*" | Copy-Item -Destination "E:\kbs1.ir\kbs1.ir\" -Recurse -Force
|
||||
- name: Start Website
|
||||
run: |
|
||||
& "C:\Windows\System32\inetsrv\appcmd.exe" start site /site.name:kbs1.ir
|
||||
shell: powershell
|
||||
@@ -142,6 +142,15 @@
|
||||
<MudText Typo="Typo.subtitle1" Class="mud-text-secondary mb-8">
|
||||
بر اساس اندازهٔ تیم خود انتخاب کنید.
|
||||
</MudText>
|
||||
@if (_isLoadingPackages)
|
||||
{
|
||||
<MudStack AlignItems="AlignItems.Center" Class="py-8">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true" Size="Size.Large" />
|
||||
<MudText Typo="Typo.body1" Class="mud-text-secondary mt-2">در حال بارگذاری پکیجها...</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
else if (_packs.Any())
|
||||
{
|
||||
<MudGrid Spacing="3" Justify="Justify.Center" Class="stretch-grid">
|
||||
@foreach (var p in _packs)
|
||||
{
|
||||
@@ -154,22 +163,20 @@
|
||||
ObjectPosition="ObjectPosition.Center"
|
||||
Class="feature-img" />
|
||||
<div class="pa-5">
|
||||
<MudText Typo="Typo.h6" Class="mb-1">@(p.Title)</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-2">@(p.Body)</MudText>
|
||||
<MudList T="string" Dense="true">
|
||||
@foreach (var item in p.Items)
|
||||
{
|
||||
<MudListItem T="string" Value="@item">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Verified" Size="Size.Small" Class="ml-2" />
|
||||
@item
|
||||
</MudListItem>
|
||||
}
|
||||
</MudList>
|
||||
<MudText Typo="Typo.h6" Class="mb-2">@(p.Title)</MudText>
|
||||
@((MarkupString)p.Body)
|
||||
</div>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
}
|
||||
</MudGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudStack AlignItems="AlignItems.Center" Class="py-8">
|
||||
<MudText Typo="Typo.body1" Class="mud-text-secondary">هیچ پکیجی یافت نشد.</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
</MudContainer>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,10 +1,53 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using FrontOffice.BFF.Package.Protobuf.Protos.Package;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages;
|
||||
public partial class Index
|
||||
{
|
||||
[Inject] private PackageContract.PackageContractClient PackageClient { get; set; } = default!;
|
||||
|
||||
private string? _email;
|
||||
private bool _isLoadingPackages;
|
||||
private List<Pack> _packs = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadPackagesAsync();
|
||||
}
|
||||
|
||||
private async Task LoadPackagesAsync()
|
||||
{
|
||||
_isLoadingPackages = true;
|
||||
try
|
||||
{
|
||||
var response = await PackageClient.GetAllPackageByFilterAsync(request: new());
|
||||
if (response?.Models?.Any() == true)
|
||||
{
|
||||
_packs = response.Models.Select(p => new Pack(
|
||||
p.Title,
|
||||
p.Description,
|
||||
Image: UrlUtility.DownloadUrl + p.ImagePath
|
||||
)).ToList();
|
||||
}
|
||||
else
|
||||
_packs = new List<Pack>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"خطا در بارگذاری پکیجها: {ex.Message}", Severity.Error);
|
||||
// Fallback to empty list
|
||||
_packs = new List<Pack>();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoadingPackages = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
private void JoinWaitlist()
|
||||
{
|
||||
@@ -17,30 +60,9 @@ public partial class Index
|
||||
_email = string.Empty;
|
||||
}
|
||||
|
||||
private record Pack(string Title, string Body, IEnumerable<string> Items, string Image);
|
||||
private record Pack(string Title, string Body, string Image);
|
||||
private record Plan(string Name, string Price, bool Highlight, IEnumerable<string> Features);
|
||||
private record QA(string Q, string A);
|
||||
|
||||
private readonly List<Pack> _packs = new()
|
||||
{
|
||||
new("پکیج استارتر", "برای تیمهای کوچک و شروع سریع.", new []{
|
||||
"تا ۲۰۰ عضو فعال",
|
||||
"نمایش شجرهنامه پایه",
|
||||
"گزارشهای ماهانه"
|
||||
}, "https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?q=80&w=1200&auto=format&fit=crop"),
|
||||
|
||||
new("پکیج رشد", "برای تیمهای در حال توسعه.", new []{
|
||||
"تا ۵۰۰۰ عضو",
|
||||
"موتور کارمزد پیشرفته",
|
||||
"پشتیبانی اولویتدار"
|
||||
}, "https://images.unsplash.com/photo-1551836022-4e32a88b5f16?q=80&w=1200&auto=format&fit=crop"),
|
||||
|
||||
new("پکیج اسکیل", "برای سازمانهای بزرگ و حساس.", new []{
|
||||
"اعضای نامحدود",
|
||||
"قوانین سفارشی کارمزد",
|
||||
"SLA و آنبوردینگ اختصاصی"
|
||||
}, "https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?q=80&w=1200&auto=format&fit=crop"),
|
||||
};
|
||||
private readonly List<Plan> _plans = new()
|
||||
{
|
||||
new("استارتر", "رایگان", false, new []{ "تا ۲۰۰ عضو", "شجرهنامه پایه", "پشتیبانی ایمیلی" }),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
//"GwUrl": "https://afrinogw.afrino.co",
|
||||
"GwUrl": "https://localhost:34781",
|
||||
"GwUrl": "https://fogw.kbs1.ir",
|
||||
//"GwUrl": "https://localhost:34781",
|
||||
"DownloadUrl": "https://dl.afrino.co",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
||||
Reference in New Issue
Block a user