Compare commits

...

48 Commits
rem ... master

Author SHA1 Message Date
remrem 852a6b795d Update 'Blazor/Blazor/Pages/_Layout.cshtml'
continuous-integration/drone/push Build is passing Details
2 years ago
remrem d523f07b9c Update 'Blazor/Blazor/Pages/_Layout.cshtml'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 2aebc338d9 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
remrem c6439a5562 add docs for a lot of class
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 7cba21a0e4 Merge branch 'master' of https://codefirst.iut.uca.fr/git/remi.arnal/blazor
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 763b94cb11 add doc for DataApiService
2 years ago
Aurian JAULT f67569da8a supr README
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT fa450864f2 Ajouter 'Blazor/README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 7a16a683f3 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 20bd93ad62 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 3e3985def5 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 4a7a4925b5 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT c1b0ce361b Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 01a33c822e Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 1c9e43b43c Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT f05af173ee Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT b4f9192146 Mise à jour de 'Blazor/Blazor/Pages/_Layout.cshtml'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 22bd05dccf Mise à jour de 'Blazor/Blazor/Pages/_Layout.cshtml'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 603a39eb9c Mise à jour de 'Blazor/Blazor/Pages/_Layout.cshtml'
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 8860b5e4ac "end of project"
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT ca5d6e4c88 actions done
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 909f0b01e0 keep items in memory
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 54860c3528 "Local storage"
continuous-integration/drone/push Build is failing Details
2 years ago
Aurian JAULT a6256d80ec "local storage + stack display"
2 years ago
Aurian JAULT ce33f8d425 display number
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT 9cf768b4bd "Acion handled on list of items"
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT ee46227910 merged
continuous-integration/drone/push Build is passing Details
2 years ago
Aurian JAULT b535946d5c bug congired
2 years ago
remrem 9a86d5f669 css
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 9cb1d36242 pour aurian sous la menace
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 6e754626cb component InventoryListImage works + reAdd OnInitializedAsync
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 8d0deba849 Merge branch 'master' of https://codefirst.iut.uca.fr/git/remi.arnal/blazor
continuous-integration/drone/push Build is failing Details
2 years ago
Aurian JAULT d9c36b2e2d "action handling"
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 9d8dbc3335 add InventoryListImage.razor
2 years ago
remrem c973844f4a Merge branch 'master' of https://codefirst.iut.uca.fr/git/remi.arnal/blazor
continuous-integration/drone/push Build is passing Details
2 years ago
remrem 26596ca54d api url
2 years ago
Aurian JAULT 1f9d8fe450 "Action on list"
continuous-integration/drone/push Build is passing Details
2 years ago
remrem ecbafa58e8 Merge pull request 'HAHA' (#3) from rem into master
continuous-integration/drone/push Build is failing Details
2 years ago
remrem 9603ddbbdd Merge pull request 'aurian' (#2) from aurian into master
continuous-integration/drone/push Build is failing Details
2 years ago
remrem fab2ba4605 Update 'Blazor/Blazor/Pages/_Layout.cshtml'
2 years ago
Aurian JAULT 413a6f2db3 "Inventory ended"
2 years ago
remrem f1713b98ad Merge pull request 'rem' (#1) from rem into master
continuous-integration/drone/push Build is failing Details
2 years ago
Aurian JAULT f1cfce9fe6 finalisation
2 years ago
Aurian JAULT 14c9004c26 Action handler in inventory
2 years ago
Aurian JAULT 4f10a6acdb display img and default one
2 years ago
Aurian JAULT c11278f6c7 Empty cases
2 years ago
Aurian JAULT f758144ee8 gestion item vide
2 years ago
remrem 0f8b8deea7 Update '.drone.yml'
continuous-integration/drone/push Build is passing Details
2 years ago

@ -43,7 +43,6 @@
<div class="col-12">
<div>Actions</div>
<div class="actions" id="actions">
</div>
</div>
</div>

@ -1,6 +1,6 @@
.item {
width: 64px;
height: 64px;
border: 1px solid;
overflow: hidden;
}
.item {
width: 64px;
height: 64px;
border: 1px solid;
overflow: hidden;
}

@ -0,0 +1,33 @@
@using Models;
<CascadingValue Value="@this">
<div id="master">
<div class="inventory">
<div class="css-grid">
@for(int i = 0; i<Models.InventoryList.size;i++)
{
@if (inventory.inventoryItems[i] != null)
{
<ItemInventory items="@inventory.inventoryItems[i]" Index="@i" NoDrop=true />
}
else
{
<ItemInventory items="@inventory.inventoryItems[i]" Index="@i"/>
}
}
</div>
<div>Actions</div>
<div class="actions" id="actions">
</div>
</div>
<div class="inventory-list">
<InventoryList/>
</div>
</div>
</CascadingValue>

@ -0,0 +1,67 @@
using Blazor.Models;
using Blazor.Pages;
using Blazored.LocalStorage;
using Blazorise.DataGrid;
using Blazorise;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Text.Json;
using Blazor.Data;
namespace Blazor.Components
{
partial class Inventory
{
public Models.InventoryList inventory = new Models.InventoryList();
public Models.InventoryItem CurrentDragItem { get; set; }
public ObservableCollection<InventoryAction> Actions { get; set; }
[Inject]
internal IJSRuntime JavaScriptRuntime { get; set; }
[Inject]
public ILocalStorageService LocalStorage { get; set; }
[Inject]
public HttpClient Http { get; set; }
public Inventory()
{
Actions = new ObservableCollection<InventoryAction>();
Actions.CollectionChanged += OnActionsCollectionChanged;
}
public async void update()
{
this.StateHasChanged();
var serial = JsonSerializer.Serialize(inventory);
await LocalStorage.SetItemAsync<String>("list", serial);
return;
}
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
}
private async Task OnReadData(DataGridReadDataEventArgs<Item> e)
{
if (e.CancellationToken.IsCancellationRequested)
{
return;
}
var response = await LocalStorage.GetItemAsync<String>("list");
if (!e.CancellationToken.IsCancellationRequested)
{
inventory = JsonSerializer.Deserialize<Models.InventoryList>(response);
}
}
}
}

@ -0,0 +1,26 @@
.inventory-list {
width: 40%;
}
.inventory {
width: 40%;
}
.css-grid {
grid-template-columns: repeat(6, minmax(0,1fr));
gap: 10px;
display: grid;
}
#master {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}
.actions {
border: 1px solid black;
height: 250px;
overflow: scroll;
}

@ -0,0 +1,16 @@
window.Inventory =
{
AddActions: function (data) {
data.forEach(element => {
var div = document.createElement('div');
div.innerHTML = 'Action: ' + element.action + ' - Index: ' + element.index;
if (element.item) {
div.innerHTML += ' - Item Name: ' + element.item.name;
}
document.getElementById('actions').appendChild(div);
});
}
}

@ -0,0 +1,16 @@
using Blazor.Models;
namespace Blazor.Components
{
public class InventoryAction
{
public InventoryAction(String ac, int num,Item objet) {
Action = ac;
Index = num;
Item = objet;
}
public string Action { get; set; }
public int Index { get; set; }
public Item Item { get; set; }
}
}

@ -1,29 +1,22 @@
@using Blazor.Models
<h3>Inventory Item List</h3>
<DataGrid TItem="Item"
Data="@items"
TotalItems="@totalItem"
PageSize="10"
ShowPager
Filterable
Responsive>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="#" Width="15%"/>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image" Filterable="false">
<DisplayTemplate >
@if (!string.IsNullOrWhiteSpace(context.ImageBase64))
{
<img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="width: 60px" />
}
else
{
<img src="images/default.png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="width: 60px"/>
}
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Display name">
<DisplayTemplate>
<span style="font-weight: bold; font-size: 2rem; display: flex; justify-content: center;">@context.DisplayName</span>
</DisplayTemplate>
<CascadingValue Value="@this.Parent">
<DataGrid TItem="Item"
Data="@items"
TotalItems="@totalItem"
PageSize="10"
ShowPager
Filterable
Responsive>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="#" Width="15%"/>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image" Filterable="false">
<DisplayTemplate>
<InventoryListImage Item="context"/>
</DisplayTemplate>
</DataGridColumn>
</DataGrid>
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="@Localizer["Caption"]">
<DisplayTemplate>
<span style="font-weight: bold; font-size: 2rem; display: flex; justify-content: center;">@context.DisplayName</span>
</DisplayTemplate>
</DataGridColumn>
</DataGrid>
</CascadingValue>

@ -1,4 +1,5 @@
using Blazor.Models;
using Blazor.Pages;
using Blazor.Services;
using Blazored.Modal;
using Blazored.Modal.Services;
@ -18,7 +19,7 @@ namespace Blazor.Components
public IDataService DataService { get; set; }
[Inject]
public IWebHostEnvironment WebHostEnvironment { get; set; }
public IWebHostEnvironment WebHostEnvironment { get; set;}
[Inject]
public NavigationManager NavigationManager { get; set; }
@ -29,12 +30,14 @@ namespace Blazor.Components
[Inject]
public IStringLocalizer<InventoryList> Localizer { get; set; }
protected override async Task OnInitializedAsync()
{
[CascadingParameter]
public Inventory Parent { get; set; }
items = await DataService.getAll();
totalItem = await DataService.Count();
await base.OnInitializedAsync();
}
protected override async Task OnInitializedAsync()
{
items = await DataService.getAll();
totalItem = await DataService.Count();
await base.OnInitializedAsync();
}
}
}

@ -0,0 +1,21 @@
@using Blazor.Models;
<div
class="item"
ondragover="event.preventDefault();"
draggable="true"
@ondragstart="@OnDragStart"
@ondrop="@OnDrop"
@ondragenter="@OnDragEnter"
@ondragleave="@OnDragLeave">
@if (!string.IsNullOrWhiteSpace(Item.ImageBase64))
{
<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="Item.DisplayName" alt="Item.DisplayName" style="width: 60px" />
}
else
{
<img src="images/default.png" class="img-thumbnail" title="Item.DisplayName" alt="Item.DisplayName" style="width: 60px"/>
}
</div>

@ -0,0 +1,42 @@
using Blazor.Models;
using Microsoft.AspNetCore.Components;
namespace Blazor.Components
{
public partial class InventoryListImage
{
[Parameter]
public Item Item { get; set; }
[CascadingParameter]
public Inventory Parent { get; set; }
internal void OnDragEnter()
{
Parent.Actions.Add(new InventoryAction("On drag enter", Item.Id, Item));
return;
}
internal void OnDragLeave()
{
Parent.Actions.Add(new InventoryAction("On drag leave", Item.Id, Item));
return;
}
internal void OnDrop()
{
Parent.Actions.Add(new InventoryAction("On drop", Item.Id, Item));
Parent.CurrentDragItem = null;
return;
}
private void OnDragStart()
{
Parent.CurrentDragItem = new InventoryItem(Item);
Parent.Actions.Add(new InventoryAction("On drag start", Item.Id, Item));
return;
}
}
}

@ -0,0 +1,30 @@
<div class="item"
ondragover="event.preventDefault();"
@ondragstart="@OnDragStartAsync"
@ondrop="@OnDropAsync"
@ondragenter="@OnDragEnter"
@ondragleave="@OnDragLeave">
@if(Items != null)
{
@if(!string.IsNullOrWhiteSpace(Items.item.ImageBase64))
{
<div Class="itemDisplay">
<img src="data:image/png;base64, @(Items.item.ImageBase64)" title="@Items.item.DisplayName" alt="@Items.item.DisplayName" style="width: 50px; height: 50px" />
<span class="number-item">@Items.Stack</span>
</div>
}
else
{
<div class="itemDisplay">
<img src="images/default.png" title="@Items.item.DisplayName" alt="@Items.item.DisplayName" style="width: 50px; height: 50px"/>
<span class="number-item">@Items.Stack</span>
</div>
}
}
else
{
<div class="itemDisplay">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAINJREFUeF7t18ENACAMAzE6OuLD1jDImREiGitz9n0r/EYAfoAT0AHhDlxKkAIUoAAFKBBOAIMYxCAGMRhGwBjCIAYxiEEMYjCcAAYxiEEMYjCMgDWIQQxiEIMYxGA4AQxiEIMYxGAYAWsQgxjEIAYxiMFwAhjEIAYxiMEwAtYgBusMfuMLowEYJcXzAAAAAElFTkSuQmCC" class="img-thumbnail" title="empty" alt="empty slot" style="width: 50px; height: 50px" />
</div>
}
</div>

@ -0,0 +1,130 @@
using Blazor.Models;
using Blazored.LocalStorage;
using Blazorise.Extensions;
using Microsoft.AspNetCore.Components;
namespace Blazor.Components
{
public partial class ItemInventory
{
[Parameter]
public bool NoDrop { get; set; }
[Parameter]
public InventoryItem Items { get; set; }
[Parameter]
public int Index { get; set; }
[CascadingParameter]
public Inventory Parent { get; set; }
[Inject]
public ILocalStorageService LocalStorage { get; set; }
public async Task OnDragStartAsync()
{
if (this.Items == null)
{
Parent.CurrentDragItem = null;
return;
}
Parent.CurrentDragItem = this.Items;
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,Items.item));
this.Items = null;
Parent.inventory.inventoryItems[this.Index] = null ;
await LocalStorage.RemoveItemAsync("data" + this.Index);
await LocalStorage.RemoveItemAsync("stack" + this.Index);
}
public async Task OnDropAsync()
{
if (Parent.CurrentDragItem == null)
{
return;
}
if(this.Items == null)
{
this.Items = Parent.CurrentDragItem;
Parent.CurrentDragItem = null;
await LocalStorage.SetItemAsync<Item>("data" + this.Index, this.Items.item);
await LocalStorage.SetItemAsync<int>("stack" + this.Index, this.Items.Stack);
Parent.Actions.Add(new InventoryAction("On drag drop",this.Index,Items.item));
return;
}
if (Parent.CurrentDragItem.item.Id != this.Items.item.Id)
{
this.Items = Parent.CurrentDragItem;
Parent.CurrentDragItem = null;
await LocalStorage.SetItemAsync<Item>("data" + this.Index, this.Items.item);
await LocalStorage.SetItemAsync<int>("stack" + this.Index, this.Items.Stack);
Parent.Actions.Add(new InventoryAction("On drag drop",this.Index,Items.item));
return;
}
else
{
int total = Parent.CurrentDragItem.Stack + this.Items.Stack;
if (total > this.Items.item.StackSize)
{
this.Items.Stack = this.Items.item.StackSize;
Parent.CurrentDragItem = null;
await LocalStorage.SetItemAsync<Item>("data" + this.Index, this.Items.item);
await LocalStorage.SetItemAsync<int>("stack" + this.Index, this.Items.Stack);
Parent.Actions.Add(new InventoryAction("On drag drop",this.Index,Items.item));
return;
}
else
{
this.Items.Stack = total;
Parent.CurrentDragItem = null;
await LocalStorage.SetItemAsync<Item>("data" + this.Index, this.Items.item);
await LocalStorage.SetItemAsync<int>("stack" + this.Index, this.Items.Stack);
Parent.Actions.Add(new InventoryAction("On drag drop",this.Index,Items.item));
return;
}
}
}
internal void OnDragEnter()
{
if (this.Items == null) return;
Parent.Actions.Add(new InventoryAction("Drag Enter",this.Index,Items.item));
}
internal void OnDragLeave()
{
if (this.Items == null) return;
Parent.Actions.Add(new InventoryAction("Drag Leave",this.Index,Items.item));
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
base.OnAfterRenderAsync(firstRender);
if (!firstRender)
{
return;
}
var item = await LocalStorage.GetItemAsync<Item>("data" + this.Index);
int stack = await LocalStorage.GetItemAsync<int>("stack" + this.Index);
if (item != null)
{
this.Items = new Models.InventoryItem(item, stack);
}
else
{
this.Items = null;
}
StateHasChanged();
return;
}
}
}

@ -0,0 +1,17 @@
.itemDisplay {
position: relative;
text-align: center;
width: 50px;
height: 50px;
color: black;
}
.number-item {
position: absolute;
bottom: 5px;
right: 5px;
font-size: 1em;
font-weight: bold;
-webkit-text-stroke: 2px black;
font-family: 'Segoe UI', Tahoma, Verdana, Geneva, Tahoma, sans-serif
}

@ -1,11 +1,20 @@
using Blazor.Models;
namespace Blazor.Factories
{
{
/// <summary>
/// A static factory for creating and updating ItemModel and Item.
/// </summary>
public static class ItemFactory
{
{
/// <summary>
/// Converts an Item to an ItemModel
/// </summary>
/// <param name="item">The item to convert.</param>
/// <param name="imageContent">The image content of the ItemModel</param>
/// <returns>An ItemModel with the same properties as the item.</returns>
public static ItemModel ToModel(Item item, byte[] imageContent)
{
{
return new ItemModel
{
Id = item.Id,
@ -20,6 +29,11 @@ namespace Blazor.Factories
};
}
/// <summary>
/// Creates an Item from an ItemModel.
/// </summary>
/// <param name="model">The ItemModel to create the Itemfrom.</param>
/// <returns>An Item with the same properties as the ItemModel.</returns>
public static Item Create(ItemModel model)
{
return new Item
@ -35,7 +49,12 @@ namespace Blazor.Factories
ImageBase64 = Convert.ToBase64String(model.ImageContent)
};
}
/// <summary>
/// Updates an Item with the properties of an ItemModel.
/// </summary>
/// <param name="item"> The Item to update </param>
/// <param name="model"> The ItemModel used to update the item </param>
public static void Update(Item item, ItemModel model)
{
item.DisplayName = model.DisplayName;

@ -5,18 +5,29 @@ using Blazored.Modal.Services;
using Microsoft.AspNetCore.Components;
namespace Blazor.Modals
{
{
/// <summary>
/// Partial class for the delete confirmation modal.
/// </summary>
public partial class DeleteConfirmation
{
{
/// <summary>
/// The modal instance
/// </summary>
[CascadingParameter]
public BlazoredModalInstance ModalInstance { get; set; }
[Inject]
public IDataService DataService { get; set; }
/// <summary>
/// The id of the item to delete
/// </summary>
[Parameter]
public int Id { get; set; }
private Item item = new Item();
protected override async Task OnInitializedAsync()
@ -25,11 +36,17 @@ namespace Blazor.Modals
item = await DataService.GetById(Id);
}
/// <summary>
/// Confirms the deletion of the item.
/// </summary>
void ConfirmDelete()
{
ModalInstance.CloseAsync(ModalResult.Ok(true));
}
/// <summary>
/// Cancels the deletion of the item.
/// </summary>
void Cancel()
{
ModalInstance.CancelAsync();

@ -0,0 +1,47 @@
using System.Collections;
namespace Blazor.Models
{
/// <summary>
/// Represents an item in a player's inventory.
/// </summary>
public class InventoryItem
{
public Item item;
int stack;
/// <summary>
/// The number of items in the stack.
/// </summary>
public int Stack { get; set; }
/// <summary>
/// Constructor for InventoryItem with no parameters.
/// </summary>
public InventoryItem()
{
item = new Item();
Stack = 64;
}
/// <summary>
/// Constructor for InventoryItem with a single item.
/// </summary>
/// <param name="item">The item.</param>
public InventoryItem(Item item)
{
this.item = item;
Stack = 1;
}
/// <summary>
/// Constructor for InventoryItem with a stack of items.
/// </summary>
/// <param name="item">The item</param>
/// <param name="stock">The number of items in the stack.</param>
public InventoryItem(Item item, int stock)
{
this.item = item;
Stack = stock;
}
}
}

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Http.Features;
namespace Blazor.Models
{
/// <summary>
/// Represents a list of items in a player's inventory.
/// </summary>
public partial class InventoryList
{
static public int size = 18;
/// <summary>
/// List of inventory items.
/// </summary>
public List<InventoryItem> inventoryItems = new List<InventoryItem>(new InventoryItem[size]);
/// <summary>
/// Constructor for InventoryList.
/// </summary>
public InventoryList()
{
inventoryItems[0] = new InventoryItem();
}
}
}

@ -1,5 +1,8 @@
namespace Blazor.Models
{
{
/// <summary>
/// Represents an item.
/// </summary>
public class Item
{
public int Id { get; set; }
@ -12,5 +15,21 @@
public DateTime CreatedDate { get; set; }
public DateTime? UpdatedDate { get; set; }
public string ImageBase64 { get; set; }
/// <summary>
/// Constructor for Item.
/// </summary>
public Item()
{
Id = 2;
DisplayName = "Dirt";
Name = "Block_of_dirt";
StackSize = 64;
MaxDurability= 9999;
EnchantCategories = new List<string>();
RepairWith = new List<string>();
CreatedDate= DateTime.Now;
UpdatedDate = DateTime.Now;
}
}
}

@ -1,7 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace Blazor.Models
{
{
/// <summary>
/// Model for creating or updating an item.
/// </summary>
public class ItemModel
{
public int Id { get; set; }

@ -1,5 +1,7 @@
@page "/"
@using Blazor.Components;
@using System.Globalization
<div>
<Crafting Items="Items" Recipes="Recipes" />
</div>

@ -4,16 +4,32 @@ using Blazor.Services;
using Microsoft.AspNetCore.Components;
namespace Blazor.Pages
{
{
/// <summary>
/// Partial class for the Index page.
/// </summary>
public partial class Index
{
{
/// <summary>
/// The data service for accessing item and recipe data.
/// </summary>
[Inject]
public IDataService DataService { get; set; }
/// <summary>
/// List of items to display on the page.
/// </summary>
public List<Item> Items { get; set; } = new List<Item>();
/// <summary>
/// List of crafting recipes possible.
/// </summary>
private List<CraftingRecipe> Recipes { get; set; } = new List<CraftingRecipe>();
/// <summary>
/// Method that runs after the component has finished rendering.
/// </summary>
/// <param name="firstRender">Indicates whether this is the first render of the component.</param>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
base.OnAfterRenderAsync(firstRender);

@ -1,18 +0,0 @@
@page "/inventory"
@using Blazor.Components
@using Blazor.Models
<PageTitle>Counter</PageTitle>
<h1>Inventory</h1>
<div id="master">
<div class="inventory">
<span>Ici c'est l'inventaire</span>
</div>
<div class="inventory-list">
<InventoryList/>
</div>
</div>

@ -0,0 +1,10 @@
@page "/inventory"
@using Blazor.Components
@using Microsoft.Extensions.Localization;
<PageTitle>@Localizer["Title"]</PageTitle>
<h1>@Localizer["Title"]</h1>
<Inventory/>

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
namespace Blazor.Pages
{
/// <summary>
/// Partial class for the InventoryPage.
/// </summary>
public partial class InventoryPage
{
/// <summary>
/// The localizer for the InventoryPage.
/// </summary>
[Inject]
public IStringLocalizer<InventoryPage> Localizer { get; set; }
}
}

@ -1,14 +1,14 @@
.inventory-list {
width: 40%;
}
.inventory {
width: 40%;
}
#master {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}
.inventory-list {
width: 40%;
}
.inventory {
width: 40%;
}
#master {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}

@ -9,9 +9,12 @@ using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
namespace Blazor.Pages
{
{
/// <summary>
/// Partial class for the List page.
/// </summary>
public partial class List
{
{
private List<Item> items;
private int totalItem;
@ -22,15 +25,29 @@ namespace Blazor.Pages
[Inject]
public IWebHostEnvironment WebHostEnvironment { get; set; }
/// <summary>
/// The navigation manager for navigating between pages.
/// </summary>
[Inject]
public NavigationManager NavigationManager { get; set; }
/// <summary>
/// The modal service for displaying modal dialogs
/// </summary>
[CascadingParameter]
public IModalService Modal { get; set; }
/// <summary>
/// The localizer for the List page.
/// </summary>
[Inject]
public IStringLocalizer<List> Localizer { get; set; }
/// <summary>
/// Event handler for reading data in the data grid.
/// </summary>
/// <param name="e">The event arguments.</param>
/// <returns>A task representing the asynchronous operation.</returns>
private async Task OnReadData(DataGridReadDataEventArgs<Item> e)
{
if (e.CancellationToken.IsCancellationRequested)
@ -45,6 +62,10 @@ namespace Blazor.Pages
}
}
/// <summary>
/// Event handler for deleting an item.
/// </summary>
/// <param name="id">The id of the item to delete.</param>
private async void OnDelete(int id)
{
var parameters = new ModalParameters();

@ -7,7 +7,6 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@*<base href="https://codefirst.iut.uca.fr/containers/blazor-web-remiarnal/" />*@
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Caption" xml:space="preserve">
<value>Nom de l'objet</value>
</data>
</root>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Caption" xml:space="preserve">
<value>Display name</value>
</data>
</root>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Inventaire</value>
</data>
</root>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Inventory</value>
</data>
</root>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Liste des éléments</value>
</data>
</root>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Item List</value>
</data>
</root>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Counter" xml:space="preserve">
<value>Compteur</value>
</data>
<data name="Fetch" xml:space="preserve">
<value>Récupérer des données</value>
</data>
<data name="Home" xml:space="preserve">
<value>Menu</value>
</data>
<data name="Inventory" xml:space="preserve">
<value>Inventaire</value>
</data>
<data name="List" xml:space="preserve">
<value>Liste</value>
</data>
</root>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Counter" xml:space="preserve">
<value>Counter</value>
</data>
<data name="Fetch" xml:space="preserve">
<value>Fetch Data</value>
</data>
<data name="Home" xml:space="preserve">
<value>Home</value>
</data>
<data name="Inventory" xml:space="preserve">
<value>Inventory</value>
</data>
<data name="List" xml:space="preserve">
<value>List</value>
</data>
</root>

@ -3,61 +3,104 @@ using Blazor.Factories;
using Blazor.Models;
namespace Blazor.Services
{
{
/// <summary>
/// Service for interacting with a data API.
/// </summary>
public class DataApiService : IDataService
{
private readonly HttpClient _http;
/// <summary>
/// Constructor for DataApiService.
/// </summary>
/// <param name="http">HttpClient for making API requests.</param>
public DataApiService(HttpClient http)
{
_http = http;
}
/// <summary>
/// Add a new item to the API.
/// </summary>
/// <param name="model">Model containing data for the new item.</param>
public async Task Add(ItemModel model)
{
// Get the item
var item = ItemFactory.Create(model);
// Save the data
await _http.PostAsJsonAsync("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/", item);
await _http.PostAsJsonAsync("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/", item);
}
/// <summary>
/// Get the number of items in the API.
/// </summary>
/// <returns>Task representing the asynchronous operation, returning the number of items.</returns>
public async Task<int> Count()
{
return await _http.GetFromJsonAsync<int>("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/count");
return await _http.GetFromJsonAsync<int>("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/count");
}
/// <summary>
/// Get a list of items from the API, paginated.
/// </summary>
/// <param name="currentPage">The current page number.</param>
/// <param name="pageSize">The number of items per page.</param>
/// <returns>Task representing the asynchronous operation, returning a list of items.</returns>
public async Task<List<Item>> List(int currentPage, int pageSize)
{
return await _http.GetFromJsonAsync<List<Item>>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/?currentPage={currentPage}&pageSize={pageSize}");
return await _http.GetFromJsonAsync<List<Item>>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/?currentPage={currentPage}&pageSize={pageSize}");
}
/// <summary>
/// Get a list of all items from the API.
/// </summary>
/// <returns>Task representing the asynchronous operation, returning a list of items.</returns>
public async Task<List<Item>> getAll()
{
return await _http.GetFromJsonAsync<List<Item>>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/?currentPage=0&pageSize=100000");
return await _http.GetFromJsonAsync<List<Item>>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/all");
}
/// <summary>
/// Get a single item from the API by its ID.
/// </summary>
/// <param name="id">The ID of the item to retrieve.</param>
/// <returns>Task representing the asynchronous operation, returning the item with the specified ID.</returns>
public async Task<Item> GetById(int id)
{
return await _http.GetFromJsonAsync<Item>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/{id}");
return await _http.GetFromJsonAsync<Item>($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/{id}");
}
/// <summary>
/// Update an existing item in the API.
/// </summary>
/// <param name="id">The ID of the item to update.</param>
/// <param name="model">Model containing the updated data for the item.</param>
public async Task Update(int id, ItemModel model)
{
// Get the item
var item = ItemFactory.Create(model);
await _http.PutAsJsonAsync($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/{id}", item);
await _http.PutAsJsonAsync($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/{id}", item);
}
/// <summary>
/// Delete an existing item from the API.
/// </summary>
/// <param name="id">The ID of the item to delete.</param>
public async Task Delete(int id)
{
await _http.DeleteAsync($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/{id}");
await _http.DeleteAsync($"https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/{id}");
}
/// <summary>
/// Get a list of crafting recipes from the API.
/// </summary>
/// <returns>Task representing the asynchronous operation, returning a list of crafting recipes.</returns>
public async Task<List<CraftingRecipe>> GetRecipes()
{
return await _http.GetFromJsonAsync<List<CraftingRecipe>>("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-julienriboulet/api/Crafting/recipe");
return await _http.GetFromJsonAsync<List<CraftingRecipe>>("https://codefirst.iut.uca.fr/containers/container-blazor-web-api-marcchevaldonne/api/Crafting/recipe");
}
}
}

@ -11,27 +11,27 @@
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Home
<span class="oi oi-home" aria-hidden="true"></span>@Localizer["Home"]
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="oi oi-plus" aria-hidden="true"></span> Counter
<span class="oi oi-plus" aria-hidden="true"></span> @Localizer["Counter"]
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="fetchdata">
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Fetch"]
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="list">
<span class="oi oi-list-rich" aria-hidden="true"></span> List
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["List"]
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="inventory">
<span class="oi oi-box" aria-hidden="true"></span> Inventory
<span class="oi oi-box" aria-hidden="true"></span> @Localizer["Inventory"]
</NavLink>
</div>
</nav>

@ -0,0 +1,12 @@
using Blazor.Pages;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
namespace Blazor.Shared
{
public partial class NavMenu
{
[Inject]
public IStringLocalizer<NavMenu> Localizer { get; set; }
}
}

@ -1,3 +1,27 @@
# blazor
i
i
# Projet blazor
## Présentation
Le projet de notre dépôt contient tous les éléments de la consignes (hors bonus), indiqué à [cette adresse](https://codefirst.iut.uca.fr/documentation/julien.riboulet/docusaurus/Blazor/your-next-steps).
## Lancer le projet
Plusieurs méthodes sont disponibles pour lancer le projet.
### Via Docker
Une version déployée du projet est déjà disponible à l'URL https://codefirst.iut.uca.fr/containers/projet-blazor-aurianjault
### Via Visual Studio
#### Lancez VS
Lancez visual Studio, cliquez, sur la droite, "Clôner un dépôt".
#### Cloner
Renseigner dans le champ "Emplacement du dêpôt" ce lien: `https://codefirst.iut.uca.fr/git/remi.arnal/blazor.git`
Une fois que vous avez choisi le chemin de votre choix pour le clonage, appuyez sur Cloner.
#### Lancer la solution
Une fois le dépôt cloné, lancez la solution en cliquant sur le triangle vert plein situé dans la barre d'outil en haut de votre écran.

Loading…
Cancel
Save