made RenderMode configurable

This commit is contained in:
Shaun Walker
2021-05-30 15:37:23 -04:00
parent afcc5e2170
commit 276817c89d
8 changed files with 67 additions and 18 deletions

View File

@ -11,6 +11,7 @@ using System.Reflection;
using Oqtane.Repository;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Oqtane.Pages
{
@ -33,12 +34,24 @@ namespace Oqtane.Pages
_languages = languages;
}
public string Runtime = "Server";
public RenderMode RenderMode = RenderMode.Server;
public string HeadResources = "";
public string BodyResources = "";
public string Message = "";
public void OnGet()
{
if (_configuration.GetSection("Runtime").Exists())
{
Runtime = _configuration.GetSection("Runtime").Value;
}
if (Runtime != "WebAssembly" && _configuration.GetSection("RenderMode").Exists())
{
RenderMode = (RenderMode)Enum.Parse(typeof(RenderMode), _configuration.GetSection("RenderMode").Value, true);
}
var assemblies = AppDomain.CurrentDomain.GetOqtaneAssemblies();
foreach (Assembly assembly in assemblies)
{