Fixed web rendering issues

This commit is contained in:
2025-04-23 11:55:46 +03:00
parent 2d319f3d34
commit 0493dfaeb4
7 changed files with 99 additions and 43 deletions

View File

@@ -4,4 +4,16 @@
<h1>Hello, world!</h1>
Welcome to your new app.
<button type="button" class="btn" @onclick="() => ClickTest(2)">Name</button>
Welcome to your new app.
@code {
private void ClickTest(int i)
{
Console.WriteLine($"Clicked {i}");
}
}

View File

@@ -1,4 +1,6 @@
@page "/plugins/local"
@rendermode InteractiveServer
@using DiscordBotCore.Logging
@using DiscordBotCore.PluginManagement
@using DiscordBotCore.PluginManagement.Models

View File

@@ -1,9 +1,11 @@
@page "/plugins/online"
@rendermode InteractiveServer
@using DiscordBotCore.Logging
@using DiscordBotCore.PluginManagement
<h3>Available Plugins</h3>
<h3>Available Plugins</h3>
@if (_onlinePlugins.Any())
{
<table class="table table-bordered">
@@ -25,7 +27,7 @@
<td>@plugin.Author</td>
<td>@plugin.Version</td>
<td>
<button type="button" class="btn btn-primary" @onmousedown="async () => await InstallPlugin(plugin.Id)">Download</button>
<button type="button" class="btn" @onclick="async () => await InstallPlugin(plugin.Id)">Download</button>
</td>
</tr>
}
@@ -104,6 +106,9 @@ else
};
_onlinePlugins.Add(onlinePlugin);
}
Logger.Log($"Found {_onlinePlugins.Count} online plugins.", this);
StateHasChanged();
}
private async Task InstallPlugin(int pluginId)
@@ -128,6 +133,7 @@ else
Logger.Log($"Plugin {pluginData.Name} installed successfully.", this);
CloseInstallPercentageModal();
StateHasChanged();
}
private void CloseInstallPercentageModal()
@@ -145,4 +151,4 @@ else
public string Author { get; set; }
public string Version { get; set; }
}
}
}

View File

@@ -7,6 +7,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.AddDiscordBotComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.