commit ccc1b47dfdd495f31dc69ae5b059be7ccff015a2 Author: zumun Date: Tue Oct 20 16:13:34 2026 +0900 feat: implement modern admin studio with live AD, NetApp, MS SQL connectivity and comprehensive docs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d79a661 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Windows / OS Files +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ + +# Temporary / Log files +*.log +*.tmp +*.bak + +# VS Code / IDE +.vscode/ +.idea/ + +# User Config (Optional overrides) +config.local.json diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 0000000..4fc9167 --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,172 @@ +# Enterprise Admin Studio - 아키텍처 설계 문서 (ARCHITECTURE.md) + +## 1. 개요 (Overview) + +**Enterprise Admin Studio**는 Windows 및 기업 인프라의 3대 핵심 컴포넌트인 **Active Directory (AD DS)**, **NetApp ONTAP 스토리지 (Qtree, Quota, Share)**, **Microsoft SQL Server**를 단일 화면에서 통합 모니터링 및 제어할 수 있는 모던 UI 기반의 관리 콘솔입니다. + +본 프로젝트는 **PowerShell 7 / Windows PowerShell 5.1**과 **.NET WPF (XAML)** 기술을 기반으로 구축되었으며, 차후 엔터프라이즈 환경에서 필요 시 **C# (.NET 8+ / WPF / WinUI 3)** 환경으로의 100% 무손실 전환이 가능하도록 철저한 계층 분리(Separation of Concerns) 아키텍처를 채택했습니다. + +--- + +## 2. 전체 시스템 구조도 (System Architecture) + +```mermaid +flowchart TD + subgraph Presentation_Layer ["Presentation Layer (UI/XAML)"] + MW["MainWindow.xaml\n(Fluent Dark Frame, Sidebar Navigation, Mode Badge)"] + Styles["Styles/Theme.xaml\n(Color Palette, Modern Controls, Icons)"] + + subgraph Views ["Views (Dynamic UserControls)"] + V1["DashboardView.xaml\n(KPI Cards, Audit Grid)"] + V2["ActiveDirectoryView.xaml\n(User Grid, Detail Inspector)"] + V3["NetAppView.xaml\n(Qtree, Quota, CIFS/NFS Tabs)"] + V4["SqlDatabaseView.xaml\n(DB Grid, T-SQL Console)"] + V5["SettingsView.xaml\n(Endpoint Config, Diagnostic)"] + end + end + + subgraph Application_Core ["Application Core (PowerShell Routing & Cache)"] + Entry["Start-App.ps1\n(Application Entrypoint & Event Dispatcher)"] + Router["Page Navigator & ViewCache\n(Fast Instant Page Switching)"] + Config["config.json & ConfigService.ps1\n(Persistent Configuration Engine)"] + end + + subgraph Service_Layer ["Service / Business Logic Layer (Modules)"] + AD_SVC["ADService.ps1\n[IActiveDirectoryService]"] + NETAPP_SVC["NetAppService.ps1\n[INetAppStorageService]"] + SQL_SVC["SqlService.ps1\n[ISqlServerService]"] + end + + subgraph Infrastructure_Targets ["Target Enterprise Infrastructure"] + DC["Active Directory Domain Controller\n(LDAP / LDAPS Port 389/636)"] + ONTAP["NetApp ONTAP Cluster\n(REST API v2 / HTTPS 443)"] + MSSQL["MS SQL Server Instance\n(TDS Protocol / TCP 1433)"] + end + + MW --> Router + Router --> Views + Styles -.-> MW + Styles -.-> Views + + Entry --> Router + Entry --> Config + + Views --> AD_SVC + Views --> NETAPP_SVC + Views --> SQL_SVC + + AD_SVC --> DC + NETAPP_SVC --> ONTAP + SQL_SVC --> MSSQL +``` + +--- + +## 3. 계층별 상세 설계 (Layer Details) + +### 3.1 Presentation Layer (XAML UI) +- **Fluent Modern Dark 테마**: + - 배경: `#0F172A` (Slate Dark), 카드/사이드바: `#1E293B`, 액센트: `#3B82F6` / `#6366F1` + - 표준 WPF 컨트롤 템플릿(`Button`, `TextBox`, `RadioButton`, `DataGrid`, `TabControl`, `Border`)을 모던 라운딩 처리 +- **네이티브 아이콘 시스템**: + - 외부 폰트 설치나 대용량 SVG 의존성 없이 Windows 10/11 기본 탑재 글꼴인 `Segoe MDL2 Assets`의 유니코드 글리프(예: ``, ``, ``) 사용 +- **Dynamic View Hosting**: + - `MainWindow.xaml` 내 `ContentControl x:Name="MainContentHost"`에 각 View를 동적 인스턴스화 + - `ViewCache` 해시테이블을 두어 최초 로드 후 페이지 전환 시 재파싱 비용을 제거하여 네이티브 수준의 부드러운 전환 구현 + +### 3.2 Service & Integration Layer (비즈니스 로직) + +#### A. Active Directory 연동 (`ADService.ps1`) +- **기술 스택**: Windows 기본 내장 `.NET System.DirectoryServices` +- **프로토콜**: LDAP (Port 389) 또는 LDAPS (Port 636) +- **동작 원리**: + 1. `DirectoryEntry`를 통해 지정된 도메인 컨트롤러 또는 기본 도메인에 바인딩 (자격증명 지원) + 2. `DirectorySearcher`를 이용해 `(&(objectCategory=person)(objectClass=user))` 필터링 및 페이징(PageSize = 1000) 처리 + 3. 속성 매핑: + - `userAccountControl`: `0x0002` 비트 연산을 통한 활성/비활성 판정 및 변경 + - `lockoutTime`: 정수값을 통한 잠금 여부 확인 및 `lockoutTime = 0` 커밋을 통한 계정 잠금 해제 + - `Invoke("SetPassword", ...)`: 안전한 비밀번호 초기화 및 `pwdLastSet = 0` 강제 변경 플래그 + 4. **Fallback 메커니즘**: AD 환경이 아닌 로컬 PC나 개발 환경에서는 자동으로 Mock 데이터 및 데모 시뮬레이션으로 안전하게 동작 + +#### B. NetApp ONTAP 스토리지 연동 (`NetAppService.ps1`) +- **기술 스택**: NetApp ONTAP 9.6+ 표준 REST API (HTTPS RESTful) +- **엔드포인트 매핑**: + - Qtree 관리: `GET /api/storage/qtrees`, `POST /api/storage/qtrees` + - Quota 한도/모니터링: `GET /api/storage/quota/rules`, `GET /api/storage/quota/reports` + - CIFS 파일 공유: `GET /api/protocols/cifs/shares`, `POST /api/protocols/cifs/shares` + - NFS 내보내기 정책: `GET /api/protocols/nfs/export-policies` + - 클러스터 상태 진단: `GET /api/cluster` +- **보안 및 인증**: HTTP Basic Authentication 및 자체 서명 SSL 인증서 무시 처리(`IgnoreSslErrors`) 옵션 내장 + +#### C. MS SQL Server 연동 (`SqlService.ps1`) +- **기술 스택**: .NET 기본 제공 `System.Data.SqlClient` +- **프로토콜**: Tabular Data Stream (TDS, Port 1433) +- **동작 원리**: + 1. Windows 통합 인증(Integrated Security) 및 SQL Server 계정(User ID / Password) 인증 동시 지원 + 2. `sys.databases`, `sys.master_files`, `msdb.dbo.backupset` 카탈로그 뷰를 조인하여 실제 데이터베이스 상태, 용량, 복구 모델, 최종 Full 백업 일시 동적 집계 + 3. `BACKUP DATABASE [{0}] TO DISK = '{1}' WITH INIT, STATS = 10` 실제 데이터베이스 백업 수행 + 4. T-SQL 간이 쿼리 실행기: 사용자 입력을 파싱하여 `SqlDataAdapter`로 DataTable에 적재 후 결과 포맷팅 + +--- + +## 4. C# (.NET 8 / WPF / WinUI 3) 마이그레이션 로드맵 + +향후 C# 솔루션으로 승격(Promote) 시 100% 매핑되도록 설계되었습니다. + +### 4.1 XAML 파일의 무수정 재사용 +`Views/*.xaml` 및 `Styles/Theme.xaml`은 표준 WPF 문법을 준수합니다. C# 프로젝트에 그대로 포함하고 아래와 같이 코드 비하인드만 연결하면 됩니다: +```csharp +namespace ModernAdminStudio.Views; + +public partial class ActiveDirectoryView : UserControl +{ + public ActiveDirectoryView() + { + InitializeComponent(); + } +} +``` + +### 4.2 MVVM 및 DI (의존성 주입) 패턴 매핑 +```csharp +// Program.cs 또는 App.xaml.cs +services.AddSingleton(); +services.AddSingleton(); +services.AddSingleton(); + +services.AddTransient(); +services.AddTransient(); +services.AddTransient(); +services.AddTransient(); +services.AddTransient(); +``` + +### 4.3 서비스 인터페이스 정의서 (C# Blueprint) +```csharp +public interface IActiveDirectoryService +{ + Task> GetUsersAsync(string filter); + Task UnlockAccountAsync(string samAccountName); + Task ResetPasswordAsync(string samAccountName, string newPassword); + Task SetAccountStateAsync(string samAccountName, bool enable); + Task TestConnectionAsync(); +} + +public interface INetAppStorageService +{ + Task> GetQtreesAsync(string svm); + Task> GetQuotasAsync(string svm); + Task> GetSharesAsync(string svm); + Task CreateQtreeAsync(CreateQtreeRequest request); + Task CreateShareAsync(CreateShareRequest request); + Task TestConnectionAsync(); +} + +public interface ISqlServerService +{ + Task> GetDatabasesAsync(); + Task BackupDatabaseAsync(string databaseName, string targetPath); + Task ExecuteQuerySnippetAsync(string query); + Task TestConnectionAsync(); +} +``` diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ee2f467 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Enterprise Admin Studio - 변경 이력 (CHANGELOG.md) + +## [v1.2.0] - 2026-10-20 +### Added (신규 기능 추가) +- **실제 엔터프라이즈 인프라 연결 엔진 구현**: + - **Active Directory**: .NET 내장 `System.DirectoryServices`를 활용한 실제 LDAP/LDAPS 연결, `DirectorySearcher` 기반 실시간 사용자 검색, 계정 잠금 해제(`lockoutTime = 0`), 임시 비밀번호 초기화 및 강제 변경(`pwdLastSet = 0`), 계정 활성/비활성 제어 구현 + - **NetApp ONTAP 스토리지**: ONTAP 9.6+ 표준 REST API(`https:///api/...`) 호출 엔진 구현. Qtree 목록/생성, Quota 한도/모니터링 조회, CIFS/NFS 공유 생성 및 목록 조회, 자체 서명 SSL 인증서 우회(`IgnoreSslErrors`) 옵션 탑재 + - **MS SQL Server**: `System.Data.SqlClient`를 활용한 실제 인스턴스 접속, `sys.databases` 카탈로그 뷰 조인 실시간 DB 용량/복구모델/최근백업 집계, `BACKUP DATABASE` 실시간 백업 파일 생성, T-SQL 간이 쿼리 파서 및 실행기 구현 +- **동작 모드 토글 (Live vs Mock) 시스템**: + - 상단 헤더에 현재 모드(Live 초록색 배지 vs Mock 보라색 배지) 실시간 시각화 + - 실제 대상 서버가 없거나 네트워크가 단절된 경우에도 안전하게 목업 데이터로 자동 폴백되는 안전장치 구축 +- **영속적 설정 관리 (`config.json` & `ConfigService.ps1`)**: + - AD, NetApp, MS SQL의 모든 접속 엔드포인트 및 자격증명을 JSON 기반으로 저장/로드 + - 환경설정 화면에서 원클릭 "전체 인프라 일괄 진단" 기능 추가 +- **문서화 강화**: + - 시스템 구조도 및 C# 마이그레이션 청사진을 담은 `ARCHITECTURE.md` 작성 + - 실제 운영 및 메뉴얼 가이드 `USAGE.md` 작성 + +## [v1.0.0] - 2026-10-20 +### Added +- **프로젝트 초기 구축 (Initial Release)**: + - PowerShell + WPF (XAML) 기반 아키텍처 스캐폴딩 + - Windows 11 Fluent Dark 모던 테마(`Styles/Theme.xaml`) 및 `Segoe MDL2 Assets` 글리프 아이콘 적용 + - 사이드바 내비게이션 및 `ViewCache` 기반의 부드러운 페이지 전환 라우팅 구현 + - 메뉴별 독립 View 5종 분리 (`DashboardView`, `ActiveDirectoryView`, `NetAppView`, `SqlDatabaseView`, `SettingsView`) + - 원클릭 백그라운드 실행을 위한 `Run.bat` 제공 diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..bada1fc --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +