Compare commits
No commits in common. 'f8f3f94869c5026d696d471a8accee7d6ba32c97' and '49fef89a7415cf262e37d7fc9948300dd5d166a0' have entirely different histories.
f8f3f94869
...
49fef89a74
@ -1,10 +1,12 @@
|
|||||||
<CascadingBlazoredModal>
|
<Router AppAssembly="@typeof(App).Assembly">
|
||||||
<Router AppAssembly="@typeof(Program).Assembly">
|
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||||
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||||
</Found>
|
</Found>
|
||||||
<NotFound>
|
<NotFound>
|
||||||
<p>Sorry, there's nothing at this address.</p>
|
<PageTitle>Not found</PageTitle>
|
||||||
|
<LayoutView Layout="@typeof(MainLayout)">
|
||||||
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||||
|
</LayoutView>
|
||||||
</NotFound>
|
</NotFound>
|
||||||
</Router>
|
</Router>
|
||||||
</CascadingBlazoredModal>
|
|
@ -1,69 +0,0 @@
|
|||||||
@page "/add"
|
|
||||||
|
|
||||||
<h3>Add</h3>
|
|
||||||
|
|
||||||
<EditForm Model="@itemModel" OnValidSubmit="@HandleValidSubmit">
|
|
||||||
<DataAnnotationsValidator />
|
|
||||||
<ValidationSummary />
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<label for="display-name">
|
|
||||||
Display name:
|
|
||||||
<InputText id="display-name" @bind-Value="itemModel.DisplayName" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="name">
|
|
||||||
Name:
|
|
||||||
<InputText id="name" @bind-Value="itemModel.Name" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="stack-size">
|
|
||||||
Stack size:
|
|
||||||
<InputNumber id="stack-size" @bind-Value="itemModel.StackSize" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="max-durability">
|
|
||||||
Max durability:
|
|
||||||
<InputNumber id="max-durability" @bind-Value="itemModel.MaxDurability" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Enchant categories:
|
|
||||||
<div>
|
|
||||||
@foreach (var item in enchantCategories)
|
|
||||||
{
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" @onchange="@(e => OnEnchantCategoriesChange(item, e.Value))" />@item
|
|
||||||
</label>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Repair with:
|
|
||||||
<div>
|
|
||||||
@foreach (var item in repairWith)
|
|
||||||
{
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" @onchange="@(e => OnRepairWithChange(item, e.Value))" />@item
|
|
||||||
</label>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
Item image:
|
|
||||||
<InputFile OnChange="@LoadImage" accept=".png" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
Accept Condition:
|
|
||||||
<InputCheckbox @bind-Value="itemModel.AcceptCondition" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<button type="submit">Submit</button>
|
|
||||||
</EditForm>
|
|
@ -1,3 +0,0 @@
|
|||||||
@page "/BlazorRoute"
|
|
||||||
@page "/DifferentBlazorRoute"
|
|
||||||
<h3>BlazorRoute</h3>
|
|
@ -1,82 +0,0 @@
|
|||||||
@page "/edit/{Id:int}"
|
|
||||||
|
|
||||||
<h3>Edit</h3>
|
|
||||||
|
|
||||||
<EditForm Model="@itemModel" OnValidSubmit="@HandleValidSubmit">
|
|
||||||
<DataAnnotationsValidator />
|
|
||||||
<ValidationSummary />
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<label for="display-name">
|
|
||||||
Display name:
|
|
||||||
<InputText id="display-name" @bind-Value="itemModel.DisplayName" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="name">
|
|
||||||
Name:
|
|
||||||
<InputText id="name" @bind-Value="itemModel.Name" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="stack-size">
|
|
||||||
Stack size:
|
|
||||||
<InputNumber id="stack-size" @bind-Value="itemModel.StackSize" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="max-durability">
|
|
||||||
Max durability:
|
|
||||||
<InputNumber id="max-durability" @bind-Value="itemModel.MaxDurability" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Enchant categories:
|
|
||||||
<div>
|
|
||||||
@foreach (var item in enchantCategories)
|
|
||||||
{
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" @onchange="@(e => OnEnchantCategoriesChange(item, e.Value))" checked="@(itemModel.EnchantCategories.Contains(item) ? "checked" : null)" />@item
|
|
||||||
</label>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Repair with:
|
|
||||||
<div>
|
|
||||||
@foreach (var item in repairWith)
|
|
||||||
{
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" @onchange="@(e => OnRepairWithChange(item, e.Value))" checked="@(itemModel.RepairWith.Contains(item) ? "checked" : null)" />@item
|
|
||||||
</label>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
Current Item image:
|
|
||||||
@if (File.Exists($"{WebHostEnvironment.WebRootPath}/images/{itemModel.Name}.png"))
|
|
||||||
{
|
|
||||||
<img src="images/@(itemModel.Name).png" class="img-thumbnail" title="@itemModel.DisplayName" alt="@itemModel.DisplayName" style="max-width: 150px"/>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<img src="images/default.png" class="img-thumbnail" title="@itemModel.DisplayName" alt="@itemModel.DisplayName" style="max-width: 150px"/>
|
|
||||||
}
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
Item image:
|
|
||||||
<InputFile OnChange="@LoadImage" accept=".png" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
Accept Condition:
|
|
||||||
<InputCheckbox @bind-Value="itemModel.AcceptCondition" />
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<button type="submit">Submit</button>
|
|
||||||
</EditForm>
|
|
@ -1,10 +0,0 @@
|
|||||||
@page "/parameter-parent"
|
|
||||||
@using ProjetBlaser.Models
|
|
||||||
|
|
||||||
<h1>Child component (without attribute values)</h1>
|
|
||||||
|
|
||||||
<ParameterChild />
|
|
||||||
|
|
||||||
<h1>Child component (with attribute values)</h1>
|
|
||||||
|
|
||||||
<ParameterChild Title="Set by Parent" Body="@(new PanelBody() { Text = "Set by parent.", Style = "italic" })" />
|
|
@ -1,13 +0,0 @@
|
|||||||
@page "/RouteParameter/{text?}"
|
|
||||||
|
|
||||||
<h1>Blazor is @Text!</h1>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter]
|
|
||||||
public string? Text { get; set; }
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
Text = Text ?? "fantastic";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
@page "/user/{Id:int}"
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Id: @Id
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Option: @Option
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter]
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public bool Option { get; set; }
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
@using ProjetBlaser.Models
|
|
||||||
<div class="card w-25" style="margin-bottom:15px">
|
|
||||||
<div class="card-header font-weight-bold">@Title</div>
|
|
||||||
<div class="card-body" style="font-style:@Body.Style">
|
|
||||||
@Body.Text
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter]
|
|
||||||
public string Title { get; set; } = "Set By Child";
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public PanelBody Body { get; set; } =
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Text = "Set by child.",
|
|
||||||
Style = "normal"
|
|
||||||
};
|
|
||||||
}
|
|
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 117 KiB |
Loading…
Reference in new issue