Fixed ui bugs, improved plugins page, added new 404 component

This commit is contained in:
Marcel Baumgartner
2023-06-20 02:55:50 +02:00
parent e2a6d70f6a
commit e71495533b
7 changed files with 103 additions and 77 deletions

View File

@@ -3,18 +3,22 @@
@using Microsoft.AspNetCore.Components.Rendering
<LazyLoader Load="Load">
<div class="accordion" id="serverSetting">
<div class="row">
@foreach (var setting in Settings)
{
<div class="accordion-item">
<h2 class="accordion-header" id="serverSetting-header@(setting.GetHashCode())">
<button class="accordion-button fs-4 fw-semibold" type="button" data-bs-toggle="collapse" data-bs-target="#serverSetting-body@(setting.GetHashCode())" aria-expanded="true" aria-controls="serverSetting-body@(setting.GetHashCode())">
<TL>@(setting.Key)</TL>
</button>
</h2>
<div id="serverSetting-body@(setting.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="serverSetting-header@(setting.GetHashCode())" data-bs-parent="#serverSetting">
<div class="accordion-body">
@(GetComponent(setting.Value))
<div class="col-12 col-md-6 p-3">
<div class="accordion" id="serverSetting@(setting.GetHashCode())">
<div class="accordion-item">
<h2 class="accordion-header" id="serverSetting-header@(setting.GetHashCode())">
<button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#serverSetting-body@(setting.GetHashCode())" aria-expanded="false" aria-controls="serverSetting-body@(setting.GetHashCode())">
<TL>@(setting.Key)</TL>
</button>
</h2>
<div id="serverSetting-body@(setting.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="serverSetting-header@(setting.GetHashCode())" data-bs-parent="#serverSetting">
<div class="accordion-body">
@(GetComponent(setting.Value))
</div>
</div>
</div>
</div>
</div>
@@ -31,49 +35,49 @@
public string[] Tags { get; set; }
private Dictionary<string, Type> Settings = new();
private Task Load(LazyLoader lazyLoader)
{
if(Tags.Contains("paperversion"))
if (Tags.Contains("paperversion"))
Settings.Add("Paper version", typeof(PaperVersionSetting));
if(Tags.Contains("forgeversion"))
if (Tags.Contains("forgeversion"))
Settings.Add("Forge version", typeof(ForgeVersionSetting));
if(Tags.Contains("fabricversion"))
if (Tags.Contains("fabricversion"))
Settings.Add("Fabric version", typeof(FabricVersionSetting));
if(Tags.Contains("join2start"))
if (Tags.Contains("join2start"))
Settings.Add("Join2Start", typeof(Join2StartSetting));
if(Tags.Contains("javascriptversion"))
if (Tags.Contains("javascriptversion"))
Settings.Add("Javascript version", typeof(JavascriptVersionSetting));
if(Tags.Contains("javascriptfile"))
if (Tags.Contains("javascriptfile"))
Settings.Add("Javascript file", typeof(JavascriptFileSetting));
if(Tags.Contains("pythonversion"))
if (Tags.Contains("pythonversion"))
Settings.Add("Python version", typeof(PythonVersionSetting));
if(Tags.Contains("javaversion"))
if (Tags.Contains("javaversion"))
Settings.Add("Java version", typeof(JavaRuntimeVersionSetting));
if(Tags.Contains("dotnetversion"))
if (Tags.Contains("dotnetversion"))
Settings.Add("Dotnet version", typeof(DotnetVersionSetting));
if(Tags.Contains("pythonfile"))
if (Tags.Contains("pythonfile"))
Settings.Add("Python file", typeof(PythonFileSetting));
if(Tags.Contains("javafile"))
if (Tags.Contains("javafile"))
Settings.Add("Jar file", typeof(JavaFileSetting));
if(Tags.Contains("dotnetfile"))
if (Tags.Contains("dotnetfile"))
Settings.Add("Dll file", typeof(DotnetFileSetting));
Settings.Add("Rename", typeof(ServerRenameSetting));
Settings.Add("Reset", typeof(ServerResetSetting));
Settings.Add("Delete", typeof(ServerDeleteSetting));
return Task.CompletedTask;