mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 02:17:20 +02:00
chore: Some minor improvements
This commit is contained in:
1 parent
798a9d0e43
commit
d3d25fa62d
3 files changed
+19
-9
No files matched your search
@@ -1,16 +1,23 @@
|
||||
@using WotBlitzStatisticsPro.Blazor.Model
|
||||
@inherits SearchDialogTypeBase
|
||||
<!--Realm type selection-->
|
||||
<RadzenTextBox Placeholder=@($"{Localizer["Search"]}...") Change=@OnSearchTextChange Style="width: 100%;" />
|
||||
|
||||
<RadzenTextBox Placeholder=@($"{Localizer["Search"]}...") Change=@OnSearchTextChange Disabled="@ComponentBusy" Style="width: 100%;" />
|
||||
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate"
|
||||
Visible="@ComponentBusy"
|
||||
Style="width: 100%; margin-top: 10px;" />
|
||||
<RadzenListBox
|
||||
@bind-Value=@CurrentValue
|
||||
Data=@FilteredList
|
||||
ValueProperty="ItemId"
|
||||
Style="height:335px; width: 100%; margin-top: 10px;">
|
||||
Style="height:335px; width: 100%; margin-top: 10px;"
|
||||
Visible="@(!ComponentBusy)">
|
||||
<Template>
|
||||
<!--ToDo: Create new component that will show nick[clan] {WinRate with color}, {battles count with translatable word "battles"}. And another component for Clans-->
|
||||
@(((SearchItem) context).ItemName) | accountId: @(((SearchItem) context).ItemId)
|
||||
</Template>
|
||||
</RadzenListBox>
|
||||
<RadzenButton Click=@(args => OnOkButtonClick()) Text="Ok" Style="margin: 10px auto 10px auto; display: block; width: 150px; " />
|
||||
<RadzenButton
|
||||
Click=@(args => OnOkButtonClick())
|
||||
Text="Ok"
|
||||
Visible="@(!ComponentBusy)"
|
||||
Style="margin: 10px auto 10px auto; display: block; width: 150px; " />
|
||||
@@ -33,6 +33,8 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
|
||||
public long CurrentValue { get; set; }
|
||||
|
||||
public bool ComponentBusy { get; set; } = false;
|
||||
|
||||
public async Task OnSearchTextChange(string value)
|
||||
{
|
||||
if (DialogType == DialogType.FindPlayer && value.Length < 3)
|
||||
@@ -41,10 +43,9 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
}
|
||||
|
||||
FilteredList.Clear();
|
||||
ComponentBusy = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
// ToDo: Add busy cursor
|
||||
|
||||
// ToDo: Move this call to a service
|
||||
var accounts =
|
||||
await WotBlitzStatisticsProClient.FindAccounts.ExecuteAsync(value, RealmType.Ru, RequestLanguage.En);
|
||||
@@ -58,8 +59,10 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
|
||||
}
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
ComponentBusy = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
public async Task OnOkButtonClick()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
@@ -30,11 +31,10 @@ namespace WotBlitzStatisticsPro.Blazor
|
||||
builder.Services.AddSingleton<NavigationMessagesInterceptor>();
|
||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
|
||||
// ToDo: Find out URL
|
||||
// StrawberryShake GraphQL Client
|
||||
builder.Services
|
||||
.AddWotBlitzStatisticsProClient()
|
||||
.ConfigureHttpClient(client => client.BaseAddress = new Uri($"https://localhost:5001/graphql/"));
|
||||
.ConfigureHttpClient(client => client.BaseAddress = new Uri($"{builder.HostEnvironment.BaseAddress}graphql/"));
|
||||
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
Reference in new issue
Block a user