fix : order homepage informations
parent
684b7783f8
commit
53a7bf501f
|
@ -2,6 +2,7 @@
|
|||
@using Netina.AdminPanel.PWA.Layout
|
||||
@using Netina.AdminPanel.PWA.Pages
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IConfiguration Configuration
|
||||
<Router AppAssembly="@typeof(App).Assembly">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
||||
|
@ -30,3 +31,4 @@
|
|||
|
||||
|
||||
</Router>
|
||||
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
Icon="@Icons.Material.Outlined.WebAsset">دسته بندی های بلاگـــ</MudNavLink>
|
||||
</MudNavGroup>
|
||||
|
||||
<MudNavGroup Title="مدیریت برگه ها" Expanded="false"
|
||||
Icon="@Icons.Material.Outlined.Pages">
|
||||
<MudNavLink Href="management/pages" Icon="@Icons.Material.Filled.Pageview">برگه ها</MudNavLink>
|
||||
<MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink>
|
||||
</MudNavGroup>
|
||||
|
||||
@if (isShop)
|
||||
{
|
||||
<MudNavGroup Title="حسابداری" Expanded="false"
|
||||
|
@ -83,7 +89,6 @@
|
|||
<MudNavGroup Title="فروشگاه من" Expanded="false" Icon="@Icons.Material.Outlined.Settings">
|
||||
<MudNavLink Href="management/shop" Icon="@Icons.Material.Filled.Shop2">فروشگاه</MudNavLink>
|
||||
<MudNavLink Href="management/marketer" Icon="@Icons.Material.Filled.Person4">بازاریاب ها</MudNavLink>
|
||||
<MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink>
|
||||
</MudNavGroup>
|
||||
}
|
||||
else
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<MudText Typo="Typo.caption">می توانید کتن کامل بلاگــــ خود را کامل وارد کنید</MudText>
|
||||
</MudStack>
|
||||
<MudGrid>
|
||||
<MudItem sm="12" class="!text-black">
|
||||
<MudItem sm="12" class="!text-black max-h-[60vh] !overflow-y-scroll">
|
||||
|
||||
<RichTextEditorUi @bind-Text="@ViewModel.Content" />
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ public class BlogActionDialogBoxViewModel : BaseViewModel
|
|||
if (SelectedCategory == null)
|
||||
throw new Exception("لطفا یک دسته بندی انتخاب کنید");
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
|
||||
if (token == null)
|
||||
throw new Exception("Token is null");
|
||||
var request = new BlogLDto
|
||||
{
|
||||
Id = Blog.Id,
|
||||
|
@ -126,7 +127,7 @@ public class BlogActionDialogBoxViewModel : BaseViewModel
|
|||
Summery = Summery,
|
||||
Tags = Tags
|
||||
};
|
||||
await _restWrapper.CrudApiRest<Blog, Guid>(Address.BlogController).Create<BlogLDto>(request, token);
|
||||
await _restWrapper.CrudApiRest<Blog, Guid>(Address.BlogController).Update<BlogLDto>(request, token);
|
||||
_snackbar.Add($"ویرایش بلاگ {Title} با موفقیت انجام شد", Severity.Success);
|
||||
_mudDialog.Close();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ public static class StorageFileExtension
|
|||
{
|
||||
public static string GetLink(this StorageFileSDto file)
|
||||
{
|
||||
var link = $"https://storage.vesmeh.com/{file.FileLocation}";
|
||||
var link = $"{Address.StorageAddress}{file.FileLocation}";
|
||||
return link;
|
||||
}
|
||||
}
|
|
@ -2,32 +2,25 @@
|
|||
|
||||
public static class Address
|
||||
{
|
||||
|
||||
public static string WebSiteAddress = string.Empty;
|
||||
public static string StorageAddress = string.Empty;
|
||||
#if DEBUG
|
||||
public static string BaseAddress = "http://localhost:32770/api";
|
||||
//public static string BaseAddress = "https://api.vesmeh.com/api";
|
||||
#else
|
||||
public static string BaseAddress = "https://api.vesmeh.com/api";
|
||||
#endif
|
||||
public static string AuthController = $"{BaseAddress}/auth";
|
||||
public static string UserController = $"{BaseAddress}/user";
|
||||
public static string ProductCategoryController = $"{BaseAddress}/product/category";
|
||||
public static string ProductController = $"{BaseAddress}/product";
|
||||
public static string BrandController = $"{BaseAddress}/brand";
|
||||
public static string FileController => $"{BaseAddress}/file";
|
||||
public static string BlogController => $"{BaseAddress}/blog";
|
||||
public static string BlogCategoryController => $"{BaseAddress}/blog/category";
|
||||
public static string DiscountController => $"{BaseAddress}/discount";
|
||||
public static string RoleController => $"{BaseAddress}/user/role";
|
||||
public static string ShippingController => $"{BaseAddress}/warehouse/shipping";
|
||||
public static string OrderController => $"{BaseAddress}/order";
|
||||
public static string PaymentController => $"{BaseAddress}/accounting/pay";
|
||||
public static string PageController => $"{BaseAddress}/page";
|
||||
public static string ScraperController => $"{BaseAddress}/scraper";
|
||||
public static string NewsletterMemberController => $"{BaseAddress}/newsletter/member";
|
||||
public static string DashboardController => $"{BaseAddress}/dashboard";
|
||||
public static string SettingController => $"{BaseAddress}/setting";
|
||||
public static string DistrictController => $"{BaseAddress}/district";
|
||||
public static string AuthController = $"/auth";
|
||||
public static string UserController = $"/user";
|
||||
public static string ProductCategoryController = $"/product/category";
|
||||
public static string ProductController = $"/product";
|
||||
public static string BrandController = $"/brand";
|
||||
public static string FileController => $"/file";
|
||||
public static string BlogController => $"/blog";
|
||||
public static string BlogCategoryController => $"/blog/category";
|
||||
public static string DiscountController => $"/discount";
|
||||
public static string RoleController => $"/user/role";
|
||||
public static string ShippingController => $"/warehouse/shipping";
|
||||
public static string OrderController => $"/order";
|
||||
public static string PaymentController => $"/accounting/pay";
|
||||
public static string PageController => $"/page";
|
||||
public static string ScraperController => $"/scraper";
|
||||
public static string NewsletterMemberController => $"/newsletter/member";
|
||||
public static string DashboardController => $"/dashboard";
|
||||
public static string SettingController => $"/setting";
|
||||
public static string DistrictController => $"/district";
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
namespace Netina.AdminPanel.PWA.Models;
|
||||
|
||||
public static class StatConfigs
|
||||
{
|
||||
public static bool IsShop { get; set; } = false;
|
||||
}
|
|
@ -5,8 +5,8 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
||||
<AssemblyVersion>0.25.27.48</AssemblyVersion>
|
||||
<FileVersion>0.25.27.48</FileVersion>
|
||||
<AssemblyVersion>0.27.31.52</AssemblyVersion>
|
||||
<FileVersion>0.27.31.52</FileVersion>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class FaqManagementPageViewModel : BaseViewModel<FAQPage>
|
|||
PageDto = dto.GetData<FAQPage>();
|
||||
_request = new PageActionRequestDto
|
||||
{
|
||||
Name = dto.Name,
|
||||
Title = dto.Title,
|
||||
Content = dto.Content,
|
||||
Description = dto.Description,
|
||||
Id = dto.Id,
|
||||
|
@ -76,7 +76,7 @@ public class FaqManagementPageViewModel : BaseViewModel<FAQPage>
|
|||
IsProcessing = true;
|
||||
var request = new PageActionRequestDto
|
||||
{
|
||||
Name = "سوالات متداول",
|
||||
Title = "سوالات متداول",
|
||||
Content = string.Empty,
|
||||
Description = string.Empty,
|
||||
Data = PageDto,
|
||||
|
|
|
@ -69,15 +69,30 @@
|
|||
|
||||
</div>
|
||||
<div class="h-full basis-full md:basis-1/2 md:rounded-tr-none md:rounded-bl-xl md:rounded-tl-xl flex md:px-10 lg:px-20 py-8 px-4">
|
||||
|
||||
<div class="mx-auto my-auto">
|
||||
<dotlottie-player src="https://lottie.host/235bcb2d-0f2c-4f06-9c36-7e6677b82e00/9tGECPkU5J.json"
|
||||
@if (StatConfigs.IsShop)
|
||||
{
|
||||
<div class="mx-auto my-auto">
|
||||
<dotlottie-player src="https://lottie.host/235bcb2d-0f2c-4f06-9c36-7e6677b82e00/9tGECPkU5J.json"
|
||||
background="transparent" speed="1" class="mx-auto w-64 h-64 lg:w-96 lg:h-96" loop autoplay />
|
||||
|
||||
<MudText Typo="Typo.h5" Align="Align.Center"><b>داشبورد تخصصی وسمه</b></MudText>
|
||||
<MudText Align="Align.Center">شما میتوانید با ورود به داشبورد تخصصی نتینا فروشگاه خود را مدیریت کنید </MudText>
|
||||
<MudText Typo="Typo.h5" Align="Align.Center"><b>داشبورد تخصصی وسمه</b></MudText>
|
||||
<MudText Align="Align.Center">شما میتوانید با ورود به داشبورد تخصصی نتینا فروشگاه خود را مدیریت کنید </MudText>
|
||||
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<div class="mx-auto my-auto">
|
||||
<dotlottie-player src="https://s3.ir-thr-at1.arvanstorage.ir/amir-content/Lotties/SEO-strategy-animation_management.json"
|
||||
background="transparent" speed="1" class="mx-auto w-64 h-64 lg:w-96 lg:h-96" loop autoplay />
|
||||
|
||||
<MudText Typo="Typo.h5" Align="Align.Center"><b>داشبورد وب سایت شما</b></MudText>
|
||||
<MudText Align="Align.Center">شما میتوانید با ورود به داشبورد ، وب سایت خود را مدیریت کنید </MudText>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
|
|
|
@ -15,28 +15,28 @@
|
|||
<MudItem xs="12" sm="6" lg="3">
|
||||
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
|
||||
<MudText Typo="Typo.body1" class="mb-4">سفارشات امروز</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-amber-600"><b>1124</b></MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-amber-600"><b>@ViewModel.PageDto.TodayOrdersCount</b></MudText>
|
||||
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" lg="3">
|
||||
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
|
||||
<MudText Typo="Typo.body1" class="mb-4">سفارشات در انتظار تایید</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-blue-600"><b>845</b></MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-blue-600"><b>@ViewModel.PageDto.PayedOrdersCount</b></MudText>
|
||||
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" lg="3">
|
||||
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
|
||||
<MudText Typo="Typo.body1" class="mb-4">تغییر نسبت هفته پیش</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-lime-600"><b>125</b></MudText>
|
||||
<MudText Typo="Typo.body1" class="mb-4">سفارشات ارسال نشده</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-lime-600"><b>@ViewModel.PageDto.UnSendOrdersCount</b></MudText>
|
||||
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" lg="3">
|
||||
<MudPaper class="p-3 m-2 rounded-md" Elevation="2">
|
||||
<MudText Typo="Typo.body1" class="mb-4">تغییر نسبت به ماه پیش</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-rose-600"><b>10</b></MudText>
|
||||
<MudText Typo="Typo.body1" class="mb-4">مجموع سفارش ماه</MudText>
|
||||
<MudText Typo="Typo.h3" Align="Align.Center" class="text-rose-600"><b>@ViewModel.PageDto.ThisMonthOrdersCount</b></MudText>
|
||||
<MudText Typo="Typo.h6" Align="Align.Center" class="mb-4 -mt-1"><b>عدد</b></MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace Netina.AdminPanel.PWA.Pages;
|
||||
|
||||
public class OrdersPageViewModel : BaseViewModel
|
||||
public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
|
||||
{
|
||||
private readonly NavigationManager _navigationManager;
|
||||
private readonly ISnackbar _snackbar;
|
||||
|
@ -36,6 +36,9 @@ public class OrdersPageViewModel : BaseViewModel
|
|||
dto.ForEach(d => MainOrders.Add(d));
|
||||
if (MainOrders.Count == 15)
|
||||
MainGridPageCount = 2;
|
||||
|
||||
var orderDashboardDto = await _restWrapper.DashboardApiRest.GetOrdersDashboardAsync(token);
|
||||
PageDto = orderDashboardDto;
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@page "/pages"
|
||||
@page "/management/pages"
|
||||
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
||||
|
||||
@inject IDialogService DialogService
|
||||
|
@ -8,87 +8,69 @@
|
|||
@inject IRestWrapper RestWrapper
|
||||
|
||||
<MudStack class="w-full p-8 h-screen bg-[--mud-palette-background-grey]">
|
||||
<MudGrid>
|
||||
<MudItem xs="12">
|
||||
<MudStack Row="true" class="mb-5">
|
||||
<MudText Typo="Typo.h4">پرداختـــ ها</MudText>
|
||||
<MudPaper class="px-5 py-5">
|
||||
<MudStack>
|
||||
<MudStack Row="true">
|
||||
<MudStack class="mb-5 mx-2">
|
||||
<MudText Typo="Typo.h4">تنظیمات برگه ها</MudText>
|
||||
<MudText Typo="Typo.caption">برگه های وب سایت خود را ویرایش نمایید</MudText>
|
||||
</MudStack>
|
||||
|
||||
<MudSpacer />
|
||||
@* <BaseButtonUi Size="Size.Large"
|
||||
OnClickCallback="ViewModel.SubmitPagesSettingAsync"
|
||||
class="mt-2 mb-8 w-64 rounded-md"
|
||||
IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.Outlined.Check"
|
||||
Content="ثبتـــ اطلاعات" Variant="Variant.Filled" Color="Color.Success" /> *@
|
||||
</MudStack>
|
||||
<MudPaper>
|
||||
<MudDataGrid FixedFooter="true" FixedHeader="true" Striped="true"
|
||||
T="PaymentSDto" Items="@ViewModel.PageDto" CurrentPage="@ViewModel.CurrentPage"
|
||||
RowsPerPage="20" Filterable="false" Loading="@ViewModel.IsProcessing"
|
||||
SortMode="@SortMode.None" Groupable="false">
|
||||
<MudGrid class="!max-h-[80vh] overflow-auto">
|
||||
<MudItem xs="6">
|
||||
|
||||
@* <ToolBarContent>
|
||||
<MudTextField T="string" Placeholder="جست جو بر اساس کد پیگیری" Adornment="Adornment.Start" Immediate="true"
|
||||
Clearable="true"
|
||||
ValueChanged="@ViewModel.SearchChanged"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" class="my-auto"
|
||||
OnAdornmentClick="@ViewModel.SearchAsync"></MudTextField>
|
||||
</ToolBarContent> *@
|
||||
<Columns>
|
||||
<PropertyColumn Title="شماره فاکتور" Property="arg => arg.FactorNumber" />
|
||||
<PropertyColumn Title="پرداخت کننده" Property="arg => arg.CustomerFullName" />
|
||||
<PropertyColumn Title="شماره تماس" Property="arg => arg.CustomerPhoneNumber" />
|
||||
<TemplateColumn T="PaymentSDto" Title="نوع پرداخت">
|
||||
<MudDivider />
|
||||
<MudText class="mt-4 mb-5" Typo="Typo.h6">افزودن برگه جدید</MudText>
|
||||
|
||||
<CellTemplate>
|
||||
<p>@context.Item.Type.ToDisplay()</p>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
<TemplateColumn T="PaymentSDto" Title="وظعیت پرداخت">
|
||||
<MudTextField @bind-Value="@ViewModel.NewPageDto.Title" T="string" Label="عنوان" Variant="Variant.Outlined" />
|
||||
|
||||
<CellTemplate>
|
||||
<p>@context.Item.Status.ToDisplay()</p>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
<MudTextField class="my-3" @bind-Value="@ViewModel.NewPageDto.Slug" T="string" Label="اسلاگ" Variant="Variant.Outlined" />
|
||||
|
||||
<TemplateColumn T="PaymentSDto" Title="مبلغ سفارش ">
|
||||
<MudButton class="w-full py-3 mt-1" Variant="Variant.Outlined" Color="Color.Secondary" OnClick="ViewModel.AddPageAsync">افزودن +</MudButton>
|
||||
|
||||
<CellTemplate>
|
||||
<p>@context.Item.Amount.ToString("N0") ریالــ</p>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudExpansionPanels>
|
||||
@foreach (var navMenuItem in ViewModel.PageDto)
|
||||
{
|
||||
<MudExpansionPanel>
|
||||
<TitleContent>
|
||||
<MudStack Row="true">
|
||||
<MudText class="my-auto">@navMenuItem.Title</MudText>
|
||||
<MudSpacer />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete" OnClick="async ()=>{await ViewModel.RemovePageAsync(navMenuItem.Id);}" Color="Color.Error"></MudIconButton>
|
||||
</MudStack>
|
||||
</TitleContent>
|
||||
<ChildContent>
|
||||
|
||||
<TemplateColumn T="PaymentSDto" Title="تاریخ پرداخت">
|
||||
<CellTemplate>
|
||||
<p>@context.Item.CreatedAt.ToPersianDateTime().ToLongDateString()</p>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
<MudTextField class="my-3" @bind-Value="@navMenuItem.Title" T="string" Label="عنوان" Variant="Variant.Outlined" />
|
||||
<MudTextField class="my-3" @bind-Value="@navMenuItem.Slug" T="string" Label="اسلاگ" Variant="Variant.Outlined" />
|
||||
|
||||
<TemplateColumn CellClass="d-flex justify-end">
|
||||
<CellTemplate>
|
||||
<MudStack Row="true">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.PanoramaFishEye"
|
||||
Size="@Size.Small"
|
||||
Variant="@Variant.Outlined"
|
||||
Color="@Color.Info"
|
||||
OnClick="async()=>await ViewModel.ShowClicked(context.Item)" />
|
||||
</MudStack>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
</Columns>
|
||||
<PagerContent>
|
||||
<MudStack Row="true" class="w-full">
|
||||
|
||||
<MudPagination Rectangular="true" Variant="Variant.Filled" Count="@ViewModel.PageCount"
|
||||
SelectedChanged="@ViewModel.ChangePageAsync" class="my-4 mx-auto" />
|
||||
</MudStack>
|
||||
|
||||
</PagerContent>
|
||||
</MudDataGrid>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</ChildContent>
|
||||
</MudExpansionPanel>
|
||||
}
|
||||
</MudExpansionPanels>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudStack>
|
||||
|
||||
@code
|
||||
{
|
||||
public PaymentsPageViewModel ViewModel { get; set; }
|
||||
public PagesManagementPageViewModel ViewModel { get; set; }
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ViewModel = new PaymentsPageViewModel(NavigationManager, Snackbar, UserUtility, RestWrapper, DialogService);
|
||||
ViewModel = new PagesManagementPageViewModel(NavigationManager, Snackbar, UserUtility, RestWrapper, DialogService);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,138 @@
|
|||
namespace Netina.AdminPanel.PWA.Pages;
|
||||
using Force.DeepCloner;
|
||||
|
||||
public class PagesManagementPageViewModel
|
||||
namespace Netina.AdminPanel.PWA.Pages;
|
||||
|
||||
public class PagesManagementPageViewModel : BaseViewModel<ObservableCollection<BasePageSDto>>
|
||||
{
|
||||
|
||||
private readonly NavigationManager _navigationManager;
|
||||
private readonly ISnackbar _snackbar;
|
||||
private readonly IUserUtility _userUtility;
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly IRestWrapper _restWrapper;
|
||||
|
||||
public PagesManagementPageViewModel(
|
||||
NavigationManager navigationManager,
|
||||
ISnackbar snackbar,
|
||||
IUserUtility userUtility,
|
||||
IRestWrapper restWrapper,
|
||||
IDialogService dialogService)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
_userUtility = userUtility;
|
||||
_restWrapper = restWrapper;
|
||||
_dialogService = dialogService;
|
||||
}
|
||||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
if (token == null)
|
||||
throw new Exception("Token is null");
|
||||
var pages = await _restWrapper.PageRestApi.ReadAll(token);
|
||||
PageDto.Clear();
|
||||
pages.ForEach(p=>PageDto.Add(p));
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
var exe = await e.GetContentAsAsync<ApiResult>();
|
||||
if (e.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
await _userUtility.LogoutAsync();
|
||||
_navigationManager.NavigateTo("login", true, true);
|
||||
}
|
||||
_snackbar.Add(exe != null ? exe.Message : e.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsProcessing = false;
|
||||
}
|
||||
|
||||
await base.InitializeAsync();
|
||||
}
|
||||
|
||||
public PageActionRequestDto NewPageDto { get; set; } = new();
|
||||
|
||||
public async Task AddPageAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
if (token == null)
|
||||
throw new Exception("Token is null");
|
||||
|
||||
if (NewPageDto.Title.IsNullOrEmpty())
|
||||
throw new AppException("عنوان صفحه را وارد کنید");
|
||||
if (NewPageDto.Slug.IsNullOrEmpty())
|
||||
throw new AppException("اسلاگ صفحه را وارد کنید");
|
||||
|
||||
await _restWrapper.PageRestApi.CreatePage(NewPageDto.DeepClone(), token);
|
||||
NewPageDto = new PageActionRequestDto();
|
||||
_snackbar.Add("برگه مورد نظر با موفقیت افزوده شد", Severity.Success);
|
||||
await InitializeAsync();
|
||||
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
var exe = await e.GetContentAsAsync<ApiResult>();
|
||||
if (e.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
await _userUtility.LogoutAsync();
|
||||
_navigationManager.NavigateTo("login", true, true);
|
||||
}
|
||||
_snackbar.Add(exe != null ? exe.Message : e.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RemovePageAsync(Guid pageId)
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
if (token == null)
|
||||
throw new Exception("Token is null");
|
||||
|
||||
await _restWrapper.PageRestApi.DeletePage(pageId, token);
|
||||
_snackbar.Add("برگه مورد نظر با موفقیت حذف شد", Severity.Success);
|
||||
await InitializeAsync();
|
||||
|
||||
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
var exe = await e.GetContentAsAsync<ApiResult>();
|
||||
if (e.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
await _userUtility.LogoutAsync();
|
||||
_navigationManager.NavigateTo("login", true, true);
|
||||
}
|
||||
_snackbar.Add(exe != null ? exe.Message : e.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<head>
|
||||
</head>
|
||||
<RichTextEditorUi />
|
||||
|
||||
@code {
|
||||
|
||||
}
|
|
@ -12,7 +12,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|||
|
||||
Address.WebSiteAddress = builder.Configuration.GetValue<string>($"WebSiteUrl") ?? string.Empty;
|
||||
Address.StorageAddress = builder.Configuration.GetValue<string>("StorageBaseUrl") ?? string.Empty;
|
||||
|
||||
StatConfigs.IsShop = builder.Configuration.GetValue<bool>("IsShop");
|
||||
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
|
|
@ -4,4 +4,6 @@ public interface IDashboardApiRest
|
|||
{
|
||||
[Get("/home")]
|
||||
public Task<HomeDashboardDto> GetHomeDashboardAsync([Header("Authorization")] string authorization);
|
||||
[Get("/orders")]
|
||||
public Task<OrderDashboardDto> GetOrdersDashboardAsync([Header("Authorization")] string authorization);
|
||||
}
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
public interface IPageRestApi
|
||||
{
|
||||
[Get("")]
|
||||
Task<List<BasePageSDto>> ReadAll([Header("Authorization")] string authorization);
|
||||
|
||||
|
||||
[Get("/type/{type}")]
|
||||
Task<BasePageSDto> ReadByType([Query] string type, [Header("Authorization")] string authorization);
|
||||
|
@ -11,4 +14,7 @@ public interface IPageRestApi
|
|||
|
||||
[Post("")]
|
||||
Task CreatePage([Body] PageActionRequestDto request, [Header("Authorization")] string authorization);
|
||||
|
||||
[Delete("/{id}")]
|
||||
Task DeletePage(Guid id, [Header("Authorization")] string authorization);
|
||||
}
|
|
@ -2,37 +2,41 @@
|
|||
|
||||
public class RestWrapper : IRestWrapper
|
||||
{
|
||||
|
||||
private string baseApiAddress;
|
||||
public RestWrapper(IConfiguration configuration)
|
||||
{
|
||||
baseApiAddress = configuration.GetValue<string>("ApiUrl") ?? string.Empty;
|
||||
}
|
||||
private static RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings
|
||||
{
|
||||
Formatting = Newtonsoft.Json.Formatting.Indented,
|
||||
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
|
||||
|
||||
|
||||
}));
|
||||
|
||||
public ICrudApiRest<T, TKey> CrudApiRest<T, TKey>(string address) where T : class
|
||||
{
|
||||
return RestService.For<ICrudApiRest<T, TKey>>(address, setting);
|
||||
return RestService.For<ICrudApiRest<T, TKey>>(baseApiAddress + address, setting);
|
||||
}
|
||||
public ICrudDtoApiRest<T, TDto, TKey> CrudDtoApiRest<T, TDto, TKey>(string address) where T : class where TDto : class
|
||||
{
|
||||
return RestService.For<ICrudDtoApiRest<T, TDto, TKey>>(address, setting);
|
||||
return RestService.For<ICrudDtoApiRest<T, TDto, TKey>>(baseApiAddress + address, setting);
|
||||
}
|
||||
public IAuthRestApi AuthRestApi => RestService.For<IAuthRestApi>(Address.AuthController, setting);
|
||||
public IUserRestApi UserRestApi => RestService.For<IUserRestApi>(Address.UserController, setting);
|
||||
public IProductCategoryRestApi ProductCategoryRestApi => RestService.For<IProductCategoryRestApi>(Address.ProductCategoryController, setting);
|
||||
public IProductRestApi ProductRestApi => RestService.For<IProductRestApi>(Address.ProductController, setting);
|
||||
public IBrandRestApi BrandRestApi => RestService.For<IBrandRestApi>(Address.BrandController, setting);
|
||||
public IFileRestApi FileRestApi => RestService.For<IFileRestApi>(Address.FileController, setting);
|
||||
public IBlogRestApi BlogRestApi => RestService.For<IBlogRestApi>(Address.BlogController, setting);
|
||||
public IDiscountRestApi DiscountRest => RestService.For<IDiscountRestApi>(Address.DiscountController, setting);
|
||||
public IBlogCategoryRestApi BlogCategoryRestApi => RestService.For<IBlogCategoryRestApi>(Address.BlogCategoryController, setting);
|
||||
public IRoleRestApi RoleRestApi => RestService.For<IRoleRestApi>(Address.RoleController, setting);
|
||||
public IOrderRestApi OrderRestApi => RestService.For<IOrderRestApi>(Address.OrderController, setting);
|
||||
public IPaymentRestApi PaymentRestApi => RestService.For<IPaymentRestApi>(Address.PaymentController, setting);
|
||||
public IPageRestApi PageRestApi => RestService.For<IPageRestApi>(Address.PageController, setting);
|
||||
public IScraperRestApi ScraperRestApi => RestService.For<IScraperRestApi>(Address.ScraperController, setting);
|
||||
public ISettingRestApi SettingRestApi => RestService.For<ISettingRestApi>(Address.SettingController, setting);
|
||||
public IDashboardApiRest DashboardApiRest => RestService.For<IDashboardApiRest>(Address.DashboardController, setting);
|
||||
public IDistrictApiRest DistrictApiRest => RestService.For<IDistrictApiRest>(Address.DistrictController, setting);
|
||||
public IAuthRestApi AuthRestApi => RestService.For<IAuthRestApi>($"{baseApiAddress}{Address.AuthController}", setting);
|
||||
public IUserRestApi UserRestApi => RestService.For<IUserRestApi>($"{baseApiAddress}{Address.UserController}", setting);
|
||||
public IProductCategoryRestApi ProductCategoryRestApi => RestService.For<IProductCategoryRestApi>($"{baseApiAddress}{Address.ProductCategoryController}", setting);
|
||||
public IProductRestApi ProductRestApi => RestService.For<IProductRestApi>($"{baseApiAddress}{Address.ProductController}", setting);
|
||||
public IBrandRestApi BrandRestApi => RestService.For<IBrandRestApi>($"{baseApiAddress}{Address.BrandController}", setting);
|
||||
public IFileRestApi FileRestApi => RestService.For<IFileRestApi>($"{baseApiAddress}{Address.FileController}", setting);
|
||||
public IBlogRestApi BlogRestApi => RestService.For<IBlogRestApi>($"{baseApiAddress}{Address.BlogController}", setting);
|
||||
public IDiscountRestApi DiscountRest => RestService.For<IDiscountRestApi>($"{baseApiAddress}{Address.DiscountController}",setting);
|
||||
public IBlogCategoryRestApi BlogCategoryRestApi => RestService.For<IBlogCategoryRestApi>($"{baseApiAddress}{Address.BlogCategoryController}", setting);
|
||||
public IRoleRestApi RoleRestApi => RestService.For<IRoleRestApi>($"{baseApiAddress}{Address.RoleController}", setting);
|
||||
public IOrderRestApi OrderRestApi => RestService.For<IOrderRestApi>($"{baseApiAddress}{Address.OrderController}", setting);
|
||||
public IPaymentRestApi PaymentRestApi => RestService.For<IPaymentRestApi>($"{baseApiAddress}{Address.PaymentController}", setting);
|
||||
public IPageRestApi PageRestApi => RestService.For<IPageRestApi>($"{baseApiAddress}{Address.PageController}", setting);
|
||||
public IScraperRestApi ScraperRestApi => RestService.For<IScraperRestApi>($"{baseApiAddress}{Address.ScraperController}", setting);
|
||||
public ISettingRestApi SettingRestApi => RestService.For<ISettingRestApi>($"{baseApiAddress}{Address.SettingController}", setting);
|
||||
public IDashboardApiRest DashboardApiRest => RestService.For<IDashboardApiRest>($"{baseApiAddress}{Address.DashboardController}", setting);
|
||||
public IDistrictApiRest DistrictApiRest => RestService.For<IDistrictApiRest>($"{baseApiAddress}{Address.DistrictController}", setting);
|
||||
}
|
|
@ -4,25 +4,9 @@
|
|||
"versionName": "چرتکه",
|
||||
"description": "",
|
||||
"features": [
|
||||
"افزودن تم دارک",
|
||||
"تغییر دیالوگ پرسشی",
|
||||
"افزودن تنظیمات درگاه",
|
||||
"افزودن کد رهگیری پستی",
|
||||
"تکمیل پروسه سفارش گیری",
|
||||
"افزودن بخش تنظیمات فروشگاه",
|
||||
"قابلیت افزودن تصویر به برند ها",
|
||||
"قابلیت افزودن تصویر به دسته بندی محصولات",
|
||||
"عدم نمایش محصولات غیرقابل نمایش برای مشتری",
|
||||
"افزودن فاکتور برای فروش ها"
|
||||
""
|
||||
],
|
||||
"bugFixes": [
|
||||
"حل مشکلات امنیتی",
|
||||
"رفع مشکلات رسپانسیو",
|
||||
"رفع مشکل دریافت تصاویر",
|
||||
"رفع مشکل عدم اتصال به درگاه",
|
||||
"رفع مشکل عدم نمایش لیست بلاگ ها",
|
||||
"رفع مشکل عدم ویرایش تگ ها در محصولات",
|
||||
"رفع مشکل ادیتور متن در بلاگ و محصولات",
|
||||
"رفع مشکلات ساختاری در ریسپانس"
|
||||
"نمایش اطلاعات صحیح در صفحه سفارشات"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10,5 +10,12 @@
|
|||
},
|
||||
"WebSiteUrl": "https://vesmeh.com",
|
||||
"AdminPanelBaseUrl": "https://admin.vesmeh.com",
|
||||
"StorageBaseUrl": "https://storage.vesmeh.com"
|
||||
"StorageBaseUrl": "https://storage.vesmeh.com",
|
||||
"ApiUrl": "http://192.168.1.12:32770/api",
|
||||
"IsShop": true
|
||||
//"WebSiteUrl": "https://hamyanedalat.com",
|
||||
//"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",
|
||||
//"StorageBaseUrl": "https://storage.hamyanedalat.com",
|
||||
//"ApiUrl": "https://api.hamyanedalat.com/api",
|
||||
//"IsShop": false
|
||||
}
|
|
@ -10,5 +10,7 @@
|
|||
},
|
||||
"WebSiteUrl": "https://hamyanedalat.com",
|
||||
"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",
|
||||
"StorageBaseUrl": "https://storage.hamyanedalat.com"
|
||||
"StorageBaseUrl": "https://storage.hamyanedalat.com",
|
||||
"ApiUrl": "https://api.hamyanedalat.com/api",
|
||||
"IsShop": false
|
||||
}
|
|
@ -1307,6 +1307,9 @@ input:checked + .toggle-bg {
|
|||
.max-h-\[50rem\] {
|
||||
max-height: 50rem;
|
||||
}
|
||||
.max-h-\[60vh\] {
|
||||
max-height: 60vh;
|
||||
}
|
||||
.min-h-\[33rem\] {
|
||||
min-height: 33rem;
|
||||
}
|
||||
|
@ -1484,6 +1487,9 @@ input:checked + .toggle-bg {
|
|||
.overflow-x-scroll {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.\!overflow-y-scroll {
|
||||
overflow-y: scroll !important;
|
||||
}
|
||||
.overflow-y-scroll {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
|
|
@ -1455,25 +1455,8 @@ input:checked + .toggle-bg {
|
|||
max-height: 50rem;
|
||||
}
|
||||
|
||||
.\!max-h-\[75vh\] {
|
||||
max-height: 75vh !important;
|
||||
}
|
||||
|
||||
.\!max-h-\[70vh\] {
|
||||
max-height: 70vh !important;
|
||||
}
|
||||
|
||||
.\!max-h-full {
|
||||
max-height: 100% !important;
|
||||
}
|
||||
|
||||
.\!max-h-\[70\%\] {
|
||||
max-height: 70% !important;
|
||||
}
|
||||
|
||||
.\!max-h-max {
|
||||
max-height: -moz-max-content !important;
|
||||
max-height: max-content !important;
|
||||
.max-h-\[60vh\] {
|
||||
max-height: 60vh;
|
||||
}
|
||||
|
||||
.min-h-\[33rem\] {
|
||||
|
@ -1707,6 +1690,10 @@ input:checked + .toggle-bg {
|
|||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.\!overflow-y-scroll {
|
||||
overflow-y: scroll !important;
|
||||
}
|
||||
|
||||
.overflow-y-scroll {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue