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>
|
<DataAnnotationsValidator></DataAnnotationsValidator>
|
||||||
<ValidationSummary></ValidationSummary>
|
<ValidationSummary></ValidationSummary>
|
||||||
<InputNumber @bind-Value="server.Id" hidden></InputNumber>
|
<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">
|
<FieldComponent Label="Name">
|
||||||
<div class="col-2">
|
<Control>
|
||||||
<label class="col-form-label">City</label>
|
<InputText @bind-Value="server.Name" class="form-control"></InputText>
|
||||||
</div>
|
</Control>
|
||||||
<div class="col-6 input-width">
|
<ValidationControl>
|
||||||
|
<ValidationMessage For="() => server.Name"></ValidationMessage>
|
||||||
|
</ValidationControl>
|
||||||
|
</FieldComponent>
|
||||||
|
|
||||||
|
<FieldComponent Label="City">
|
||||||
|
<Control>
|
||||||
<InputText @bind-Value="server.City" class="form-control"></InputText>
|
<InputText @bind-Value="server.City" class="form-control"></InputText>
|
||||||
</div>
|
</Control>
|
||||||
<div class="col">
|
<ValidationControl>
|
||||||
<ValidationMessage For="() => server.City"></ValidationMessage>
|
<ValidationMessage For="() => server.City"></ValidationMessage>
|
||||||
</div>
|
</ValidationControl>
|
||||||
</div>
|
</FieldComponent>
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-2">
|
<FieldComponent Label="Online">
|
||||||
<label class="col-form-label">Online</label>
|
<Control>
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<InputCheckbox @bind-Value="server.IsOnline" class="form-check-input"></InputCheckbox>
|
<InputCheckbox @bind-Value="server.IsOnline" class="form-check-input"></InputCheckbox>
|
||||||
</div>
|
</Control>
|
||||||
</div>
|
</FieldComponent>
|
||||||
<br/>
|
<br/>
|
||||||
<button class="btn btn-primary" type="submit">Update</button>
|
<button class="btn btn-primary" type="submit">Update</button>
|
||||||
|
|
||||||
|
|||||||
@ -9,4 +9,5 @@
|
|||||||
@using ServerManagement
|
@using ServerManagement
|
||||||
@using ServerManagement.Components
|
@using ServerManagement.Components
|
||||||
@using ServerManagement.Components.Controls
|
@using ServerManagement.Components.Controls
|
||||||
|
@using ServerManagement.Components.Controls.Generic
|
||||||
@using ServerManagement.Models
|
@using ServerManagement.Models
|
||||||
Loading…
x
Reference in New Issue
Block a user