68 lines
2.2 KiB
Plaintext
68 lines
2.2 KiB
Plaintext
@using MoonCore.Blazor.FlyonUi.Components
|
|
@using MoonlightServers.Shared.Http.Requests.Admin.NodeAllocations
|
|
|
|
@inherits MoonCore.Blazor.FlyonUi.Modals.Components.BaseModal
|
|
|
|
<div class="p-5">
|
|
<div class="flex items-center gap-4">
|
|
<div class="avatar avatar-placeholder max-sm:hidden">
|
|
<div class="border-base-content/20 rounded-box w-13 border-1">
|
|
<span class="icon-ethernet-port text-xl"></span>
|
|
</div>
|
|
</div>
|
|
<div class="space-y-1">
|
|
<h3 class="text-base-content text-2xl font-semibold">Add multiple allocations</h3>
|
|
<p class="text-base-content/80">Add a range of new allocations to the selected node</p>
|
|
</div>
|
|
</div>
|
|
<div class="mt-5">
|
|
<HandleForm @ref="HandleForm" Model="Form" OnValidSubmit="OnValidSubmit">
|
|
<div class="mt-2">
|
|
<label class="label-text">IP Address</label>
|
|
<input class="input" @bind="Form.IpAddress" type="text"/>
|
|
</div>
|
|
<div class="mt-2">
|
|
<label class="label-text">Start Port</label>
|
|
<input class="input" @bind="Form.Start" type="number"/>
|
|
</div>
|
|
<div class="mt-2">
|
|
<label class="label-text">End Port</label>
|
|
<input class="input" @bind="Form.End" type="number"/>
|
|
</div>
|
|
</HandleForm>
|
|
</div>
|
|
<div class="mt-5 flex justify-end">
|
|
<button @onclick="HideAsync" type="button" class="btn btn-secondary me-2">
|
|
Cancel
|
|
</button>
|
|
<WButton OnClick="SubmitAsync">
|
|
Create
|
|
</WButton>
|
|
</div>
|
|
</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 HideAsync();
|
|
}
|
|
|
|
private Task SubmitAsync() => HandleForm.SubmitAsync();
|
|
} |