Create templated generic component for Fields for EditServer page.
This commit is contained in:
parent
9396e98eea
commit
6b3b08b07a
@ -0,0 +1,24 @@
|
||||
@namespace ServerManagement.Components.Controls.Generic
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-2">
|
||||
<label class="col-form-label">@Label</label>
|
||||
</div>
|
||||
<div class="col-6 input-width">
|
||||
@Control
|
||||
</div>
|
||||
<div class="col">
|
||||
@ValidationControl
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string? Label { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment? Control { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment? ValidationControl { get; set; }
|
||||
}
|
||||
@ -15,37 +15,30 @@
|
||||
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||
<ValidationSummary></ValidationSummary>
|
||||
<InputNumber @bind-Value="server.Id" hidden></InputNumber>
|
||||
<div class="row mb-3">
|
||||
<div class="col-2">
|
||||
<label class="col-form-label">Name</label>
|
||||
</div>
|
||||
<div class="col-6 input-width">
|
||||
<InputText @bind-Value="server.Name" class="form-control"></InputText>
|
||||
</div>
|
||||
<div class="col">
|
||||
<ValidationMessage For="() => server.Name"></ValidationMessage>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-2">
|
||||
<label class="col-form-label">City</label>
|
||||
</div>
|
||||
<div class="col-6 input-width">
|
||||
<FieldComponent Label="Name">
|
||||
<Control>
|
||||
<InputText @bind-Value="server.Name" class="form-control"></InputText>
|
||||
</Control>
|
||||
<ValidationControl>
|
||||
<ValidationMessage For="() => server.Name"></ValidationMessage>
|
||||
</ValidationControl>
|
||||
</FieldComponent>
|
||||
|
||||
<FieldComponent Label="City">
|
||||
<Control>
|
||||
<InputText @bind-Value="server.City" class="form-control"></InputText>
|
||||
</div>
|
||||
<div class="col">
|
||||
</Control>
|
||||
<ValidationControl>
|
||||
<ValidationMessage For="() => server.City"></ValidationMessage>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-2">
|
||||
<label class="col-form-label">Online</label>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
</ValidationControl>
|
||||
</FieldComponent>
|
||||
|
||||
<FieldComponent Label="Online">
|
||||
<Control>
|
||||
<InputCheckbox @bind-Value="server.IsOnline" class="form-check-input"></InputCheckbox>
|
||||
</div>
|
||||
</div>
|
||||
</Control>
|
||||
</FieldComponent>
|
||||
<br/>
|
||||
<button class="btn btn-primary" type="submit">Update</button>
|
||||
|
||||
|
||||
@ -9,4 +9,5 @@
|
||||
@using ServerManagement
|
||||
@using ServerManagement.Components
|
||||
@using ServerManagement.Components.Controls
|
||||
@using ServerManagement.Components.Controls.Generic
|
||||
@using ServerManagement.Models
|
||||
Loading…
x
Reference in New Issue
Block a user