fix(Pages) , feat(NotPermitted)
parent
7bfff18735
commit
0fbe6492ee
|
@ -1,8 +1,6 @@
|
|||
@using Netina.AdminPanel.PWA.Models
|
||||
@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)">
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
@if (!IsPermitted)
|
||||
{
|
||||
<div class="h-full w-full bg-amber-500">
|
||||
<MudText Align="Align.Center"> شما اجازه دسترسی به این بخش را ندارد </MudText>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public bool IsPermitted { get; set; }
|
||||
}
|
|
@ -6,7 +6,11 @@
|
|||
</head>
|
||||
<style>
|
||||
.ck-content * {
|
||||
all: revert ;
|
||||
all: revert;
|
||||
}
|
||||
|
||||
.ck-balloon-panel {
|
||||
z-index: 9999 !important
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -94,7 +98,6 @@
|
|||
|
||||
var lDotNetReference = DotNetObjectReference.Create(this);
|
||||
await JsRuntime.InvokeVoidAsync("GLOBAL.SetDotnetReference", lDotNetReference);
|
||||
|
||||
await JsRuntime.InvokeVoidAsync("window.lunchEditor", Text);
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
|
|
@ -3,14 +3,12 @@
|
|||
@inject IUserUtility UserUtility
|
||||
|
||||
<MudStack class="w-full pt-4 h-screen bg-[--mud-palette-background]">
|
||||
<MudImage class="mx-15 mt-5" Src="https://vesmeh.com/wp-content/uploads/2023/02/logo-web.png.webp"></MudImage>
|
||||
|
||||
<MudNavMenu Rounded="true" Margin="Margin.Dense" Color="Color.Warning" Class="pa-2" Bordered="true">
|
||||
<MudNavLink Href="home" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Dashboard">داشبورد</MudNavLink>
|
||||
@if (isShop)
|
||||
{
|
||||
<MudNavLink Href="orders"
|
||||
Icon="@Icons.Material.Outlined.ShoppingBag">فروش</MudNavLink>
|
||||
<MudNavLink Href="orders" Icon="@Icons.Material.Outlined.ShoppingBag">فروش</MudNavLink>
|
||||
}
|
||||
@if (isShop)
|
||||
{
|
||||
|
@ -109,10 +107,12 @@
|
|||
@code
|
||||
{
|
||||
private bool isShop = true;
|
||||
private List<string> _permissions;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_permissions = await UserUtility.GetPermissionsAsync() ?? new List<string>();
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
if (token == null)
|
||||
{
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
_isProcessing = true;
|
||||
await Task.Delay(1000);
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
if (token == null)
|
||||
throw new Exception("Token is null");
|
||||
var request = new BlogCategorySDto {Id = BlogCategory.Id , Name = _name, Description = _description };
|
||||
await RestWrapper.CrudApiRest<BlogCategory, Guid>(Address.BlogCategoryController).Update<BlogCategorySDto>(request, token);
|
||||
MudDialog.Close();
|
||||
|
|
|
@ -17,7 +17,7 @@ public class DigikalaProductActionDialogBoxViewModel : BaseViewModel<ObservableC
|
|||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog)
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -16,7 +16,7 @@ public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
|
|||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog)
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -29,7 +29,7 @@ public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
|
|||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
DiscountSDto discount)
|
||||
DiscountSDto discount) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -14,9 +14,12 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
private readonly IPrintingService _printingService;
|
||||
private readonly IJSRuntime _jsRuntime;
|
||||
|
||||
public OrderActionDialogBoxViewModel(ISnackbar snackbar, IRestWrapper restWrapper, IUserUtility userUtility, IDialogService dialogService,
|
||||
public OrderActionDialogBoxViewModel(ISnackbar snackbar,
|
||||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
IPrintingService printingService, IJSRuntime jsRuntime)
|
||||
IPrintingService printingService, IJSRuntime jsRuntime) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -33,7 +36,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
MudDialogInstance mudDialog,
|
||||
OrderSDto order,
|
||||
IPrintingService printingService,
|
||||
IJSRuntime jsRuntime)
|
||||
IJSRuntime jsRuntime) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -8,7 +8,11 @@ public class ProductActionDialogBoxViewModel : BaseViewModel<ProductLDto>
|
|||
private readonly IDialogService _dialogService;
|
||||
private readonly MudDialogInstance _mudDialog;
|
||||
|
||||
public ProductActionDialogBoxViewModel(ISnackbar snackbar, IRestWrapper restWrapper, IUserUtility userUtility, IDialogService dialogService, MudDialogInstance mudDialog)
|
||||
public ProductActionDialogBoxViewModel(ISnackbar snackbar,
|
||||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -21,7 +25,7 @@ public class ProductActionDialogBoxViewModel : BaseViewModel<ProductLDto>
|
|||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
ProductSDto product)
|
||||
ProductSDto product) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -5,124 +5,125 @@
|
|||
|
||||
<MudDialog class="mx-auto" DisableSidePadding="true">
|
||||
<DialogContent>
|
||||
<MudStack class="mx-5 overflow-x-hidden overflow-y-hidden">
|
||||
<MudContainer class="h-full">
|
||||
<MudDivider class="-mt-3" />
|
||||
<MudStack Spacing="0">
|
||||
|
||||
<MudText Typo="Typo.h6">اطلاعات کلی</MudText>
|
||||
<MudText Typo="Typo.caption">اطلاعات کلی دسته بندی محصول را به دقت وارد کنید</MudText>
|
||||
</MudStack>
|
||||
<MudGrid>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudTextField T="string" @bind-Value="@ViewModel.Name" Label="نام دسته بندی" Variant="Variant.Outlined"></MudTextField>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudSelect T="bool" @bind-Value="@ViewModel.IsMain" Label="آیا دسته بندی اصلی است ؟" ToStringFunc="b=>b.ToPersianString()" Variant="Variant.Outlined" AnchorOrigin="Origin.BottomCenter">
|
||||
<MudSelectItem T="bool" Value="true" />
|
||||
<MudSelectItem T="bool" Value="false" />
|
||||
</MudSelect>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudAutocomplete Required="true" ToStringFunc="dto => dto.Name" @bind-Value="@ViewModel.SelectedCategory"
|
||||
SearchFunc="ViewModel.SearchCategory"
|
||||
T="ProductCategorySDto"
|
||||
Label="دسته پدر"
|
||||
Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
</MudItem>
|
||||
<MudItem sm="12" md="12" lg="12">
|
||||
<MudStack class="mt-2 mb-4" Spacing="0">
|
||||
<MudStack class="mx-5 overflow-x-hidden overflow-y-hidden">
|
||||
<MudGrid>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudTextField T="string" @bind-Value="@ViewModel.Name" Label="نام دسته بندی" Variant="Variant.Outlined"></MudTextField>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudSelect T="bool" @bind-Value="@ViewModel.IsMain" Label="آیا دسته بندی اصلی است ؟" ToStringFunc="b=>b.ToPersianString()" Variant="Variant.Outlined" AnchorOrigin="Origin.BottomCenter">
|
||||
<MudSelectItem T="bool" Value="true" />
|
||||
<MudSelectItem T="bool" Value="false" />
|
||||
</MudSelect>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="4" md="6">
|
||||
<MudAutocomplete Required="true" ToStringFunc="dto => dto.Name" @bind-Value="@ViewModel.SelectedCategory"
|
||||
SearchFunc="ViewModel.SearchCategory"
|
||||
T="ProductCategorySDto"
|
||||
Label="دسته پدر"
|
||||
Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
</MudItem>
|
||||
<MudItem sm="12" md="12" lg="12">
|
||||
<MudStack class="mt-2 mb-4" Spacing="0">
|
||||
|
||||
<MudText Typo="Typo.h6">تصاویر برند</MudText>
|
||||
<MudText Typo="Typo.caption">می توانید برای برند چند تصویر اپلود کنید</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true">
|
||||
<MudIconButton HtmlTag="label"
|
||||
Color="Color.Info"
|
||||
Variant="Variant.Outlined"
|
||||
class="w-28 h-28"
|
||||
Size="Size.Large"
|
||||
Icon="@Icons.Material.Outlined.Wallpaper"
|
||||
OnClick="async () => await ViewModel.SelectFileAsync()">
|
||||
</MudIconButton>
|
||||
@foreach (var item in ViewModel.Files)
|
||||
{
|
||||
<div class="w-28 h-28">
|
||||
<MudImage Src="@item.GetLink()" Elevation="25" Class="rounded-lg w-28 h-28 absolute" />
|
||||
|
||||
<MudIconButton DisableElevation="true"
|
||||
class="absolute m-1.5"
|
||||
Size="@Size.Small"
|
||||
Variant="@Variant.Filled"
|
||||
OnClick="() => ViewModel.RemoveFile(item)"
|
||||
Color="@Color.Error"
|
||||
Icon="@Icons.Material.Outlined.Delete" />
|
||||
@if (item.IsHeader)
|
||||
{
|
||||
<p class="bg-pink-500 px-1.5 py-0.5 absolute bottom-0 mr-2 rounded-lg text-white">هدر</p>
|
||||
}
|
||||
@if (item.IsPrimary)
|
||||
{
|
||||
<p class="bg-blue-500 px-1.5 py-0.5 absolute bottom-0 mr-2 rounded-lg text-white">اصلی</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="12" md="12">
|
||||
<MudContainer class="max-h-[20rem] lg:max-h-[25rem] overflow-y-scroll overflow-x-hidden">
|
||||
<MudStack class="mt-4 mb-2" Spacing="0">
|
||||
|
||||
<MudText Typo="Typo.h6">توضیحات تکمیلی</MudText>
|
||||
<MudText Typo="Typo.caption">می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید</MudText>
|
||||
<MudText Typo="Typo.h6">تصاویر برند</MudText>
|
||||
<MudText Typo="Typo.caption">می توانید برای برند چند تصویر اپلود کنید</MudText>
|
||||
</MudStack>
|
||||
<div class="!text-black">
|
||||
<RichTextEditorUi @bind-Text="@ViewModel.Description" />
|
||||
</div>
|
||||
</MudContainer>
|
||||
</MudItem>
|
||||
<MudStack Row="true">
|
||||
<MudIconButton HtmlTag="label"
|
||||
Color="Color.Info"
|
||||
Variant="Variant.Outlined"
|
||||
class="w-28 h-28"
|
||||
Size="Size.Large"
|
||||
Icon="@Icons.Material.Outlined.Wallpaper"
|
||||
OnClick="async () => await ViewModel.SelectFileAsync()">
|
||||
</MudIconButton>
|
||||
@foreach (var item in ViewModel.Files)
|
||||
{
|
||||
<div class="w-28 h-28">
|
||||
<MudImage Src="@item.GetLink()" Elevation="25" Class="rounded-lg w-28 h-28 absolute" />
|
||||
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
<MudIconButton DisableElevation="true"
|
||||
class="absolute m-1.5"
|
||||
Size="@Size.Small"
|
||||
Variant="@Variant.Filled"
|
||||
OnClick="() => ViewModel.RemoveFile(item)"
|
||||
Color="@Color.Error"
|
||||
Icon="@Icons.Material.Outlined.Delete" />
|
||||
@if (item.IsHeader)
|
||||
{
|
||||
<p class="bg-pink-500 px-1.5 py-0.5 absolute bottom-0 mr-2 rounded-lg text-white">هدر</p>
|
||||
}
|
||||
@if (item.IsPrimary)
|
||||
{
|
||||
<p class="bg-blue-500 px-1.5 py-0.5 absolute bottom-0 mr-2 rounded-lg text-white">اصلی</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem sm="12" lg="12" md="12">
|
||||
<MudContainer class="overflow-y-hidden overflow-x-hidden">
|
||||
<MudStack class="mt-4 mb-2" Spacing="0">
|
||||
|
||||
<MudText Typo="Typo.h6">توضیحات تکمیلی</MudText>
|
||||
<MudText Typo="Typo.caption">می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید</MudText>
|
||||
</MudStack>
|
||||
<div class="!text-black">
|
||||
<RichTextEditorUi @bind-Text="@ViewModel.Description" />
|
||||
</div>
|
||||
</MudContainer>
|
||||
</MudItem>
|
||||
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
|
||||
|
||||
<MudStack Row="true" class="w-full mx-4 mb-2">
|
||||
|
||||
@if (ViewModel.IsEditing)
|
||||
{
|
||||
<BaseButtonUi class="w-64 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.Outlined.Check"
|
||||
Variant="Variant.Filled" Color="Color.Success"
|
||||
Content="ثبت ویرایش" OnClickCallback="ViewModel.SubmitEditAsync" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<BaseButtonUi class="w-64 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.Outlined.Check"
|
||||
Variant="Variant.Filled" Color="Color.Success"
|
||||
Content="تایید" OnClickCallback="ViewModel.SubmitCreateAsync" />
|
||||
}
|
||||
<MudSpacer />
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Large" Color="Color.Error" OnClick="ViewModel.Cancel">بستن</MudButton>
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
<MudStack Row="true" class="w-full mx-4 mb-2">
|
||||
|
||||
@if (ViewModel.IsEditing)
|
||||
{
|
||||
<BaseButtonUi class="w-64 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.Outlined.Check"
|
||||
Variant="Variant.Filled" Color="Color.Success"
|
||||
Content="ثبت ویرایش" OnClickCallback="ViewModel.SubmitEditAsync" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<BaseButtonUi class="w-64 rounded-md" IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.Outlined.Check"
|
||||
Variant="Variant.Filled" Color="Color.Success"
|
||||
Content="تایید" OnClickCallback="ViewModel.SubmitCreateAsync" />
|
||||
}
|
||||
<MudSpacer />
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Large" Color="Color.Error" OnClick="ViewModel.Cancel">بستن</MudButton>
|
||||
</MudStack>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
@code
|
||||
@code
|
||||
{
|
||||
|
||||
[CascadingParameter]
|
||||
|
@ -136,7 +137,7 @@
|
|||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Category == null)
|
||||
ViewModel = new ProductCategoryActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, MudDialog,DialogService);
|
||||
ViewModel = new ProductCategoryActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, MudDialog, DialogService);
|
||||
else
|
||||
ViewModel = new ProductCategoryActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, MudDialog, DialogService, Category);
|
||||
await ViewModel.InitializeAsync();
|
||||
|
|
|
@ -16,7 +16,7 @@ public class RoleActionDialogBoxViewModel : BaseViewModel<RoleActionRequestDto>
|
|||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog)
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -31,7 +31,7 @@ public class RoleActionDialogBoxViewModel : BaseViewModel<RoleActionRequestDto>
|
|||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
ApplicationRole role)
|
||||
ApplicationRole role) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -15,7 +15,7 @@ public class ShippingActionDialogBoxViewModel : BaseViewModel<ShippingSDto>
|
|||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog)
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -29,7 +29,7 @@ public class ShippingActionDialogBoxViewModel : BaseViewModel<ShippingSDto>
|
|||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
ShippingSDto shipping)
|
||||
ShippingSDto shipping) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -16,7 +16,7 @@ public class UserActionDialogBoxViewModel : BaseViewModel<UserActionRequestDto>
|
|||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog)
|
||||
MudDialogInstance mudDialog) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -30,7 +30,7 @@ public class UserActionDialogBoxViewModel : BaseViewModel<UserActionRequestDto>
|
|||
IUserUtility userUtility,
|
||||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
ApplicationUserSDto user)
|
||||
ApplicationUserSDto user) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
@using Netina.AdminPanel.PWA.Models
|
||||
|
||||
@inherits LayoutComponentBase
|
||||
@inject IPWAUpdaterService PwaUpdaterService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IUserUtility UserUtility
|
||||
@inject IJSRuntime Js
|
||||
|
||||
<style>
|
||||
|
||||
body .pwa-updater[b-pwa-updater] {
|
||||
--pwa-updater-bar-height: 40px;
|
||||
--pwa-updater-font-size: 16px;
|
||||
|
@ -28,44 +28,44 @@
|
|||
body .pwa-updater-close-button {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
|
||||
<Authorized>
|
||||
<MudRTLProvider RightToLeft="true">
|
||||
<MudThemeProvider IsDarkMode="@MainTheme.IsDarkMode" Theme="@MainTheme.MyCustomTheme" />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
<MudThemeProvider IsDarkMode="@MainTheme.IsDarkMode" Theme="@MainTheme.MyCustomTheme"/>
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
<MudLayout>
|
||||
<MudAppBar class="py-2" Color="Color.Transparent" Fixed="false" Elevation="2">
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" OnClick="@ToggleDrawer" Edge="Edge.Start" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" OnClick="@ToggleDrawer" Edge="Edge.Start"/>
|
||||
</MudHidden>
|
||||
|
||||
|
||||
<RadzenGravatar class="w-14 h-14" Email="@_user?.Email" />
|
||||
<RadzenGravatar class="w-14 h-14" Email="@_user?.Email"/>
|
||||
<MudStack class="mr-2" Spacing="0">
|
||||
<MudText Color="Color.Inherit" Typo="Typo.body1"><b>@_user?.FullName</b></MudText>
|
||||
<MudText Color="Color.Inherit" Typo="Typo.caption">@_user?.PhoneNumber</MudText>
|
||||
</MudStack>
|
||||
<MudSpacer />
|
||||
<MudSpacer/>
|
||||
<MudToggleIconButton @bind-Toggled="@MainTheme.IsDarkMode"
|
||||
Icon="@Icons.Material.Outlined.DarkMode" Color="@Color.Default" Title="تاریک"
|
||||
ToggledIcon="@Icons.Material.Filled.LightMode" ToggledColor="@Color.Default" ToggledTitle="روشن" />
|
||||
<MudIconButton Size="Size.Medium" Color="Color.Error" OnClick="LogoutAsync" Icon="@Icons.Material.Outlined.ExitToApp" />
|
||||
ToggledIcon="@Icons.Material.Filled.LightMode" ToggledColor="@Color.Default" ToggledTitle="روشن"/>
|
||||
<MudIconButton Size="Size.Medium" Color="Color.Error" OnClick="LogoutAsync" Icon="@Icons.Material.Outlined.ExitToApp"/>
|
||||
</MudAppBar>
|
||||
|
||||
<MudDrawer @bind-Open="@open" Breakpoint="Breakpoint.MdAndUp" Elevation="1" Variant="@DrawerVariant.Responsive">
|
||||
<SideBarUi />
|
||||
<SideBarUi/>
|
||||
</MudDrawer>
|
||||
|
||||
<MudGrid Spacing="0">
|
||||
|
||||
<MudItem md="3" lg="2">
|
||||
<MudHidden Breakpoint="Breakpoint.SmAndDown">
|
||||
<SideBarUi />
|
||||
<SideBarUi/>
|
||||
</MudHidden>
|
||||
</MudItem>
|
||||
<MudItem sm="12" md="9" lg="10">
|
||||
|
@ -77,28 +77,30 @@
|
|||
</MudGrid>
|
||||
</MudLayout>
|
||||
<div dir="ltr">
|
||||
<PWAUpdater Align="PWAUpdater.Aligns.Buttom" Text="@_updateText" ButtonCaption="اپدیت کنید" />
|
||||
<PWAUpdater Align="PWAUpdater.Aligns.Buttom" Text="@_updateText" ButtonCaption="اپدیت کنید"/>
|
||||
</div>
|
||||
</MudRTLProvider>
|
||||
</Authorized>
|
||||
|
||||
<NotAuthorized>
|
||||
<MudRTLProvider RightToLeft="true">
|
||||
<MudThemeProvider Theme="@MainTheme.MyCustomTheme" />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
<MudThemeProvider Theme="@MainTheme.MyCustomTheme"/>
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
|
||||
<MudLayout>
|
||||
<div>
|
||||
<LoginPage />
|
||||
<LoginPage/>
|
||||
<div dir="ltr">
|
||||
<PWAUpdater Text="@_updateText" ButtonCaption="اپدیت کنید" />
|
||||
<PWAUpdater Text="@_updateText" ButtonCaption="اپدیت کنید"/>
|
||||
</div>
|
||||
</div>
|
||||
</MudLayout>
|
||||
</MudRTLProvider>
|
||||
|
||||
</NotAuthorized>
|
||||
|
||||
</AuthorizeView>
|
||||
|
||||
@code
|
||||
{
|
||||
|
||||
|
@ -111,6 +113,7 @@
|
|||
await UserUtility.LogoutAsync();
|
||||
NavigationManager.NavigateTo("login", true, true);
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
string? version = typeof(Program)?.Assembly.GetName()?.Version?.ToString();
|
||||
|
|
|
@ -18,16 +18,42 @@ public class BaseViewModel<TPageDto>
|
|||
{
|
||||
public bool IsProcessing { get; set; } = false;
|
||||
public TPageDto PageDto { get; set; }
|
||||
public BaseViewModel()
|
||||
private string[] _permissions = new string[]{};
|
||||
private readonly IUserUtility _userUtility;
|
||||
public bool IsPermitted { get; set; } = false;
|
||||
public BaseViewModel(IUserUtility userUtility,params string[] permissions)
|
||||
{
|
||||
_userUtility = userUtility;
|
||||
_permissions = permissions;
|
||||
PageDto = Activator.CreateInstance<TPageDto>();
|
||||
}
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual Task InitializeAsync()
|
||||
public virtual async Task InitializeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
await CheckPermissions();
|
||||
}
|
||||
|
||||
public async Task<bool> CheckPermissions()
|
||||
{
|
||||
if (_permissions.Length == 0)
|
||||
{
|
||||
IsPermitted = true;
|
||||
return true;
|
||||
}
|
||||
var permissions = await _userUtility.GetPermissionsAsync();
|
||||
if (permissions == null)
|
||||
return false;
|
||||
foreach (var permission in _permissions)
|
||||
{
|
||||
if (permissions.Contains(permission))
|
||||
{
|
||||
IsPermitted = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -5,8 +5,8 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
||||
<AssemblyVersion>0.27.31.52</AssemblyVersion>
|
||||
<FileVersion>0.27.31.52</FileVersion>
|
||||
<AssemblyVersion>0.27.37.59</AssemblyVersion>
|
||||
<FileVersion>0.27.37.59</FileVersion>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<MudItem xs="12">
|
||||
<MudStack Row="true" class="mb-5">
|
||||
<MudText Typo="Typo.h4">دسته بندی بلاگـــــ ها</MudText>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip>
|
||||
@* <MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip> *@
|
||||
<MudSpacer />
|
||||
<MudButton Variant="Variant.Filled"
|
||||
DisableElevation="true"
|
||||
|
|
|
@ -14,7 +14,7 @@ public class BlogCategoriesPageViewModel:BaseViewModel<ObservableCollection<Blog
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public BlogCategoriesPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public BlogCategoriesPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<MudItem xs="12">
|
||||
<MudStack Row="true" class="mb-5">
|
||||
<MudText Typo="Typo.h4">بلاگـــــ ها</MudText>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">@ViewModel.TotalItems عدد</MudChip>
|
||||
<MudSpacer />
|
||||
<MudButton Variant="Variant.Filled"
|
||||
DisableElevation="true"
|
||||
|
|
|
@ -13,8 +13,8 @@ public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
|
|||
public string Search = string.Empty;
|
||||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public BlogsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public int TotalItems = 0;
|
||||
public BlogsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
@ -33,6 +33,7 @@ public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
|
|||
dto.Blogs.ForEach(d => PageDto.Add(d));
|
||||
if (PageDto.Count == 20)
|
||||
PageCount = 2;
|
||||
TotalItems = dto.Pager.TotalItems;
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<MudItem xs="12">
|
||||
<MudStack Row="true" class="mb-5">
|
||||
<MudText Typo="Typo.h4">برنــــدها</MudText>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip>
|
||||
@* <MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip> *@
|
||||
|
||||
<MudSpacer />
|
||||
<MudButton Variant="Variant.Filled"
|
||||
|
|
|
@ -13,7 +13,7 @@ public class BrandsPageViewModel : BaseViewModel<List<BrandSDto>>
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public BrandsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public BrandsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<MudItem xs="12">
|
||||
<MudStack Row="true" class="mb-5">
|
||||
<MudText Typo="Typo.h4">دسته بندی ها</MudText>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip>
|
||||
@* <MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip> *@
|
||||
|
||||
|
||||
<MudSpacer/>
|
||||
|
|
|
@ -12,7 +12,7 @@ public class CategoriesPageViewModel : BaseViewModel<ObservableCollection<Produc
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public CategoriesPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public CategoriesPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -14,7 +14,7 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public DiscountPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public DiscountPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -8,7 +8,7 @@ public class FaqManagementPageViewModel : BaseViewModel<FAQPage>
|
|||
private readonly IDialogService _dialogService;
|
||||
private readonly IRestWrapper _restWrapper;
|
||||
|
||||
public FaqManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public FaqManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
|
||||
@code{
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ public class HomeViewModel : BaseViewModel<HomeDashboardDto>
|
|||
private readonly IDialogService _dialogService;
|
||||
private readonly NavigationManager _navigationManager;
|
||||
|
||||
public HomeViewModel(ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService,NavigationManager navigationManager)
|
||||
public HomeViewModel(ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService,NavigationManager navigationManager) : base(userUtility)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_userUtility = userUtility;
|
||||
|
|
|
@ -9,7 +9,7 @@ public class MarketerManagementPageViewModel : BaseViewModel<MarketerSetting>
|
|||
private readonly IRestWrapper _restWrapper;
|
||||
|
||||
|
||||
public MarketerManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public MarketerManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
@page "/orders"
|
||||
@using Netina.Domain.Models.Claims
|
||||
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
||||
@attribute [PermissionAuthorize(ApplicationPermission.ManageDashboard)]
|
||||
|
||||
@inject IDialogService DialogService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
@ -9,6 +7,7 @@
|
|||
@inject IUserUtility UserUtility
|
||||
@inject IRestWrapper RestWrapper
|
||||
|
||||
|
||||
<MudStack class="px-3 md:p-5 lg:px-8 w-full h-screen overflow-x-hidden overflow-y-scroll bg-[--mud-palette-background-grey]">
|
||||
|
||||
<MudHidden Breakpoint="Breakpoint.Xs">
|
||||
|
@ -73,6 +72,7 @@
|
|||
</MudPaper>
|
||||
</MudStack>
|
||||
</MudHidden>
|
||||
|
||||
<MudGrid>
|
||||
<MudItem xs="12">
|
||||
|
||||
|
@ -213,8 +213,10 @@
|
|||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
</MudStack>
|
||||
|
||||
|
||||
@code
|
||||
{
|
||||
public OrdersPageViewModel ViewModel { get; set; }
|
||||
|
|
|
@ -14,7 +14,11 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
|
|||
|
||||
public ObservableCollection<OrderSDto> MainOrders { get; } = new ObservableCollection<OrderSDto>();
|
||||
|
||||
public OrdersPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public OrdersPageViewModel(NavigationManager navigationManager,
|
||||
ISnackbar snackbar,
|
||||
IUserUtility userUtility,
|
||||
IRestWrapper restWrapper,
|
||||
IDialogService dialogService) : base(userUtility,"Cached")
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
@ -25,6 +29,9 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
|
|||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
await base.InitializeAsync();
|
||||
if (!IsPermitted)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
|
@ -59,7 +66,6 @@ public class OrdersPageViewModel : BaseViewModel<OrderDashboardDto>
|
|||
|
||||
IsProcessing = false;
|
||||
}
|
||||
await base.InitializeAsync();
|
||||
}
|
||||
|
||||
public async Task ChangePageAsync(int page)
|
||||
|
|
|
@ -15,7 +15,7 @@ public class PagesManagementPageViewModel : BaseViewModel<ObservableCollection<B
|
|||
ISnackbar snackbar,
|
||||
IUserUtility userUtility,
|
||||
IRestWrapper restWrapper,
|
||||
IDialogService dialogService)
|
||||
IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -12,7 +12,7 @@ public class PaymentsPageViewModel : BaseViewModel<ObservableCollection<PaymentS
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public PaymentsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public PaymentsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -17,7 +17,7 @@ public class ManageNavMenuPageViewModel : BaseViewModel<NavMenuSetting>
|
|||
ISnackbar snackbar,
|
||||
IUserUtility userUtility,
|
||||
IRestWrapper restWrapper,
|
||||
IDialogService dialogService)
|
||||
IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<MudItem xs="12" sm="6" md="8">
|
||||
<MudStack Row="true">
|
||||
<MudText Typo="Typo.h4">محصولاتــــ</MudText>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">124 عدد</MudChip>
|
||||
<MudChip Color="Color.Info" Variant="Variant.Outlined">@ViewModel.TotalItems عدد</MudChip>
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
|
|
|
@ -11,8 +11,13 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
|
|||
public string Search = string.Empty;
|
||||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
public int TotalItems = 0;
|
||||
|
||||
public ProductsPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public ProductsPageViewModel(NavigationManager navigationManager,
|
||||
ISnackbar snackbar,
|
||||
IUserUtility userUtility,
|
||||
IRestWrapper restWrapper,
|
||||
IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
@ -34,6 +39,7 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
|
|||
dto.Products.ForEach(d => PageDto.Add(d));
|
||||
if (PageDto.Count == 20)
|
||||
PageCount = 2;
|
||||
TotalItems = dto.Pager.TotalItems;
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ShippingPageViewModel : BaseViewModel<ObservableCollection<Shipping
|
|||
public int CurrentPage = 0;
|
||||
public int PageCount = 1;
|
||||
|
||||
public ShippingPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||
public ShippingPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService) : base(userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
|
|
|
@ -18,7 +18,7 @@ builder.RootComponents.Add<App>("#app");
|
|||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
builder.Services.AddOptions();
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.AddAuthorizationCore(option=>option.ConfigPolicies());
|
||||
builder.Services.AddApiAuthorization();
|
||||
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
|
||||
builder.Services.AddMudServices(config =>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
using Netina.Domain.Models.Claims;
|
||||
|
||||
namespace Netina.AdminPanel.PWA.Utilities;
|
||||
|
||||
public static class PoliciesUtility
|
||||
{
|
||||
public static void ConfigPolicies(this AuthorizationOptions options)
|
||||
{
|
||||
ApplicationClaims.AllClaimDtos.ForEach(claim =>
|
||||
{
|
||||
options.AddPolicy(claim.Value, builder =>
|
||||
{
|
||||
builder.RequireClaim(CustomClaimType.Permission, claim.Value);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -17,4 +17,5 @@
|
|||
@using Netina.AdminPanel.PWA.Utilities
|
||||
@using Netina.Common.Extensions
|
||||
@using Netina.Domain.Entities.Users
|
||||
@using Netina.AdminPanel.PWA.Components.Originals
|
||||
@using Netina.AdminPanel.PWA.Components.Originals
|
||||
@using Netina.Domain.Models.Claims
|
|
@ -10,9 +10,10 @@
|
|||
},
|
||||
"WebSiteUrl": "https://vesmeh.com",
|
||||
"AdminPanelBaseUrl": "https://admin.vesmeh.com",
|
||||
"StorageBaseUrl": "https://storage.vesmeh.com",
|
||||
"ApiUrl": "http://192.168.1.12:32770/api",
|
||||
"IsShop": true
|
||||
"StorageBaseUrl": "https://storage.vesmeh.com/",
|
||||
"ApiUrl": "https://api.vesmeh.com/api"
|
||||
//"ApiUrl": "http://192.168.1.12:32770/api"
|
||||
|
||||
//"WebSiteUrl": "https://hamyanedalat.com",
|
||||
//"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",
|
||||
//"StorageBaseUrl": "https://storage.hamyanedalat.com",
|
||||
|
|
|
@ -1201,9 +1201,6 @@ input:checked + .toggle-bg {
|
|||
.mt-4 {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.mt-5 {
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
.mt-6 {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
@ -1298,9 +1295,6 @@ input:checked + .toggle-bg {
|
|||
.\!max-h-\[80vh\] {
|
||||
max-height: 80vh !important;
|
||||
}
|
||||
.max-h-\[20rem\] {
|
||||
max-height: 20rem;
|
||||
}
|
||||
.max-h-\[30rem\] {
|
||||
max-height: 30rem;
|
||||
}
|
||||
|
@ -1588,6 +1582,10 @@ input:checked + .toggle-bg {
|
|||
.bg-\[--mud-palette-background\] {
|
||||
background-color: var(--mud-palette-background);
|
||||
}
|
||||
.bg-amber-500 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(245 158 11 / var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-blue-500 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(63 131 248 / var(--tw-bg-opacity));
|
||||
|
@ -2301,10 +2299,6 @@ code {
|
|||
height: 38rem;
|
||||
}
|
||||
|
||||
.lg\:max-h-\[25rem\] {
|
||||
max-height: 25rem;
|
||||
}
|
||||
|
||||
.lg\:max-h-\[35rem\] {
|
||||
max-height: 35rem;
|
||||
}
|
||||
|
|
|
@ -1315,10 +1315,6 @@ input:checked + .toggle-bg {
|
|||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.mt-5 {
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
.mt-6 {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
@ -1443,10 +1439,6 @@ input:checked + .toggle-bg {
|
|||
max-height: 80vh !important;
|
||||
}
|
||||
|
||||
.max-h-\[20rem\] {
|
||||
max-height: 20rem;
|
||||
}
|
||||
|
||||
.max-h-\[30rem\] {
|
||||
max-height: 30rem;
|
||||
}
|
||||
|
@ -1463,10 +1455,6 @@ input:checked + .toggle-bg {
|
|||
min-height: 33rem;
|
||||
}
|
||||
|
||||
.min-h-screen {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.w-1\/2 {
|
||||
width: 50%;
|
||||
}
|
||||
|
@ -1824,6 +1812,11 @@ input:checked + .toggle-bg {
|
|||
background-color: var(--mud-palette-background);
|
||||
}
|
||||
|
||||
.bg-amber-500 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(245 158 11 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.bg-blue-500 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(63 131 248 / var(--tw-bg-opacity));
|
||||
|
@ -2645,10 +2638,6 @@ code {
|
|||
height: 38rem;
|
||||
}
|
||||
|
||||
.lg\:max-h-\[25rem\] {
|
||||
max-height: 25rem;
|
||||
}
|
||||
|
||||
.lg\:max-h-\[35rem\] {
|
||||
max-height: 35rem;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/*
|
||||
* CKEditor 5 (v41.3.1) content styles.
|
||||
* Generated on Wed, 24 Apr 2024 10:28:24 GMT.
|
||||
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
||||
*/
|
||||
|
||||
:root {
|
||||
:root {
|
||||
--ck-color-image-caption-background: hsl(0, 0%, 97%);
|
||||
--ck-color-image-caption-text: hsl(0, 0%, 20%);
|
||||
--ck-color-mention-background: hsla(341, 100%, 30%, 0.1);
|
||||
|
|
Loading…
Reference in New Issue