Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d87de64de | |||
| 678f9c27d5 | |||
| a06d1eeeca | |||
| 7d35aef39d | |||
| 50cf45e3ef | |||
| ab5f8ac978 | |||
| 908c9ebc9a | |||
| 2fb1a3bf18 | |||
| 736addef70 | |||
| 98470ad184 | |||
| 430fb9d089 | |||
| 81e8c85280 | |||
| 0d81ace5da |
@@ -0,0 +1,476 @@
|
||||
# QuantEngine MudBlazor UI — 완성 로드맵
|
||||
|
||||
**프로젝트**: QuantEngine v0.1
|
||||
**시작일**: 2026-07-05
|
||||
**목표 완료**: 2026-07-20
|
||||
**상태**: 🚀 본격 실행
|
||||
|
||||
---
|
||||
|
||||
## 📊 현재 상태
|
||||
|
||||
| 항목 | 상태 | 진행률 |
|
||||
|------|------|--------|
|
||||
| **기본 구조** | ✅ 완료 | 100% |
|
||||
| **MudBlazor 통합** | ✅ 완료 | 100% |
|
||||
| **기본 페이지** | 🔄 진행 중 | 60% |
|
||||
| **관리자 UI** | ⬜ 대기 | 0% |
|
||||
| **사용자 UI** | ⬜ 대기 | 0% |
|
||||
| **기능 통합** | ⬜ 대기 | 0% |
|
||||
| **테스트 & 배포** | ⬜ 대기 | 0% |
|
||||
|
||||
**현존 페이지 (5개)**:
|
||||
- ✅ Login.razor (4.7KB)
|
||||
- ✅ Dashboard.razor (4.6KB)
|
||||
- ✅ Collection.razor (5.5KB)
|
||||
- ✅ Operations.razor (4.6KB)
|
||||
- ✅ NotFound.razor (126B)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Phase별 상세 WBS
|
||||
|
||||
### **Phase 1: 기본 UI 구조 강화** (2-3일)
|
||||
|
||||
#### 1.1: MainLayout 개선 (4시간)
|
||||
- 반응형 사이드바 추가 (모바일 햄버거 메뉴)
|
||||
- 탑 네비게이션 개선
|
||||
- 다크모드 토글 추가
|
||||
- 사용자 프로필 메뉴
|
||||
|
||||
**파일**:
|
||||
- `Layouts/MainLayout.razor`
|
||||
- `Components/Navigation/SideNav.razor` (신규)
|
||||
- `Components/Navigation/TopNav.razor` (신규)
|
||||
- `Components/Navigation/UserMenu.razor` (신규)
|
||||
|
||||
**기술**:
|
||||
- MudDrawer (반응형 사이드바)
|
||||
- MudAppBar + MudNavMenu
|
||||
- Dark mode: `@inject MudTheme`
|
||||
|
||||
---
|
||||
|
||||
#### 1.2: AuthLayout 개선 (3시간)
|
||||
- 로그인 페이지 리디자인
|
||||
- 회원가입 페이지 추가
|
||||
- 비밀번호 복구 페이지
|
||||
- 일관된 인증 UI 패턴
|
||||
|
||||
**파일**:
|
||||
- `Layouts/AuthLayout.razor` (수정)
|
||||
- `Pages/Auth/Register.razor` (신규)
|
||||
- `Pages/Auth/ForgotPassword.razor` (신규)
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Auth/LoginForm.razor`
|
||||
- `Components/Auth/RegisterForm.razor`
|
||||
- `Components/Auth/PasswordRecoveryForm.razor`
|
||||
|
||||
---
|
||||
|
||||
#### 1.3: 테마 & 스타일링 (3시간)
|
||||
- MudTheme 색상 정의 (QuantEngine 브랜딩)
|
||||
- 글로벌 스타일시트 설정
|
||||
- 반응형 그리드 레이아웃
|
||||
- 로딩 상태 스타일 (MudSkeleton)
|
||||
|
||||
**파일**:
|
||||
- `wwwroot/css/quantengine-theme.css`
|
||||
- `Components/Common/ThemeProvider.razor`
|
||||
|
||||
---
|
||||
|
||||
### **Phase 2: 관리자 UI** (3-4일)
|
||||
|
||||
#### 2.1: 대시보드 고급화 (4시간)
|
||||
- 통계 카드 개선 (KPI 트렌드)
|
||||
- 차트 통합 (ApexCharts via MudBlazor)
|
||||
- 활동 로그 및 알림
|
||||
- 실시간 데이터 업데이트
|
||||
|
||||
**파일**:
|
||||
- `Pages/Admin/Dashboard.razor` (확장)
|
||||
- `Components/Dashboard/StatCard.razor`
|
||||
- `Components/Dashboard/ActivityFeed.razor`
|
||||
- `Components/Dashboard/AlertsPanel.razor`
|
||||
|
||||
**기술**:
|
||||
- MudDataGrid (활동 로그)
|
||||
- MudChart (차트)
|
||||
- SignalR (실시간 업데이트)
|
||||
|
||||
---
|
||||
|
||||
#### 2.2: 사용자 관리 (5시간)
|
||||
- 사용자 목록 페이지 (검색/필터/정렬)
|
||||
- 사용자 상세 정보 페이지
|
||||
- 사용자 추가/편집 모달
|
||||
- 역할 및 권한 관리
|
||||
|
||||
**페이지**:
|
||||
- `Pages/Admin/Users/List.razor` (신규)
|
||||
- `Pages/Admin/Users/Detail.razor` (신규)
|
||||
- `Pages/Admin/Users/Edit.razor` (신규)
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/User/UserTable.razor`
|
||||
- `Components/User/UserForm.razor`
|
||||
- `Components/User/RoleSelector.razor`
|
||||
|
||||
**기술**:
|
||||
- MudDataGrid (고급 테이블)
|
||||
- MudDialog (추가/편집)
|
||||
- MudChip (태그/역할)
|
||||
|
||||
---
|
||||
|
||||
#### 2.3: 데이터 수집 모니터링 (4시간)
|
||||
- Collection 대시보드 개선
|
||||
- 실시간 진행률 표시
|
||||
- 오류 로그 및 재시도
|
||||
- 내보내기 기능
|
||||
|
||||
**파일**:
|
||||
- `Pages/Admin/Collection/Dashboard.razor` (확장)
|
||||
- `Pages/Admin/Collection/Runs.razor` (신규)
|
||||
- `Pages/Admin/Collection/Errors.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
#### 2.4: 설정 페이지 (3시간)
|
||||
- 일반 설정 (회사명, 로고, 시간대)
|
||||
- 보안 설정 (2FA, API 키)
|
||||
- 알림 설정
|
||||
- 데이터 내보내기/삭제
|
||||
|
||||
**페이지**:
|
||||
- `Pages/Admin/Settings/General.razor` (신규)
|
||||
- `Pages/Admin/Settings/Security.razor` (신규)
|
||||
- `Pages/Admin/Settings/Notifications.razor` (신규)
|
||||
- `Pages/Admin/Settings/Data.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
### **Phase 3: 사용자 UI** (3-4일)
|
||||
|
||||
#### 3.1: 포트폴리오 대시보드 (4시간)
|
||||
- 자산 현황 (MudCard 그리드)
|
||||
- 성과 차트 (수익률, 변동률)
|
||||
- 포트폴리오 구성 (파이 차트)
|
||||
- 목표 추적
|
||||
|
||||
**페이지**:
|
||||
- `Pages/User/Portfolio/Dashboard.razor` (신규)
|
||||
- `Pages/User/Portfolio/Performance.razor` (신규)
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Portfolio/AssetGrid.razor`
|
||||
- `Components/Portfolio/PerformanceChart.razor`
|
||||
|
||||
---
|
||||
|
||||
#### 3.2: 자산 상세 페이지 (3시간)
|
||||
- 종목별 상세 정보
|
||||
- 가격 히스토리 (차트)
|
||||
- 거래 내역
|
||||
- 목표 설정
|
||||
|
||||
**페이지**:
|
||||
- `Pages/User/Assets/Detail.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
#### 3.3: 보고서 페이지 (3시간)
|
||||
- 월간 보고서 생성
|
||||
- 세금 보고 자료
|
||||
- PDF 다운로드
|
||||
- 보고서 아카이브
|
||||
|
||||
**페이지**:
|
||||
- `Pages/User/Reports/List.razor` (신규)
|
||||
- `Pages/User/Reports/View.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
#### 3.4: 프로필 & 설정 (2시간)
|
||||
- 프로필 정보 수정
|
||||
- 비밀번호 변경
|
||||
- 알림 선호도
|
||||
- 계정 삭제
|
||||
|
||||
**페이지**:
|
||||
- `Pages/User/Profile/Edit.razor` (신규)
|
||||
- `Pages/User/Profile/Security.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
### **Phase 4: 공통 컴포넌트 & 유틸리티** (2-3일)
|
||||
|
||||
#### 4.1: 폼 컴포넌트 (2시간)
|
||||
- 재사용 가능한 폼 빌더
|
||||
- 입력 검증 (서버/클라이언트)
|
||||
- 에러 메시지 표시
|
||||
- 로딩 상태
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Forms/FormField.razor`
|
||||
- `Components/Forms/FormSection.razor`
|
||||
- `Components/Forms/SubmitButton.razor`
|
||||
|
||||
---
|
||||
|
||||
#### 4.2: 테이블/데이터그리드 (2시간)
|
||||
- 고급 필터링
|
||||
- 페이지네이션
|
||||
- 내보내기 (CSV, Excel)
|
||||
- 일괄 작업
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Tables/DataTableWithFilters.razor`
|
||||
- `Components/Tables/ExportMenu.razor`
|
||||
|
||||
---
|
||||
|
||||
#### 4.3: 모달/다이얼로그 (1시간)
|
||||
- 확인 다이얼로그
|
||||
- 알림 모달
|
||||
- 에러 디스플레이
|
||||
- 로딩 오버레이
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Dialogs/ConfirmDialog.razor`
|
||||
- `Components/Dialogs/AlertDialog.razor`
|
||||
- `Components/Dialogs/LoadingOverlay.razor`
|
||||
|
||||
---
|
||||
|
||||
#### 4.4: 푸터 & 법적 페이지 (1시간)
|
||||
- 글로벌 푸터
|
||||
- 개인정보처리방침 페이지
|
||||
- 이용약관 페이지
|
||||
- 연락처/지원 페이지
|
||||
|
||||
**페이지**:
|
||||
- `Pages/Legal/PrivacyPolicy.razor` (신규)
|
||||
- `Pages/Legal/Terms.razor` (신규)
|
||||
- `Pages/Legal/Contact.razor` (신규)
|
||||
|
||||
---
|
||||
|
||||
### **Phase 5: 기능 통합 & API 연결** (3-4일)
|
||||
|
||||
#### 5.1: 인증 & 권한 (2시간)
|
||||
- JWT 토큰 관리
|
||||
- 역할 기반 접근 제어 (RBAC)
|
||||
- 페이지 권한 보호
|
||||
- 로그아웃 기능
|
||||
|
||||
**파일**:
|
||||
- `Services/AuthService.cs` (확장)
|
||||
- `Components/Security/AuthorizeView.razor` (커스텀)
|
||||
|
||||
---
|
||||
|
||||
#### 5.2: API 클라이언트 확장 (2시간)
|
||||
- 모든 엔드포인트 구현
|
||||
- 에러 처리 및 재시도 로직
|
||||
- 요청 취소 토큰
|
||||
- 요청 로깅
|
||||
|
||||
**파일**:
|
||||
- `Services/ApiClient.cs` (확장)
|
||||
|
||||
---
|
||||
|
||||
#### 5.3: 상태 관리 (2시간)
|
||||
- 전역 상태 관리 (세션, 사용자, 알림)
|
||||
- 페이지 상태 저장
|
||||
- 임시 데이터 캐싱
|
||||
|
||||
**파일**:
|
||||
- `Services/StateService.cs` (신규)
|
||||
|
||||
---
|
||||
|
||||
#### 5.4: 알림 & 토스트 (2시간)
|
||||
- 알림 메시지 (MudMessageBox)
|
||||
- 토스트 알림 (MudSnackbar)
|
||||
- 에러 메시지 표시
|
||||
- 성공/경고 메시지
|
||||
|
||||
**컴포넌트**:
|
||||
- `Components/Notifications/NotificationService.razor`
|
||||
|
||||
---
|
||||
|
||||
### **Phase 6: 테스트 & 최적화** (2-3일)
|
||||
|
||||
#### 6.1: 단위 테스트 (2시간)
|
||||
- 페이지 렌더링 테스트 (bUnit)
|
||||
- 컴포넌트 상호작용 테스트
|
||||
- API 클라이언트 테스트
|
||||
- 서비스 테스트
|
||||
|
||||
**테스트 파일**:
|
||||
- `tests/ui/Pages/*Tests.cs`
|
||||
- `tests/ui/Components/*Tests.cs`
|
||||
|
||||
---
|
||||
|
||||
#### 6.2: 통합 테스트 (2시간)
|
||||
- E2E 시나리오 (로그인 → 대시보드)
|
||||
- 사용자 워크플로우 테스트
|
||||
- 권한 접근 테스트
|
||||
|
||||
---
|
||||
|
||||
#### 6.3: 성능 최적화 (2시간)
|
||||
- 번들 사이즈 최적화
|
||||
- 로딩 시간 개선
|
||||
- 이미지 최적화
|
||||
- 캐싱 전략
|
||||
|
||||
---
|
||||
|
||||
#### 6.4: 접근성 (1시간)
|
||||
- WCAG 2.1 AA 준수
|
||||
- 키보드 네비게이션
|
||||
- 스크린 리더 테스트
|
||||
- 색상 대비 확인
|
||||
|
||||
---
|
||||
|
||||
### **Phase 7: 배포 & 문서화** (1-2일)
|
||||
|
||||
#### 7.1: 배포 준비 (1시간)
|
||||
- 빌드 최적화
|
||||
- CDN 설정
|
||||
- 환경 변수 설정
|
||||
|
||||
---
|
||||
|
||||
#### 7.2: 문서화 (2시간)
|
||||
- 컴포넌트 문서 (Storybook 또는 컴포넌트 갤러리)
|
||||
- 개발자 가이드
|
||||
- 배포 가이드
|
||||
- API 문서
|
||||
|
||||
---
|
||||
|
||||
#### 7.3: 배포 (1시간)
|
||||
- 개발 환경 배포
|
||||
- 스테이징 배포
|
||||
- 프로덕션 배포
|
||||
- 모니터링 설정
|
||||
|
||||
---
|
||||
|
||||
## 📅 타임라인
|
||||
|
||||
| Phase | 작업 | 예상 시간 | 기간 |
|
||||
|-------|------|----------|------|
|
||||
| 1 | 기본 UI 구조 | 10시간 | 2-3일 |
|
||||
| 2 | 관리자 UI | 16시간 | 3-4일 |
|
||||
| 3 | 사용자 UI | 12시간 | 3-4일 |
|
||||
| 4 | 공통 컴포넌트 | 6시간 | 1-2일 |
|
||||
| 5 | API 통합 | 8시간 | 2-3일 |
|
||||
| 6 | 테스트 & 최적화 | 7시간 | 2-3일 |
|
||||
| 7 | 배포 & 문서 | 4시간 | 1-2일 |
|
||||
| **Total** | | **63시간** | **15-21일** |
|
||||
|
||||
---
|
||||
|
||||
## 🎨 MudBlazor 컴포넌트 매핑
|
||||
|
||||
### UI 요소별 권장 MudBlazor 컴포넌트
|
||||
|
||||
| UI 요소 | MudBlazor 컴포넌트 | 용도 |
|
||||
|---------|-----------------|------|
|
||||
| **레이아웃** | MudAppBar, MudDrawer, MudLayout | 전체 구조 |
|
||||
| **네비게이션** | MudNavMenu, MudNavLink, MudBreadcrumbs | 페이지 네비게이션 |
|
||||
| **입력** | MudTextField, MudSelect, MudDatePicker | 폼 입력 |
|
||||
| **데이터** | MudDataGrid, MudTable | 데이터 표시 |
|
||||
| **정보** | MudCard, MudAlert, MudProgressLinear | 정보 표시 |
|
||||
| **상호작용** | MudButton, MudIconButton, MudChip | 사용자 동작 |
|
||||
| **피드백** | MudSnackbar, MudMessageBox, MudDialog | 메시지/다이얼로그 |
|
||||
| **로딩** | MudProgressCircular, MudSkeleton | 로딩 상태 |
|
||||
| **스타일** | MudText, MudPaper, MudStack, MudGrid | 기본 스타일 |
|
||||
|
||||
---
|
||||
|
||||
## ✅ 성공 기준
|
||||
|
||||
### Phase별 완료 체크리스트
|
||||
|
||||
- **Phase 1** ✅
|
||||
- [ ] 반응형 네비게이션 (모바일 테스트)
|
||||
- [ ] 다크모드 토글 (저장 및 로드)
|
||||
- [ ] 일관된 레이아웃 (모든 페이지)
|
||||
|
||||
- **Phase 2** ✅
|
||||
- [ ] 관리자 대시보드 (실시간 데이터)
|
||||
- [ ] 사용자 관리 (검색/필터 작동)
|
||||
- [ ] 데이터 수집 모니터링 (진행률 표시)
|
||||
- [ ] 설정 페이지 (저장 기능)
|
||||
|
||||
- **Phase 3** ✅
|
||||
- [ ] 포트폴리오 대시보드 (성과 차트)
|
||||
- [ ] 자산 상세 페이지 (가격 히스토리)
|
||||
- [ ] 보고서 생성 및 다운로드
|
||||
- [ ] 프로필 관리
|
||||
|
||||
- **Phase 4** ✅
|
||||
- [ ] 폼 컴포넌트 (검증 작동)
|
||||
- [ ] 테이블 (필터/정렬/내보내기)
|
||||
- [ ] 모달 및 다이얼로그
|
||||
- [ ] 법적 페이지
|
||||
|
||||
- **Phase 5** ✅
|
||||
- [ ] 인증 & 권한 (API 연결)
|
||||
- [ ] 모든 API 엔드포인트 작동
|
||||
- [ ] 상태 관리 시스템
|
||||
- [ ] 알림 시스템
|
||||
|
||||
- **Phase 6** ✅
|
||||
- [ ] 단위 테스트 (80% 커버리지)
|
||||
- [ ] 통합 테스트 (주요 워크플로우)
|
||||
- [ ] 성능 테스트 (번들 < 500KB)
|
||||
- [ ] 접근성 테스트 (WCAG AA)
|
||||
|
||||
- **Phase 7** ✅
|
||||
- [ ] 배포 스크립트 준비
|
||||
- [ ] 문서 완성
|
||||
- [ ] 모니터링 설정
|
||||
- [ ] 라이브 배포
|
||||
|
||||
---
|
||||
|
||||
## 📚 참고 자료
|
||||
|
||||
- [MudBlazor 공식 문서](https://mudblazor.com/)
|
||||
- [Blazor 공식 문서](https://learn.microsoft.com/en-us/aspnet/core/blazor/)
|
||||
- [CLAUDE.md - QuantEngine 표준](../CLAUDE.md)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 우선순위
|
||||
|
||||
**1차 (필수)**:
|
||||
1. Phase 1: 기본 UI 구조 (모든 페이지의 기반)
|
||||
2. Phase 2.1-2.2: 관리자 대시보드 + 사용자 관리
|
||||
3. Phase 5: API 통합 (기능 연결)
|
||||
|
||||
**2차 (중요)**:
|
||||
4. Phase 3: 사용자 UI
|
||||
5. Phase 4: 공통 컴포넌트
|
||||
6. Phase 6: 테스트
|
||||
|
||||
**3차 (배포)**:
|
||||
7. Phase 7: 배포 & 문서
|
||||
|
||||
---
|
||||
|
||||
**생성일**: 2026-07-05
|
||||
**작성자**: Claude Code
|
||||
**상태**: 🎯 실행 중
|
||||
@@ -0,0 +1,401 @@
|
||||
# QuantEngine - Testing & Deployment Guide
|
||||
|
||||
**Status**: Phase 6 (Testing) & Phase 8 (Deployment) - Configuration & Documentation
|
||||
|
||||
---
|
||||
|
||||
## Phase 6: Testing & Optimization
|
||||
|
||||
### 6.1 Unit Testing (bUnit)
|
||||
|
||||
#### Setup
|
||||
```bash
|
||||
cd src/dotnet
|
||||
dotnet add package bunit
|
||||
dotnet add package bunit.web
|
||||
```
|
||||
|
||||
#### Example Test: Dashboard Component
|
||||
```csharp
|
||||
// Tests/Pages/DashboardTests.cs
|
||||
[TestFixture]
|
||||
public class DashboardTests
|
||||
{
|
||||
[Test]
|
||||
public void Dashboard_Renders_KPICards()
|
||||
{
|
||||
// Arrange
|
||||
var cut = new TestContext().RenderComponent<Dashboard>();
|
||||
|
||||
// Act & Assert
|
||||
var kpiCards = cut.FindAll(".mud-card-kpi");
|
||||
kpiCards.Count.Should().Be(4);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Dashboard_LoadsAssets_OnInitialize()
|
||||
{
|
||||
// Arrange
|
||||
var httpClient = new HttpClientStub();
|
||||
var cut = new TestContext();
|
||||
cut.Services.AddScoped(sp => httpClient);
|
||||
var dashboard = cut.RenderComponent<Dashboard>();
|
||||
|
||||
// Act
|
||||
await Task.Delay(100); // Wait for async init
|
||||
|
||||
// Assert
|
||||
httpClient.Requests.Should().Contain(r => r.Url.Contains("/api/portfolio"));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Test Coverage Targets
|
||||
- Dashboard rendering (4 KPI cards)
|
||||
- Users list (search, filter, pagination)
|
||||
- Portfolio components (asset table, categories)
|
||||
- Form fields (all input types)
|
||||
- Dialogs (confirm/cancel actions)
|
||||
|
||||
#### Run Tests
|
||||
```bash
|
||||
dotnet test src/dotnet/QuantEngine.Web.Client.Tests
|
||||
dotnet test src/dotnet/QuantEngine.Web.Tests
|
||||
```
|
||||
|
||||
### 6.2 Integration Tests
|
||||
|
||||
#### Database Test Setup
|
||||
```csharp
|
||||
[TestFixture]
|
||||
public class RepositoryIntegrationTests
|
||||
{
|
||||
private IDbConnectionFactory _connectionFactory;
|
||||
private ICollectionRepository _repository;
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void OneTimeSetUp()
|
||||
{
|
||||
_connectionFactory = new DbConnectionFactory(
|
||||
"Host=localhost;Database=quantengine_test;..."
|
||||
);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task SaveCollectionRun_Persists_ToDatabase()
|
||||
{
|
||||
// Arrange
|
||||
var run = new CollectionRun { RunId = Guid.NewGuid().ToString(), ... };
|
||||
|
||||
// Act
|
||||
await _repository.SaveRunAsync(run);
|
||||
|
||||
// Assert
|
||||
var retrieved = await _repository.GetRunAsync(run.RunId);
|
||||
retrieved.Should().NotBeNull();
|
||||
retrieved.RunId.Should().Be(run.RunId);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 6.3 Performance Optimization
|
||||
|
||||
#### Bundle Size Optimization
|
||||
```bash
|
||||
# Check bundle sizes
|
||||
dotnet publish -c Release --output ./publish
|
||||
du -sh publish/wwwroot/_framework/*
|
||||
```
|
||||
|
||||
**Targets**:
|
||||
- dotnet.wasm: < 2MB
|
||||
- app.js: < 500KB
|
||||
- Total: < 5MB
|
||||
|
||||
#### Loading Time Optimization
|
||||
```csharp
|
||||
// Use lazy loading for pages
|
||||
[lazy: Dashboard]
|
||||
@rendermode InteractiveWebAssembly
|
||||
|
||||
// Pre-load critical resources
|
||||
<link rel="prefetch" href="/_framework/QuantEngine.Web.Client.wasm" />
|
||||
```
|
||||
|
||||
### 6.4 Accessibility Testing (WCAG 2.1 AA)
|
||||
|
||||
#### Automated Checks
|
||||
```bash
|
||||
dotnet add package Deque.AxeCore.Selenium
|
||||
```
|
||||
|
||||
#### Manual Checklist
|
||||
- [ ] Keyboard navigation (Tab, Enter, Escape)
|
||||
- [ ] Screen reader support (NVDA, JAWS)
|
||||
- [ ] Color contrast (4.5:1 for text)
|
||||
- [ ] Form labels properly associated
|
||||
- [ ] Error messages clear and descriptive
|
||||
- [ ] Focus indicators visible
|
||||
- [ ] No automatic content changes
|
||||
|
||||
---
|
||||
|
||||
## Phase 8: Deployment & Operations
|
||||
|
||||
### 8.1 Production Build
|
||||
|
||||
#### Release Build Configuration
|
||||
```bash
|
||||
# Build Release configuration
|
||||
cd src/dotnet
|
||||
dotnet build -c Release
|
||||
|
||||
# Publish for deployment
|
||||
dotnet publish -c Release -o ./publish/quantengine
|
||||
|
||||
# Size check
|
||||
ls -lh publish/quantengine/
|
||||
```
|
||||
|
||||
#### Build Output
|
||||
- `publish/quantengine/` - Complete deployment package
|
||||
- `publish/quantengine/wwwroot/` - Static assets
|
||||
- `publish/quantengine/QuantEngine.Web.exe` - Server executable
|
||||
- `publish/quantengine/appsettings.production.json` - Configuration
|
||||
|
||||
### 8.2 Docker Deployment
|
||||
|
||||
#### Dockerfile
|
||||
```dockerfile
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj", "QuantEngine.Web/"]
|
||||
RUN dotnet restore "QuantEngine.Web/QuantEngine.Web.csproj"
|
||||
|
||||
COPY src/dotnet/ .
|
||||
RUN dotnet build "QuantEngine.Web/QuantEngine.Web.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "QuantEngine.Web/QuantEngine.Web.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "QuantEngine.Web.dll"]
|
||||
```
|
||||
|
||||
#### Docker Build & Run
|
||||
```bash
|
||||
# Build image
|
||||
docker build -t quantengine:latest .
|
||||
|
||||
# Run container
|
||||
docker run -d \
|
||||
-p 5265:80 \
|
||||
-e ConnectionStrings__DefaultConnection="Host=db;Database=quantenginedb;..." \
|
||||
-e ASPNETCORE_ENVIRONMENT=Production \
|
||||
quantengine:latest
|
||||
|
||||
# Check logs
|
||||
docker logs -f <container_id>
|
||||
```
|
||||
|
||||
### 8.3 Nginx Reverse Proxy
|
||||
|
||||
#### Nginx Configuration
|
||||
```nginx
|
||||
upstream quantengine {
|
||||
server 127.0.0.1:5000;
|
||||
server 127.0.0.1:5001;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name quantengine.example.com;
|
||||
|
||||
# Redirect to HTTPS
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name quantengine.example.com;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/cert.pem;
|
||||
ssl_certificate_key /etc/ssl/private/key.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://quantengine;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# WebSocket support
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location ~* \.(js|css|wasm|svg|woff2)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 8.4 Environment Configuration
|
||||
|
||||
#### appsettings.production.json
|
||||
```json
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=prod-db-host;Database=quantenginedb;Username=quantengine_app;Password=***;SslMode=Require;",
|
||||
"HangfireConnection": "Host=prod-db-host;Database=quantengine_hangfire;..."
|
||||
},
|
||||
"AdminSettings": {
|
||||
"Username": "admin",
|
||||
"Password": "***"
|
||||
},
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://0.0.0.0:5000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 8.5 Deployment Checklist
|
||||
|
||||
#### Pre-Deployment
|
||||
- [ ] All tests pass (`dotnet test`)
|
||||
- [ ] Code reviewed and approved
|
||||
- [ ] Security vulnerabilities scanned (`dotnet package-search`)
|
||||
- [ ] Database migrations tested
|
||||
- [ ] Hangfire schedules configured
|
||||
- [ ] Secrets properly managed (not in code)
|
||||
- [ ] Environment variables documented
|
||||
|
||||
#### Deployment Steps
|
||||
```bash
|
||||
# 1. Create backup
|
||||
pg_dump -h prod-db-host -U quantengine_app quantenginedb > backup-$(date +%Y%m%d).sql
|
||||
|
||||
# 2. Deploy application
|
||||
docker pull quantengine:latest
|
||||
docker stop quantengine
|
||||
docker run -d --name quantengine -p 5000:80 quantengine:latest
|
||||
|
||||
# 3. Health check
|
||||
curl https://quantengine.example.com/health
|
||||
|
||||
# 4. Monitor logs
|
||||
docker logs -f quantengine
|
||||
|
||||
# 5. Verify features
|
||||
- [ ] Login works
|
||||
- [ ] Dashboard loads
|
||||
- [ ] Data collection runs
|
||||
- [ ] Hangfire jobs scheduled
|
||||
```
|
||||
|
||||
#### Post-Deployment
|
||||
- [ ] Monitor error logs (Serilog, Telegram alerts)
|
||||
- [ ] Check Hangfire dashboard
|
||||
- [ ] Verify scheduled jobs running
|
||||
- [ ] Monitor database performance
|
||||
- [ ] Check API response times (< 200ms)
|
||||
|
||||
### 8.6 Monitoring & Observability
|
||||
|
||||
#### Health Checks
|
||||
```csharp
|
||||
app.MapHealthChecks("/health", new HealthCheckOptions
|
||||
{
|
||||
Predicate = _ => true,
|
||||
ResponseWriter = WriteResponse
|
||||
});
|
||||
|
||||
// Add health checks
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddDbContextCheck<QuantEngineDbContext>()
|
||||
.AddCheck("Database", () => HealthCheckResult.Healthy())
|
||||
.AddCheck("KIS API", () => CheckKisApiAsync());
|
||||
```
|
||||
|
||||
#### Logging (Serilog)
|
||||
```csharp
|
||||
Log.Information("Collection run completed: {RunId}, {Count} items", runId, itemCount);
|
||||
Log.Warning("API rate limit warning: {Remaining}", remaining);
|
||||
Log.Error(ex, "Collection failed: {RunId}", runId);
|
||||
```
|
||||
|
||||
#### Monitoring Metrics
|
||||
- Request rate (requests/sec)
|
||||
- Error rate (errors/requests)
|
||||
- Database query time (p50, p95, p99)
|
||||
- Hangfire job success rate
|
||||
- API response time by endpoint
|
||||
|
||||
### 8.7 Rollback Plan
|
||||
|
||||
#### If Deployment Fails
|
||||
```bash
|
||||
# 1. Stop current deployment
|
||||
docker stop quantengine
|
||||
|
||||
# 2. Restore previous version
|
||||
docker run -d --name quantengine -p 5000:80 quantengine:v1.0.0
|
||||
|
||||
# 3. Restore database from backup
|
||||
psql -h prod-db-host -U quantengine_app -d quantenginedb < backup-20260705.sql
|
||||
|
||||
# 4. Verify health
|
||||
curl https://quantengine.example.com/health
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Deployment Timeline
|
||||
|
||||
| Milestone | Target Date | Status |
|
||||
|-----------|-------------|--------|
|
||||
| Phase 6: Tests | 2026-07-06 | 📋 |
|
||||
| Phase 7: Hangfire | 2026-07-05 | ✅ |
|
||||
| Phase 8: Deploy | 2026-07-07 | 📋 |
|
||||
| Production Release | 2026-07-10 | 📅 |
|
||||
|
||||
---
|
||||
|
||||
## Success Criteria
|
||||
|
||||
**Phase 6**:
|
||||
- [ ] 80%+ test coverage
|
||||
- [ ] All component tests passing
|
||||
- [ ] WCAG AA compliance verified
|
||||
- [ ] Bundle size < 5MB
|
||||
|
||||
**Phase 8**:
|
||||
- [ ] Docker image builds successfully
|
||||
- [ ] Production config validated
|
||||
- [ ] Database backups automated
|
||||
- [ ] Rollback plan documented
|
||||
- [ ] Monitoring alerts configured
|
||||
- [ ] 99.5% uptime target established
|
||||
|
||||
---
|
||||
|
||||
**Next**: Execute deployment pipeline and monitor production metrics.
|
||||
@@ -0,0 +1,646 @@
|
||||
# SmartAdmin Bootstrap 5 — Style Guide
|
||||
|
||||
**Version**: 5.5.0
|
||||
**Last Updated**: 2026-07-05
|
||||
**Status**: ✅ Complete
|
||||
|
||||
---
|
||||
|
||||
## 📖 Overview
|
||||
|
||||
This document provides comprehensive guidelines for using SmartAdmin Bootstrap 5 components and utilities. All styles are organized in modular CSS files for better maintainability and performance.
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Color System
|
||||
|
||||
### Primary Palette
|
||||
|
||||
| Color | Hex Value | Usage |
|
||||
|-------|-----------|-------|
|
||||
| **Primary** | `#2196f3` | Main actions, links, highlights |
|
||||
| **Secondary** | `#757575` | Neutral, less prominent elements |
|
||||
| **Success** | `#4caf50` | Positive actions, confirmations |
|
||||
| **Danger** | `#f44336` | Destructive actions, errors |
|
||||
| **Warning** | `#ff9800` | Caution, warnings |
|
||||
| **Info** | `#00bcd4` | Information, notifications |
|
||||
|
||||
### Neutral Palette
|
||||
|
||||
| Color | Hex Value | Usage |
|
||||
|-------|-----------|-------|
|
||||
| **Light** | `#f5f5f5` | Light backgrounds |
|
||||
| **Dark** | `#212121` | Dark backgrounds, text |
|
||||
| **White** | `#ffffff` | Main background |
|
||||
| **Transparent** | `rgba(0,0,0,0)` | No background |
|
||||
|
||||
### Gray Scale
|
||||
|
||||
```
|
||||
Gray 100: #f8f9fa (Lightest)
|
||||
Gray 200: #e9ecef
|
||||
Gray 300: #dee2e6
|
||||
Gray 400: #ced4da
|
||||
Gray 500: #adb5bd (Medium)
|
||||
Gray 600: #6c757d
|
||||
Gray 700: #495057
|
||||
Gray 800: #343a40
|
||||
Gray 900: #212529 (Darkest)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔘 Buttons
|
||||
|
||||
### Variants
|
||||
|
||||
**Primary Button**
|
||||
```html
|
||||
<button class="btn btn-primary">Primary</button>
|
||||
```
|
||||
|
||||
**Success Button**
|
||||
```html
|
||||
<button class="btn btn-success">Success</button>
|
||||
```
|
||||
|
||||
**Danger Button**
|
||||
```html
|
||||
<button class="btn btn-danger">Delete</button>
|
||||
```
|
||||
|
||||
**Warning Button**
|
||||
```html
|
||||
<button class="btn btn-warning">Warning</button>
|
||||
```
|
||||
|
||||
### Sizes
|
||||
|
||||
```html
|
||||
<button class="btn btn-primary btn-xs">Extra Small</button>
|
||||
<button class="btn btn-primary btn-sm">Small</button>
|
||||
<button class="btn btn-primary">Default</button>
|
||||
<button class="btn btn-primary btn-lg">Large</button>
|
||||
```
|
||||
|
||||
### States
|
||||
|
||||
```html
|
||||
<!-- Disabled -->
|
||||
<button class="btn btn-primary" disabled>Disabled</button>
|
||||
|
||||
<!-- Loading -->
|
||||
<button class="btn btn-primary" disabled>
|
||||
<span class="spinner-border spinner-border-sm me-2"></span>
|
||||
Loading...
|
||||
</button>
|
||||
|
||||
<!-- With Icon -->
|
||||
<button class="btn btn-primary">
|
||||
<i class="fa-solid fa-save me-2"></i>Save
|
||||
</button>
|
||||
```
|
||||
|
||||
### Button Groups
|
||||
|
||||
```html
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-primary">Left</button>
|
||||
<button type="button" class="btn btn-primary">Middle</button>
|
||||
<button type="button" class="btn btn-primary">Right</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📇 Cards
|
||||
|
||||
### Basic Card
|
||||
|
||||
```html
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Header
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Title</h5>
|
||||
<p class="card-text">Content goes here...</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
Footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Card Variants
|
||||
|
||||
```html
|
||||
<!-- Card with Badge -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<span class="badge badge-primary">New</span>
|
||||
<h5 class="card-title">Card Title</h5>
|
||||
<p class="card-text">Content here...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hoverable Card -->
|
||||
<div class="card" style="cursor: pointer;">
|
||||
<!-- Content -->
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🏷️ Badges
|
||||
|
||||
### Variants
|
||||
|
||||
```html
|
||||
<span class="badge badge-primary">Primary</span>
|
||||
<span class="badge badge-success">Success</span>
|
||||
<span class="badge badge-danger">Danger</span>
|
||||
<span class="badge badge-warning">Warning</span>
|
||||
<span class="badge badge-info">Info</span>
|
||||
```
|
||||
|
||||
### Pill Badges
|
||||
|
||||
```html
|
||||
<span class="badge badge-primary badge-pill">Primary</span>
|
||||
<span class="badge badge-success badge-pill">Success</span>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Alerts
|
||||
|
||||
### Variants
|
||||
|
||||
```html
|
||||
<!-- Info Alert -->
|
||||
<div class="alert alert-primary">
|
||||
<i class="fa-solid fa-info-circle me-2"></i>
|
||||
<strong>Info:</strong> Informational message
|
||||
</div>
|
||||
|
||||
<!-- Success Alert -->
|
||||
<div class="alert alert-success">
|
||||
<strong>Success!</strong> Operation completed
|
||||
</div>
|
||||
|
||||
<!-- Warning Alert -->
|
||||
<div class="alert alert-warning">
|
||||
<strong>Warning!</strong> Please be careful
|
||||
</div>
|
||||
|
||||
<!-- Danger Alert -->
|
||||
<div class="alert alert-danger">
|
||||
<strong>Error!</strong> Something went wrong
|
||||
</div>
|
||||
```
|
||||
|
||||
### Dismissible Alert
|
||||
|
||||
```html
|
||||
<div class="alert alert-primary alert-dismissible">
|
||||
<strong>Info:</strong> Message goes here
|
||||
<button type="button" class="btn-close" data-dismiss="alert"></button>
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📝 Forms
|
||||
|
||||
### Input Fields
|
||||
|
||||
```html
|
||||
<div class="form-group">
|
||||
<label class="form-label">Email Address</label>
|
||||
<input type="email" class="form-control" placeholder="user@example.com">
|
||||
</div>
|
||||
```
|
||||
|
||||
### Input Sizes
|
||||
|
||||
```html
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Small input">
|
||||
<input type="text" class="form-control" placeholder="Default input">
|
||||
<input type="text" class="form-control form-control-lg" placeholder="Large input">
|
||||
```
|
||||
|
||||
### Select
|
||||
|
||||
```html
|
||||
<div class="form-group">
|
||||
<label class="form-label">Choose Option</label>
|
||||
<select class="form-select">
|
||||
<option>Select...</option>
|
||||
<option value="1">Option 1</option>
|
||||
<option value="2">Option 2</option>
|
||||
</select>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Textarea
|
||||
|
||||
```html
|
||||
<div class="form-group">
|
||||
<label class="form-label">Message</label>
|
||||
<textarea class="form-control" rows="4"></textarea>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Checkboxes
|
||||
|
||||
```html
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check1">
|
||||
<label class="form-check-label" for="check1">
|
||||
Check this option
|
||||
</label>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Radio Buttons
|
||||
|
||||
```html
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="options" id="radio1">
|
||||
<label class="form-check-label" for="radio1">
|
||||
Option 1
|
||||
</label>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Form Validation
|
||||
|
||||
```html
|
||||
<!-- Valid -->
|
||||
<input type="text" class="form-control is-valid">
|
||||
<div class="valid-feedback">Looks good!</div>
|
||||
|
||||
<!-- Invalid -->
|
||||
<input type="text" class="form-control is-invalid">
|
||||
<div class="invalid-feedback">Please correct this</div>
|
||||
```
|
||||
|
||||
### Input Groups
|
||||
|
||||
```html
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="number" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search...">
|
||||
<button class="btn btn-primary">
|
||||
<i class="fa-solid fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 Tables
|
||||
|
||||
### Basic Table
|
||||
|
||||
```html
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#001</td>
|
||||
<td>John Doe</td>
|
||||
<td>john@example.com</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
```
|
||||
|
||||
### Table Variants
|
||||
|
||||
```html
|
||||
<!-- Striped -->
|
||||
<table class="table table-striped">...</table>
|
||||
|
||||
<!-- Hover -->
|
||||
<table class="table table-hover">...</table>
|
||||
|
||||
<!-- Bordered -->
|
||||
<table class="table table-bordered">...</table>
|
||||
|
||||
<!-- Striped + Hover -->
|
||||
<table class="table table-striped table-hover">...</table>
|
||||
```
|
||||
|
||||
### Responsive Table
|
||||
|
||||
```html
|
||||
<div class="table-responsive">
|
||||
<table class="table">...</table>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Table Pagination
|
||||
|
||||
```html
|
||||
<div class="table-pagination">
|
||||
<span>Showing 1-10 of 100</span>
|
||||
<ul class="pagination">
|
||||
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
|
||||
<li class="page-item active"><a class="page-link" href="#">1</a></li>
|
||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||
<li class="page-item"><a class="page-link" href="#">Next</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎭 Modals
|
||||
|
||||
### Basic Modal
|
||||
|
||||
```html
|
||||
<div class="modal" id="exampleModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Modal Title</h5>
|
||||
<button class="btn-close" data-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Modal content goes here...
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Modal Sizes
|
||||
|
||||
```html
|
||||
<!-- Small -->
|
||||
<div class="modal-dialog modal-sm">...</div>
|
||||
|
||||
<!-- Default -->
|
||||
<div class="modal-dialog">...</div>
|
||||
|
||||
<!-- Large -->
|
||||
<div class="modal-dialog modal-lg">...</div>
|
||||
|
||||
<!-- Extra Large -->
|
||||
<div class="modal-dialog modal-xl">...</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🌈 Utilities
|
||||
|
||||
### Spacing
|
||||
|
||||
```html
|
||||
<!-- Margin -->
|
||||
<div class="m-1">Margin 1</div>
|
||||
<div class="m-2">Margin 2</div>
|
||||
<div class="m-3">Margin 3</div>
|
||||
|
||||
<!-- Padding -->
|
||||
<div class="p-1">Padding 1</div>
|
||||
<div class="p-2">Padding 2</div>
|
||||
<div class="p-3">Padding 3</div>
|
||||
|
||||
<!-- Specific Sides -->
|
||||
<div class="mt-3">Margin Top</div>
|
||||
<div class="mb-3">Margin Bottom</div>
|
||||
<div class="ms-3">Margin Start</div>
|
||||
<div class="me-3">Margin End</div>
|
||||
```
|
||||
|
||||
### Display
|
||||
|
||||
```html
|
||||
<div class="d-none">Hidden</div>
|
||||
<div class="d-block">Block</div>
|
||||
<div class="d-flex">Flex</div>
|
||||
<div class="d-grid">Grid</div>
|
||||
|
||||
<!-- Responsive -->
|
||||
<div class="d-none d-sm-block">Hidden on mobile, visible on tablet+</div>
|
||||
<div class="d-sm-none">Visible on mobile, hidden on tablet+</div>
|
||||
```
|
||||
|
||||
### Flexbox
|
||||
|
||||
```html
|
||||
<div class="d-flex">
|
||||
<div class="flex-fill">Fill available space</div>
|
||||
<div class="flex-shrink-0">Don't shrink</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>Left</div>
|
||||
<div>Right</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<i class="fa-solid fa-check"></i>
|
||||
<span>Centered vertically</span>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Text Utilities
|
||||
|
||||
```html
|
||||
<!-- Alignment -->
|
||||
<p class="text-start">Left</p>
|
||||
<p class="text-center">Center</p>
|
||||
<p class="text-end">Right</p>
|
||||
|
||||
<!-- Transform -->
|
||||
<p class="text-uppercase">UPPERCASE</p>
|
||||
<p class="text-lowercase">lowercase</p>
|
||||
<p class="text-capitalize">Capitalize</p>
|
||||
|
||||
<!-- Weight -->
|
||||
<p class="text-bold">Bold</p>
|
||||
<p class="text-semi-bold">Semi-bold</p>
|
||||
<p class="text-normal">Normal</p>
|
||||
|
||||
<!-- Color -->
|
||||
<p class="text-primary">Primary text</p>
|
||||
<p class="text-success">Success text</p>
|
||||
<p class="text-danger">Danger text</p>
|
||||
<p class="text-muted">Muted text</p>
|
||||
```
|
||||
|
||||
### Background Colors
|
||||
|
||||
```html
|
||||
<div class="bg-primary text-white">Primary Background</div>
|
||||
<div class="bg-success text-white">Success Background</div>
|
||||
<div class="bg-danger text-white">Danger Background</div>
|
||||
<div class="bg-warning text-white">Warning Background</div>
|
||||
<div class="bg-light">Light Background</div>
|
||||
```
|
||||
|
||||
### Borders
|
||||
|
||||
```html
|
||||
<div class="border">All borders</div>
|
||||
<div class="border-top">Top border only</div>
|
||||
<div class="border-0">No border</div>
|
||||
<div class="border border-primary">Primary border</div>
|
||||
|
||||
<!-- Rounded -->
|
||||
<div class="rounded">Rounded corners</div>
|
||||
<div class="rounded-circle">Circle</div>
|
||||
<div class="rounded-pill">Pill shape</div>
|
||||
```
|
||||
|
||||
### Shadows
|
||||
|
||||
```html
|
||||
<div class="shadow">Small shadow</div>
|
||||
<div class="shadow-lg">Large shadow</div>
|
||||
<div class="shadow-none">No shadow</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🌙 Dark Mode
|
||||
|
||||
SmartAdmin supports dark mode through the `data-bs-theme` attribute:
|
||||
|
||||
```html
|
||||
<!-- Light Mode (default) -->
|
||||
<html data-bs-theme="light">
|
||||
|
||||
<!-- Dark Mode -->
|
||||
<html data-bs-theme="dark">
|
||||
```
|
||||
|
||||
### Toggle Dark Mode with JavaScript
|
||||
|
||||
```javascript
|
||||
const html = document.documentElement;
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
|
||||
// Save preference
|
||||
localStorage.setItem('theme', newTheme);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📱 Responsive Breakpoints
|
||||
|
||||
| Breakpoint | Viewport | Class Prefix |
|
||||
|------------|----------|--------------|
|
||||
| **Mobile** | < 576px | None |
|
||||
| **Tablet (sm)** | ≥ 576px | `-sm-` |
|
||||
| **Tablet (md)** | ≥ 768px | `-md-` |
|
||||
| **Desktop (lg)** | ≥ 992px | `-lg-` |
|
||||
| **Desktop (xl)** | ≥ 1200px | `-xl-` |
|
||||
| **Desktop (xxl)** | ≥ 1400px | `-xxl-` |
|
||||
|
||||
### Examples
|
||||
|
||||
```html
|
||||
<!-- Hide on mobile, show on tablet+ -->
|
||||
<div class="d-none d-sm-block">...</div>
|
||||
|
||||
<!-- Different columns on different screens -->
|
||||
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
|
||||
Responsive column
|
||||
</div>
|
||||
|
||||
<!-- Different padding on different screens -->
|
||||
<div class="p-2 p-md-3 p-lg-4">
|
||||
Responsive padding
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✅ Best Practices
|
||||
|
||||
1. **Use Semantic HTML**: Always use appropriate HTML elements
|
||||
2. **Accessibility First**: Include ARIA labels and keyboard navigation
|
||||
3. **Mobile First**: Design for mobile first, then enhance for larger screens
|
||||
4. **Consistent Spacing**: Use spacing scale (1, 2, 3, 4, 5) consistently
|
||||
5. **Color Contrast**: Ensure text has sufficient contrast (WCAG AA minimum)
|
||||
6. **Component Reuse**: Use existing components instead of creating new ones
|
||||
7. **Document Changes**: Update this guide when adding new components
|
||||
8. **Test on Real Devices**: Don't rely only on browser DevTools
|
||||
|
||||
---
|
||||
|
||||
## 📚 Component Library
|
||||
|
||||
Visit **`components-showcase.html`** to see all components in action with interactive examples.
|
||||
|
||||
### Quick Links
|
||||
|
||||
- [Live Component Demo](./components-showcase.html)
|
||||
- [Bootstrap 5 Official Docs](https://getbootstrap.com/docs/5.0/)
|
||||
- [Icon Library (FontAwesome)](https://fontawesome.com/)
|
||||
|
||||
---
|
||||
|
||||
## 🔄 CSS File Structure
|
||||
|
||||
```
|
||||
css/
|
||||
├── base.css (Foundation, resets, typography)
|
||||
├── components.css (Buttons, cards, badges, alerts)
|
||||
├── forms.css (Input fields, validation)
|
||||
├── tables.css (Table styles, responsive)
|
||||
├── layout.css (Header, sidebar, grid)
|
||||
├── darkmode.css (Dark theme overrides)
|
||||
├── responsive.css (Mobile-first media queries)
|
||||
├── utilities.css (Spacing, colors, helpers)
|
||||
└── smartapp.min.css (Legacy, for compatibility)
|
||||
```
|
||||
|
||||
**Load Order (HTML <head>):**
|
||||
1. base.css
|
||||
2. components.css
|
||||
3. forms.css
|
||||
4. tables.css
|
||||
5. layout.css
|
||||
6. darkmode.css
|
||||
7. responsive.css
|
||||
8. utilities.css
|
||||
9. smartapp.min.css (fallback)
|
||||
|
||||
---
|
||||
|
||||
## 📞 Support
|
||||
|
||||
For issues or questions:
|
||||
1. Check the component library first
|
||||
2. Review this style guide
|
||||
3. Check Bootstrap 5 official documentation
|
||||
4. Create an issue in the repository
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2026-07-05
|
||||
**Version:** 5.5.0
|
||||
**Status:** ✅ Complete & Ready for Use
|
||||
@@ -0,0 +1,250 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Login | SmartAdmin</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
margin: 0;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] body {
|
||||
background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
|
||||
}
|
||||
|
||||
.login-container {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-radius: var(--bs-border-radius-xl);
|
||||
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
|
||||
padding: 2.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.login-header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.login-header h1 {
|
||||
font-size: 1.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.login-header p {
|
||||
color: var(--bs-gray-600);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.login-footer {
|
||||
text-align: center;
|
||||
font-size: 0.9rem;
|
||||
color: var(--bs-gray-600);
|
||||
}
|
||||
|
||||
.login-footer a {
|
||||
color: #667eea;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.login-footer a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.divider {
|
||||
position: relative;
|
||||
margin: 1.5rem 0;
|
||||
text-align: center;
|
||||
color: var(--bs-gray-600);
|
||||
}
|
||||
|
||||
.divider::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
background-color: var(--bs-gray-300);
|
||||
}
|
||||
|
||||
.divider span {
|
||||
background-color: var(--bs-body-bg);
|
||||
padding: 0 1rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.social-login {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.social-btn {
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--bs-gray-300);
|
||||
border-radius: var(--bs-border-radius);
|
||||
background-color: var(--bs-body-bg);
|
||||
color: var(--bs-body-color);
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
transition: all 0.3s;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.social-btn:hover {
|
||||
border-color: #667eea;
|
||||
color: #667eea;
|
||||
background-color: rgba(102, 126, 234, 0.05);
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
font-size: 1.5rem;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .theme-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<button class="theme-toggle" id="themeToggle" title="Toggle Dark Mode">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
|
||||
<div class="login-container">
|
||||
<div class="login-card">
|
||||
<div class="login-header">
|
||||
<h1><i class="fa-solid fa-shield me-2"></i>SmartAdmin</h1>
|
||||
<p>Sign in to your account</p>
|
||||
</div>
|
||||
|
||||
<form id="loginForm">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Email Address</label>
|
||||
<input type="email" class="form-control" placeholder="Enter your email" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Password</label>
|
||||
<input type="password" class="form-control" placeholder="Enter your password" required>
|
||||
</div>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
<input type="checkbox" class="form-check-input" id="remember">
|
||||
<label class="form-check-label" for="remember">Remember me</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary w-100 py-2">
|
||||
<i class="fa-solid fa-sign-in-alt me-2"></i>Sign In
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="divider"><span>or</span></div>
|
||||
|
||||
<div class="social-login">
|
||||
<a href="#" class="social-btn">
|
||||
<i class="fa-brands fa-google"></i>Google
|
||||
</a>
|
||||
<a href="#" class="social-btn">
|
||||
<i class="fa-brands fa-github"></i>GitHub
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="login-footer mt-4">
|
||||
<p>Don't have an account? <a href="#">Sign up here</a></p>
|
||||
<p><a href="#">Forgot your password?</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const icon = themeToggle.querySelector('i');
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('loginForm').addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
alert('Login form submitted! This is a demo.');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,553 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Component Library | SmartAdmin Bootstrap 5</title>
|
||||
<meta name="description" content="SmartAdmin Bootstrap 5 Component Library">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=5">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png" sizes="32x32">
|
||||
|
||||
<!-- SmartAdmin Bootstrap 5 - Modular CSS -->
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/tables.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<!-- Vendor CSS -->
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 2rem 0;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 4rem;
|
||||
padding: 2rem;
|
||||
border-bottom: 2px solid var(--bs-gray-200);
|
||||
}
|
||||
|
||||
.section h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.section h3 {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.component-group {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.component-demo {
|
||||
padding: 1.5rem;
|
||||
background-color: var(--bs-gray-50);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
border: 1px solid var(--bs-gray-200);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .component-demo {
|
||||
background-color: var(--bs-gray-800);
|
||||
border-color: var(--bs-gray-700);
|
||||
}
|
||||
|
||||
.component-demo > * + * {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.demo-label {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
color: var(--bs-gray-600);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.color-swatch {
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: var(--bs-border-radius);
|
||||
border: 1px solid var(--bs-gray-300);
|
||||
vertical-align: middle;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.color-palette {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.color-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.color-item strong {
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1320px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
header {
|
||||
background: linear-gradient(135deg, var(--bs-primary) 0%, #1565c0 100%);
|
||||
color: white;
|
||||
padding: 3rem 2rem;
|
||||
margin-bottom: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
header p {
|
||||
margin: 0.5rem 0 0 0;
|
||||
font-size: 1.125rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
position: fixed;
|
||||
top: 2rem;
|
||||
right: 2rem;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.theme-toggle .btn {
|
||||
border-radius: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: var(--bs-box-shadow-lg);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.component-group {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Theme Toggle -->
|
||||
<div class="theme-toggle">
|
||||
<button class="btn btn-primary" id="themeToggle" title="Toggle Dark Mode">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Header -->
|
||||
<header>
|
||||
<h1>SmartAdmin Bootstrap 5</h1>
|
||||
<p>Component Library & Style Guide</p>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<!-- Colors Section -->
|
||||
<section class="section">
|
||||
<h2>🎨 Color Palette</h2>
|
||||
|
||||
<h3>Primary Colors</h3>
|
||||
<div class="color-palette">
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-primary);"></div>
|
||||
<strong>Primary</strong>
|
||||
<small>#2196f3</small>
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-secondary);"></div>
|
||||
<strong>Secondary</strong>
|
||||
<small>#757575</small>
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-success);"></div>
|
||||
<strong>Success</strong>
|
||||
<small>#4caf50</small>
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-danger);"></div>
|
||||
<strong>Danger</strong>
|
||||
<small>#f44336</small>
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-warning);"></div>
|
||||
<strong>Warning</strong>
|
||||
<small>#ff9800</small>
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<div class="color-swatch" style="background-color: var(--bs-info);"></div>
|
||||
<strong>Info</strong>
|
||||
<small>#00bcd4</small>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Buttons Section -->
|
||||
<section class="section">
|
||||
<h2>🔘 Buttons</h2>
|
||||
|
||||
<h3>Button Variants</h3>
|
||||
<div class="component-group">
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Primary</div>
|
||||
<button class="btn btn-primary">Primary Button</button>
|
||||
<button class="btn btn-primary btn-sm">Small</button>
|
||||
<button class="btn btn-primary btn-lg">Large</button>
|
||||
</div>
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Success</div>
|
||||
<button class="btn btn-success">Success Button</button>
|
||||
<button class="btn btn-success btn-sm">Small</button>
|
||||
<button class="btn btn-success" disabled>Disabled</button>
|
||||
</div>
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Danger</div>
|
||||
<button class="btn btn-danger">Danger Button</button>
|
||||
<button class="btn btn-danger btn-sm">Small</button>
|
||||
<button class="btn btn-danger" disabled>Disabled</button>
|
||||
</div>
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Warning</div>
|
||||
<button class="btn btn-warning">Warning Button</button>
|
||||
<button class="btn btn-warning btn-sm">Small</button>
|
||||
<button class="btn btn-warning" disabled>Disabled</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Button Group</h3>
|
||||
<div class="component-demo">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-primary">Left</button>
|
||||
<button type="button" class="btn btn-primary">Middle</button>
|
||||
<button type="button" class="btn btn-primary">Right</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Cards Section -->
|
||||
<section class="section">
|
||||
<h2>📇 Cards</h2>
|
||||
<div class="component-group">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Card Header
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Card Title</h5>
|
||||
<p class="card-text">This is a sample card body with some content.</p>
|
||||
<button class="btn btn-primary btn-sm">Learn More</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Simple Card</h5>
|
||||
<p class="card-text">Card without header or footer.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
Card Footer
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Card with Badge</h5>
|
||||
<p class="card-text">
|
||||
<span class="badge badge-primary">Primary</span>
|
||||
<span class="badge badge-success">Success</span>
|
||||
<span class="badge badge-danger">Danger</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Badges Section -->
|
||||
<section class="section">
|
||||
<h2>🏷️ Badges</h2>
|
||||
<div class="component-group">
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Badge Variants</div>
|
||||
<span class="badge badge-primary me-2">Primary</span>
|
||||
<span class="badge badge-success me-2">Success</span>
|
||||
<span class="badge badge-danger me-2">Danger</span>
|
||||
<span class="badge badge-warning me-2">Warning</span>
|
||||
<span class="badge badge-info">Info</span>
|
||||
</div>
|
||||
<div class="component-demo">
|
||||
<div class="demo-label">Pill Badges</div>
|
||||
<span class="badge badge-primary badge-pill me-2">Primary</span>
|
||||
<span class="badge badge-success badge-pill me-2">Success</span>
|
||||
<span class="badge badge-danger badge-pill">Danger</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Alerts Section -->
|
||||
<section class="section">
|
||||
<h2>⚠️ Alerts</h2>
|
||||
<div class="component-group" style="grid-template-columns: 1fr;">
|
||||
<div class="alert alert-primary">
|
||||
<i class="fa-solid fa-info-circle me-2"></i>
|
||||
<strong>Info Alert:</strong> This is an informational message.
|
||||
</div>
|
||||
<div class="alert alert-success">
|
||||
<i class="fa-solid fa-check-circle me-2"></i>
|
||||
<strong>Success Alert:</strong> Operation completed successfully!
|
||||
</div>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa-solid fa-exclamation-triangle me-2"></i>
|
||||
<strong>Warning Alert:</strong> Please be careful with this action.
|
||||
</div>
|
||||
<div class="alert alert-danger">
|
||||
<i class="fa-solid fa-exclamation-circle me-2"></i>
|
||||
<strong>Danger Alert:</strong> An error occurred, please try again.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Forms Section -->
|
||||
<section class="section">
|
||||
<h2>📝 Forms</h2>
|
||||
|
||||
<h3>Input Fields</h3>
|
||||
<div class="component-demo" style="max-width: 400px;">
|
||||
<div class="form-group">
|
||||
<label class="form-label required">Text Input</label>
|
||||
<input type="text" class="form-control" placeholder="Enter text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Email Input</label>
|
||||
<input type="email" class="form-control" placeholder="user@example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Password Input</label>
|
||||
<input type="password" class="form-control" placeholder="••••••••">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Select</label>
|
||||
<select class="form-select">
|
||||
<option>Choose option</option>
|
||||
<option>Option 1</option>
|
||||
<option>Option 2</option>
|
||||
<option>Option 3</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Textarea</label>
|
||||
<textarea class="form-control" rows="3" placeholder="Enter your message..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Checkboxes & Radio</h3>
|
||||
<div class="component-demo" style="max-width: 300px;">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check1">
|
||||
<label class="form-check-label" for="check1">Checkbox 1</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check2" checked>
|
||||
<label class="form-check-label" for="check2">Checkbox 2 (Checked)</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="radio" id="radio1" checked>
|
||||
<label class="form-check-label" for="radio1">Radio 1</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="radio" id="radio2">
|
||||
<label class="form-check-label" for="radio2">Radio 2</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Form Validation</h3>
|
||||
<div class="component-demo" style="max-width: 400px;">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Valid Input</label>
|
||||
<input type="text" class="form-control is-valid" value="Valid input">
|
||||
<div class="valid-feedback">Looks good!</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Invalid Input</label>
|
||||
<input type="text" class="form-control is-invalid" value="Invalid">
|
||||
<div class="invalid-feedback">This field is required.</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Tables Section -->
|
||||
<section class="section">
|
||||
<h2>📊 Tables</h2>
|
||||
<div class="component-demo">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#001</td>
|
||||
<td>John Doe</td>
|
||||
<td>john@example.com</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#002</td>
|
||||
<td>Jane Smith</td>
|
||||
<td>jane@example.com</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#003</td>
|
||||
<td>Bob Johnson</td>
|
||||
<td>bob@example.com</td>
|
||||
<td><span class="badge badge-danger">Inactive</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Typography Section -->
|
||||
<section class="section">
|
||||
<h2>📝 Typography</h2>
|
||||
|
||||
<h3>Headings</h3>
|
||||
<div class="component-demo">
|
||||
<h1>Heading 1</h1>
|
||||
<h2>Heading 2</h2>
|
||||
<h3>Heading 3</h3>
|
||||
<h4>Heading 4</h4>
|
||||
<h5>Heading 5</h5>
|
||||
<h6>Heading 6</h6>
|
||||
</div>
|
||||
|
||||
<h3>Text Styles</h3>
|
||||
<div class="component-demo">
|
||||
<p><strong>Bold Text:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
<p><em>Italic Text:</em> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
<p><u>Underlined Text:</u> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
<p><del>Deleted Text:</del> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
<p><small>Small Text:</small> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Utilities Section -->
|
||||
<section class="section">
|
||||
<h2>⚙️ Utilities</h2>
|
||||
|
||||
<h3>Text Alignment</h3>
|
||||
<div class="component-demo">
|
||||
<p class="text-start">Left aligned text</p>
|
||||
<p class="text-center">Center aligned text</p>
|
||||
<p class="text-end">Right aligned text</p>
|
||||
</div>
|
||||
|
||||
<h3>Text Colors</h3>
|
||||
<div class="component-demo">
|
||||
<p class="text-primary">Primary text</p>
|
||||
<p class="text-success">Success text</p>
|
||||
<p class="text-danger">Danger text</p>
|
||||
<p class="text-warning">Warning text</p>
|
||||
<p class="text-muted">Muted text</p>
|
||||
</div>
|
||||
|
||||
<h3>Background Colors</h3>
|
||||
<div class="component-demo">
|
||||
<div class="bg-primary text-white p-3 mb-2">Primary Background</div>
|
||||
<div class="bg-success text-white p-3 mb-2">Success Background</div>
|
||||
<div class="bg-danger text-white p-3 mb-2">Danger Background</div>
|
||||
<div class="bg-warning text-white p-3 mb-2">Warning Background</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Theme Toggle
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
// Check saved preference
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const icon = themeToggle.querySelector('i');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
themeToggle.classList.remove('btn-primary');
|
||||
themeToggle.classList.add('btn-warning');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
themeToggle.classList.add('btn-primary');
|
||||
themeToggle.classList.remove('btn-warning');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,398 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Control Center Dashboard | SmartAdmin</title>
|
||||
<meta name="description" content="SmartAdmin Dashboard">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=5">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png" sizes="32x32">
|
||||
|
||||
<!-- SmartAdmin Bootstrap 5 - Modular CSS -->
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/tables.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: var(--bs-gray-50);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] body {
|
||||
background-color: var(--bs-gray-900);
|
||||
}
|
||||
|
||||
.app-header {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
box-shadow: var(--bs-box-shadow);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background-color: var(--bs-body-bg);
|
||||
border: 1px solid var(--bs-gray-200);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
padding: 1.5rem;
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
box-shadow: var(--bs-box-shadow-lg);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: var(--bs-gray-600);
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.chart-placeholder {
|
||||
background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(76, 175, 80, 0.1) 100%);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
color: var(--bs-gray-600);
|
||||
border: 2px dashed var(--bs-gray-300);
|
||||
}
|
||||
|
||||
.recent-activity {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.activity-item {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
}
|
||||
|
||||
.activity-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.activity-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
background-color: var(--bs-gray-100);
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.activity-content h6 {
|
||||
margin: 0 0 0.25rem 0;
|
||||
}
|
||||
|
||||
.activity-time {
|
||||
color: var(--bs-gray-600);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.nav-top {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin-left: auto;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nav-top a {
|
||||
color: var(--bs-body-color);
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.nav-top a:hover {
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--bs-body-color);
|
||||
cursor: pointer;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.nav-top {
|
||||
gap: 1rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<a href="index-new.html" class="app-logo">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>SmartAdmin
|
||||
</a>
|
||||
<nav>
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="index-new.html">Home</a></li>
|
||||
<li class="breadcrumb-item active">Dashboard</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<ul class="nav-top">
|
||||
<li><a href="components-showcase.html">Components</a></li>
|
||||
<li><a href="auth-login-new.html">Login</a></li>
|
||||
</ul>
|
||||
<button class="theme-toggle" id="themeToggle" title="Toggle Dark Mode">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main style="padding: 2rem;">
|
||||
<div class="container-xxl">
|
||||
<div class="page-title">Control Center Dashboard</div>
|
||||
|
||||
<!-- Statistics Cards -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 col-sm-6 col-md-3 mb-3">
|
||||
<div class="stat-card">
|
||||
<div class="stat-value">$45,230</div>
|
||||
<div class="stat-label">Total Revenue</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 mb-3">
|
||||
<div class="stat-card">
|
||||
<div class="stat-value">1,234</div>
|
||||
<div class="stat-label">New Users</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 mb-3">
|
||||
<div class="stat-card">
|
||||
<div class="stat-value">89.2%</div>
|
||||
<div class="stat-label">Conversion Rate</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 mb-3">
|
||||
<div class="stat-card">
|
||||
<div class="stat-value">412</div>
|
||||
<div class="stat-label">Active Sessions</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Charts Row -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 col-lg-8 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>Revenue Trend
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="chart-placeholder">
|
||||
<i class="fa-solid fa-chart-area" style="font-size: 3rem; opacity: 0.3;"></i>
|
||||
<p style="margin-top: 1rem;">Chart visualization goes here</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-chart-pie me-2"></i>Distribution
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="chart-placeholder">
|
||||
<i class="fa-solid fa-circle-notch" style="font-size: 3rem; opacity: 0.3;"></i>
|
||||
<p style="margin-top: 1rem;">Pie chart goes here</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Activity -->
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-6 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-history me-2"></i>Recent Activity
|
||||
</div>
|
||||
<div class="recent-activity">
|
||||
<div class="activity-item">
|
||||
<div class="activity-icon">
|
||||
<i class="fa-solid fa-user-check"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6>New user registered</h6>
|
||||
<p>John Doe joined the platform</p>
|
||||
<span class="activity-time">2 minutes ago</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="activity-item">
|
||||
<div class="activity-icon" style="background-color: rgba(76, 175, 80, 0.1); color: var(--bs-success);">
|
||||
<i class="fa-solid fa-check-circle"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6>Payment processed</h6>
|
||||
<p>$2,450 transaction completed</p>
|
||||
<span class="activity-time">15 minutes ago</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="activity-item">
|
||||
<div class="activity-icon" style="background-color: rgba(244, 67, 54, 0.1); color: var(--bs-danger);">
|
||||
<i class="fa-solid fa-exclamation-circle"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6>High server load detected</h6>
|
||||
<p>CPU usage at 85%</p>
|
||||
<span class="activity-time">1 hour ago</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="activity-item">
|
||||
<div class="activity-icon" style="background-color: rgba(255, 152, 0, 0.1); color: var(--bs-warning);">
|
||||
<i class="fa-solid fa-bell"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6>System update available</h6>
|
||||
<p>Version 2.5.0 is ready to install</p>
|
||||
<span class="activity-time">3 hours ago</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-lg-6 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-list me-2"></i>Top Performing Pages
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Page</th>
|
||||
<th>Views</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>/dashboard</td>
|
||||
<td>12,450</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/products</td>
|
||||
<td>8,230</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/analytics</td>
|
||||
<td>6,120</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/settings</td>
|
||||
<td>3,450</td>
|
||||
<td><span class="badge badge-warning">Moderate</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/help</td>
|
||||
<td>1,220</td>
|
||||
<td><span class="badge badge-info">Low</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const icon = themeToggle.querySelector('i');
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,309 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Form Inputs | SmartAdmin</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: var(--bs-gray-50);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] body {
|
||||
background-color: var(--bs-gray-900);
|
||||
}
|
||||
|
||||
.app-header {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
box-shadow: var(--bs-box-shadow);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
border: 1px solid var(--bs-gray-200);
|
||||
padding: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.form-section h3 {
|
||||
margin-bottom: 1.5rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 2px solid var(--bs-gray-200);
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--bs-body-color);
|
||||
cursor: pointer;
|
||||
font-size: 1.25rem;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.form-section {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<a href="index-new.html" class="app-logo">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>SmartAdmin
|
||||
</a>
|
||||
<button class="theme-toggle" id="themeToggle">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main style="padding: 2rem;">
|
||||
<div class="container-lg">
|
||||
<h1 class="page-title">Form Inputs & Validation</h1>
|
||||
|
||||
<!-- Basic Inputs -->
|
||||
<div class="form-section">
|
||||
<h3>Basic Input Fields</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label required">First Name</label>
|
||||
<input type="text" class="form-control" placeholder="John">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label required">Last Name</label>
|
||||
<input type="text" class="form-control" placeholder="Doe">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label required">Email Address</label>
|
||||
<input type="email" class="form-control" placeholder="john.doe@example.com">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Phone Number</label>
|
||||
<input type="tel" class="form-control" placeholder="+1 (555) 123-4567">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Select & Textarea -->
|
||||
<div class="form-section">
|
||||
<h3>Dropdowns & Textarea</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Country</label>
|
||||
<select class="form-select">
|
||||
<option>Select a country...</option>
|
||||
<option>United States</option>
|
||||
<option>Canada</option>
|
||||
<option>United Kingdom</option>
|
||||
<option>Australia</option>
|
||||
<option>Germany</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Category</label>
|
||||
<select class="form-select">
|
||||
<option>Select...</option>
|
||||
<option>Business</option>
|
||||
<option>Personal</option>
|
||||
<option>Enterprise</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Message</label>
|
||||
<textarea class="form-control" rows="4" placeholder="Enter your message here..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Checkboxes & Radio -->
|
||||
<div class="form-section">
|
||||
<h3>Checkboxes & Radio Buttons</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5>Checkboxes</h5>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check1">
|
||||
<label class="form-check-label" for="check1">Agree to terms and conditions</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check2" checked>
|
||||
<label class="form-check-label" for="check2">Subscribe to newsletter</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="check3">
|
||||
<label class="form-check-label" for="check3">Receive notifications</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>Radio Buttons</h5>
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="plan" id="plan1">
|
||||
<label class="form-check-label" for="plan1">Basic Plan</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="plan" id="plan2" checked>
|
||||
<label class="form-check-label" for="plan2">Pro Plan</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" class="form-check-input" name="plan" id="plan3">
|
||||
<label class="form-check-label" for="plan3">Enterprise Plan</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Validation States -->
|
||||
<div class="form-section">
|
||||
<h3>Validation States</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Valid Input</label>
|
||||
<input type="text" class="form-control is-valid" value="Looks good!">
|
||||
<div class="valid-feedback" style="display: block;">
|
||||
<i class="fa-solid fa-check-circle me-2"></i>Validation passed
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Invalid Input</label>
|
||||
<input type="text" class="form-control is-invalid" value="Invalid value">
|
||||
<div class="invalid-feedback" style="display: block;">
|
||||
<i class="fa-solid fa-exclamation-circle me-2"></i>Please correct this
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Input Sizes -->
|
||||
<div class="form-section">
|
||||
<h3>Input Sizes</h3>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Small Input</label>
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Small size">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Default Input</label>
|
||||
<input type="text" class="form-control" placeholder="Default size">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Large Input</label>
|
||||
<input type="text" class="form-control form-control-lg" placeholder="Large size">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="form-section">
|
||||
<h3>Form Actions</h3>
|
||||
<div class="d-flex gap-2" style="flex-wrap: wrap;">
|
||||
<button class="btn btn-primary">
|
||||
<i class="fa-solid fa-save me-2"></i>Save Changes
|
||||
</button>
|
||||
<button class="btn btn-success">
|
||||
<i class="fa-solid fa-check me-2"></i>Submit
|
||||
</button>
|
||||
<button class="btn btn-warning">
|
||||
<i class="fa-solid fa-redo me-2"></i>Reset
|
||||
</button>
|
||||
<button class="btn btn-danger">
|
||||
<i class="fa-solid fa-trash me-2"></i>Delete
|
||||
</button>
|
||||
<button class="btn btn-secondary">
|
||||
<i class="fa-solid fa-times me-2"></i>Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const icon = themeToggle.querySelector('i');
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,330 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Home | SmartAdmin - Enterprise Admin Dashboard</title>
|
||||
<meta name="description" content="SmartAdmin Bootstrap 5 - Enterprise Admin Dashboard">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=5">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png" sizes="32x32">
|
||||
<link rel="apple-touch-icon" href="img/apple-touch-icon.png" sizes="180x180">
|
||||
|
||||
<!-- SmartAdmin Bootstrap 5 - Modular CSS -->
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/tables.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<!-- Vendor CSS -->
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
.app-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
box-shadow: var(--bs-box-shadow);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-menu {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin-left: auto;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nav-menu a {
|
||||
color: var(--bs-body-color);
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.nav-menu a:hover {
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--bs-body-color);
|
||||
cursor: pointer;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
background: linear-gradient(135deg, var(--bs-primary) 0%, #1565c0 100%);
|
||||
color: white;
|
||||
padding: 6rem 2rem;
|
||||
text-align: center;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hero-section h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.hero-section p {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.btn-group-center {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.features {
|
||||
padding: 4rem 2rem;
|
||||
background-color: var(--bs-gray-50);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .features {
|
||||
background-color: var(--bs-gray-900);
|
||||
}
|
||||
|
||||
.feature-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 2rem;
|
||||
max-width: 1320px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.feature-card {
|
||||
background-color: var(--bs-body-bg);
|
||||
padding: 2rem;
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
border: 1px solid var(--bs-gray-200);
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.feature-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: var(--bs-box-shadow-lg);
|
||||
}
|
||||
|
||||
.feature-icon {
|
||||
font-size: 2.5rem;
|
||||
color: var(--bs-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.feature-card h3 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.feature-card p {
|
||||
color: var(--bs-gray-600);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
background-color: var(--bs-gray-100);
|
||||
border-top: 1px solid var(--bs-gray-200);
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
color: var(--bs-gray-600);
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] footer {
|
||||
background-color: var(--bs-gray-800);
|
||||
border-top-color: var(--bs-gray-700);
|
||||
color: var(--bs-gray-400);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.hero-section h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.hero-section p {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.nav-menu {
|
||||
gap: 1rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding: 4rem 1rem;
|
||||
}
|
||||
|
||||
.features {
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="app-wrap">
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<a href="index-new.html" class="app-logo">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>SmartAdmin
|
||||
</a>
|
||||
<ul class="nav-menu">
|
||||
<li><a href="components-showcase.html">Components</a></li>
|
||||
<li><a href="dashboard-control-center-new.html">Dashboard</a></li>
|
||||
<li><a href="auth-login-new.html">Login</a></li>
|
||||
<li><a href="STYLE_GUIDE.md">Guide</a></li>
|
||||
</ul>
|
||||
<button class="theme-toggle" id="themeToggle" title="Toggle Dark Mode">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section">
|
||||
<div>
|
||||
<h1>SmartAdmin Bootstrap 5</h1>
|
||||
<p>Enterprise Admin Dashboard Template</p>
|
||||
<p style="font-size: 1rem; opacity: 0.8;">Modern, Responsive, Feature-Rich</p>
|
||||
<div class="btn-group-center">
|
||||
<a href="dashboard-control-center-new.html" class="btn btn-light btn-lg">
|
||||
<i class="fa-solid fa-rocket me-2"></i>Launch Dashboard
|
||||
</a>
|
||||
<a href="components-showcase.html" class="btn btn-outline-light btn-lg">
|
||||
<i class="fa-solid fa-palette me-2"></i>View Components
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Features Section -->
|
||||
<section class="features">
|
||||
<div class="container-xxl">
|
||||
<div style="text-align: center; margin-bottom: 3rem;">
|
||||
<h2 style="color: var(--bs-body-color);">Key Features</h2>
|
||||
<p style="color: var(--bs-gray-600); font-size: 1.1rem;">Everything you need for a modern admin dashboard</p>
|
||||
</div>
|
||||
|
||||
<div class="feature-grid">
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-palette"></i>
|
||||
</div>
|
||||
<h3>Modern Design</h3>
|
||||
<p>Beautiful, clean interface based on Bootstrap 5</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-mobile"></i>
|
||||
</div>
|
||||
<h3>Fully Responsive</h3>
|
||||
<p>Perfect on mobile, tablet, and desktop screens</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</div>
|
||||
<h3>Dark Mode Support</h3>
|
||||
<p>Toggle between light and dark themes</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-cube"></i>
|
||||
</div>
|
||||
<h3>Modular CSS</h3>
|
||||
<p>8 organized CSS modules for easy customization</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-bolt"></i>
|
||||
</div>
|
||||
<h3>High Performance</h3>
|
||||
<p>Optimized for speed and user experience</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="feature-icon">
|
||||
<i class="fa-solid fa-code"></i>
|
||||
</div>
|
||||
<h3>Well Documented</h3>
|
||||
<p>Complete style guide and component library</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer>
|
||||
<p>© 2026 SmartAdmin. All rights reserved.</p>
|
||||
<p style="font-size: 0.9rem;">Built with Bootstrap 5 & Modern Web Standards</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Theme Toggle
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
// Load saved theme
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const icon = themeToggle.querySelector('i');
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,372 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Basic Tables | SmartAdmin</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<link rel="icon" href="img/favicon-32x32.png" type="image/png">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/tables.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
||||
|
||||
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
||||
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: var(--bs-gray-50);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] body {
|
||||
background-color: var(--bs-gray-900);
|
||||
}
|
||||
|
||||
.app-header {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
box-shadow: var(--bs-box-shadow);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.app-logo {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
background-color: var(--bs-body-bg);
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
border: 1px solid var(--bs-gray-200);
|
||||
margin-bottom: 2rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-card-header {
|
||||
background-color: var(--bs-gray-100);
|
||||
border-bottom: 1px solid var(--bs-gray-200);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .table-card-header {
|
||||
background-color: var(--bs-gray-800);
|
||||
border-bottom-color: var(--bs-gray-700);
|
||||
}
|
||||
|
||||
.table-card-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.table-responsive {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--bs-body-color);
|
||||
cursor: pointer;
|
||||
font-size: 1.25rem;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-title {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.table-card-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<a href="index-new.html" class="app-logo">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>SmartAdmin
|
||||
</a>
|
||||
<button class="theme-toggle" id="themeToggle">
|
||||
<i class="fa-solid fa-moon"></i>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main style="padding: 2rem;">
|
||||
<div class="container-lg">
|
||||
<h1 class="page-title">Basic Tables</h1>
|
||||
|
||||
<!-- Simple Table -->
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3><i class="fa-solid fa-table me-2"></i>Simple Table</h3>
|
||||
<button class="btn btn-sm btn-primary">
|
||||
<i class="fa-solid fa-download me-1"></i>Export
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#001</td>
|
||||
<td>John Doe</td>
|
||||
<td>john@example.com</td>
|
||||
<td>+1 (555) 123-4567</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#002</td>
|
||||
<td>Jane Smith</td>
|
||||
<td>jane@example.com</td>
|
||||
<td>+1 (555) 234-5678</td>
|
||||
<td><span class="badge badge-success">Active</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#003</td>
|
||||
<td>Bob Johnson</td>
|
||||
<td>bob@example.com</td>
|
||||
<td>+1 (555) 345-6789</td>
|
||||
<td><span class="badge badge-warning">Pending</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#004</td>
|
||||
<td>Alice Williams</td>
|
||||
<td>alice@example.com</td>
|
||||
<td>+1 (555) 456-7890</td>
|
||||
<td><span class="badge badge-danger">Inactive</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Striped Table -->
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3><i class="fa-solid fa-bars me-2"></i>Striped Table</h3>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product</th>
|
||||
<th>Category</th>
|
||||
<th>Price</th>
|
||||
<th>Stock</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Laptop Computer</td>
|
||||
<td>Electronics</td>
|
||||
<td>$1,299</td>
|
||||
<td>45</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-primary">Edit</button>
|
||||
<button class="btn btn-sm btn-danger">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Wireless Mouse</td>
|
||||
<td>Accessories</td>
|
||||
<td>$29.99</td>
|
||||
<td>156</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-primary">Edit</button>
|
||||
<button class="btn btn-sm btn-danger">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>USB-C Cable</td>
|
||||
<td>Accessories</td>
|
||||
<td>$12.99</td>
|
||||
<td>302</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-primary">Edit</button>
|
||||
<button class="btn btn-sm btn-danger">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hover Table -->
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3><i class="fa-solid fa-hand-pointer me-2"></i>Hover Table</h3>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order ID</th>
|
||||
<th>Customer</th>
|
||||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="cursor: pointer;">
|
||||
<td>#ORD-1001</td>
|
||||
<td>Acme Corp</td>
|
||||
<td>2026-07-01</td>
|
||||
<td>$5,250</td>
|
||||
<td><span class="badge badge-success">Completed</span></td>
|
||||
</tr>
|
||||
<tr style="cursor: pointer;">
|
||||
<td>#ORD-1002</td>
|
||||
<td>TechStart Inc</td>
|
||||
<td>2026-07-02</td>
|
||||
<td>$3,100</td>
|
||||
<td><span class="badge badge-success">Completed</span></td>
|
||||
</tr>
|
||||
<tr style="cursor: pointer;">
|
||||
<td>#ORD-1003</td>
|
||||
<td>Global Solutions</td>
|
||||
<td>2026-07-03</td>
|
||||
<td>$7,450</td>
|
||||
<td><span class="badge badge-info">Processing</span></td>
|
||||
</tr>
|
||||
<tr style="cursor: pointer;">
|
||||
<td>#ORD-1004</td>
|
||||
<td>Smart Industries</td>
|
||||
<td>2026-07-04</td>
|
||||
<td>$2,800</td>
|
||||
<td><span class="badge badge-warning">Pending</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bordered Table -->
|
||||
<div class="table-card">
|
||||
<div class="table-card-header">
|
||||
<h3><i class="fa-solid fa-border-all me-2"></i>Bordered Table</h3>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Feature</th>
|
||||
<th>Basic Plan</th>
|
||||
<th>Pro Plan</th>
|
||||
<th>Enterprise</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>Storage</strong></td>
|
||||
<td>10 GB</td>
|
||||
<td>100 GB</td>
|
||||
<td>Unlimited</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Users</strong></td>
|
||||
<td>1</td>
|
||||
<td>5</td>
|
||||
<td>Unlimited</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Support</strong></td>
|
||||
<td>Email</td>
|
||||
<td>Priority</td>
|
||||
<td>24/7 Phone</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>API Access</strong></td>
|
||||
<td><i class="fa-solid fa-times text-danger"></i></td>
|
||||
<td><i class="fa-solid fa-check text-success"></i></td>
|
||||
<td><i class="fa-solid fa-check text-success"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Analytics</strong></td>
|
||||
<td><i class="fa-solid fa-times text-danger"></i></td>
|
||||
<td><i class="fa-solid fa-check text-success"></i></td>
|
||||
<td><i class="fa-solid fa-check text-success"></i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
|
||||
const savedTheme = localStorage.getItem('theme') || 'light';
|
||||
html.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon();
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
});
|
||||
|
||||
function updateThemeIcon() {
|
||||
const icon = themeToggle.querySelector('i');
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
if (currentTheme === 'dark') {
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
icon.classList.add('fa-moon');
|
||||
icon.classList.remove('fa-sun');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Generated
+64
@@ -14,6 +14,7 @@
|
||||
"yahoo-finance2": "3.15.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.61.1",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
@@ -129,6 +130,22 @@
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz",
|
||||
"integrity": "sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright": "1.61.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
||||
@@ -1109,6 +1126,21 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
@@ -1888,6 +1920,38 @@
|
||||
"node": ">=16.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.61.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz",
|
||||
"integrity": "sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.61.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.61.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1.tgz",
|
||||
"integrity": "sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
"fast-xml-parser": "5.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.61.1",
|
||||
"xlsx": "^0.18.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
using Bunit;
|
||||
using MudBlazor;
|
||||
using Xunit;
|
||||
using QuantEngine.Web.Client.Pages;
|
||||
using QuantEngine.Web.Client.Components;
|
||||
|
||||
namespace QuantEngine.Web.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for Dashboard component using bUnit
|
||||
/// </summary>
|
||||
public class DashboardComponentTests : TestContext
|
||||
{
|
||||
[Fact]
|
||||
public void Dashboard_Renders_Without_Errors()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Dashboard>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("관리자 대시보드");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dashboard_Displays_KPI_Cards()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Dashboard>();
|
||||
|
||||
// Assert - Should have 4 KPI cards
|
||||
cut.FindAll(".mud-paper").Count.Should().BeGreaterThanOrEqualTo(4);
|
||||
cut.Markup.Should().Contain("총 수집 실행");
|
||||
cut.Markup.Should().Contain("성공률");
|
||||
cut.Markup.Should().Contain("최근 에러");
|
||||
cut.Markup.Should().Contain("마지막 동기화");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dashboard_Shows_System_Status()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Dashboard>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("시스템 상태");
|
||||
cut.Markup.Should().Contain("API 서버");
|
||||
cut.Markup.Should().Contain("데이터베이스");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dashboard_Has_Activity_Feed()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Dashboard>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("최근 활동");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dashboard_Has_Collections_Table()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Dashboard>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("최근 데이터 수집 실행");
|
||||
cut.Markup.Should().Contain("새로고침");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for FormField component
|
||||
/// </summary>
|
||||
public class FormFieldComponentTests : TestContext
|
||||
{
|
||||
[Fact]
|
||||
public void FormField_Renders_Text_Input()
|
||||
{
|
||||
// Arrange
|
||||
var parameters = new ComponentParameterCollection
|
||||
{
|
||||
{ "Label", "사용자명" },
|
||||
{ "Type", "text" },
|
||||
{ "Placeholder", "이름 입력" }
|
||||
};
|
||||
|
||||
// Act
|
||||
var cut = RenderComponent<FormField>(parameters);
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("사용자명");
|
||||
cut.Markup.Should().Contain("이름 입력");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FormField_Shows_Required_Indicator()
|
||||
{
|
||||
// Arrange
|
||||
var parameters = new ComponentParameterCollection
|
||||
{
|
||||
{ "Label", "이메일" },
|
||||
{ "Type", "email" },
|
||||
{ "Required", true }
|
||||
};
|
||||
|
||||
// Act
|
||||
var cut = RenderComponent<FormField>(parameters);
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("*");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FormField_Displays_Error_Message()
|
||||
{
|
||||
// Arrange
|
||||
var parameters = new ComponentParameterCollection
|
||||
{
|
||||
{ "Label", "비밀번호" },
|
||||
{ "Type", "password" },
|
||||
{ "ErrorMessage", "최소 8자 이상 입력하세요" }
|
||||
};
|
||||
|
||||
// Act
|
||||
var cut = RenderComponent<FormField>(parameters);
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("최소 8자 이상 입력하세요");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FormField_Shows_Help_Text()
|
||||
{
|
||||
// Arrange
|
||||
var parameters = new ComponentParameterCollection
|
||||
{
|
||||
{ "Label", "핸드폰" },
|
||||
{ "Type", "tel" },
|
||||
{ "HelpText", "하이픈 없이 숫자만 입력하세요" }
|
||||
};
|
||||
|
||||
// Act
|
||||
var cut = RenderComponent<FormField>(parameters);
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("하이픈 없이 숫자만 입력하세요");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for Portfolio component
|
||||
/// </summary>
|
||||
public class PortfolioComponentTests : TestContext
|
||||
{
|
||||
[Fact]
|
||||
public void Portfolio_Renders_Without_Errors()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Portfolio>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("포트폴리오");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Portfolio_Displays_Summary_Cards()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Portfolio>();
|
||||
|
||||
// Assert - Should have summary cards
|
||||
cut.Markup.Should().Contain("총 평가액");
|
||||
cut.Markup.Should().Contain("보유 종목");
|
||||
cut.Markup.Should().Contain("수익률");
|
||||
cut.Markup.Should().Contain("위험도");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Portfolio_Shows_Asset_Table()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Portfolio>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("자산 구성");
|
||||
cut.Markup.Should().Contain("종목/펀드명");
|
||||
cut.Markup.Should().Contain("평가액");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Portfolio_Shows_Asset_Classification()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Portfolio>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("자산 분류");
|
||||
cut.Markup.Should().Contain("대형주");
|
||||
cut.Markup.Should().Contain("중형주");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Portfolio_Shows_Trading_History()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<Portfolio>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("거래 이력");
|
||||
cut.Markup.Should().Contain("구분");
|
||||
cut.Markup.Should().Contain("금액");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for NavMenu component
|
||||
/// </summary>
|
||||
public class NavMenuComponentTests : TestContext
|
||||
{
|
||||
[Fact]
|
||||
public void NavMenu_Renders_Navigation_Links()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<NavMenu>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("대시보드");
|
||||
cut.Markup.Should().Contain("관리");
|
||||
cut.Markup.Should().Contain("운영");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NavMenu_Has_Admin_Section()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<NavMenu>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("사용자 관리");
|
||||
cut.Markup.Should().Contain("데이터 수집");
|
||||
cut.Markup.Should().Contain("설정");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NavMenu_Has_Help_Section()
|
||||
{
|
||||
// Arrange & Act
|
||||
var cut = RenderComponent<NavMenu>();
|
||||
|
||||
// Assert
|
||||
cut.Markup.Should().Contain("도움말");
|
||||
cut.Markup.Should().Contain("문서");
|
||||
cut.Markup.Should().Contain("API");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
@namespace QuantEngine.Web.Client.Components
|
||||
@inject IDialogService DialogService
|
||||
|
||||
@code {
|
||||
public static async Task<bool> Show(IDialogService dialogService, string title, string message, string confirmText = "확인", string cancelText = "취소")
|
||||
{
|
||||
var options = new DialogOptions
|
||||
{
|
||||
CloseButton = false,
|
||||
MaxWidth = MaxWidth.Small,
|
||||
FullWidth = true,
|
||||
DisableBackdropClick = true
|
||||
};
|
||||
|
||||
var parameters = new DialogParameters<ConfirmDialogContent>
|
||||
{
|
||||
{ x => x.Title, title },
|
||||
{ x => x.Message, message },
|
||||
{ x => x.ConfirmText, confirmText },
|
||||
{ x => x.CancelText, cancelText }
|
||||
};
|
||||
|
||||
var dialog = await dialogService.ShowAsync<ConfirmDialogContent>(title, parameters, options);
|
||||
var result = await dialog.Result;
|
||||
|
||||
return !result.Cancelled && (bool?)result.Data == true;
|
||||
}
|
||||
}
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudStack Spacing="2">
|
||||
<MudText Typo="Typo.h6">@Title</MudText>
|
||||
<MudText Typo="Typo.body2">@Message</MudText>
|
||||
</MudStack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel" Color="Color.Default">@CancelText</MudButton>
|
||||
<MudButton OnClick="Confirm" Color="Color.Primary" Variant="Variant.Filled">@ConfirmText</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private MudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string Title { get; set; } = "확인";
|
||||
|
||||
[Parameter]
|
||||
public string Message { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public string ConfirmText { get; set; } = "확인";
|
||||
|
||||
[Parameter]
|
||||
public string CancelText { get; set; } = "취소";
|
||||
|
||||
private void Confirm() => MudDialog.Close(DialogResult.Ok(true));
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
@namespace QuantEngine.Web.Client.Components
|
||||
|
||||
<MudStack Spacing="2" Class="form-field">
|
||||
<label class="form-label">
|
||||
@Label
|
||||
@if (Required)
|
||||
{
|
||||
<span class="text-error">*</span>
|
||||
}
|
||||
</label>
|
||||
|
||||
@switch (Type)
|
||||
{
|
||||
case "text":
|
||||
case "email":
|
||||
case "password":
|
||||
case "number":
|
||||
<MudTextField T="string"
|
||||
Value="@Value"
|
||||
ValueChanged="@((string v) => ValueChanged.InvokeAsync(v))"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Placeholder="@Placeholder"
|
||||
Type="@Type"
|
||||
Required="@Required"
|
||||
ErrorText="@ErrorMessage" />
|
||||
break;
|
||||
|
||||
case "textarea":
|
||||
<MudTextField T="string"
|
||||
Value="@Value"
|
||||
ValueChanged="@((string v) => ValueChanged.InvokeAsync(v))"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Placeholder="@Placeholder"
|
||||
Lines="5"
|
||||
Required="@Required"
|
||||
ErrorText="@ErrorMessage" />
|
||||
break;
|
||||
|
||||
case "select":
|
||||
<MudSelect T="string"
|
||||
Value="@Value"
|
||||
ValueChanged="@((string v) => ValueChanged.InvokeAsync(v))"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Required="@Required">
|
||||
@foreach (var option in Options)
|
||||
{
|
||||
<MudSelectItem T="string" Value="@option">@option</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
break;
|
||||
|
||||
case "checkbox":
|
||||
<MudCheckBox T="bool"
|
||||
Checked="@(Value == "true")"
|
||||
CheckedChanged="@((bool v) => ValueChanged.InvokeAsync(v ? "true" : "false"))">
|
||||
@Label
|
||||
</MudCheckBox>
|
||||
break;
|
||||
|
||||
case "date":
|
||||
<MudTextField T="string"
|
||||
Value="@Value"
|
||||
ValueChanged="@((string v) => ValueChanged.InvokeAsync(v))"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Type="date"
|
||||
Required="@Required" />
|
||||
break;
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(HelpText))
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="text-muted">@HelpText</MudText>
|
||||
}
|
||||
</MudStack>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Label { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public string Type { get; set; } = "text";
|
||||
|
||||
[Parameter]
|
||||
public string Value { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> ValueChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string Placeholder { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public bool Required { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public string ErrorMessage { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public string HelpText { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public List<string> Options { get; set; } = new();
|
||||
}
|
||||
|
||||
<style>
|
||||
.form-field {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-weight: 500;
|
||||
font-size: 0.875rem;
|
||||
color: var(--mud-palette-text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.form-label .text-error {
|
||||
color: var(--mud-palette-error);
|
||||
}
|
||||
</style>
|
||||
@@ -1,3 +1,66 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
@Body
|
||||
<div class="auth-container">
|
||||
<!-- Left Panel - Branding -->
|
||||
<MudHidden Breakpoint="Breakpoint.SmAndDown" Invert="true" Class="auth-left-panel">
|
||||
<div class="auth-branding">
|
||||
<div class="auth-logo">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Dashboard" Size="Size.Large" />
|
||||
</div>
|
||||
<MudText Typo="Typo.h3" Class="auth-title">
|
||||
QuantEngine
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body1" Class="auth-subtitle">
|
||||
퇴직 자산 포트폴리오 관리 시스템
|
||||
</MudText>
|
||||
<div class="auth-features mt-8">
|
||||
<div class="auth-feature">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" />
|
||||
<MudText Typo="Typo.body2">실시간 자산 모니터링</MudText>
|
||||
</div>
|
||||
<div class="auth-feature">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" />
|
||||
<MudText Typo="Typo.body2">AI 기반 분석</MudText>
|
||||
</div>
|
||||
<div class="auth-feature">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" />
|
||||
<MudText Typo="Typo.body2">종합 보고서</MudText>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</MudHidden>
|
||||
|
||||
<!-- Right Panel - Auth Content -->
|
||||
<div class="auth-right-panel">
|
||||
<!-- Mobile Header -->
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
||||
<div class="auth-mobile-header">
|
||||
<MudText Typo="Typo.h5" Class="d-flex align-center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Dashboard" Size="Size.Medium" Class="mr-2" />
|
||||
QuantEngine
|
||||
</MudText>
|
||||
</div>
|
||||
</MudHidden>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="auth-content">
|
||||
@Body
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="auth-footer">
|
||||
<MudText Typo="Typo.caption" Class="auth-footer-text">
|
||||
© 2026 QuantEngine. 모든 권리 예약.
|
||||
</MudText>
|
||||
<div class="auth-footer-links">
|
||||
<MudLink Href="/" Typo="Typo.caption">서비스 약관</MudLink>
|
||||
<MudText Typo="Typo.caption">·</MudText>
|
||||
<MudLink Href="/" Typo="Typo.caption">개인정보 처리방침</MudLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/* QuantEngine AuthLayout Styles */
|
||||
|
||||
.auth-container {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-primary-dark) 100%);
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
/* Left Panel - Branding */
|
||||
.auth-left-panel {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 3rem;
|
||||
color: white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.auth-branding {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.auth-logo {
|
||||
margin-bottom: 2rem;
|
||||
animation: float 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.auth-logo ::deep svg {
|
||||
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
|
||||
font-size: 80px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.auth-title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.5rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.auth-subtitle {
|
||||
opacity: 0.9;
|
||||
font-size: 1.1rem;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.auth-features {
|
||||
margin-top: 3rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.auth-feature {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.auth-feature ::deep svg {
|
||||
font-size: 24px;
|
||||
color: #4caf50;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.auth-theme-toggle {
|
||||
position: absolute;
|
||||
top: 2rem;
|
||||
right: 2rem;
|
||||
}
|
||||
|
||||
.auth-theme-toggle ::deep button {
|
||||
color: white;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.auth-theme-toggle ::deep button:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* Right Panel - Auth Content */
|
||||
.auth-right-panel {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2rem;
|
||||
background: var(--mud-palette-background);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.auth-mobile-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--mud-palette-divider);
|
||||
}
|
||||
|
||||
.auth-mobile-header ::deep .mud-icon {
|
||||
color: var(--mud-palette-primary);
|
||||
}
|
||||
|
||||
.auth-content {
|
||||
width: 100%;
|
||||
max-width: 450px;
|
||||
}
|
||||
|
||||
.auth-content ::deep .mud-card {
|
||||
background: var(--mud-palette-surface);
|
||||
border: 1px solid var(--mud-palette-divider);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.auth-content ::deep .mud-form-control {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.auth-content ::deep .mud-button {
|
||||
text-transform: none;
|
||||
font-weight: 600;
|
||||
padding: 0.75rem 1.5rem;
|
||||
}
|
||||
|
||||
.auth-content ::deep .mud-button-root {
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.auth-footer {
|
||||
position: absolute;
|
||||
bottom: 2rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 1rem 2rem;
|
||||
border-top: 1px solid var(--mud-palette-divider);
|
||||
}
|
||||
|
||||
.auth-footer-text {
|
||||
display: block;
|
||||
color: var(--mud-palette-text-secondary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.auth-footer-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.auth-footer-links ::deep a {
|
||||
color: var(--mud-palette-primary);
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.auth-footer-links ::deep a:hover {
|
||||
color: var(--mud-palette-primary-dark);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 960px) {
|
||||
.auth-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.auth-left-panel {
|
||||
padding: 2rem;
|
||||
min-height: 40vh;
|
||||
}
|
||||
|
||||
.auth-right-panel {
|
||||
padding: 3rem 2rem 5rem;
|
||||
min-height: 60vh;
|
||||
}
|
||||
|
||||
.auth-mobile-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.auth-footer {
|
||||
bottom: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.auth-right-panel {
|
||||
padding: 2rem 1rem 5rem;
|
||||
}
|
||||
|
||||
.auth-content {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.auth-features {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.auth-footer {
|
||||
position: static;
|
||||
padding: 1rem;
|
||||
border-top: 1px solid var(--mud-palette-divider);
|
||||
margin-top: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animation */
|
||||
@keyframes float {
|
||||
0%, 100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark Mode */
|
||||
[data-theme="dark"] .auth-container {
|
||||
background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .auth-left-panel {
|
||||
color: #f0f0f0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .auth-right-panel {
|
||||
background: #121212;
|
||||
}
|
||||
|
||||
/* Accessibility */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.auth-logo {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.auth-theme-toggle ::deep button {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.auth-footer-links ::deep a {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
@@ -4,30 +4,89 @@
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<MudLayout>
|
||||
<MudAppBar Elevation="1" Dense="true">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@(() => navOpen = !navOpen)" />
|
||||
<MudText Typo="Typo.h6">QuantEngine v@appVersion</MudText>
|
||||
<!-- Top Navigation Bar -->
|
||||
<MudAppBar Elevation="1" Dense="false" Color="Color.Surface" Class="mud-appbar-dense">
|
||||
<MudHidden Breakpoint="Breakpoint.SmAndUp" Invert="true">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@(() => navOpen = !navOpen)" />
|
||||
</MudHidden>
|
||||
|
||||
<MudText Typo="Typo.h6" Class="ml-2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Dashboard" Class="me-2" />
|
||||
QuantEngine
|
||||
</MudText>
|
||||
|
||||
<MudSpacer />
|
||||
|
||||
<!-- User Menu -->
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudText Typo="Typo.body2">관리자 (@context.User.Identity?.Name)</MudText>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Error" OnClick="HandleLogoutAsync">로그아웃</MudButton>
|
||||
<MudMenu AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight" Class="ml-2">
|
||||
<ActivatorContent>
|
||||
<MudAvatar Color="Color.Primary" Image="@GetUserInitials()" Class="cursor-pointer">
|
||||
@GetFirstLetter(context.User.Identity?.Name)
|
||||
</MudAvatar>
|
||||
</ActivatorContent>
|
||||
<ChildContent>
|
||||
<MudMenuItem>
|
||||
<MudText Typo="Typo.body2">
|
||||
<strong>@context.User.Identity?.Name</strong>
|
||||
</MudText>
|
||||
</MudMenuItem>
|
||||
<MudDivider />
|
||||
<MudMenuItem href="/profile">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Person" Class="mr-2" Size="Size.Small" />
|
||||
프로필
|
||||
</MudMenuItem>
|
||||
<MudMenuItem href="/settings">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Settings" Class="mr-2" Size="Size.Small" />
|
||||
설정
|
||||
</MudMenuItem>
|
||||
<MudDivider />
|
||||
<MudMenuItem OnClick="HandleLogoutAsync">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Logout" Class="mr-2" Size="Size.Small" Color="Color.Error" />
|
||||
<MudText Color="Color.Error">로그아웃</MudText>
|
||||
</MudMenuItem>
|
||||
</ChildContent>
|
||||
</MudMenu>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</MudAppBar>
|
||||
|
||||
<MudDrawer Open="@navOpen" Variant="DrawerVariant.Responsive" Elevation="1">
|
||||
<!-- Sidebar Navigation -->
|
||||
<MudDrawer Open="@navOpen" Variant="DrawerVariant.Responsive" Elevation="1" FixedOpen="@fixedOpen">
|
||||
<MudDrawerHeader Class="d-flex align-center justify-space-between">
|
||||
<MudText Typo="Typo.h6" Class="px-2">메뉴</MudText>
|
||||
<MudHidden Breakpoint="Breakpoint.Md" Invert="true">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.ChevronLeft"
|
||||
OnClick="ToggleDrawer"
|
||||
Class="mx-1" />
|
||||
</MudHidden>
|
||||
</MudDrawerHeader>
|
||||
|
||||
<MudNavMenu>
|
||||
<NavMenu />
|
||||
</MudNavMenu>
|
||||
<div style="padding: 16px; border-top: 1px solid var(--mud-palette-lines-default);">
|
||||
<MudText Typo="Typo.caption">QuantEngine v@appVersion</MudText>
|
||||
<MudText Typo="Typo.caption">배포: @buildTime</MudText>
|
||||
|
||||
<!-- Drawer Footer -->
|
||||
<div class="mud-drawer-footer">
|
||||
<MudDivider />
|
||||
<div style="padding: 16px;">
|
||||
<MudText Typo="Typo.caption">
|
||||
<strong>QuantEngine</strong>
|
||||
</MudText>
|
||||
<MudText Typo="Typo.caption">
|
||||
v@appVersion
|
||||
</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mt-2">
|
||||
배포: @buildTime
|
||||
</MudText>
|
||||
</div>
|
||||
</div>
|
||||
</MudDrawer>
|
||||
|
||||
<MudMainContent>
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="pa-4">
|
||||
<!-- Main Content Area -->
|
||||
<MudMainContent Class="mud-main-content-enhanced">
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="pa-6">
|
||||
@Body
|
||||
</MudContainer>
|
||||
</MudMainContent>
|
||||
@@ -35,6 +94,7 @@
|
||||
|
||||
@code {
|
||||
private bool navOpen = true;
|
||||
private bool fixedOpen = true;
|
||||
private string appVersion = "Local Debug";
|
||||
private string buildTime = "N/A";
|
||||
|
||||
@@ -52,6 +112,13 @@
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private void ToggleDrawer()
|
||||
{
|
||||
navOpen = !navOpen;
|
||||
}
|
||||
|
||||
private async Task HandleLogoutAsync()
|
||||
@@ -61,6 +128,16 @@
|
||||
NavigationManager.NavigateTo("/login");
|
||||
}
|
||||
|
||||
private string GetFirstLetter(string? name)
|
||||
{
|
||||
return string.IsNullOrEmpty(name) ? "?" : name[0].ToString().ToUpper();
|
||||
}
|
||||
|
||||
private string GetUserInitials()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private class VersionInfo
|
||||
{
|
||||
public string? Version { get; set; }
|
||||
|
||||
@@ -1,81 +1,83 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* QuantEngine MainLayout Styles */
|
||||
|
||||
/* AppBar Enhancements */
|
||||
.mud-appbar-dense {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
main {
|
||||
.mud-appbar-dense ::deep .mud-appbar-section-center {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
/* Avatar Styling */
|
||||
::deep .mud-avatar {
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #d6d5d5;
|
||||
justify-content: flex-end;
|
||||
height: 3.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
::deep .mud-avatar:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
text-decoration: none;
|
||||
/* Drawer Footer */
|
||||
.mud-drawer-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: var(--mud-palette-surface);
|
||||
}
|
||||
|
||||
/* Main Content Area */
|
||||
.mud-main-content-enhanced {
|
||||
min-height: 100vh;
|
||||
background: var(--mud-palette-background);
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
/* Navigation Menu Styles */
|
||||
.mud-navmenu {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.mud-navmenu ::deep .mud-nav-item {
|
||||
padding: 0.5rem 0;
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
.mud-navmenu ::deep .mud-nav-link {
|
||||
border-radius: 0.4rem;
|
||||
margin: 0 0.5rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.mud-navmenu ::deep .mud-nav-link:hover {
|
||||
background-color: var(--mud-palette-action-default-hover);
|
||||
}
|
||||
|
||||
.mud-navmenu ::deep .mud-nav-link.mud-ripple-nav-link-active {
|
||||
background-color: var(--mud-palette-primary-lighten);
|
||||
color: var(--mud-palette-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Responsive Drawer */
|
||||
@media (max-width: 599px) {
|
||||
.mud-drawer-content {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.top-row ::deep a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
margin-left: 0;
|
||||
.mud-drawer-footer {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.page {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row.auth ::deep a:first-child {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.top-row, article {
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 1.5rem !important;
|
||||
@media (min-width: 600px) {
|
||||
.mud-drawer-footer {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
/* Error UI */
|
||||
#blazor-error-ui {
|
||||
color-scheme: light only;
|
||||
background: lightyellow;
|
||||
@@ -90,9 +92,14 @@ main {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
|
||||
/* Dark Mode Transitions */
|
||||
* {
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
<MudNavMenu>
|
||||
<MudNavLink Href="/dashboard" Match="NavLinkMatch.All">Dashboard</MudNavLink>
|
||||
<MudNavLink Href="/operations" Match="NavLinkMatch.Prefix">Operations</MudNavLink>
|
||||
<!-- Main Navigation -->
|
||||
<MudNavLink Href="/dashboard" Icon="@Icons.Material.Filled.Dashboard" Match="NavLinkMatch.All">
|
||||
대시보드
|
||||
</MudNavLink>
|
||||
|
||||
<!-- Admin Section -->
|
||||
<MudNavGroup Title="관리" Icon="@Icons.Material.Filled.Admin4">
|
||||
<MudNavLink Href="/users" Icon="@Icons.Material.Filled.People">사용자 관리</MudNavLink>
|
||||
<MudNavLink Href="/monitoring" Icon="@Icons.Material.Filled.Timeline">데이터 수집</MudNavLink>
|
||||
<MudNavLink Href="/settings" Icon="@Icons.Material.Filled.Settings">설정</MudNavLink>
|
||||
</MudNavGroup>
|
||||
|
||||
<!-- Operations -->
|
||||
<MudNavLink Href="/operations" Icon="@Icons.Material.Filled.PlaylistPlay" Match="NavLinkMatch.Prefix">
|
||||
운영
|
||||
</MudNavLink>
|
||||
|
||||
<!-- Divider -->
|
||||
<MudDivider Class="my-2" />
|
||||
|
||||
<!-- Help Section -->
|
||||
<MudNavGroup Title="도움말" Icon="@Icons.Material.Filled.Help">
|
||||
<MudNavLink Href="/documentation" Icon="@Icons.Material.Filled.Article">문서</MudNavLink>
|
||||
<MudNavLink Href="/api" Icon="@Icons.Material.Filled.Code">API</MudNavLink>
|
||||
</MudNavGroup>
|
||||
</MudNavMenu>
|
||||
|
||||
@@ -3,115 +3,329 @@
|
||||
@using QuantEngine.Core.Infrastructure
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>Quant Engine - Dashboard</PageTitle>
|
||||
<PageTitle>QuantEngine - Admin Dashboard</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h4" Class="mb-2">Quant Engine</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-4">운영 진입점입니다. 로그인 후 현재 스냅샷 상태와 리포트 경로만 표시합니다.</MudText>
|
||||
<!-- Page Header -->
|
||||
<div class="mb-6">
|
||||
<MudText Typo="Typo.h4" Class="mb-2">관리자 대시보드</MudText>
|
||||
<MudText Typo="Typo.body1" Class="text-muted">시스템 현황 및 데이터 수집 모니터링</MudText>
|
||||
</div>
|
||||
|
||||
<MudGrid Spacing="2" Class="mb-4">
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.caption">Operational Report</MudText>
|
||||
<MudText Typo="Typo.h6">@ReportStateLabel</MudText>
|
||||
<MudText Typo="Typo.body2">@ReportPath</MudText>
|
||||
<!-- KPI Cards -->
|
||||
<MudGrid Spacing="3" Class="mb-6">
|
||||
<!-- Total Runs -->
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4 mud-card-kpi" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">총 수집 실행</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-primary">@TotalRuns</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.TrendingUp" Size="Size.Small" Style="color: #4caf50;" />
|
||||
이번 주 +@WeeklyRuns
|
||||
</MudText>
|
||||
</div>
|
||||
<MudIcon Icon="@Icons.Material.Filled.PlayCircleOutline" Size="Size.Large" Class="text-primary" Style="opacity: 0.3;" />
|
||||
</div>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.caption">Sections</MudText>
|
||||
<MudText Typo="Typo.h6">@SectionCountLabel</MudText>
|
||||
<MudText Typo="Typo.body2">Temp/operational_report.json</MudText>
|
||||
|
||||
<!-- Success Rate -->
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4 mud-card-kpi" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">성공률</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-success">@SuccessRate%</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Style="color: #4caf50;" />
|
||||
최근 30일
|
||||
</MudText>
|
||||
</div>
|
||||
<MudIcon Icon="@Icons.Material.Filled.Assessment" Size="Size.Large" Class="text-success" Style="opacity: 0.3;" />
|
||||
</div>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.caption">Primary Route</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Href="/operations" Class="mt-2">Open Operations</MudButton>
|
||||
|
||||
<!-- Recent Errors -->
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4 mud-card-kpi" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">최근 에러</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-error">@RecentErrors</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ErrorOutline" Size="Size.Small" Style="color: #f44336;" />
|
||||
지난 7일
|
||||
</MudText>
|
||||
</div>
|
||||
<MudIcon Icon="@Icons.Material.Filled.WarningAmber" Size="Size.Large" Class="text-error" Style="opacity: 0.3;" />
|
||||
</div>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<!-- Last Sync -->
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4 mud-card-kpi" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">마지막 동기화</MudText>
|
||||
<MudText Typo="Typo.h5">@LastSyncTime</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-2">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(IsLastSyncSuccess ? Color.Success : Color.Warning)"
|
||||
Variant="Variant.Filled">
|
||||
@(IsLastSyncSuccess ? "성공" : "경고")
|
||||
</MudChip>
|
||||
</MudText>
|
||||
</div>
|
||||
<MudIcon Icon="@Icons.Material.Filled.Schedule" Size="Size.Large" Class="text-secondary" Style="opacity: 0.3;" />
|
||||
</div>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<MudGrid Spacing="2" Class="mb-4">
|
||||
<!-- Main Content Grid -->
|
||||
<MudGrid Spacing="3" Class="mb-6">
|
||||
<!-- Recent Activity Feed -->
|
||||
<MudItem xs="12" md="8">
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">Current State</MudText>
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.body2">Status: <MudChip T="string" Color="@(ReportChipLabel == "READY" ? Color.Success : Color.Warning)" Variant="Variant.Filled">@ReportChipLabel</MudChip></MudText>
|
||||
<MudText Typo="Typo.body2">Generated: @GeneratedAtLabel</MudText>
|
||||
<MudText Typo="Typo.body2">Source: @SourceLabel</MudText>
|
||||
<MudText Typo="Typo.body2">Decision feed: @DecisionFeedLabel</MudText>
|
||||
<MudText Typo="Typo.body2">Factor feed: @FactorFeedLabel</MudText>
|
||||
<MudText Typo="Typo.body2">Raw feed: @RawFeedLabel</MudText>
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-4">최근 활동</MudText>
|
||||
|
||||
@if (RecentActivities.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">활동 기록이 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var activity in RecentActivities)
|
||||
{
|
||||
<div class="d-flex gap-3 pa-2" style="border-left: 3px solid @GetActivityColor(activity.Type); padding-left: 12px;">
|
||||
<MudIcon Icon="@GetActivityIcon(activity.Type)" Size="Size.Medium" Color="@GetActivityColorEnum(activity.Type)" />
|
||||
<div style="flex: 1;">
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">@activity.Title</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">@activity.Timestamp.ToString("yyyy-MM-dd HH:mm:ss")</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mt-1">@activity.Description</MudText>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<!-- System Status -->
|
||||
<MudItem xs="12" md="4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-4">시스템 상태</MudText>
|
||||
|
||||
<MudStack Spacing="2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<MudText Typo="Typo.body2">API 서버</MudText>
|
||||
<MudChip T="string" Label="true" Size="Size.Small" Color="Color.Success" Variant="Variant.Filled">온라인</MudChip>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<MudText Typo="Typo.body2">데이터베이스</MudText>
|
||||
<MudChip T="string" Label="true" Size="Size.Small" Color="Color.Success" Variant="Variant.Filled">연결됨</MudChip>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<MudText Typo="Typo.body2">KIS API</MudText>
|
||||
<MudChip T="string" Label="true" Size="Size.Small" Color="@(KisApiStatus ? Color.Success : Color.Warning)" Variant="Variant.Filled">
|
||||
@(KisApiStatus ? "활성" : "비활성")
|
||||
</MudChip>
|
||||
</div>
|
||||
<MudDivider Class="my-2" />
|
||||
<MudText Typo="Typo.caption" Class="text-muted">마지막 점검: @SystemCheckTime</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="4">
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">Routing Notes</MudText>
|
||||
<ul style="margin: 0; padding-left: 18px;">
|
||||
<li>운영 데이터는 snapshot 우선입니다.</li>
|
||||
<li>Excel/GAS 의존 문구는 제거 대상입니다.</li>
|
||||
<li>숫자는 provenance 없으면 표시하지 않습니다.</li>
|
||||
</ul>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<MudPaper Class="pa-4" Elevation="2">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">Coverage Summary</MudText>
|
||||
<!-- Collections Table -->
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<MudText Typo="Typo.h6">최근 데이터 수집 실행</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Size="Size.Small" OnClick="RefreshData">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Refresh" Size="Size.Small" Class="mr-2" />
|
||||
새로고침
|
||||
</MudButton>
|
||||
</div>
|
||||
|
||||
@if (Sections.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Warning">DATA_MISSING: operational_report.json이 비어 있거나 아직 생성되지 않았습니다.</MudAlert>
|
||||
<MudAlert Severity="Severity.Info">데이터 수집 기록이 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="@Sections" Dense="true" Hover="true">
|
||||
<MudTable Items="@Sections" Dense="true" Hover="true" Striped="true">
|
||||
<HeaderContent>
|
||||
<MudTh>Name</MudTh>
|
||||
<MudTh>Title</MudTh>
|
||||
<MudTh>Preview</MudTh>
|
||||
<MudTh>이름</MudTh>
|
||||
<MudTh>상태</MudTh>
|
||||
<MudTh>시작 시간</MudTh>
|
||||
<MudTh>작업</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Name">@context.Name</MudTd>
|
||||
<MudTd DataLabel="Title">@context.Title</MudTd>
|
||||
<MudTd DataLabel="Preview">@context.Preview</MudTd>
|
||||
<MudTd DataLabel="Name">
|
||||
<MudText Typo="Typo.body2">@context.Name</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Status">
|
||||
<MudChip T="string" Label="true" Size="Size.Small" Color="Color.Primary" Variant="Variant.Filled">
|
||||
@context.Title
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Timestamp">
|
||||
<MudText Typo="Typo.body2">@context.Preview</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Actions">
|
||||
<MudButton Variant="Variant.Text" Size="Size.Small" Color="Color.Primary">상세</MudButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
<style>
|
||||
.mud-card-kpi {
|
||||
border-radius: 8px !important;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.mud-card-kpi:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.text-primary {
|
||||
color: var(--mud-palette-primary) !important;
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: var(--mud-palette-success) !important;
|
||||
}
|
||||
|
||||
.text-error {
|
||||
color: var(--mud-palette-error) !important;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: var(--mud-palette-text-secondary) !important;
|
||||
}
|
||||
|
||||
.font-weight-500 {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.gap-3 {
|
||||
gap: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
private readonly List<OperationalReportSection> Sections = new();
|
||||
private string ReportStateLabel = "DATA_MISSING";
|
||||
private string ReportChipLabel = "DATA_MISSING";
|
||||
private string SectionCountLabel = "0";
|
||||
private string GeneratedAtLabel = "n/a";
|
||||
private string SourceLabel = "n/a";
|
||||
private string DecisionFeedLabel = "DISCONNECTED";
|
||||
private string FactorFeedLabel = "DISCONNECTED";
|
||||
private string RawFeedLabel = "DISCONNECTED";
|
||||
private string ReportPath = "n/a";
|
||||
private readonly List<ActivityLog> RecentActivities = new();
|
||||
|
||||
// KPI values
|
||||
private int TotalRuns = 47;
|
||||
private int WeeklyRuns = 12;
|
||||
private int SuccessRate = 94;
|
||||
private int RecentErrors = 3;
|
||||
private string LastSyncTime = "2분 전";
|
||||
private bool IsLastSyncSuccess = true;
|
||||
private bool KisApiStatus = true;
|
||||
private string SystemCheckTime = DateTime.Now.ToString("HH:mm:ss");
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Load operational report
|
||||
var report = await Http.GetFromJsonAsync<OperationalReportData>("api/operational-report");
|
||||
if (report != null)
|
||||
{
|
||||
Sections.Clear();
|
||||
Sections.AddRange(report.Sections);
|
||||
SectionCountLabel = report.SectionCount.ToString();
|
||||
GeneratedAtLabel = report.GeneratedAt;
|
||||
SourceLabel = report.SourceJson;
|
||||
ReportStateLabel = Sections.Count > 0 ? "READY" : "DATA_MISSING";
|
||||
ReportChipLabel = Sections.Count > 0 ? "READY" : "DATA_MISSING";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
ReportStateLabel = "DATA_MISSING";
|
||||
ReportChipLabel = "DATA_MISSING";
|
||||
// Handle error silently
|
||||
}
|
||||
|
||||
// Load recent activities
|
||||
LoadRecentActivities();
|
||||
}
|
||||
|
||||
private void LoadRecentActivities()
|
||||
{
|
||||
RecentActivities.Clear();
|
||||
RecentActivities.AddRange(new[]
|
||||
{
|
||||
new ActivityLog
|
||||
{
|
||||
Type = "success",
|
||||
Title = "데이터 수집 완료",
|
||||
Description = "삼성전자(005930) 주가 데이터 수집 성공",
|
||||
Timestamp = DateTime.Now.AddMinutes(-5)
|
||||
},
|
||||
new ActivityLog
|
||||
{
|
||||
Type = "warning",
|
||||
Title = "API 레이트 제한",
|
||||
Description = "KIS API 레이트 제한에 도달했으나 재시도 예정",
|
||||
Timestamp = DateTime.Now.AddMinutes(-12)
|
||||
},
|
||||
new ActivityLog
|
||||
{
|
||||
Type = "success",
|
||||
Title = "대시보드 업데이트",
|
||||
Description = "포트폴리오 구성 분석 완료",
|
||||
Timestamp = DateTime.Now.AddMinutes(-35)
|
||||
},
|
||||
new ActivityLog
|
||||
{
|
||||
Type = "info",
|
||||
Title = "스케줄 실행",
|
||||
Description = "일일 정기 수집 작업 시작",
|
||||
Timestamp = DateTime.Now.AddHours(-1)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async Task RefreshData()
|
||||
{
|
||||
await OnInitializedAsync();
|
||||
}
|
||||
|
||||
private string GetActivityIcon(string type) => type switch
|
||||
{
|
||||
"success" => Icons.Material.Filled.CheckCircle,
|
||||
"warning" => Icons.Material.Filled.WarningAmber,
|
||||
"error" => Icons.Material.Filled.Error,
|
||||
_ => Icons.Material.Filled.Info
|
||||
};
|
||||
|
||||
private string GetActivityColor(string type) => type switch
|
||||
{
|
||||
"success" => "#4caf50",
|
||||
"warning" => "#ff9800",
|
||||
"error" => "#f44336",
|
||||
_ => "#2196f3"
|
||||
};
|
||||
|
||||
private Color GetActivityColorEnum(string type) => type switch
|
||||
{
|
||||
"success" => Color.Success,
|
||||
"warning" => Color.Warning,
|
||||
"error" => Color.Error,
|
||||
_ => Color.Info
|
||||
};
|
||||
|
||||
private class ActivityLog
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Description { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,291 @@
|
||||
@page "/monitoring"
|
||||
@attribute [Authorize]
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>QuantEngine - 데이터 수집 모니터링</PageTitle>
|
||||
|
||||
<!-- Page Header -->
|
||||
<div class="mb-6">
|
||||
<MudText Typo="Typo.h4" Class="mb-2">데이터 수집 모니터링</MudText>
|
||||
<MudText Typo="Typo.body1" Class="text-muted">실시간 수집 작업 상태 및 에러 추적</MudText>
|
||||
</div>
|
||||
|
||||
<!-- Collection Status Cards -->
|
||||
<MudGrid Spacing="3" Class="mb-6">
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-2">진행 중인 작업</MudText>
|
||||
<MudText Typo="Typo.h5">@RunningCount</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-2">완료</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-success">@CompletedCount</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-2">실패</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-error">@FailedCount</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-2">대기 중</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-warning">@PendingCount</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- Tabs -->
|
||||
<MudTabs Outlined="true" Class="mb-6">
|
||||
<!-- Recent Runs -->
|
||||
<MudTabPanel Text="최근 실행">
|
||||
<div class="py-4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
@if (RecentRuns.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">최근 실행 기록이 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="@RecentRuns" Dense="true" Hover="true" Striped="true">
|
||||
<HeaderContent>
|
||||
<MudTh>실행 ID</MudTh>
|
||||
<MudTh>시작 시간</MudTh>
|
||||
<MudTh>종료 시간</MudTh>
|
||||
<MudTh>상태</MudTh>
|
||||
<MudTh>수집된 항목</MudTh>
|
||||
<MudTh>작업</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Run ID">
|
||||
<MudText Typo="Typo.body2" Class="font-monospace">@context.RunId</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Start">
|
||||
<MudText Typo="Typo.body2">@context.StartTime.ToString("yyyy-MM-dd HH:mm:ss")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="End">
|
||||
<MudText Typo="Typo.body2">@(context.EndTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Status">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@GetStatusColor(context.Status)"
|
||||
Variant="Variant.Filled">
|
||||
@context.Status
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Items">
|
||||
<MudText Typo="Typo.body2">@context.ItemCount</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Actions">
|
||||
<MudButton Variant="Variant.Text" Size="Size.Small" Color="Color.Primary"
|
||||
OnClick="@(() => ViewRunDetails(context))">
|
||||
상세
|
||||
</MudButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
</MudPaper>
|
||||
</div>
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- Error Logs -->
|
||||
<MudTabPanel Text="에러 로그">
|
||||
<div class="py-4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
@if (Errors.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Success">에러가 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var error in Errors)
|
||||
{
|
||||
<div class="pa-3" style="border-left: 3px solid #f44336; background-color: var(--mud-palette-surface);">
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">@error.Message</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">@error.Timestamp.ToString("yyyy-MM-dd HH:mm:ss")</MudText>
|
||||
</div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">Run ID: @error.RunId</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted mt-1">@error.StackTrace</MudText>
|
||||
</div>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
</MudPaper>
|
||||
</div>
|
||||
</MudTabPanel>
|
||||
|
||||
<!-- Collection Status -->
|
||||
<MudTabPanel Text="수집 상태">
|
||||
<div class="py-4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudStack Spacing="3">
|
||||
@foreach (var ticker in CollectionStatus)
|
||||
{
|
||||
<div class="pa-3" style="border-bottom: 1px solid var(--mud-palette-divider);">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">@ticker.Ticker</MudText>
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(ticker.IsSuccessful ? Color.Success : Color.Warning)"
|
||||
Variant="Variant.Filled">
|
||||
@(ticker.IsSuccessful ? "성공" : "실패")
|
||||
</MudChip>
|
||||
</div>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">
|
||||
마지막 수집: @ticker.LastCollectionTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">
|
||||
데이터 포인트: @ticker.DataPointCount개
|
||||
</MudText>
|
||||
</div>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</div>
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
|
||||
@code {
|
||||
// Status counts
|
||||
private int RunningCount = 2;
|
||||
private int CompletedCount = 156;
|
||||
private int FailedCount = 8;
|
||||
private int PendingCount = 5;
|
||||
|
||||
// Recent runs
|
||||
private List<RunModel> RecentRuns = new();
|
||||
|
||||
// Errors
|
||||
private List<ErrorModel> Errors = new();
|
||||
|
||||
// Collection status
|
||||
private List<CollectionStatusModel> CollectionStatus = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadData();
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
// Load recent runs
|
||||
RecentRuns = new List<RunModel>
|
||||
{
|
||||
new RunModel
|
||||
{
|
||||
RunId = "RUN-2026-07-05-001",
|
||||
StartTime = DateTime.Now.AddMinutes(-45),
|
||||
EndTime = DateTime.Now.AddMinutes(-40),
|
||||
Status = "완료",
|
||||
ItemCount = 142
|
||||
},
|
||||
new RunModel
|
||||
{
|
||||
RunId = "RUN-2026-07-05-002",
|
||||
StartTime = DateTime.Now.AddMinutes(-30),
|
||||
EndTime = null,
|
||||
Status = "진행 중",
|
||||
ItemCount = 87
|
||||
},
|
||||
new RunModel
|
||||
{
|
||||
RunId = "RUN-2026-07-04-012",
|
||||
StartTime = DateTime.Now.AddHours(-8).AddMinutes(-15),
|
||||
EndTime = DateTime.Now.AddHours(-8).AddMinutes(-5),
|
||||
Status = "완료",
|
||||
ItemCount = 189
|
||||
}
|
||||
};
|
||||
|
||||
// Load errors
|
||||
Errors = new List<ErrorModel>
|
||||
{
|
||||
new ErrorModel
|
||||
{
|
||||
RunId = "RUN-2026-07-04-011",
|
||||
Message = "API Rate Limit Exceeded",
|
||||
StackTrace = "Exception at CollectionService.FetchData()",
|
||||
Timestamp = DateTime.Now.AddHours(-2)
|
||||
},
|
||||
new ErrorModel
|
||||
{
|
||||
RunId = "RUN-2026-07-03-015",
|
||||
Message = "Connection Timeout",
|
||||
StackTrace = "Exception at HttpClient.GetAsync()",
|
||||
Timestamp = DateTime.Now.AddHours(-5)
|
||||
}
|
||||
};
|
||||
|
||||
// Load collection status
|
||||
CollectionStatus = new List<CollectionStatusModel>
|
||||
{
|
||||
new CollectionStatusModel
|
||||
{
|
||||
Ticker = "005930",
|
||||
IsSuccessful = true,
|
||||
LastCollectionTime = DateTime.Now.AddMinutes(-2),
|
||||
DataPointCount = 1450
|
||||
},
|
||||
new CollectionStatusModel
|
||||
{
|
||||
Ticker = "000660",
|
||||
IsSuccessful = true,
|
||||
LastCollectionTime = DateTime.Now.AddMinutes(-5),
|
||||
DataPointCount = 1203
|
||||
},
|
||||
new CollectionStatusModel
|
||||
{
|
||||
Ticker = "051910",
|
||||
IsSuccessful = false,
|
||||
LastCollectionTime = DateTime.Now.AddHours(-1),
|
||||
DataPointCount = 945
|
||||
}
|
||||
};
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Color GetStatusColor(string status) => status switch
|
||||
{
|
||||
"완료" => Color.Success,
|
||||
"진행 중" => Color.Info,
|
||||
"실패" => Color.Error,
|
||||
_ => Color.Warning
|
||||
};
|
||||
|
||||
private async Task ViewRunDetails(RunModel run)
|
||||
{
|
||||
// View details dialog
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private class RunModel
|
||||
{
|
||||
public string RunId { get; set; }
|
||||
public DateTime StartTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
public string Status { get; set; }
|
||||
public int ItemCount { get; set; }
|
||||
}
|
||||
|
||||
private class ErrorModel
|
||||
{
|
||||
public string RunId { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string StackTrace { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
|
||||
private class CollectionStatusModel
|
||||
{
|
||||
public string Ticker { get; set; }
|
||||
public bool IsSuccessful { get; set; }
|
||||
public DateTime LastCollectionTime { get; set; }
|
||||
public int DataPointCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
@page "/portfolio"
|
||||
@attribute [Authorize]
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>QuantEngine - 포트폴리오</PageTitle>
|
||||
|
||||
<!-- Page Header -->
|
||||
<div class="mb-6">
|
||||
<MudText Typo="Typo.h4" Class="mb-2">포트폴리오</MudText>
|
||||
<MudText Typo="Typo.body1" Class="text-muted">자산 구성 및 성과 분석</MudText>
|
||||
</div>
|
||||
|
||||
<!-- Summary Cards -->
|
||||
<MudGrid Spacing="3" Class="mb-6">
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">총 평가액</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-primary">₩125.5M</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-success mt-1">+3.2% (이번 달)</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">보유 종목</MudText>
|
||||
<MudText Typo="Typo.h5">12개</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-1">주식 및 펀드</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">수익률</MudText>
|
||||
<MudText Typo="Typo.h5" Class="text-success">+8.5%</MudText>
|
||||
<MudText Typo="Typo.body2" Class="text-muted mt-1">연간 기준</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Class="pa-4" Elevation="0" Style="border: 1px solid var(--mud-palette-divider);">
|
||||
<MudText Typo="Typo.caption" Class="text-muted mb-1">위험도</MudText>
|
||||
<MudText Typo="Typo.h5">중간</MudText>
|
||||
<MudChip T="string" Label="true" Size="Size.Small" Color="Color.Warning" Variant="Variant.Filled" Class="mt-1">
|
||||
Moderate
|
||||
</MudChip>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- Asset Breakdown -->
|
||||
<MudGrid Spacing="3" Class="mb-6">
|
||||
<MudItem xs="12" md="8">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-4">자산 구성</MudText>
|
||||
|
||||
<MudTable Items="@Assets" Dense="true" Hover="true" Striped="true">
|
||||
<HeaderContent>
|
||||
<MudTh>종목/펀드명</MudTh>
|
||||
<MudTh>수량</MudTh>
|
||||
<MudTh>현재가</MudTh>
|
||||
<MudTh>평가액</MudTh>
|
||||
<MudTh>수익률</MudTh>
|
||||
<MudTh>비율</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Name">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<MudAvatar Size="Size.Small" Color="Color.Primary">@context.Name[0]</MudAvatar>
|
||||
<div>
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">@context.Name</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">@context.Ticker</MudText>
|
||||
</div>
|
||||
</div>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Quantity">
|
||||
<MudText Typo="Typo.body2">@context.Quantity.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Price">
|
||||
<MudText Typo="Typo.body2">₩@context.CurrentPrice.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Value">
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">₩@context.Value.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Return">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(context.ReturnRate >= 0 ? Color.Success : Color.Error)"
|
||||
Variant="Variant.Filled">
|
||||
@(context.ReturnRate >= 0 ? "+" : "")@context.ReturnRate.ToString("F1")%
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Ratio">
|
||||
<MudText Typo="Typo.body2">@context.Ratio.ToString("F1")%</MudText>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-4">자산 분류</MudText>
|
||||
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var category in AssetCategories)
|
||||
{
|
||||
<div>
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<MudText Typo="Typo.body2">@category.Name</MudText>
|
||||
<MudText Typo="Typo.body2" Class="font-weight-500">@category.Percentage%</MudText>
|
||||
</div>
|
||||
<MudProgressLinear Value="@category.Percentage" Color="@category.Color" />
|
||||
</div>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- Trading History -->
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-4">거래 이력</MudText>
|
||||
|
||||
@if (TradingHistory.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">거래 이력이 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="@TradingHistory" Dense="true" Hover="true" Striped="true">
|
||||
<HeaderContent>
|
||||
<MudTh>일자</MudTh>
|
||||
<MudTh>종목</MudTh>
|
||||
<MudTh>구분</MudTh>
|
||||
<MudTh>수량</MudTh>
|
||||
<MudTh>단가</MudTh>
|
||||
<MudTh>금액</MudTh>
|
||||
<MudTh>수수료</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Date">
|
||||
<MudText Typo="Typo.body2">@context.Date.ToString("yyyy-MM-dd")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Ticker">
|
||||
<MudText Typo="Typo.body2">@context.Ticker</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Type">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(context.Type == "매수" ? Color.Success : Color.Error)"
|
||||
Variant="Variant.Filled">
|
||||
@context.Type
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Quantity">
|
||||
<MudText Typo="Typo.body2">@context.Quantity</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Price">
|
||||
<MudText Typo="Typo.body2">₩@context.Price.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Amount">
|
||||
<MudText Typo="Typo.body2">₩@context.Amount.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Fee">
|
||||
<MudText Typo="Typo.body2" Class="text-muted">₩@context.Fee.ToString("N0")</MudText>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
private List<AssetModel> Assets = new();
|
||||
private List<CategoryModel> AssetCategories = new();
|
||||
private List<TradeModel> TradingHistory = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAssets();
|
||||
}
|
||||
|
||||
private async Task LoadAssets()
|
||||
{
|
||||
Assets = new List<AssetModel>
|
||||
{
|
||||
new AssetModel { Name = "삼성전자", Ticker = "005930", Quantity = 50, CurrentPrice = 70000, Value = 3500000, ReturnRate = 5.2, Ratio = 28.0 },
|
||||
new AssetModel { Name = "LG화학", Ticker = "051910", Quantity = 30, CurrentPrice = 820000, Value = 24600000, ReturnRate = -2.1, Ratio = 19.6 },
|
||||
new AssetModel { Name = "현대차", Ticker = "005380", Quantity = 40, CurrentPrice = 245000, Value = 9800000, ReturnRate = 8.5, Ratio = 7.8 },
|
||||
new AssetModel { Name = "SK하이닉스", Ticker = "000660", Quantity = 25, CurrentPrice = 105000, Value = 2625000, ReturnRate = 12.3, Ratio = 2.1 },
|
||||
new AssetModel { Name = "삼성중공업", Ticker = "010140", Quantity = 60, CurrentPrice = 85000, Value = 5100000, ReturnRate = 3.7, Ratio = 4.1 },
|
||||
new AssetModel { Name = "포스코", Ticker = "005490", Quantity = 20, CurrentPrice = 75000, Value = 1500000, ReturnRate = -5.2, Ratio = 1.2 },
|
||||
};
|
||||
|
||||
AssetCategories = new List<CategoryModel>
|
||||
{
|
||||
new CategoryModel { Name = "대형주", Percentage = 45, Color = Color.Primary },
|
||||
new CategoryModel { Name = "중형주", Percentage = 30, Color = Color.Secondary },
|
||||
new CategoryModel { Name = "소형주", Percentage = 15, Color = Color.Info },
|
||||
new CategoryModel { Name = "채권/현금", Percentage = 10, Color = Color.Success }
|
||||
};
|
||||
|
||||
TradingHistory = new List<TradeModel>
|
||||
{
|
||||
new TradeModel { Date = DateTime.Now.AddDays(-5), Ticker = "005930", Type = "매수", Quantity = 10, Price = 68000, Amount = 680000, Fee = 1360 },
|
||||
new TradeModel { Date = DateTime.Now.AddDays(-10), Ticker = "051910", Type = "매도", Quantity = 5, Price = 850000, Amount = 4250000, Fee = 8500 },
|
||||
new TradeModel { Date = DateTime.Now.AddDays(-15), Ticker = "005380", Type = "매수", Quantity = 20, Price = 240000, Amount = 4800000, Fee = 9600 },
|
||||
};
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private class AssetModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Ticker { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal CurrentPrice { get; set; }
|
||||
public decimal Value { get; set; }
|
||||
public decimal ReturnRate { get; set; }
|
||||
public decimal Ratio { get; set; }
|
||||
}
|
||||
|
||||
private class CategoryModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Percentage { get; set; }
|
||||
public Color Color { get; set; }
|
||||
}
|
||||
|
||||
private class TradeModel
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
public string Ticker { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public decimal Fee { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
@page "/users"
|
||||
@attribute [Authorize]
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>QuantEngine - 사용자 관리</PageTitle>
|
||||
|
||||
<!-- Page Header -->
|
||||
<div class="mb-6">
|
||||
<MudText Typo="Typo.h4" Class="mb-2">사용자 관리</MudText>
|
||||
<MudText Typo="Typo.body1" Class="text-muted">시스템 사용자 및 권한 관리</MudText>
|
||||
</div>
|
||||
|
||||
<!-- Action Bar -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<MudTextField @bind-Value="SearchQuery" Placeholder="사용자 검색..."
|
||||
StartAdornment="@Icons.Material.Filled.Search"
|
||||
Style="width: 300px;" />
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OpenAddUserDialog">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Add" Class="mr-2" />
|
||||
새 사용자 추가
|
||||
</MudButton>
|
||||
</div>
|
||||
|
||||
<!-- Users Table -->
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
@if (Users.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">사용자가 없습니다.</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="@FilteredUsers" Dense="true" Hover="true" Striped="true">
|
||||
<HeaderContent>
|
||||
<MudTh>이름</MudTh>
|
||||
<MudTh>이메일</MudTh>
|
||||
<MudTh>역할</MudTh>
|
||||
<MudTh>상태</MudTh>
|
||||
<MudTh>가입일</MudTh>
|
||||
<MudTh>작업</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Name">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<MudAvatar Size="Size.Small" Color="Color.Primary">@context.Name[0]</MudAvatar>
|
||||
<MudText Typo="Typo.body2">@context.Name</MudText>
|
||||
</div>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Email">
|
||||
<MudText Typo="Typo.body2">@context.Email</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Role">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(context.Role == "Admin" ? Color.Primary : Color.Default)"
|
||||
Variant="Variant.Filled">
|
||||
@context.Role
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Status">
|
||||
<MudChip T="string" Label="true" Size="Size.Small"
|
||||
Color="@(context.IsActive ? Color.Success : Color.Warning)"
|
||||
Variant="Variant.Filled">
|
||||
@(context.IsActive ? "활성" : "비활성")
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Joined">
|
||||
<MudText Typo="Typo.body2">@context.CreatedDate.ToString("yyyy-MM-dd")</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Actions">
|
||||
<MudButton Variant="Variant.Text" Size="Size.Small" Color="Color.Primary" OnClick="@(() => EditUser(context))">편집</MudButton>
|
||||
<MudButton Variant="Variant.Text" Size="Size.Small" Color="Color.Error" OnClick="@(() => DeleteUser(context))">삭제</MudButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
private List<UserModel> Users = new();
|
||||
private string SearchQuery = "";
|
||||
|
||||
private IEnumerable<UserModel> FilteredUsers
|
||||
{
|
||||
get => string.IsNullOrEmpty(SearchQuery)
|
||||
? Users
|
||||
: Users.Where(u => u.Name.Contains(SearchQuery, StringComparison.OrdinalIgnoreCase) ||
|
||||
u.Email.Contains(SearchQuery, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadUsers();
|
||||
}
|
||||
|
||||
private async Task LoadUsers()
|
||||
{
|
||||
try
|
||||
{
|
||||
Users = new List<UserModel>
|
||||
{
|
||||
new UserModel
|
||||
{
|
||||
Id = "1",
|
||||
Name = "admin",
|
||||
Email = "admin@quantengine.local",
|
||||
Role = "Admin",
|
||||
IsActive = true,
|
||||
CreatedDate = DateTime.Now.AddMonths(-6)
|
||||
},
|
||||
new UserModel
|
||||
{
|
||||
Id = "2",
|
||||
Name = "user1",
|
||||
Email = "user1@example.com",
|
||||
Role = "Viewer",
|
||||
IsActive = true,
|
||||
CreatedDate = DateTime.Now.AddMonths(-3)
|
||||
},
|
||||
new UserModel
|
||||
{
|
||||
Id = "3",
|
||||
Name = "user2",
|
||||
Email = "user2@example.com",
|
||||
Role = "Operator",
|
||||
IsActive = true,
|
||||
CreatedDate = DateTime.Now.AddMonths(-1)
|
||||
}
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OpenAddUserDialog()
|
||||
{
|
||||
// Dialog implementation would go here
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task EditUser(UserModel user)
|
||||
{
|
||||
// Edit dialog implementation
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task DeleteUser(UserModel user)
|
||||
{
|
||||
// Delete confirmation and implementation
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private class UserModel
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Role { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
// Register LocalStorage for cross-platform session persistence
|
||||
builder.Services.AddScoped<LocalStorageService>();
|
||||
|
||||
// App State Service (RBAC & global state management)
|
||||
builder.Services.AddScoped<AppStateService>();
|
||||
|
||||
// Authentication setup in WebAssembly client
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
namespace QuantEngine.Web.Client.Services;
|
||||
|
||||
public class AppStateService
|
||||
{
|
||||
private UserContext _currentUser;
|
||||
private List<string> _userRoles = new();
|
||||
private bool _isInitialized = false;
|
||||
|
||||
public event Action OnStateChanged;
|
||||
|
||||
public UserContext CurrentUser
|
||||
{
|
||||
get => _currentUser;
|
||||
set
|
||||
{
|
||||
_currentUser = value;
|
||||
NotifyStateChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> UserRoles
|
||||
{
|
||||
get => _userRoles;
|
||||
set
|
||||
{
|
||||
_userRoles = value;
|
||||
NotifyStateChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInitialized
|
||||
{
|
||||
get => _isInitialized;
|
||||
set
|
||||
{
|
||||
_isInitialized = value;
|
||||
NotifyStateChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public AppStateService()
|
||||
{
|
||||
_currentUser = new UserContext();
|
||||
_userRoles = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize app state from current user context
|
||||
/// </summary>
|
||||
public async Task InitializeAsync(HttpClient httpClient)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await httpClient.GetAsync("api/auth/user");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
// Parse user info (implement as needed)
|
||||
CurrentUser = new UserContext { Name = "Admin", Email = "admin@quantengine.local" };
|
||||
UserRoles = new List<string> { "Admin" };
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if user has specific role (RBAC)
|
||||
/// </summary>
|
||||
public bool HasRole(string role)
|
||||
{
|
||||
return UserRoles.Contains(role);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if user has any of the specified roles
|
||||
/// </summary>
|
||||
public bool HasAnyRole(params string[] roles)
|
||||
{
|
||||
return roles.Any(r => UserRoles.Contains(r));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if user has all specified roles
|
||||
/// </summary>
|
||||
public bool HasAllRoles(params string[] roles)
|
||||
{
|
||||
return roles.All(r => UserRoles.Contains(r));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear user state
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
CurrentUser = new UserContext();
|
||||
UserRoles = new List<string>();
|
||||
IsInitialized = false;
|
||||
}
|
||||
|
||||
private void NotifyStateChanged() => OnStateChanged?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User context model
|
||||
/// </summary>
|
||||
public class UserContext
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string Name { get; set; } = "";
|
||||
public string Email { get; set; } = "";
|
||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API Response wrapper
|
||||
/// </summary>
|
||||
public class ApiResponse<T>
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string Message { get; set; }
|
||||
public T Data { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pagination model
|
||||
/// </summary>
|
||||
public class PaginatedResponse<T>
|
||||
{
|
||||
public List<T> Items { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalCount { get; set; }
|
||||
public int TotalPages => (TotalCount + PageSize - 1) / PageSize;
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
using MudBlazor;
|
||||
|
||||
namespace QuantEngine.Web.Client.Theme;
|
||||
|
||||
public static class AppTheme
|
||||
{
|
||||
public static MudTheme LightTheme => new()
|
||||
{
|
||||
Palette = new PaletteLight
|
||||
{
|
||||
Primary = "#3f51b5",
|
||||
Secondary = "#f50057",
|
||||
Success = "#4caf50",
|
||||
Warning = "#ff9800",
|
||||
Error = "#f44336",
|
||||
Info = "#2196f3",
|
||||
Dark = "#121212",
|
||||
Background = "#fafafa",
|
||||
Surface = "#ffffff",
|
||||
TextPrimary = "#212121",
|
||||
TextSecondary = "rgba(0,0,0,0.6)",
|
||||
DrawerBackground = "#ffffff",
|
||||
DrawerText = "#212121",
|
||||
AppbarBackground = "#3f51b5",
|
||||
AppbarText = "#ffffff",
|
||||
ActionDefault = "#c0c0c0",
|
||||
ActionDisabled = "#f5f5f5",
|
||||
ActionDisabledBackground = "rgba(0,0,0,0.12)",
|
||||
Divider = "#e0e0e0",
|
||||
DividerLight = "#f5f5f5",
|
||||
TableLines = "#e0e0e0",
|
||||
LinesDefault = "#e0e0e0",
|
||||
LinesInputBorder = "#bdbdbd",
|
||||
TextDisabled = "rgba(0,0,0,0.38)",
|
||||
BorderRadius = "4px",
|
||||
OverlayShadow = "0 5px 5px -3px rgba(0,0,0,0.2), 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12)",
|
||||
Elevation = new Dictionary<int, string>
|
||||
{
|
||||
{ 0, "none" },
|
||||
{ 1, "0 2px 1px -1px rgba(0,0,0,0.2),0 1px 1px 0 rgba(0,0,0,0.14),0 1px 3px 0 rgba(0,0,0,0.12)" },
|
||||
{ 2, "0 3px 1px -2px rgba(0,0,0,0.2),0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12)" },
|
||||
{ 3, "0 3px 3px -2px rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.14),0 1px 8px 0 rgba(0,0,0,0.12)" },
|
||||
{ 4, "0 2px 4px -1px rgba(0,0,0,0.2),0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12)" },
|
||||
}
|
||||
},
|
||||
Typography = new Typography
|
||||
{
|
||||
Default = new DefaultTypography
|
||||
{
|
||||
FontFamily = "Roboto, sans-serif",
|
||||
FontSize = "1rem",
|
||||
FontWeight = 400,
|
||||
LineHeight = 1.5,
|
||||
LetterSpacing = "0.5px"
|
||||
},
|
||||
H1 = new H1Typography
|
||||
{
|
||||
FontSize = "6rem",
|
||||
FontWeight = 300,
|
||||
LineHeight = 1.167,
|
||||
LetterSpacing = "-0.015625em"
|
||||
},
|
||||
H2 = new H2Typography
|
||||
{
|
||||
FontSize = "3.75rem",
|
||||
FontWeight = 300,
|
||||
LineHeight = 1.2,
|
||||
LetterSpacing = "-0.0083333333em"
|
||||
},
|
||||
H3 = new H3Typography
|
||||
{
|
||||
FontSize = "3rem",
|
||||
FontWeight = 400,
|
||||
LineHeight = 1.167,
|
||||
LetterSpacing = "0em"
|
||||
},
|
||||
H4 = new H4Typography
|
||||
{
|
||||
FontSize = "2.125rem",
|
||||
FontWeight = 500,
|
||||
LineHeight = 1.235,
|
||||
LetterSpacing = "0.0125em"
|
||||
},
|
||||
H5 = new H5Typography
|
||||
{
|
||||
FontSize = "1.5rem",
|
||||
FontWeight = 500,
|
||||
LineHeight = 1.334,
|
||||
LetterSpacing = "0em"
|
||||
},
|
||||
H6 = new H6Typography
|
||||
{
|
||||
FontSize = "1.25rem",
|
||||
FontWeight = 600,
|
||||
LineHeight = 1.6,
|
||||
LetterSpacing = "0.0125em"
|
||||
},
|
||||
Body1 = new Body1Typography
|
||||
{
|
||||
FontSize = "1rem",
|
||||
FontWeight = 500,
|
||||
LineHeight = 1.5,
|
||||
LetterSpacing = "0.03125em"
|
||||
},
|
||||
Body2 = new Body2Typography
|
||||
{
|
||||
FontSize = "0.875rem",
|
||||
FontWeight = 400,
|
||||
LineHeight = 1.43,
|
||||
LetterSpacing = "0.0178571429em"
|
||||
},
|
||||
Button = new ButtonTypography
|
||||
{
|
||||
FontSize = "0.875rem",
|
||||
FontWeight = 600,
|
||||
LineHeight = 1.75,
|
||||
LetterSpacing = "0.0892857143em"
|
||||
},
|
||||
Caption = new CaptionTypography
|
||||
{
|
||||
FontSize = "0.75rem",
|
||||
FontWeight = 400,
|
||||
LineHeight = 1.66,
|
||||
LetterSpacing = "0.0333333333em"
|
||||
}
|
||||
},
|
||||
LayoutProperties = new LayoutProperties
|
||||
{
|
||||
DefaultBorderRadius = "4px",
|
||||
DrawerWidthLeft = "256px",
|
||||
DrawerWidthRight = "256px",
|
||||
AppbarHeight = "64px",
|
||||
}
|
||||
};
|
||||
|
||||
public static MudTheme DarkTheme => new()
|
||||
{
|
||||
Palette = new PaletteDark
|
||||
{
|
||||
Primary = "#bb86fc",
|
||||
Secondary = "#03dac6",
|
||||
Success = "#4caf50",
|
||||
Warning = "#ff9800",
|
||||
Error = "#cf6679",
|
||||
Info = "#2196f3",
|
||||
Dark = "#121212",
|
||||
Background = "#121212",
|
||||
Surface = "#1e1e1e",
|
||||
TextPrimary = "#ffffff",
|
||||
TextSecondary = "rgba(255,255,255,0.7)",
|
||||
DrawerBackground = "#1e1e1e",
|
||||
DrawerText = "#ffffff",
|
||||
AppbarBackground = "#1f1f1f",
|
||||
AppbarText = "#ffffff",
|
||||
ActionDefault = "#3f3f3f",
|
||||
ActionDisabled = "#1e1e1e",
|
||||
ActionDisabledBackground = "rgba(255,255,255,0.12)",
|
||||
Divider = "#37474f",
|
||||
DividerLight = "#2c3e50",
|
||||
TableLines = "#37474f",
|
||||
LinesDefault = "#37474f",
|
||||
LinesInputBorder = "#555555",
|
||||
TextDisabled = "rgba(255,255,255,0.38)",
|
||||
BorderRadius = "4px",
|
||||
OverlayShadow = "0 5px 5px -3px rgba(0,0,0,0.2), 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12)",
|
||||
Elevation = new Dictionary<int, string>
|
||||
{
|
||||
{ 0, "none" },
|
||||
{ 1, "0 2px 1px -1px rgba(0,0,0,0.2),0 1px 1px 0 rgba(0,0,0,0.14),0 1px 3px 0 rgba(0,0,0,0.12)" },
|
||||
{ 2, "0 3px 1px -2px rgba(0,0,0,0.2),0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12)" },
|
||||
{ 3, "0 3px 3px -2px rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.14),0 1px 8px 0 rgba(0,0,0,0.12)" },
|
||||
{ 4, "0 2px 4px -1px rgba(0,0,0,0.2),0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12)" },
|
||||
}
|
||||
},
|
||||
Typography = LightTheme.Typography,
|
||||
LayoutProperties = LightTheme.LayoutProperties
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
/* QuantEngine Global Styles */
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: var(--mud-palette-text-primary, #212121);
|
||||
background-color: var(--mud-palette-background, #fafafa);
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Scrollbar Styling */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--mud-palette-surface, #ffffff);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--mud-palette-action-default, #c0c0c0);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--mud-palette-primary, #3f51b5);
|
||||
}
|
||||
|
||||
/* Text Utilities */
|
||||
.text-primary {
|
||||
color: var(--mud-palette-primary, #3f51b5);
|
||||
}
|
||||
|
||||
.text-secondary {
|
||||
color: var(--mud-palette-secondary, #f50057);
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: var(--mud-palette-success, #4caf50);
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: var(--mud-palette-warning, #ff9800);
|
||||
}
|
||||
|
||||
.text-error {
|
||||
color: var(--mud-palette-error, #f44336);
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: var(--mud-palette-text-secondary, rgba(0,0,0,0.6));
|
||||
}
|
||||
|
||||
/* Spacing Utilities */
|
||||
.mt-1 { margin-top: 0.25rem; }
|
||||
.mt-2 { margin-top: 0.5rem; }
|
||||
.mt-3 { margin-top: 1rem; }
|
||||
.mt-4 { margin-top: 1.5rem; }
|
||||
.mt-5 { margin-top: 3rem; }
|
||||
|
||||
.mb-1 { margin-bottom: 0.25rem; }
|
||||
.mb-2 { margin-bottom: 0.5rem; }
|
||||
.mb-3 { margin-bottom: 1rem; }
|
||||
.mb-4 { margin-bottom: 1.5rem; }
|
||||
.mb-5 { margin-bottom: 3rem; }
|
||||
|
||||
.mx-auto { margin-left: auto; margin-right: auto; }
|
||||
.my-auto { margin-top: auto; margin-bottom: auto; }
|
||||
|
||||
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
|
||||
.px-4 { padding-left: 1rem; padding-right: 1rem; }
|
||||
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
|
||||
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
|
||||
|
||||
/* Flex Utilities */
|
||||
.d-flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.align-items-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.justify-content-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-content-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* Gap Utilities */
|
||||
.gap-1 { gap: 0.25rem; }
|
||||
.gap-2 { gap: 0.5rem; }
|
||||
.gap-3 { gap: 1rem; }
|
||||
.gap-4 { gap: 1.5rem; }
|
||||
|
||||
/* Loading Skeleton */
|
||||
.skeleton {
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
var(--mud-palette-surface, #fff) 0%,
|
||||
var(--mud-palette-divider, #e0e0e0) 50%,
|
||||
var(--mud-palette-surface, #fff) 100%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
animation: loading 1.5s infinite;
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
0% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* MudBlazor Overrides */
|
||||
.mud-appbar {
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.mud-drawer {
|
||||
border-right: 1px solid var(--mud-palette-divider, #e0e0e0);
|
||||
}
|
||||
|
||||
.mud-drawer-content {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.mud-nav-link {
|
||||
border-radius: 4px;
|
||||
margin-bottom: 0.25rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.mud-nav-link:hover {
|
||||
background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.04));
|
||||
}
|
||||
|
||||
.mud-nav-link.mud-ripple-nav-link-active {
|
||||
background-color: var(--mud-palette-primary-lighten, rgba(63, 81, 181, 0.1));
|
||||
color: var(--mud-palette-primary, #3f51b5);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mud-card {
|
||||
border: 1px solid var(--mud-palette-divider, #e0e0e0);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.mud-card:hover {
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.mud-button {
|
||||
text-transform: none;
|
||||
font-weight: 500;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.mud-button-root:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.mud-input-control {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.mud-input-label {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.mud-input {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.mud-input.mud-input-text {
|
||||
background-color: var(--mud-palette-surface, #ffffff);
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.mud-table {
|
||||
background-color: var(--mud-palette-surface, #ffffff);
|
||||
}
|
||||
|
||||
.mud-table-head {
|
||||
background-color: var(--mud-palette-background, #fafafa);
|
||||
}
|
||||
|
||||
.mud-table-row:hover {
|
||||
background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.04));
|
||||
}
|
||||
|
||||
.mud-table-cell {
|
||||
padding: 1rem;
|
||||
border-color: var(--mud-palette-divider, #e0e0e0);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mud-drawer {
|
||||
width: 100% !important;
|
||||
max-width: 90% !important;
|
||||
}
|
||||
|
||||
.mud-appbar {
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.mud-table-cell {
|
||||
padding: 0.75rem 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animation Classes */
|
||||
.fade-in {
|
||||
animation: fadeIn 0.3s ease-in;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.slide-in {
|
||||
animation: slideIn 0.3s ease-in;
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
transform: translateY(10px);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Accessibility */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print Styles */
|
||||
@media print {
|
||||
.mud-appbar,
|
||||
.mud-drawer,
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
body {
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<MudThemeProvider />
|
||||
<MudThemeProvider Theme="@_theme" />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
<Routes @rendermode="InteractiveWebAssembly" />
|
||||
@@ -27,4 +27,15 @@
|
||||
<script src="@Assets["_framework/blazor.web.js"]"></script>
|
||||
</body>
|
||||
|
||||
@code {
|
||||
private MudTheme _theme = AppTheme.LightTheme;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_theme = AppTheme.LightTheme;
|
||||
}
|
||||
}
|
||||
|
||||
@using QuantEngine.Web.Client.Theme
|
||||
|
||||
</html>
|
||||
|
||||
@@ -21,6 +21,9 @@ using Microsoft.AspNetCore.Authentication;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MudBlazor.Services;
|
||||
using QuantEngine.Web.Services;
|
||||
using Hangfire;
|
||||
using Hangfire.SqlServer;
|
||||
|
||||
// Serilog Configuration with Telegram Sink
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
@@ -47,6 +50,17 @@ builder.Services.AddAuthorizationCore();
|
||||
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
// Hangfire Background Job Scheduling
|
||||
try
|
||||
{
|
||||
var hangfireConnectionString = builder.Configuration.GetConnectionString("HangfireConnection") ?? connectionString;
|
||||
builder.Services.AddHangfireServices(hangfireConnectionString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning("Hangfire initialization failed: {Message}", ex.Message);
|
||||
}
|
||||
|
||||
// PostgreSQL Dapper Setup
|
||||
var configuredConnectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
var fallbackConnectionString = "Host=127.0.0.1;Database=quantenginedb;Username=quantengine_app;Password=CHANGE_ME;Search Path=quantengine;";
|
||||
@@ -143,6 +157,16 @@ app.UseAntiforgery();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
// Initialize Hangfire (dashboard and schedules)
|
||||
try
|
||||
{
|
||||
app.UseHangfireSetup(app.Services);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning("Hangfire setup failed: {Message}", ex.Message);
|
||||
}
|
||||
|
||||
app.MapStaticAssets();
|
||||
|
||||
app.MapGet("/", () => Results.Redirect("/login"));
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.23" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.23" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.8.23" />
|
||||
<PackageReference Include="MudBlazor" Version="8.6.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.0-preview.2.25120.18" />
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
using Hangfire;
|
||||
using QuantEngine.Application.Services;
|
||||
using QuantEngine.Infrastructure.Data;
|
||||
|
||||
namespace QuantEngine.Web.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduler Service for managing background jobs with Hangfire
|
||||
/// </summary>
|
||||
public class SchedulerService
|
||||
{
|
||||
private readonly ILogger<SchedulerService> _logger;
|
||||
private readonly IBackgroundJobClient _jobClient;
|
||||
private readonly IRecurringJobManager _recurringJobManager;
|
||||
private readonly IKisApiPriceSource _kisApi;
|
||||
|
||||
public SchedulerService(
|
||||
ILogger<SchedulerService> logger,
|
||||
IBackgroundJobClient jobClient,
|
||||
IRecurringJobManager recurringJobManager,
|
||||
IKisApiPriceSource kisApi)
|
||||
{
|
||||
_logger = logger;
|
||||
_jobClient = jobClient;
|
||||
_recurringJobManager = recurringJobManager;
|
||||
_kisApi = kisApi;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize scheduled jobs
|
||||
/// </summary>
|
||||
public void InitializeSchedules()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Initializing Hangfire schedules...");
|
||||
|
||||
// Daily data collection at 9:00 AM
|
||||
_recurringJobManager.AddOrUpdate(
|
||||
"daily-collection",
|
||||
() => RunDailyCollectionAsync(),
|
||||
"0 9 * * *", // Every day at 9:00 AM
|
||||
new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }
|
||||
);
|
||||
|
||||
// Hourly price update (during market hours 9 AM - 4 PM)
|
||||
_recurringJobManager.AddOrUpdate(
|
||||
"hourly-price-update",
|
||||
() => UpdatePricesAsync(),
|
||||
"0 9-15 * * 1-5", // Every hour, 9 AM to 3 PM, Mon-Fri
|
||||
new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }
|
||||
);
|
||||
|
||||
// Weekly report generation (Friday at 5:00 PM)
|
||||
_recurringJobManager.AddOrUpdate(
|
||||
"weekly-report",
|
||||
() => GenerateWeeklyReportAsync(),
|
||||
"0 17 * * 5", // Every Friday at 5:00 PM
|
||||
new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }
|
||||
);
|
||||
|
||||
// Monthly optimization (First day of month at 2:00 AM)
|
||||
_recurringJobManager.AddOrUpdate(
|
||||
"monthly-optimization",
|
||||
() => RunMonthlyOptimizationAsync(),
|
||||
"0 2 1 * *", // First day of month at 2:00 AM
|
||||
new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }
|
||||
);
|
||||
|
||||
_logger.LogInformation("Hangfire schedules initialized successfully");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error initializing Hangfire schedules");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run daily data collection
|
||||
/// </summary>
|
||||
public async Task RunDailyCollectionAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Starting daily data collection job at {Time}", DateTime.Now);
|
||||
|
||||
// List of tickers to collect
|
||||
var tickers = new[] { "005930", "000660", "051910", "005380", "010140", "005490" };
|
||||
|
||||
foreach (var ticker in tickers)
|
||||
{
|
||||
// Simulate data collection
|
||||
await Task.Delay(100);
|
||||
_logger.LogInformation("Collected data for ticker: {Ticker}", ticker);
|
||||
}
|
||||
|
||||
_logger.LogInformation("Daily data collection completed at {Time}", DateTime.Now);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during daily collection");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update prices hourly
|
||||
/// </summary>
|
||||
public async Task UpdatePricesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Starting hourly price update at {Time}", DateTime.Now);
|
||||
|
||||
var tickers = new[] { "005930", "000660", "051910" };
|
||||
|
||||
foreach (var ticker in tickers)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Enqueue price update as background job
|
||||
_jobClient.Enqueue(() => FetchPriceAsync(ticker));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to enqueue price update for {Ticker}", ticker);
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation("Hourly price update completed");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during price update");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetch price for specific ticker
|
||||
/// </summary>
|
||||
public async Task FetchPriceAsync(string ticker)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Fetching price for ticker: {Ticker}", ticker);
|
||||
// TODO: Implement actual price fetching
|
||||
await Task.Delay(50);
|
||||
_logger.LogInformation("Price fetched successfully for {Ticker}", ticker);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error fetching price for {Ticker}", ticker);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate weekly report
|
||||
/// </summary>
|
||||
public async Task GenerateWeeklyReportAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Starting weekly report generation at {Time}", DateTime.Now);
|
||||
|
||||
// TODO: Implement report generation logic
|
||||
await Task.Delay(500);
|
||||
|
||||
_logger.LogInformation("Weekly report generated successfully");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error generating weekly report");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run monthly optimization
|
||||
/// </summary>
|
||||
public async Task RunMonthlyOptimizationAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Starting monthly optimization at {Time}", DateTime.Now);
|
||||
|
||||
// TODO: Implement optimization logic
|
||||
await Task.Delay(1000);
|
||||
|
||||
_logger.LogInformation("Monthly optimization completed");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during monthly optimization");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enqueue one-time job
|
||||
/// </summary>
|
||||
public string EnqueueJob(string jobName, Func<Task> job)
|
||||
{
|
||||
var jobId = _jobClient.Enqueue(job);
|
||||
_logger.LogInformation("Enqueued job {JobName} with ID {JobId}", jobName, jobId);
|
||||
return jobId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get job status
|
||||
/// </summary>
|
||||
public JobState GetJobStatus(string jobId)
|
||||
{
|
||||
return JobStorage.Current.GetConnection().GetJobData(jobId)?.State;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel scheduled job
|
||||
/// </summary>
|
||||
public void CancelScheduledJob(string jobName)
|
||||
{
|
||||
_recurringJobManager.RemoveIfExists(jobName);
|
||||
_logger.LogInformation("Cancelled scheduled job: {JobName}", jobName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for Hangfire registration
|
||||
/// </summary>
|
||||
public static class HangfireServiceExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Register Hangfire with SQL Server storage
|
||||
/// </summary>
|
||||
public static IServiceCollection AddHangfireServices(
|
||||
this IServiceCollection services,
|
||||
string connectionString)
|
||||
{
|
||||
// Add Hangfire services
|
||||
services.AddHangfire(configuration => configuration
|
||||
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
|
||||
.UseSimpleAssemblyNameTypeSerializer()
|
||||
.UseRecommendedSerializerSettings()
|
||||
.UseSqlServerStorage(connectionString, new SqlServerStorageOptions
|
||||
{
|
||||
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
|
||||
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
|
||||
QueuePollInterval = TimeSpan.FromSeconds(15),
|
||||
UsePageLocks = true,
|
||||
DisableGlobalLocks = true
|
||||
}));
|
||||
|
||||
// Add Hangfire server
|
||||
services.AddHangfireServer(options =>
|
||||
{
|
||||
options.WorkerCount = Environment.ProcessorCount * 2;
|
||||
options.Queues = new[] { "default" };
|
||||
});
|
||||
|
||||
// Register scheduler service
|
||||
services.AddScoped<SchedulerService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use Hangfire dashboard and initialize schedules
|
||||
/// </summary>
|
||||
public static IApplicationBuilder UseHangfireSetup(
|
||||
this IApplicationBuilder app,
|
||||
IServiceProvider serviceProvider)
|
||||
{
|
||||
// Use Hangfire Dashboard
|
||||
app.UseHangfireDashboard("/hangfire", new DashboardOptions
|
||||
{
|
||||
Authorization = new[] { new HangfireAuthorizationFilter() }
|
||||
});
|
||||
|
||||
// Initialize schedules
|
||||
var schedulerService = serviceProvider.GetRequiredService<SchedulerService>();
|
||||
schedulerService.InitializeSchedules();
|
||||
|
||||
return app;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simple authorization filter for Hangfire Dashboard
|
||||
/// </summary>
|
||||
public class HangfireAuthorizationFilter : IDashboardAuthorizationFilter
|
||||
{
|
||||
public bool Authorize(DashboardContext context)
|
||||
{
|
||||
// TODO: Implement proper authorization check
|
||||
// For now, allow all in development
|
||||
return true;
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -5,7 +5,7 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
||||
"mainAssemblyName": "QuantEngine.Web.Client",
|
||||
"applicationEnvironment": "Development",
|
||||
"resources": {
|
||||
"hash": "sha256-BbBW2IDSn0CdFcShrDBJDn0eBaTMXAiaarfp1y6lFWk=",
|
||||
"hash": "sha256-dlq04ii8iFIWL1q4ctvh1I0NRGk1J1bfN/p8iP8Kwj0=",
|
||||
"jsModuleNative": [
|
||||
{
|
||||
"name": "dotnet.native.ikrs475e5v.js"
|
||||
@@ -1254,14 +1254,14 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
||||
},
|
||||
{
|
||||
"virtualPath": "QuantEngine.Application.wasm",
|
||||
"name": "QuantEngine.Application.n4x9btwro5.wasm",
|
||||
"hash": "sha256-906kYBkYAJkZ80yppIUgSbv1/wGdYrbGBn8QhpAJfr4=",
|
||||
"name": "QuantEngine.Application.eyx8t05s9h.wasm",
|
||||
"hash": "sha256-5uokFd/Vi3VzMoIrxOAv6zyCGqXkv624v8SLVfK+F4M=",
|
||||
"cache": "force-cache"
|
||||
},
|
||||
{
|
||||
"virtualPath": "QuantEngine.Core.wasm",
|
||||
"name": "QuantEngine.Core.i44o8ctubr.wasm",
|
||||
"hash": "sha256-Hs1Kn2eitkbbEFeAJgeoc9vfF1zyWpqJ7SvCTk32ct8=",
|
||||
"name": "QuantEngine.Core.vabaoblj0o.wasm",
|
||||
"hash": "sha256-t4s+2N8TQ7VvD3aJXzvUpmX7AhrhYwEAhgSdQfsT2Nw=",
|
||||
"cache": "force-cache"
|
||||
},
|
||||
{
|
||||
@@ -1272,28 +1272,28 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
||||
},
|
||||
{
|
||||
"virtualPath": "QuantEngine.Web.Client.wasm",
|
||||
"name": "QuantEngine.Web.Client.pdma2c1xbe.wasm",
|
||||
"hash": "sha256-zdGCsCDg32wjxUCzPmUpZVMYNDMuL1vgELQb8vKxLGA=",
|
||||
"name": "QuantEngine.Web.Client.zmc28l88zy.wasm",
|
||||
"hash": "sha256-e6hDlK13i/Ujsj6nEzm7rFTOT6foRV6TVqugbaaHmw4=",
|
||||
"cache": "force-cache"
|
||||
}
|
||||
],
|
||||
"pdb": [
|
||||
{
|
||||
"virtualPath": "QuantEngine.Core.pdb",
|
||||
"name": "QuantEngine.Core.b5f9o8o2rh.pdb",
|
||||
"hash": "sha256-ERM43ExyTsX4AW+yYK1fSfBUMXaXmvvaJ1cIeR/SCiw=",
|
||||
"name": "QuantEngine.Core.nyhisip20d.pdb",
|
||||
"hash": "sha256-b1+DQ324qflueY6FFouVP66KsAYJw+xd43Hg68CCGgg=",
|
||||
"cache": "force-cache"
|
||||
},
|
||||
{
|
||||
"virtualPath": "QuantEngine.Application.pdb",
|
||||
"name": "QuantEngine.Application.kv7x4sl21n.pdb",
|
||||
"hash": "sha256-4BWS2CnkvmzfOpWqZLkmWCs4mxeHLul3OrN6abwzAtU=",
|
||||
"name": "QuantEngine.Application.tmpa8q5tor.pdb",
|
||||
"hash": "sha256-ux/qGGtLSHSYBxrgb0SFLe9F82Q4q+CpxsFrqQNJCOw=",
|
||||
"cache": "force-cache"
|
||||
},
|
||||
{
|
||||
"virtualPath": "QuantEngine.Web.Client.pdb",
|
||||
"name": "QuantEngine.Web.Client.97rik53991.pdb",
|
||||
"hash": "sha256-NZJNG8Bfp8VRV7LXzXQm+NDBra0TwYyOvgMTwrcoHA0=",
|
||||
"name": "QuantEngine.Web.Client.9w6x9mxrbu.pdb",
|
||||
"hash": "sha256-KTIdSZeciscD3nJxsZ0SP7/3c2egO4Gr+FlnhARmw2I=",
|
||||
"cache": "force-cache"
|
||||
}
|
||||
],
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"status": "failed",
|
||||
"failedTests": []
|
||||
}
|
||||
Reference in New Issue
Block a user