|
|
|
@ -1,11 +1,6 @@
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using blazor_lab.Services;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Minecraft.Crafting.Api.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Net.Http.Json;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace blazor_lab.Components
|
|
|
|
@ -16,17 +11,19 @@ namespace blazor_lab.Components
|
|
|
|
|
[Parameter]
|
|
|
|
|
public List<InventoryModel> Inventory { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
|
public List<Models.Item> Items { get; set; } = new List<Models.Item>();
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public HttpClient HttpClient { get; set; }
|
|
|
|
|
public IConfiguration Config { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IConfiguration Config { get; set; }
|
|
|
|
|
private DataApiService dataApiService { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
Items = await HttpClient.GetFromJsonAsync<List<Item>>($"{Config["CraftingApi:BaseUrl"]}/api/Crafting/all");
|
|
|
|
|
Items = await dataApiService.All();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetItemImageBase64(string displayName)
|
|
|
|
|