Add storage management features and UI components
ci / build-backend (push) Successful in 1m32s
ci / build-frontend (push) Successful in 53s
ci / tests (push) Successful in 3m50s
ci / sonar (push) Successful in 4m7s

Implemented new storage endpoints in the API and updated the dependency injection to include storage-related services. Enhanced the frontend by adding storage routes and links in the admin layout, along with new types and localization for storage management. Updated documentation to reflect the new storage features and their usage in the admin interface.
This commit is contained in:
Leonid Pershin
2026-07-27 22:23:48 +03:00
parent 779f322f62
commit 8ae8eebc12
19 changed files with 1013 additions and 0 deletions
@@ -0,0 +1,33 @@
using LiteCqrs;
using TeleWave.Application.Storage;
using TeleWave.Infrastructure.Identity;
namespace TeleWave.Api.Endpoints;
/// <summary>Чем занят диск: объём по областям хранилища и заполненность тома.</summary>
public static class StorageEndpoints
{
public static IEndpointRouteBuilder MapStorageEndpoints(this IEndpointRouteBuilder app)
{
app.MapGet("/api/admin/storage", Stats)
.WithTags("Admin.Storage")
.RequireAuthorization(policy => policy.RequireRole(RoleNames.Admin))
.Produces<StorageStatsDto>();
return app;
}
/// <param name="refresh">Пересчитать, не дожидаясь истечения кэша: обход дерева долгий.</param>
private static async Task<IResult> Stats(
bool? refresh,
ISender sender,
CancellationToken cancellationToken
)
{
var result = await sender.Send(
new GetStorageStatsQuery(refresh ?? false),
cancellationToken
);
return Results.Ok(result);
}
}
+1
View File
@@ -135,6 +135,7 @@ app.MapJunctionEndpoints();
app.MapChannelEndpoints();
app.MapStreamingEndpoints();
app.MapMaintenanceEndpoints();
app.MapStorageEndpoints();
app.MapSettingsEndpoints();
app.MapMetadataEndpoints();
app.MapImageEndpoints();