private Task EndpointEvent(EndpointEventApiModel ev) { EndpointList.Results.Update(ev); PagedendpointList = EndpointList.GetPaged(int.Parse(Page), CommonHelper.PageLength, EndpointList.Error); StateHasChanged(); return(Task.CompletedTask); }
/// <summary> /// Notify page change /// </summary> /// <param name="page"></param> public async Task PagerPageChangedAsync(int page) { CommonHelper.Spinner = "loader-big"; StateHasChanged(); if (!string.IsNullOrEmpty(EndpointList.ContinuationToken) && page > PagedendpointList.PageCount) { EndpointList = await RegistryHelper.GetEndpointListAsync(DiscovererId, ApplicationId, SupervisorId, EndpointList); } PagedendpointList = EndpointList.GetPaged(page, CommonHelper.PageLength, null); NavigationManager.NavigateTo(NavigationManager.BaseUri + "endpoints/" + page + "/" + DiscovererId + "/" + ApplicationId + "/" + SupervisorId); CommonHelper.Spinner = string.Empty; StateHasChanged(); }
/// <summary> /// OnAfterRenderAsync /// </summary> /// <param name="firstRender"></param> protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { EndpointList = await RegistryHelper.GetEndpointListAsync(DiscovererId, ApplicationId, SupervisorId); Page = "1"; PagedendpointList = EndpointList.GetPaged(int.Parse(Page), CommonHelper.PageLength, EndpointList.Error); CommonHelper.Spinner = string.Empty; CommonHelper.CheckErrorOrEmpty(PagedendpointList, ref _tableView, ref _tableEmpty); StateHasChanged(); _endpointEvents = await RegistryServiceEvents.SubscribeEndpointEventsAsync( ev => InvokeAsync(() => EndpointEvent(ev))); } }