@using MoonCore.Blazor.FlyonUi.Components
@using MoonlightServers.Shared.Http.Requests.Admin.NodeAllocations
@using MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations
@inherits MoonCore.Blazor.FlyonUi.Modals.BaseModal
Update allocation
Update an existing allocation
Update
@code
{
[Parameter] public Func OnSubmit { get; set; }
[Parameter] public NodeAllocationResponse Allocation { get; set; }
private UpdateNodeAllocationRequest Form;
private HandleForm HandleForm;
protected override void OnInitialized()
{
Form = new UpdateNodeAllocationRequest()
{
IpAddress = Allocation.IpAddress,
Port = Allocation.Port
};
}
private async Task OnValidSubmit()
{
await OnSubmit.Invoke(Form);
await HideAsync();
}
private Task SubmitAsync() => HandleForm.SubmitAsync();
}