Separating runtime from application code to improve building. Upgraded mooncore packages. Started switching to flyonui. Added PluginFramework plugin loading via mooncore
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Moonlight.ApiServer.Services;
|
||||
using Moonlight.Shared.Misc;
|
||||
|
||||
namespace Moonlight.ApiServer.Http.Controllers.Frontend;
|
||||
|
||||
[ApiController]
|
||||
[Route("/")]
|
||||
public class FrontendController : Controller
|
||||
{
|
||||
private readonly FrontendService FrontendService;
|
||||
|
||||
public FrontendController(FrontendService frontendService)
|
||||
{
|
||||
FrontendService = frontendService;
|
||||
}
|
||||
|
||||
[HttpGet("frontend.json")]
|
||||
public async Task<FrontendConfiguration> GetConfiguration()
|
||||
=> await FrontendService.GetConfiguration();
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IResult> Index()
|
||||
{
|
||||
var content = await FrontendService.GenerateIndexHtml();
|
||||
|
||||
return Results.Text(content, "text/html", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
@using Moonlight.Shared.Misc
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@Configuration.Title</title>
|
||||
<base href="/" />
|
||||
|
||||
@foreach (var style in Configuration.Styles)
|
||||
{
|
||||
<link rel="stylesheet" href="@style" />
|
||||
}
|
||||
|
||||
<link href="manifest.webmanifest" rel="manifest" />
|
||||
<link rel="apple-touch-icon" sizes="512x512" href="/img/icon-512.png" />
|
||||
<link rel="apple-touch-icon" sizes="192x192" href="/img/icon-192.png" />
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-950 text-white font-inter h-full">
|
||||
<div id="app">
|
||||
|
||||
<div class="flex h-screen justify-center items-center">
|
||||
<div class="sm:max-w-lg">
|
||||
<div id="blazor-loader-label" class="text-center mb-2 text-lg font-semibold"></div>
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="progress min-w-sm md:min-w-md" role="progressbar">
|
||||
<div id="blazor-loader-progress" class="progress-bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@foreach (var script in Configuration.Scripts)
|
||||
{
|
||||
<script src="@script"></script>
|
||||
}
|
||||
|
||||
<script src="/_framework/blazor.webassembly.js"></script>
|
||||
<script>navigator.serviceWorker.register('service-worker.js');</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter] public FrontendConfiguration Configuration { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user