Большое обновление

This commit is contained in:
2025-01-02 14:42:15 +03:00
parent 4428052d78
commit 098eeb468e
14 changed files with 633 additions and 118 deletions

View File

@@ -1,8 +1,12 @@
using Gotenberg.Sharp.API.Client;
using Gotenberg.Sharp.API.Client.Domain.Settings;
using Gotenberg.Sharp.API.Client.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.UI;
using Otchinslator.Components;
using Otchinslator.Services;
var builder = WebApplication.CreateBuilder(args);
@@ -14,13 +18,17 @@ builder.Services.AddControllersWithViews(options =>
.RequireAuthenticatedUser()
.Build();
options.Filters.Add(new AuthorizeFilter(policy));
}).AddMicrosoftIdentityUI();
}).AddMicrosoftIdentityUI().AddDataAnnotationsLocalization();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddRazorPages(); //////////////
builder.Services.AddServerSideBlazor(); ///////////////
builder.Services.AddOptions<GotenbergSharpClientOptions>()
.Bind(builder.Configuration.GetSection(nameof(GotenbergSharpClient)));
builder.Services.AddGotenbergSharpClient();
builder.Services.AddScoped<IStatementGenerator, StatementGenerator>();
var app = builder.Build();
@@ -34,7 +42,7 @@ app.UseStaticFiles();
app.UseAntiforgery();
app.MapControllers();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.MapRazorComponents<App>();
// .AddInteractiveServerRenderMode();
app.Run();