Implemented frontend hosting file generation helper

This commit is contained in:
2025-03-16 22:03:01 +01:00
parent 1238095f09
commit 75f037da02
6 changed files with 296 additions and 60 deletions

View File

@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MoonCore.Extended.PermFilter;
using Moonlight.ApiServer.Services;
namespace Moonlight.ApiServer.Http.Controllers.Admin.Sys;
[Authorize]
[ApiController]
[Route("api/admin/system/advanced")]
public class AdvancedController : Controller
{
private readonly FrontendService FrontendService;
public AdvancedController(FrontendService frontendService)
{
FrontendService = frontendService;
}
[HttpGet("frontend")]
[RequirePermission("admin.system.advanced.frontend")]
public async Task Frontend()
{
var stream = await FrontendService.GenerateZip();
await Results.File(stream, fileDownloadName: "frontend.zip").ExecuteAsync(HttpContext);
}
}