Edits Global/GlobalEntity.cs and adds a test Create

This commit is contained in:
Henry Trumme
2025-04-25 22:33:35 +02:00
parent 1b40ea2cea
commit cca0f6c6a4
4 changed files with 85 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
@rendermode InteractiveServer
@page "/"
@using Microsoft.EntityFrameworkCore
@using WatchLog.Data
@inject IDbContextFactory<WatchLogDataContext> WatchLogDataContextFactory;
<PageTitle>GlobalEntities</PageTitle>
@if (ShowCreate)
{
<h3>Add a New GlobalEntity</h3>
<div class="row">
<label for="Title" class="col-4 col-form-label">Name</label>
<div class="col-8">
<input id="Title" name="Title" type="text" class="form-control" @bind="@NewGlobalEntity.Title" />
</div>
</div>
<div class="row">
<label for="Password" class="col-4 col-form-label">Password</label>
<div class="col-8">
<input id="Password" name="Password" type="text" class="form-control"/>
</div>
</div>
<div class="form-group row">
<div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary" @onclick="CreateNewGlobalEntity">Submit</button>
</div>
</div>
}
else
{
<div class="form-group row">
<div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary" @onclick="ShowCreateForm">Add a new Global Entity</button>
</div>
</div>
<p>SHOW THE LIST</p>
}