[성현모] Web.Operation CPMeta 기능 추가

This commit is contained in:
SHM
2025-11-03 14:27:54 +09:00
parent d6c033f149
commit 8198f0b7bb
14 changed files with 384 additions and 5 deletions

View File

@ -16,7 +16,7 @@
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
<script src="js/script.js"></script>
<script src="_framework/blazor.web.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
</body>

View File

@ -1,7 +1,79 @@
@page "/CpMeta"
@rendermode InteractiveServer
@using Web.Operation.Module;
@using Web.Operation.Services
@using Packet
@inject CPMetaService _cpMetaService
@inject PopupService PopupService
<h3>CPMeta</h3>
@code {
<RadzenFieldset Style="margin-bottom: 10px;" Text="Server Info">
<div style="margin-bottom: 10px;">
<RadzenLabel Style="width: 130px;" Text="Server Address"></RadzenLabel>
<RadzenTextBox Style="margin-right: 10px;" @bind-Value="@ServerAddress"></RadzenTextBox>
</div>
</RadzenFieldset>
}
<RadzenFieldset Style="margin-bottom: 10px;" Text="View Options">
<div style="margin-bottom: 10px;">
<RadzenLabel Style="margin-right: 5px;" Text="ProductID"></RadzenLabel>
<RadzenTextBox Style="margin-right: 10px;width: 30rem;" @bind-Value="@SearchProductID"></RadzenTextBox>
<RadzenButton Style="margin-right: 30px;" Click="@(() => SearchByProductID())">Search</RadzenButton>
<RadzenLabel Style="margin-right: 5px;" Text="MacAddress"></RadzenLabel>
<RadzenTextBox Style="margin-right: 10px; width: 30rem;" @bind-Value="@SearchProductMacAddress"></RadzenTextBox>
<RadzenButton Style="margin-right: 30px;" Click="@(() => SearchByMacAddress())">Search</RadzenButton>
</div>
</RadzenFieldset>
<br />
<!--count-->
@* <div style="display: flex; justify-content: space-between; margin-bottom: 0.7rem;">
<div style="display: flex; align-items:center;">
<RadzenLabel Style="color:#BA68C8; font-weight: 600; font-size: 1.1rem; margin-right: 1.2rem;" Text=@($"Total Count: {history.Count}")></RadzenLabel>
<RadzenLabel Style="color:#64B5F6; font-weight: 600; font-size: 1.1rem;" Text=@($"Filter Count: {grid.View.Count()}")></RadzenLabel>
</div>
<div>
<RadzenButton Style="background: #7E57C2; margin-right: 0.5rem;" Text="Export CSV(Full Data)" Click="@(() => OnClickExportCSV(false))"></RadzenButton>
<RadzenButton Style="background: #1976D2;" Text="Export CSV(Filter Data)" Click="@(() => OnClickExportCSV(true))"></RadzenButton>
</div>
</div> *@
<OperationGrid TDataModel="tWbms" DataList="@response.Wbms">
</OperationGrid>
@code {
private string ServerAddress = "192.168.0.126:9000";
private string SearchProductID = string.Empty;
private string SearchProductMacAddress = string.Empty;
Response_GetWbmsMeta response = new Response_GetWbmsMeta();
protected override async Task OnInitializedAsync()
{
}
private async Task SearchByProductID()
{
PopupService.OpenIndicator("");
if (string.IsNullOrEmpty(SearchProductID) == false)
response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress);
await Task.Delay(300);
PopupService.CloseIndicator();
}
private async Task SearchByMacAddress()
{
PopupService.OpenIndicator("");
if (string.IsNullOrEmpty(SearchProductMacAddress) == false)
response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress);
await Task.Delay(300);
PopupService.CloseIndicator();
}
}

View File

@ -1,4 +1,6 @@
<Router AppAssembly="typeof(Program).Assembly">
@rendermode InteractiveServer
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />