From d6c033f1493bef8bb8abe4475ef377c1de7c19fa Mon Sep 17 00:00:00 2001 From: SHM Date: Mon, 3 Nov 2025 10:35:58 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=84=B1=ED=98=84=EB=AA=A8]=20Operation=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83,=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/WebClient.Operation.Config.json | 15 ++++ .../Web.Operation/Components/App.razor | 4 + .../Components/Layout/MainLayout.razor | 54 ++++++++----- .../Components/Pages/CPMeta.razor | 7 ++ .../Web.Operation/Components/_Imports.razor | 10 +++ .../Web.Operation/Dialog/Loading.razor | 22 +++++ Projects/WebClient/Web.Operation/Program.cs | 80 ++++++++++++++++++- .../Web.Operation/Services/PopupService.cs | 43 ++++++++++ .../Web.Operation/Web.Operation.csproj | 17 ++++ .../WebClient/Web.Operation/wwwroot/app.css | 51 ++++++++++++ .../Config/WebClientConfig.cs | 3 + .../WebClient/WebClient.Library/Model/API.cs | 15 ++++ 12 files changed, 302 insertions(+), 19 deletions(-) create mode 100644 Projects/Config/WebClient.Operation.Config.json create mode 100644 Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor create mode 100644 Projects/WebClient/Web.Operation/Dialog/Loading.razor create mode 100644 Projects/WebClient/Web.Operation/Services/PopupService.cs create mode 100644 Projects/WebClient/WebClient.Library/Model/API.cs diff --git a/Projects/Config/WebClient.Operation.Config.json b/Projects/Config/WebClient.Operation.Config.json new file mode 100644 index 0000000..1c5c75f --- /dev/null +++ b/Projects/Config/WebClient.Operation.Config.json @@ -0,0 +1,15 @@ +{ + "ApplicationName": "CPXV2 Web Tools", + "Server": { + "Address": "https://*", + "Port": 9100, + "IIS": false + }, + "API": [ + { + "Id": 1, + "ApiName": "CPMetaWbms", + "Host": "192.168.0.126:9000" + } + ] +} \ No newline at end of file diff --git a/Projects/WebClient/Web.Operation/Components/App.razor b/Projects/WebClient/Web.Operation/Components/App.razor index b1b9a82..5ae47fc 100644 --- a/Projects/WebClient/Web.Operation/Components/App.razor +++ b/Projects/WebClient/Web.Operation/Components/App.razor @@ -9,12 +9,16 @@ + + + + diff --git a/Projects/WebClient/Web.Operation/Components/Layout/MainLayout.razor b/Projects/WebClient/Web.Operation/Components/Layout/MainLayout.razor index 5a24bb1..beae606 100644 --- a/Projects/WebClient/Web.Operation/Components/Layout/MainLayout.razor +++ b/Projects/WebClient/Web.Operation/Components/Layout/MainLayout.razor @@ -1,23 +1,41 @@ @inherits LayoutComponentBase -
- + + + + + + +
+ +
+
+
+ + + + + + + + @Body + +
+ -
-
- About -
+@code { + bool sidebarExpanded = true; + string ApplicationName = string.Empty; + string Page = string.Empty; -
- @Body -
-
-
+ protected override async Task OnInitializedAsync() + { + ApplicationName = configService?.GetConfig()?.ApplicationName; + Page = NavigationManager.ToBaseRelativePath(NavigationManager.Uri); + } -
- An unhandled error has occurred. - Reload - 🗙 -
+ private void OnClickMenu(MenuItemEventArgs args) + { + Page = args.Text; + } +} diff --git a/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor new file mode 100644 index 0000000..ab246d3 --- /dev/null +++ b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor @@ -0,0 +1,7 @@ +@page "/CpMeta" + +

CPMeta

+ +@code { + +} diff --git a/Projects/WebClient/Web.Operation/Components/_Imports.razor b/Projects/WebClient/Web.Operation/Components/_Imports.razor index 6c69c38..4455683 100644 --- a/Projects/WebClient/Web.Operation/Components/_Imports.razor +++ b/Projects/WebClient/Web.Operation/Components/_Imports.razor @@ -8,3 +8,13 @@ @using Microsoft.JSInterop @using Web.Operation @using Web.Operation.Components + + +@using Radzen +@using Radzen.Blazor + +@using SystemX.Core.Services +@using WebClient.Library.Config + +@inject ConfigService configService +@inject NavigationManager NavigationManager \ No newline at end of file diff --git a/Projects/WebClient/Web.Operation/Dialog/Loading.razor b/Projects/WebClient/Web.Operation/Dialog/Loading.razor new file mode 100644 index 0000000..5669ad8 --- /dev/null +++ b/Projects/WebClient/Web.Operation/Dialog/Loading.razor @@ -0,0 +1,22 @@ +@page "/loading/{Message?}" + +
+
+
+
+
+
+
+
+ @Message +
+
+@code { + [Parameter] + public string? Message { get; set; } + + protected override void OnParametersSet() + { + + } +} diff --git a/Projects/WebClient/Web.Operation/Program.cs b/Projects/WebClient/Web.Operation/Program.cs index 842ccb5..8209ee0 100644 --- a/Projects/WebClient/Web.Operation/Program.cs +++ b/Projects/WebClient/Web.Operation/Program.cs @@ -1,13 +1,82 @@ +using Radzen; +using SystemX.Core.Config.Model; +using SystemX.Core.DB; +using SystemX.Core.Services; using Web.Operation.Components; +using Web.Operation.Services; +using WebClient.Library.Config; +using WebClient.Library.Model; + + +string configDir = @"../../Config"; +string configFileName = "WebClient.Operation.Config.json"; + +//raed log4net configs +if (LogXnet.ReadConfig(@$"{configDir}/LogXnetConfig.json") == true) +{ + LogXnet.WriteLine("LogXnet Init Success"); +} +else +{ + Console.WriteLine("LogXnet Init Failed"); + return; +} + var builder = WebApplication.CreateBuilder(args); +builder.Services.AddRadzenComponents(); + +//singleton +builder.Services.AddSingleton>(); + + +//scoped +builder.Services.AddScoped(); + +//db +builder.Services.AddSingleton(); // Generic µî·Ï + + // Add services to the container. builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); +//config preload, auth set +ConfigService preloadConfig = new ConfigService(); +if (preloadConfig.OpenConfig($@"{configDir}/{configFileName}") == true) +{ + var config = preloadConfig.GetConfig(); +} +else +{ + LogXnet.WriteLine("Config Preload Load Error.", LogXLabel.Error); + return; +} + var app = builder.Build(); +//read api config and set +string serverUrl = string.Empty; +var configService = app.Services.GetService>(); +bool isIIS = false; + +if (configService?.OpenConfig($@"{configDir}/{configFileName}") == true) +{ + LogXnet.WriteLine("WebClient Config Success."); + var apiConfig = ConfigService.Config; + if (apiConfig != null) + { + serverUrl = $"{apiConfig?.Server?.Address}:{apiConfig?.Server?.Port}"; + isIIS = apiConfig!.Server.IIS; + } +} +else +{ + LogXnet.WriteLine("WebClient Config Error."); + return; +} + // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { @@ -24,4 +93,13 @@ app.UseAntiforgery(); app.MapRazorComponents() .AddInteractiveServerRenderMode(); -app.Run(); +if (isIIS == true) +{ + app.Run(); +} +else +{ + LogXnet.WriteLine($"Operation Url: {serverUrl}"); + app.Run($"{serverUrl}"); +} + diff --git a/Projects/WebClient/Web.Operation/Services/PopupService.cs b/Projects/WebClient/Web.Operation/Services/PopupService.cs new file mode 100644 index 0000000..54b6bce --- /dev/null +++ b/Projects/WebClient/Web.Operation/Services/PopupService.cs @@ -0,0 +1,43 @@ +using Radzen; +using Web.Operation.Dialog; + +namespace Web.Operation.Services +{ + public class PopupService + { + public DialogService _dialogService; + + public PopupService(DialogService dialogService) + { + _dialogService = dialogService; + } + + public async Task 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("", + new Dictionary() { { "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(); + } + } +} diff --git a/Projects/WebClient/Web.Operation/Web.Operation.csproj b/Projects/WebClient/Web.Operation/Web.Operation.csproj index 1b28a01..205d3ab 100644 --- a/Projects/WebClient/Web.Operation/Web.Operation.csproj +++ b/Projects/WebClient/Web.Operation/Web.Operation.csproj @@ -6,4 +6,21 @@ enable + + + + + + + + + + + ..\..\DLL\SystemX.Core.dll + + + ..\..\DLL\SystemX.Core.DB.dll + + + diff --git a/Projects/WebClient/Web.Operation/wwwroot/app.css b/Projects/WebClient/Web.Operation/wwwroot/app.css index 2bd9b78..e6eef8b 100644 --- a/Projects/WebClient/Web.Operation/wwwroot/app.css +++ b/Projects/WebClient/Web.Operation/wwwroot/app.css @@ -1,5 +1,6 @@ html, body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 62.5% !important; } a, .btn-link { @@ -49,3 +50,53 @@ h1:focus { .darker-border-checkbox.form-check-input { border-color: #929292; } + + +/*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; +} + +/*common*/ +span { + font-size: 1.5rem; +} diff --git a/Projects/WebClient/WebClient.Library/Config/WebClientConfig.cs b/Projects/WebClient/WebClient.Library/Config/WebClientConfig.cs index 4bffc0e..173bf7b 100644 --- a/Projects/WebClient/WebClient.Library/Config/WebClientConfig.cs +++ b/Projects/WebClient/WebClient.Library/Config/WebClientConfig.cs @@ -20,5 +20,8 @@ namespace WebClient.Library.Config [JsonPropertyName("GridDisableFilter")] public List? GridDisableFilter { get; set; } + + [JsonPropertyName("API")] + public List? Api { get; set; } } } diff --git a/Projects/WebClient/WebClient.Library/Model/API.cs b/Projects/WebClient/WebClient.Library/Model/API.cs new file mode 100644 index 0000000..56dfd82 --- /dev/null +++ b/Projects/WebClient/WebClient.Library/Model/API.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebClient.Library.Model +{ + public class API + { + public int Id { get; set; } + public string ApiName { get; set; } + public string Host { get; set; } + } +}