@page "/Card/{baid}" @using SharedProject.Models.Responses @using SharedProject.Enums @using SharedProject.Models @inject HttpClient Client

Card: @Baid

@if (response is not null) { On Off On Off On Off On Off @foreach (var item in Enum.GetValues()) { } @for (var i = -5; i <= 5; i++) { } @foreach (var item in Enum.GetValues()) { } @for (uint i = 0; i < 15; i++) { var index= i; @speedStrings[index] } On Off On Off @if (isSavingOptions) { Saving... } else { Save } } @code { [Parameter] public string? Baid { get; set; } private UserSetting? response; private bool isSavingOptions; private readonly string[] speedStrings = { "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.5", "3.0", "3.5", "4.0"}; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); isSavingOptions = false; response = await Client.GetFromJsonAsync($"api/UserSettings/{Baid}"); } private async Task SaveOptions() { isSavingOptions = true; await Client.PostAsJsonAsync($"api/UserSettings/{Baid}", response); isSavingOptions = false; } }