[성현모] DB 예외처리 추가, UI 사이즈 조정

This commit is contained in:
SHM
2025-09-02 11:50:01 +09:00
parent 2cb56154e5
commit 978e4faadc
13 changed files with 235 additions and 45 deletions

View File

@ -0,0 +1,22 @@
@page "/loading/{Message?}"
<div style="text-align: center;">
<div class="lds-ring">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="message">
@Message
</div>
</div>
@code {
[Parameter]
public string? Message { get; set; }
protected override void OnParametersSet()
{
}
}

View File

@ -0,0 +1,58 @@
.message {
/* change color here */
color: #f8b26a;
text-align: center;
font-size: 1.5rem;
}
.lds-ring {
/* change color here */
color: #f8b26a;
}
.lds-ring,
.lds-ring div {
box-sizing: border-box;
}
.lds-ring {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ring div {
box-sizing: border-box;
display: block;
position: absolute;
width: 64px;
height: 64px;
margin: 8px;
border: 8px solid currentColor;
border-radius: 50%;
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
border-color: currentColor transparent transparent transparent;
}
.lds-ring div:nth-child(1) {
animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
animation-delay: -0.15s;
}
@keyframes lds-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -5,7 +5,6 @@
@inject ConfigService<WebClientConfig> configService
@inject NavigationManager NavigationManager
<RadzenComponents @rendermode="InteractiveServer" />
<RadzenLayout>
<RadzenHeader Style="height: 5rem; font-size: 2rem;" class="rz-px-5">
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween" Gap="0">
@ -17,10 +16,11 @@
</div>
</RadzenStack>
</RadzenHeader>
<RadzenBody Style="margin:0; padding:0;">
<RadzenBody Style="margin:0; padding:0; overflow:hidden; font-size: 2rem;">
@Body
</RadzenBody>
</RadzenLayout>
<RadzenComponents @rendermode="InteractiveServer" />
@code {
bool sidebarExpanded = true;

View File

@ -2,7 +2,7 @@
@inject ContextMenuService ContextMenuService
<RadzenDataGrid TItem="TDataModel" Data="@DataList" AllowPaging PageSize="100"
<RadzenDataGrid Style="height:calc(100vh - 23rem); font-size: 20px;" TItem="TDataModel" Data="@DataList" AllowPaging PageSize="100"
AllowFiltering FilterMode="FilterMode.Advanced" CellRender="@CellRender"
SelectionMode="DataGridSelectionMode.Single" @bind-Value="@SelectedRow"
CellContextMenu="@OnCellContextMenu" RowSelect="@SelectRow">
@ -25,8 +25,10 @@
if (col.Name.ToLower().Equals("testdate"))
{
<RadzenDataGridColumn Property="@col.Name" Title="@col.Name">
<Template>
@Convert.ToDateTime(col.GetValue(context)).ToString("yyyy-MM-dd")
<Template>
<span class="custom-rz-value rz-color-secondary">
@Convert.ToDateTime(col.GetValue(context)).ToString("yyyy-MM-dd")
</span>
</Template>
</RadzenDataGridColumn>
}
@ -34,9 +36,9 @@
{
<RadzenDataGridColumn Property="@col.Name" Title="@col.Name">
<Template>
<RadzenText Style="color: lime;">
<span class="custom-rz-value" style="color: lime;">
@col.GetValue(context)
</RadzenText>
</span>
</Template>
</RadzenDataGridColumn>
}
@ -44,15 +46,20 @@
{
<RadzenDataGridColumn Property="@col.Name" Title="@col.Name">
<Template>
<RadzenText Style="color:red;">
<span class="custom-rz-value" style="color:red;">
@col.GetValue(context)
</RadzenText>
</span>
</Template>
</RadzenDataGridColumn>
}
else
{
<RadzenDataGridColumn Property="@col.Name" Title="@col.Name">
<Template>
<span class="custom-rz-value">
@col.GetValue(context)
</span>
</Template>
</RadzenDataGridColumn>
}
}

View File

@ -0,0 +1,3 @@
.custom-rz-value {
font-size: 1.5rem !important;
}

View File

@ -1,41 +1,38 @@
@page "/tra"
@using Web.Tra.Services
@inject CPXV2LogService CPXV2LogService
@inject PopupService PopupService
<RadzenStack Style="width:100%; background-color:var(--rz-primary-lighter);" class="rz-border-bottom rz-p-3" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
<!--Search Block-->
<RadzenStack Style="height:12rem; width:fit-content;" class="rz-border-right rz-pr-5" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
<RadzenStack Style="height:10rem; width:fit-content;" class="rz-border-right rz-pr-5" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
<!--Date Picker Block-->
<RadzenStack Style="font-size:1.3rem;" Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Center">
<RadzenStack Style="width: 20rem;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
<RadzenStack Style="font-size:1.5rem;" Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Center">
<RadzenStack Style="width: 25rem; margin-bottom:0.5rem;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
<RadzenLabel Text="Begin"></RadzenLabel>
<RadzenDatePicker @bind-Value=@RequestSearch.SearchStart TValue="DateOnly"></RadzenDatePicker>
</RadzenStack>
<RadzenStack Style="width:20rem;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
<RadzenStack Style="width:25rem; margin-bottom: 0.5rem;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.SpaceBetween">
<RadzenLabel Text="End"></RadzenLabel>
<RadzenDatePicker @bind-Value=@RequestSearch.SearchEnd TValue="DateOnly"></RadzenDatePicker>
<RadzenDatePicker Style="font-size: 1.5rem !important; color:red;" @bind-Value=@RequestSearch.SearchEnd TValue="DateOnly"></RadzenDatePicker>
</RadzenStack>
</RadzenStack>
<RadzenStack Style="cursor: pointer;" class="" Orientation="Orientation.Vertical" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start" @onclick="@OnSearch">
<RadzenIcon IconStyle="IconStyle.Warning" Style="font-size: 3.5rem; font-weight:400;" Icon="search"></RadzenIcon>
<RadzenLabel Style="font-size: 1.2rem; cursor:pointer;" Text="Search"></RadzenLabel>
<RadzenIcon Style="font-size: 3.5rem; font-weight:400; color:var(--rz-warning)" Icon="search"></RadzenIcon>
<RadzenLabel Style="font-size: 1.5rem; cursor:pointer; color:var(--rz-warning)" Text="Search"></RadzenLabel>
</RadzenStack>
</RadzenStack>
</RadzenStack>
<TraGrid TDataModel="Overview" DataList="@Overviews" OnClickContextMenu="@OnClickDetailOverviewContextMenu"
OnSelectRow="@OnSelectRowOverview">
</TraGrid>
@* <RadzenTabs @ref="@tabs" Style="width:100%; height: 100%;" RenderMode="TabRenderMode.Client" @bind-SelectedIndex=@SelectedTabIndex>
<RadzenTabs @ref="@tabs" Style="width:100%; height:100%;" RenderMode="TabRenderMode.Client" @bind-SelectedIndex=@SelectedTabIndex>
<Tabs>
@foreach (var tab in ListTabs)
{
<RadzenTabsItem Text="@tab.Key.ToString()">
<Template>
<span style="margin-right: 1rem;">@context.Text</span>
<span style="margin-right: 1rem; font-size: 1.5rem;">@context.Text</span>
<RadzenButton Size="ButtonSize.Small" Icon="close" Click="@(()=>OnClickClose(tab.Key))"></RadzenButton>
</Template>
<ChildContent>
@ -52,22 +49,27 @@
OnSelectRow="@OnSelectRowOverview" HostColumnMerge="true">
</TraGrid>
}
@*
@if (tab.Key.Contains(EnumTabs.TestHistoryC1.ToString()))
{
<TRAGrid TDataModel="TestHistory" DataList="@TestHistories" HostColumnMerge="true" VisibleRowNo="true">
</TRAGrid>
}
} *@
</ChildContent>
</RadzenTabsItem>
}
</Tabs>
</RadzenTabs>
*@
@code {
private RequestSearch RequestSearch = new RequestSearch();
RadzenTabs tabs;
int SelectedTabIndex = 0;
Dictionary<string, EnumTabs> ListTabs = new Dictionary<string, EnumTabs>();
List<Overview> Overviews = new List<Overview>();
List<Overview> DetailOverviews = new List<Overview>();
// List<TestHistory> TestHistories = new List<TestHistory>();
protected override async Task OnInitializedAsync()
{
@ -82,14 +84,14 @@
return;
}
Overviews = await CPXV2LogService.GetOverview(RequestSearch);
}
PopupService.OpenIndicator("Search Data");
int SelectedTabIndex = 0;
Dictionary<string, EnumTabs> ListTabs = new Dictionary<string, EnumTabs>();
List<Overview> Overviews = new List<Overview>();
List<Overview> DetailOverviews = new List<Overview>();
// List<TestHistory> TestHistories = new List<TestHistory>();
Overviews = await CPXV2LogService.GetOverview(RequestSearch);
if (ListTabs.ContainsKey(EnumTabs.OverviewC1.ToString()) == false)
ListTabs.Add($"{EnumTabs.OverviewC1}", EnumTabs.OverviewC1);
PopupService.CloseIndicator();
}
protected override void OnInitialized()
{

View File

@ -24,11 +24,14 @@ else
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRadzenComponents();
//singleton
builder.Services.AddSingleton<ConfigService<WebClientConfig>>();
//scoped
builder.Services.AddScoped<CPXV2LogService>();
builder.Services.AddScoped<PopupService>();
//db
builder.Services.AddSingleton<DbContextProvider>(); // Generic <20><><EFBFBD><EFBFBD>
@ -37,8 +40,6 @@ builder.Services.AddSingleton<DbContextProvider>(); // Generic
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddRadzenComponents();
//config preload, auth set
ConfigService<WebClientConfig> preloadConfig = new ConfigService<WebClientConfig>();
if (preloadConfig.OpenConfig($@"{configDir}/{configFileName}") == true)
@ -73,7 +74,7 @@ if (configService?.OpenConfig($@"{configDir}/{configFileName}") == true)
dbProvider?.SetDBList(apiConfig?.DataBase);
//log db list
var dbcontext = dbProvider.GetDBContext<CPXV2>("CPXV2");
var dbcontext = dbProvider.GetDBContext<CPXV2>(1);
var getDbList = await dbcontext.ExecuteStoredProcedureAsync<CPXV2, DBList>("spGetDBList");
var longTermDB = getDbList.Where(x => x.Name.ToLower().Contains("longterm")).ToList();

View File

@ -88,12 +88,12 @@ namespace Web.Tra.Services
{
var contextName = typeof(T).Name;
var findDB = provider.DBDictionary.Values.First(x => x.DBID == dbID);
if(findDB is not null)
if(provider.DBDictionary.TryGetValue(dbID, out var findDB) == true)
{
return provider?.GetDBContext<T>($"{findDB.DBName}");
}
return provider?.GetDBContext<T>(findDB.DBID);
}
LogXnet.WriteLine($"GetDBContext Error DBID:{dbID}", LogXLabel.Error);
return null;
}
}

View File

@ -0,0 +1,43 @@
using Radzen;
using Web.Tra.Components.Dialog;
namespace Web.Tra.Services
{
public class PopupService
{
public DialogService _dialogService;
public PopupService(DialogService dialogService)
{
_dialogService = dialogService;
}
public async Task<bool> Confirm(string title, string message)
{
bool result = false;
result = await _dialogService.Confirm(message, title, new ConfirmOptions
{
OkButtonText = "OK",
CancelButtonText = "Cancel",
}) ?? false;
return result;
}
public void OpenIndicator(string message = "")
{
_dialogService.Open<Loading>("",
new Dictionary<string, object>() { { "Message", message } },
new DialogOptions
{
ShowClose = false,
ShowTitle = false,
Style = "box-shadow: none; background: transparent; min-width:0; min-height:0; width:auto;"
});
}
public void CloseIndicator()
{
_dialogService.Close();
}
}
}

View File

@ -50,3 +50,57 @@ h1:focus {
.darker-border-checkbox.form-check-input {
border-color: #929292;
}
.rz-column-title {
font-size: 1.5rem !important;
color: var(--rz-secondary) !important;
}
/*calendar*/
.rz-datepicker-popup-container {
width: 30rem !important;
}
.rz-calendar-header{
height: 5rem;
}
.rz-calendar-view rz-calendar-month-view {
font-size: 1.5rem;
}
.rz-calendar-month-dropdown {
height: 3.0rem !important;
}
.rz-calendar-year-dropdown {
width: 9rem !important;
height: 3.0rem !important;
}
.rz-calendar-view-container {
font-size: 2.0rem;
}
.rz-inputtext {
font-size: 1.5rem !important;
}
.rz-state-default{
font-size: 1.5rem !important;
}
/*data grid*/
.rz-dropdown{
height: 3.0rem !important;
}
.rz-textbox{
font-size: 1.5rem !important;
}
span{
font-size: 1.5rem;
}