@page "/CpMeta" @rendermode InteractiveServer @using Web.Operation.Module; @using Web.Operation.Services @using Packet @inject ConfigService _configService @inject CPMetaService _cpMetaService @inject PopupService PopupService

CPMeta

Search Search

@*
*@
@code { private string ServerAddress = "192.168.0.126:9000"; private string ShardID = "1"; private string SearchProductID = string.Empty; private string SearchProductMacAddress = string.Empty; Response_GetWbmsMeta response = new Response_GetWbmsMeta(); Response_GetWbmsMeta latest = new Response_GetWbmsMeta(); protected override async Task OnInitializedAsync() { ServerAddress = _cpMetaService.ApiHost; var apiConfig = _configService.GetConfig().Api.Find(x => x.Id == 1); if (apiConfig is not null) { latest = await _cpMetaService.GetWbmsLatest(ServerAddress, apiConfig.LastCount); } } private async Task SearchByProductID() { PopupService.OpenIndicator(""); if(Int32.TryParse(ShardID, out var outValue)) { if (string.IsNullOrEmpty(SearchProductID) == false) response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress, outValue); } if(response == null) { response = new Response_GetWbmsMeta(); } await Task.Delay(300); PopupService.CloseIndicator(); } private async Task SearchByMacAddress() { PopupService.OpenIndicator(""); if (Int32.TryParse(ShardID, out var outValue)) { if (string.IsNullOrEmpty(SearchProductMacAddress) == false) response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress, outValue); } if (response == null) { response = new Response_GetWbmsMeta(); } await Task.Delay(300); PopupService.CloseIndicator(); } }