2024-03-01 16:16:05 +03:30
|
|
|
using Append.Blazor.Printing;
|
2024-01-23 09:13:40 +03:30
|
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
2024-01-21 08:33:37 +03:30
|
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
|
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
|
|
|
using MudBlazor.Services;
|
|
|
|
|
using NetinaShop.AdminPanel.PWA;
|
2024-01-23 09:13:40 +03:30
|
|
|
using NetinaShop.AdminPanel.PWA.Services;
|
2024-01-21 08:33:37 +03:30
|
|
|
using Toolbelt.Blazor.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
|
builder.RootComponents.Add<App>("#app");
|
|
|
|
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
2024-01-23 09:13:40 +03:30
|
|
|
builder.Services.AddCascadingAuthenticationState();
|
|
|
|
|
builder.Services.AddOptions();
|
|
|
|
|
builder.Services.AddAuthorizationCore();
|
|
|
|
|
builder.Services.AddApiAuthorization();
|
2024-03-09 22:01:39 +03:30
|
|
|
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
|
2024-01-21 08:33:37 +03:30
|
|
|
builder.Services.AddMudServices(config =>
|
|
|
|
|
{
|
|
|
|
|
config.SnackbarConfiguration.VisibleStateDuration = 3500;
|
|
|
|
|
config.SnackbarConfiguration.HideTransitionDuration = 200;
|
|
|
|
|
config.SnackbarConfiguration.ShowTransitionDuration = 200;
|
|
|
|
|
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
|
|
|
|
|
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomCenter;
|
|
|
|
|
});
|
|
|
|
|
|
2024-01-22 17:26:29 +03:30
|
|
|
builder.Services.AddScoped<IRestWrapper, RestWrapper>();
|
|
|
|
|
builder.Services.AddScoped<IUserUtility, UserUtility>();
|
2024-01-21 08:33:37 +03:30
|
|
|
builder.Services.AddBlazoredLocalStorage();
|
2024-01-28 20:51:50 +03:30
|
|
|
builder.Services.AddScoped<Radzen.ContextMenuService>();
|
|
|
|
|
builder.Services.AddScoped<Radzen.DialogService>();
|
2024-02-01 20:09:11 +03:30
|
|
|
builder.Services.AddSingleton<IEncryptProvider, AesJsProvider>();
|
2024-03-01 16:16:05 +03:30
|
|
|
builder.Services.AddScoped<IPrintingService, PrintingService>();
|
2024-01-21 08:33:37 +03:30
|
|
|
builder.Services.AddPWAUpdater();
|
|
|
|
|
await builder.Build().RunAsync();
|