allow host to change runtime and rendermode settings in System Info
This commit is contained in:
@ -18,15 +18,21 @@
|
||||
<Label For="runtime" HelpText="Blazor Runtime (Server or WebAssembly)" ResourceKey="BlazorRuntime">Blazor Runtime: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="runtime" class="form-control" @bind="@_runtime" readonly />
|
||||
<select id="runtime" class="form-control" @bind="@_runtime">
|
||||
<option value="Server">@Localizer["Server"]</option>
|
||||
<option value="WebAssembly">@Localizer["WebAssembly"]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="rendermode" HelpText="Blazor Render Mode" ResourceKey="RenderMode">Render Mode: </Label>
|
||||
<Label For="rendermode" HelpText="Blazor Server Render Mode" ResourceKey="RenderMode">Render Mode: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="rendermode" class="form-control" @bind="@_rendermode" readonly />
|
||||
<select id="rendermode" class="form-control" @bind="@_rendermode">
|
||||
<option value="Server">@Localizer["Server"]</option>
|
||||
<option value="ServerPrerendered">@Localizer["ServerPrerendered"]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -62,6 +68,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveConfig">@Localizer["Save"]</button>
|
||||
<a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Access Framework API"]</a>
|
||||
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
||||
|
||||
@ -92,6 +99,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
var settings = new Dictionary<string, string>();
|
||||
settings.Add("runtime", _runtime);
|
||||
settings.Add("rendermode", _rendermode);
|
||||
await SystemService.UpdateSystemInfoAsync(settings);
|
||||
AddModuleMessage(Localizer["Configuration Updated. Please Select Restart Application For These Changes To Be Activated."], MessageType.Success);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await logger.LogError(ex, "Error Saving Configuration");
|
||||
AddModuleMessage(Localizer["An Error Occurred Updating The Configuration"], MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RestartApplication()
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user