Skip to content

Commit 690728e

Browse files
author
Timothy Dodd
committed
feat: add ErrorCountBadgeComponent for displaying error counts with SignalR integration
feat: implement FilterPresetsModalComponent for managing filter presets with UI style: add styles for FilterPresetsModalComponent test: add unit tests for FilterPresetsModalComponent feat: create LogDetailsModalComponent for displaying detailed log information style: add styles for LogDetailsModalComponent feat: implement TimestampFormatPipe for formatting timestamps based on user preference feat: create FilterPresetsService for managing filter presets in local storage feat: implement TimestampService for handling timestamp formatting preferences feat: create ViewModeService for managing user view mode preferences
1 parent 8d7573b commit 690728e

43 files changed

Lines changed: 3532 additions & 570 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"Bash(dotnet test:*)",
66
"Bash(timeout 30 dotnet test src/RoboDodd.OrmLite.Tests/RoboDodd.OrmLite.Tests.csproj --filter \"FullyQualifiedName=RoboDodd.OrmLite.Tests.ServiceStackMigrationIntegrationTests.ErrorHandling_WithInvalidOperations_HandlesGracefully\" --verbosity normal)",
77
"Bash(timeout:*)",
8-
"Bash(npm run build:*)"
8+
"Bash(npm run build:*)",
9+
"Bash(npx ng build:*)"
910
],
1011
"deny": []
1112
}

CLAUDE.md

Lines changed: 146 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,149 @@ Use provided mixins for consistent styling:
404404
- Validate responsive behavior on mobile devices
405405
- Ensure proper contrast ratios with accessibility tools
406406

407-
This styling system ensures a consistent, maintainable, and accessible dark theme throughout the LogMk application while supporting full-width layouts optimized for log monitoring workflows.
407+
This styling system ensures a consistent, maintainable, and accessible dark theme throughout the LogMk application while supporting full-width layouts optimized for log monitoring workflows.
408+
409+
## Advanced Features & Services
410+
411+
### **Real-time Log Processing**
412+
The application implements comprehensive real-time log processing with multiple enhancement layers:
413+
414+
**Core Services:**
415+
- `SignalrService` - Real-time WebSocket connection for live log streaming
416+
- `LogApiService` - RESTful API integration for historical log retrieval
417+
- `LogFilterState` - Centralized filter state management with signals
418+
- `ViewModeService` - User preference management for display density
419+
- `TimestampService` - Flexible timestamp formatting (relative/absolute)
420+
421+
### **Enhanced Log Display System**
422+
423+
**Syntax Highlighting (HighlightLogPipe):**
424+
```typescript
425+
// Comprehensive content highlighting includes:
426+
- JSON syntax (keys, strings, numbers, booleans, null)
427+
- Network content (URLs, IP addresses, HTTP methods/status codes)
428+
- Stack traces (class names, methods, line numbers)
429+
- Technical identifiers (UUIDs, file paths, email addresses)
430+
- Search term highlighting with dynamic backgrounds
431+
- SQL keywords and exception types
432+
```
433+
434+
**View Mode System:**
435+
```typescript
436+
// Dual density modes for user preference
437+
- Compact Mode: 12px font, 2px padding, dense layout for maximum information
438+
- Expanded Mode: 14px font, 8px padding, spacious layout for readability
439+
- Persistent localStorage preference
440+
- Real-time switching with smooth CSS transitions
441+
```
442+
443+
### **Advanced Filtering & Search**
444+
445+
**Multi-dimensional Filtering:**
446+
- Log level filtering with multi-select dropdown
447+
- Pod-based filtering with search and select-all
448+
- Time range filtering (predefined + custom ranges)
449+
- Full-text search with real-time highlighting
450+
- Interactive chart-based time selection (drag to select)
451+
452+
**Filter Presets System:**
453+
```typescript
454+
// FilterPresetsService features:
455+
- Save current filter combinations with custom names
456+
- localStorage persistence across sessions
457+
- Full CRUD operations (create, read, update, delete)
458+
- One-click preset application
459+
- Export-friendly filter state management
460+
```
461+
462+
### **User Experience Enhancements**
463+
464+
**Context Menu System:**
465+
- Right-click actions on individual log entries
466+
- Dynamic action generation based on log content
467+
- Smart positioning to stay within viewport bounds
468+
- Integrated filtering (show only/hide specific levels/pods)
469+
- Copy and detail actions
470+
471+
**Modal System Architecture:**
472+
```typescript
473+
// Template-based modal system:
474+
- ModalService with signal-based state management
475+
- Support for custom headers, bodies, and footers
476+
- Multiple size variants (small, medium, large, extra-large)
477+
- Smooth animations and keyboard accessibility
478+
- Used by: Log Details, Filter Presets, and future modals
479+
```
480+
481+
**Keyboard Shortcuts:**
482+
- `Ctrl/Cmd+F` - Focus search input
483+
- `Ctrl/Cmd+Shift+C` - Clear all filters
484+
- `E` - Show only errors
485+
- `W` - Show only warnings
486+
- Arrow keys - Navigate log entries
487+
- Enter - Open log details
488+
489+
### **Export & Data Management**
490+
491+
**Export System (ExportService):**
492+
```typescript
493+
// Multi-format export with intelligent naming:
494+
- CSV format for spreadsheet analysis
495+
- JSON format with metadata inclusion
496+
- Smart filename generation based on active filters
497+
- Respects current filter state
498+
- Date range and count metadata
499+
```
500+
501+
**Memory Management:**
502+
- Virtual scrolling with configurable buffer amounts
503+
- Automatic log rotation (5000+ entries)
504+
- Efficient DOM recycling for performance
505+
- Parent scroll element detection for smooth scrolling
506+
507+
### **Component Architecture Patterns**
508+
509+
**Modern Angular Patterns (17+):**
510+
```typescript
511+
// Signal-based architecture throughout:
512+
- input<T>() for component inputs
513+
- output<T>() for component outputs
514+
- viewChild<T>() for element/component references
515+
- inject() for dependency injection
516+
- computed() for derived state
517+
- New @if/@for control flow syntax
518+
```
519+
520+
**State Management:**
521+
```typescript
522+
// Centralized state with signals:
523+
- LogFilterState - All filter-related state
524+
- ViewModeService - Display preferences
525+
- TimestampService - Time format preferences
526+
- FilterPresetsService - Saved filter combinations
527+
- ModalService - Global modal state
528+
```
529+
530+
### **Performance Optimizations**
531+
532+
**Virtual Scrolling:**
533+
- `@iharbeck/ngx-virtual-scroller` for large datasets
534+
- Configurable buffer amounts and throttling
535+
- Parent scroll element integration
536+
- Unequal children size support for dynamic content
537+
538+
**Efficient Rendering:**
539+
```typescript
540+
// Optimized rendering patterns:
541+
- OnPush change detection strategy
542+
- TrackBy functions for *ngFor loops
543+
- Computed signals for expensive operations
544+
- Debounced search input (300ms)
545+
- Lazy loading with pagination
546+
```
547+
548+
**CSS Performance:**
549+
- CSS custom properties for runtime theming
550+
- Efficient selectors with minimal specificity
551+
- CSS containment for large lists
552+
- Hardware-accelerated animations

README.md

Lines changed: 91 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,32 @@ LogMk is a lightweight log monitoring solution for Kubernetes environments. It c
77

88
## ✨ Features
99

10-
- **Real-time Log Streaming**: View logs in real-time with SignalR WebSocket integration
11-
- **Centralized Storage**: All logs stored in MySQL with configurable retention policies
12-
- **Advanced Filtering**: Filter by namespace, pod, container, log level, and time ranges
13-
- **Modern Web Interface**: Angular 20 SPA with dark theme and responsive design
14-
- **Kubernetes Native**: DaemonSet deployment for automatic log collection across all nodes
15-
- **JWT Authentication**: Secure access with token-based authentication and refresh tokens
16-
- **Docker Ready**: Containerized components for easy deployment
10+
### **Core Functionality**
11+
- **Real-time Log Streaming**: Live log monitoring with SignalR WebSocket integration
12+
- **Centralized Storage**: MySQL database with configurable retention policies (default 30 days)
13+
- **Advanced Filtering**: Multi-dimensional filtering by pod, log level, time ranges, and full-text search
14+
- **Interactive Chart Selection**: Click and drag on charts to select custom time ranges
15+
- **Export Capabilities**: Export filtered logs to CSV or JSON with intelligent naming
16+
17+
### **User Experience**
18+
- **Modern Dark Theme**: Dracula-inspired color scheme optimized for extended viewing
19+
- **Mobile Responsive**: Full mobile and tablet support with adaptive layouts
20+
- **Keyboard Shortcuts**: Power user navigation (Ctrl+F for search, E for errors, W for warnings)
21+
- **Context Menus**: Right-click actions for filtering and copying log entries
22+
- **View Modes**: Toggle between compact (dense) and expanded (spacious) layouts
23+
24+
### **Advanced Features**
25+
- **Syntax Highlighting**: Comprehensive highlighting for JSON, URLs, IPs, stack traces, HTTP codes
26+
- **Filter Presets**: Save and manage filter combinations for quick reuse
27+
- **Copy Functionality**: One-click log copying with visual feedback
28+
- **Error Count Badge**: Real-time error counter in navigation with click-to-filter
29+
- **Timestamp Formats**: Toggle between relative ("5 min ago") and absolute timestamps
30+
31+
### **Performance & Accessibility**
32+
- **Virtual Scrolling**: Handle thousands of logs with smooth performance
33+
- **Memory Management**: Automatic cleanup and efficient DOM recycling
34+
- **WCAG Compliance**: Accessible design with proper contrast ratios and keyboard navigation
35+
- **Progressive Enhancement**: Graceful degradation for older browsers
1736

1837
![image](https://github.com/user-attachments/assets/a7f87068-4019-456a-b438-410ef5aad22a)
1938

@@ -35,10 +54,18 @@ LogMk consists of three main components:
3554
- **Features**: JWT authentication, automatic schema migration, log retention management
3655

3756
### 3. **LogMkWeb** (Web Interface)
38-
- **Purpose**: User interface for log viewing and filtering
39-
- **Technology**: Angular 20 with TypeScript and Bootstrap 5
40-
- **Function**: Real-time log visualization with advanced filtering capabilities
41-
- **Features**: Dark theme, responsive design, SignalR integration, date range picker
57+
- **Purpose**: Advanced user interface for log monitoring and analysis
58+
- **Technology**: Angular 20 with TypeScript, modern signal-based architecture
59+
- **Function**: Real-time log visualization with comprehensive filtering and analysis tools
60+
- **Features**:
61+
- Dracula dark theme with comprehensive syntax highlighting
62+
- Mobile-responsive design with adaptive layouts
63+
- Real-time SignalR integration with error count badges
64+
- Advanced filtering with presets and interactive chart selection
65+
- Export capabilities (CSV/JSON) with intelligent naming
66+
- Keyboard shortcuts and accessibility features
67+
- Context menus and copy functionality
68+
- Compact/expanded view modes for user preference
4269

4370
## 🚀 Quick Start
4471

@@ -120,16 +147,36 @@ kubectl apply -f k8s/
120147

121148
## 🎯 Usage
122149

150+
### **Getting Started**
123151
1. **Access the Web Interface**: Navigate to `http://localhost:6200` (development) or your deployed URL
124152
2. **Authentication**: Log in with your configured credentials
125153
3. **Real-time Monitoring**: Logs stream automatically via SignalR connection
126-
4. **Filtering**: Use the sidebar filters to narrow down logs by:
127-
- Namespace
128-
- Pod name
129-
- Container
130-
- Log level
131-
- Time range
132-
5. **Search**: Use the search bar for full-text log content searching
154+
155+
### **Advanced Filtering**
156+
- **Multi-select Dropdowns**: Filter by log levels and pods with search and select-all options
157+
- **Time Range Selection**: Use predefined ranges or select custom ranges by dragging on charts
158+
- **Full-text Search**: Search log content with real-time highlighting of matching terms
159+
- **Filter Presets**: Save frequently used filter combinations for quick access
160+
161+
### **Keyboard Shortcuts**
162+
- `Ctrl/Cmd+F` - Focus search input
163+
- `Ctrl/Cmd+Shift+C` - Clear all active filters
164+
- `E` - Show only error logs
165+
- `W` - Show only warning logs
166+
- Arrow keys - Navigate through log entries
167+
- Enter - Open detailed log view
168+
169+
### **Context Actions**
170+
- **Right-click any log entry** for context menu with:
171+
- Filter by specific pod or log level
172+
- Hide logs from specific sources
173+
- Copy log content
174+
- View detailed log information
175+
176+
### **View Customization**
177+
- **View Modes**: Toggle between compact (dense) and expanded (spacious) layouts
178+
- **Timestamp Formats**: Switch between relative ("5 min ago") and absolute timestamps
179+
- **Export Options**: Download filtered logs as CSV or JSON with metadata
133180

134181
## 📋 Configuration
135182

@@ -193,12 +240,32 @@ dotnet run --project src/LogMkAgent
193240

194241
## 📝 Tech Stack
195242

196-
- **Backend**: .NET 9, C#, ServiceStack.OrmLite, SignalR
197-
- **Frontend**: Angular 20, TypeScript, Bootstrap 5, ng2-charts
198-
- **Database**: MySQL 8.0+
199-
- **Authentication**: JWT with refresh tokens
200-
- **Real-time**: SignalR WebSockets
201-
- **Infrastructure**: Docker, Kubernetes, GitHub Actions
243+
### **Backend**
244+
- **.NET 9**: Modern C# with high-performance runtime
245+
- **ServiceStack.OrmLite**: Lightweight ORM for MySQL integration
246+
- **SignalR**: Real-time WebSocket communication
247+
- **JWT Authentication**: Secure token-based auth with refresh tokens
248+
249+
### **Frontend**
250+
- **Angular 20**: Latest Angular with signal-based architecture
251+
- **TypeScript**: Type-safe development with modern ES features
252+
- **CSS Variables**: Dynamic theming with Dracula color scheme
253+
- **Virtual Scrolling**: High-performance rendering for large datasets
254+
- **PWA Ready**: Progressive Web App capabilities
255+
256+
### **Libraries & Tools**
257+
- **Lucide Angular**: Modern icon library with 1000+ icons
258+
- **ng2-charts**: Chart.js integration for interactive visualizations
259+
- **ngx-toastr**: Toast notifications for user feedback
260+
- **date-fns**: Comprehensive date manipulation utilities
261+
- **@iharbeck/ngx-virtual-scroller**: Optimized virtual scrolling
262+
263+
### **Development & Deployment**
264+
- **Angular CLI**: Modern build system with Vite bundler
265+
- **ESLint & Prettier**: Code quality and formatting
266+
- **Docker Multi-stage**: Optimized container builds
267+
- **Kubernetes**: Cloud-native deployment with DaemonSets
268+
- **GitHub Actions**: CI/CD pipeline automation
202269

203270
## 🤝 Contributing
204271

0 commit comments

Comments
 (0)