[성현모] CPMeta 최근데이터 조회 기능 추가
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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>();
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,5 +11,6 @@ namespace WebClient.Library.Model
|
||||
public int Id { get; set; }
|
||||
public string ApiName { get; set; }
|
||||
public string Host { get; set; }
|
||||
public int LastCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user