57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
@using MoonCore.Blazor.Tailwind.Modals.Components
|
|
@using MoonCore.Blazor.Tailwind.Components
|
|
@using MoonlightServers.Shared.Http.Requests.Admin.NodeAllocations
|
|
|
|
@inherits BaseModal
|
|
|
|
<h1 class="mb-5 font-semibold text-xl">Add a range of new allocations</h1>
|
|
|
|
<HandleForm @ref="HandleForm" Model="Form" OnValidSubmit="OnValidSubmit">
|
|
<div class="grid grid-cols-1 gap-2">
|
|
<div class="col-span-1">
|
|
<label class="block text-sm font-medium leading-6 text-white">IP Address</label>
|
|
<input @bind="Form.IpAddress" type="text" class="form-input w-full"/>
|
|
</div>
|
|
|
|
<div class="col-span-1">
|
|
<label class="block text-sm font-medium leading-6 text-white">Start Port</label>
|
|
<input @bind="Form.Start" type="text" class="form-input w-full"/>
|
|
</div>
|
|
|
|
<div class="col-span-1">
|
|
<label class="block text-sm font-medium leading-6 text-white">End Port</label>
|
|
<input @bind="Form.End" type="text" class="form-input w-full"/>
|
|
</div>
|
|
</div>
|
|
</HandleForm>
|
|
|
|
<div class="mt-5 flex space-x-2">
|
|
<WButton OnClick="_ => Hide()" CssClasses="btn btn-secondary grow">Cancel</WButton>
|
|
<WButton OnClick="_ => Submit()" CssClasses="btn btn-primary grow">Create</WButton>
|
|
</div>
|
|
|
|
@code
|
|
{
|
|
[Parameter] public Func<CreateNodeAllocationRangeRequest, Task> OnSubmit { get; set; }
|
|
|
|
private CreateNodeAllocationRangeRequest Form;
|
|
private HandleForm HandleForm;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
Form = new()
|
|
{
|
|
IpAddress = "0.0.0.0",
|
|
Start = 2000,
|
|
End = 3000
|
|
};
|
|
}
|
|
|
|
private async Task OnValidSubmit()
|
|
{
|
|
await OnSubmit.Invoke(Form);
|
|
await Hide();
|
|
}
|
|
|
|
private Task Submit() => HandleForm.Submit();
|
|
} |