[성현모] CPMeta 최근데이터 조회 기능 추가

This commit is contained in:
SHM
2026-02-13 08:50:33 +09:00
parent 3626030124
commit 3f94a7b2b2
10 changed files with 107 additions and 3 deletions

View File

@ -18,7 +18,7 @@
@* <RadzenPanelMenuItem Text="ProxyKms" Icon="assignment" Path="/ProxyKms"/> *@
</RadzenPanelMenu>
</RadzenSidebar>
<RadzenBody Style="margin:0; padding:1rem; overflow:hidden; font-size: 2rem;">
<RadzenBody Style="margin:0; padding:1rem; overflow:auto; font-size: 2rem;">
@Body
</RadzenBody>
</RadzenLayout>

View File

@ -46,7 +46,11 @@
</div> *@
<OperationGrid TDataModel="tWbms" DataList="@response.Wbms">
</OperationGrid>
<br />
<RadzenLabel Style="width: 200px; color:darkorange" Text="Latest Data"></RadzenLabel>
<OperationGrid TDataModel="tWbms" DataList="@latest.Wbms">
</OperationGrid>
@code {
@ -56,10 +60,18 @@
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()

View File

@ -4,7 +4,7 @@
@typeparam TDataModel
<RadzenDataGrid class="rz-shadow-1" TItem="TDataModel" Data="@DataList" GridLines="DataGridGridLines.Both"
AllowFiltering FilterMode="FilterMode.Simple" AllowColumnResize
AllowFiltering FilterMode="FilterMode.Simple" AllowPaging Count=10 PageNumbersCount="10" PagerHorizontalAlign="HorizontalAlign.Center"
SelectionMode="DataGridSelectionMode.Single" Density="@Density.Default">
<Columns>
@foreach (var col in typeof(TDataModel).GetProperties())

View File

@ -34,6 +34,12 @@
public int ShardID { get; set; } = 1;
}
public class Request_GetWbmsLatest
{
public int Count { get; set; } = 20;
public int ShardID { get; set; } = 1;
}
public class Response_GetWbmsMeta
{
public List<tWbms> Wbms { get; set; } = new List<tWbms>();

View File

@ -64,5 +64,19 @@ namespace Web.Operation.Services
return res;
}
public async Task<Response_GetWbmsMeta> GetWbmsLatest(string host, int count = 20, int shardID = 1)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsLatest?";
requestUrl += $"Count={count}&";
requestUrl += $"ShardID={shardID}";
Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
LogXnet.WriteLine($"{res.ToJson()}", LogXLabel.HTTP);
return res;
}
}
}