@page "/servers"
@attribute [StreamRendering]
Servers
Servers
@if (servers == null)
{
Loading...
}
else
{
Id |
Name |
State |
@foreach (var world in servers)
{
@world.Id |
@world.Name |
@world.State |
}
}
@code {
private List? servers;
protected override async Task OnInitializedAsync()
{
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(Environment.GetEnvironmentVariable("ADMIN_KEY"));
servers = await httpClient.GetFromJsonAsync>("http://localhost:8080/api/admin/servers");
}
}