Ajout de introduction à HTML table (View data)

pull/9/head
Louwar 3 years ago
parent e87f3d4d94
commit eb2cb4fc7f

@ -0,0 +1,15 @@
namespace ValblazeProject.Models
{
public class Item
{
public int Id { get; set; }
public string DisplayName { get; set; }
public string Name { get; set; }
public int StackSize { get; set; }
public int MaxDurability { get; set; }
public List<string> EnchantCategories { get; set; }
public List<string> RepairWith { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime? UpdatedDate { get; set; }
}
}

@ -0,0 +1,22 @@
@page "/episodes"
@layout DoctorWhoLayout
<h2>Episodes</h2>
<ul>
<li>
<a href="https://www.bbc.co.uk/programmes/p00vfknq">
<em>The Ribos Operation</em>
</a>
</li>
<li>
<a href="https://www.bbc.co.uk/programmes/p00vfdsb">
<em>The Sun Makers</em>
</a>
</li>
<li>
<a href="https://www.bbc.co.uk/programmes/p00vhc26">
<em>Nightmare of Eden</em>
</a>
</li>
</ul>

@ -0,0 +1,34 @@
@page "/list"
<h3>List</h3>
@if (items != null)
{
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Display Name</th>
<th>Stack Size</th>
<th>Maximum Durability</th>
<th>Enchant Categories</th>
<th>Repair With</th>
<th>Created Date</th>
</tr>
</thead>
<tbody>
@foreach (var item in items)
{
<tr>
<td>@item.Id</td>
<td>@item.DisplayName</td>
<td>@item.StackSize</td>
<td>@item.MaxDurability</td>
<td>@(string.Join(", ", item.EnchantCategories))</td>
<td>@(string.Join(", ", item.RepairWith))</td>
<td>@item.CreatedDate.ToShortDateString()</td>
</tr>
}
</tbody>
</table>
}

@ -0,0 +1,21 @@
using Microsoft.AspNetCore.Components;
using ValblazeProject.Models;
namespace ValblazeProject.Pages
{
public partial class List
{
private Item[] items;
[Inject]
public HttpClient Http { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; }
protected override async Task OnInitializedAsync()
{
items = await Http.GetFromJsonAsync<Item[]>($"{NavigationManager.BaseUri}fake-data.json");
}
}
}

@ -1,5 +0,0 @@
<h3>list</h3>
@code {
}

@ -1,6 +0,0 @@
namespace ValblazeProject.Pages
{
public class List
{
}
}

@ -9,6 +9,10 @@ builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddHttpClient();
var app = builder.Build();
// Configure the HTTP request pipeline.
@ -29,3 +33,4 @@ app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();

@ -0,0 +1,23 @@
@inherits LayoutComponentBase
<header>
<h1>Doctor Who&trade; Episode Database</h1>
</header>
<nav>
<a href="masterlist">Master Episode List</a>
<a href="search">Search</a>
<a href="new">Add Episode</a>
</nav>
@Body
<footer>
@TrademarkMessage
</footer>
@code {
public string TrademarkMessage { get; set; } =
"Doctor Who is a registered trademark of the BBC. " +
"https://www.doctorwho.tv/";
}

@ -9,6 +9,11 @@
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="list">
<span class="oi oi-list-rich" aria-hidden="true"></span> List
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Home

@ -23,6 +23,10 @@ build_metadata.AdditionalFiles.CssScope =
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcQ291bnRlci5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Pages/Episodes.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRXBpc29kZXMucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Pages/FetchData.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRmV0Y2hEYXRhLnJhem9y
build_metadata.AdditionalFiles.CssScope =
@ -31,8 +35,12 @@ build_metadata.AdditionalFiles.CssScope =
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXgucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Pages/Llist.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcTGxpc3QucmF6b3I=
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Pages/List.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcTGlzdC5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Shared/DoctorWhoLayout.razor]
build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXERvY3Rvcldob0xheW91dC5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/Louis Dufour/Source/Repos/ValoBlaz/ValblazeProject/Shared/SurveyPrompt.razor]

@ -0,0 +1,271 @@
[
{
"id": 1,
"displayname": "Zilch",
"name": "zilch",
"stacksize": 39,
"maxdurability": 121,
"enchantcategories": [
"armor_head",
"armor"
],
"repairwith": [
"spruce_planks"
],
"createddate": "2019-07-23",
"updateddate": null
},
{
"id": 2,
"displayname": "Twiist",
"name": "twiist",
"stacksize": 3,
"maxdurability": 50,
"enchantcategories": [],
"repairwith": [],
"createddate": "2019-02-07",
"updateddate": null
},
{
"id": 3,
"displayname": "Prosure",
"name": "prosure",
"stacksize": 18,
"maxdurability": 112,
"enchantcategories": [
"digger"
],
"repairwith": [
"crimson_planks",
"spruce_planks"
],
"createddate": "2015-10-18",
"updateddate": null
},
{
"id": 4,
"displayname": "Zizzle",
"name": "zizzle",
"stacksize": 16,
"maxdurability": 54,
"enchantcategories": [
"breakable"
],
"repairwith": [
"spruce_planks"
],
"createddate": "2017-06-28",
"updateddate": "2020-10-22"
},
{
"id": 5,
"displayname": "Lunchpad",
"name": "lunchpad",
"stacksize": 21,
"maxdurability": 37,
"enchantcategories": [
"weapon"
],
"repairwith": [
"warped_planks",
"warped_planks"
],
"createddate": "2022-05-23",
"updateddate": "2020-07-02"
},
{
"id": 6,
"displayname": "Zenco",
"name": "zenco",
"stacksize": 55,
"maxdurability": 101,
"enchantcategories": [
"armor",
"armor_head"
],
"repairwith": [],
"createddate": "2022-07-02",
"updateddate": "2018-03-17"
},
{
"id": 7,
"displayname": "Cubix",
"name": "cubix",
"stacksize": 63,
"maxdurability": 21,
"enchantcategories": [
"weapon",
"digger"
],
"repairwith": [],
"createddate": "2017-07-29",
"updateddate": "2018-01-26"
},
{
"id": 8,
"displayname": "Opticall",
"name": "opticall",
"stacksize": 36,
"maxdurability": 56,
"enchantcategories": [],
"repairwith": [
"jungle_planks",
"acacia_planks"
],
"createddate": "2020-11-25",
"updateddate": "2015-05-11"
},
{
"id": 9,
"displayname": "Gogol",
"name": "gogol",
"stacksize": 63,
"maxdurability": 57,
"enchantcategories": [
"digger"
],
"repairwith": [
"oak_planks"
],
"createddate": "2018-07-28",
"updateddate": null
},
{
"id": 10,
"displayname": "Trollery",
"name": "trollery",
"stacksize": 41,
"maxdurability": 51,
"enchantcategories": [],
"repairwith": [
"birch_planks"
],
"createddate": "2019-05-11",
"updateddate": null
},
{
"id": 11,
"displayname": "Limage",
"name": "limage",
"stacksize": 19,
"maxdurability": 104,
"enchantcategories": [
"weapon",
"digger",
"weapon"
],
"repairwith": [
"birch_planks",
"birch_planks"
],
"createddate": "2020-06-17",
"updateddate": "2014-08-13"
},
{
"id": 12,
"displayname": "Squish",
"name": "squish",
"stacksize": 35,
"maxdurability": 86,
"enchantcategories": [
"armor",
"digger",
"digger"
],
"repairwith": [],
"createddate": "2014-02-23",
"updateddate": null
},
{
"id": 13,
"displayname": "Viagreat",
"name": "viagreat",
"stacksize": 57,
"maxdurability": 115,
"enchantcategories": [
"weapon"
],
"repairwith": [
"dark_oak_planks",
"jungle_planks"
],
"createddate": "2018-07-07",
"updateddate": null
},
{
"id": 14,
"displayname": "Biflex",
"name": "biflex",
"stacksize": 47,
"maxdurability": 112,
"enchantcategories": [
"armor_head",
"weapon",
"armor_head"
],
"repairwith": [
"jungle_planks"
],
"createddate": "2019-12-19",
"updateddate": "2021-10-29"
},
{
"id": 15,
"displayname": "Geekular",
"name": "geekular",
"stacksize": 39,
"maxdurability": 94,
"enchantcategories": [
"armor_chest",
"breakable",
"armor"
],
"repairwith": [],
"createddate": "2020-01-31",
"updateddate": null
},
{
"id": 16,
"displayname": "Biotica",
"name": "biotica",
"stacksize": 44,
"maxdurability": 64,
"enchantcategories": [],
"repairwith": [
"acacia_planks"
],
"createddate": "2021-07-10",
"updateddate": null
},
{
"id": 17,
"displayname": "Olympix",
"name": "olympix",
"stacksize": 39,
"maxdurability": 69,
"enchantcategories": [
"armor_head",
"armor"
],
"repairwith": [
"crimson_planks",
"dark_oak_planks"
],
"createddate": "2019-12-12",
"updateddate": null
},
{
"id": 18,
"displayname": "Plutorque",
"name": "plutorque",
"stacksize": 64,
"maxdurability": 72,
"enchantcategories": [],
"repairwith": [
"oak_planks",
"birch_planks"
],
"createddate": "2022-01-29",
"updateddate": null
}
]
Loading…
Cancel
Save