Removed asset controllers. Started adding design section in settings
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Moonlight.ApiServer.Services;
|
||||
using Moonlight.Shared.Http.Responses.Assets;
|
||||
|
||||
namespace Moonlight.ApiServer.Http.Controllers.Assets;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/assets")]
|
||||
public class AssetsController : Controller
|
||||
{
|
||||
private readonly AssetService AssetService;
|
||||
|
||||
public AssetsController(AssetService assetService)
|
||||
{
|
||||
AssetService = assetService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<FrontendAssetResponse> Get()
|
||||
{
|
||||
return new FrontendAssetResponse()
|
||||
{
|
||||
JavascriptFiles = AssetService.GetJavascriptAssets(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MoonCore.Exceptions;
|
||||
using MoonCore.Models;
|
||||
using Moonlight.ApiServer.Services;
|
||||
|
||||
namespace Moonlight.ApiServer.Http.Controllers.Assets;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/assets/plugins")]
|
||||
public class AssetsPluginsController : Controller
|
||||
{
|
||||
private readonly PluginService PluginService;
|
||||
|
||||
public AssetsPluginsController(PluginService pluginService)
|
||||
{
|
||||
PluginService = pluginService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Task<HostedPluginsManifest> GetManifest()
|
||||
{
|
||||
return Task.FromResult(PluginService.HostedPluginsManifest);
|
||||
}
|
||||
|
||||
[HttpGet("stream")]
|
||||
public async Task GetAssembly([FromQuery(Name = "assembly")] string assembly)
|
||||
{
|
||||
var assembliesMap = PluginService.ClientAssemblyMap;
|
||||
|
||||
if (assembliesMap.ContainsKey(assembly))
|
||||
throw new HttpApiException("The requested assembly could not be found", 404);
|
||||
|
||||
var path = assembliesMap[assembly];
|
||||
|
||||
await Results.File(path).ExecuteAsync(HttpContext);
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class FrontendController : Controller
|
||||
return configuration;
|
||||
}
|
||||
|
||||
[HttpGet("plugins/{assemblyName}")]
|
||||
[HttpGet("plugins/{assemblyName}")] // TODO: Test this
|
||||
public async Task GetPluginAssembly(string assemblyName)
|
||||
{
|
||||
var assembliesMap = PluginService.ClientAssemblyMap;
|
||||
|
||||
Reference in New Issue
Block a user