docs: add details modal and log modal patterns to component library
- Add Details Modal (Table Layout) example to components page - Shows header with icon and status badge - Stats cards grid (imported, updated, errors, total) - Key-value table with icon-labeled rows - Add Log Details Modal example with live demo - Level-based coloring (warning=yellow, error=red, critical=purple) - Message, exception, and stack trace sections - Copy-to-clipboard for stack traces - Both error and warning log demo buttons - Update jinja-macros.md with Details Modal Pattern documentation - Document the pattern structure and key features - Link to components library for live examples - Add Alpine.js state variables for new modal demos 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -424,6 +424,40 @@ function adminComponents() {
|
||||
// Modal state variables for examples
|
||||
showExampleModal: false,
|
||||
showFormModal: false,
|
||||
showDetailsModal: false,
|
||||
showLogModal: false,
|
||||
exampleLog: null,
|
||||
|
||||
// Example log data for demo
|
||||
showErrorLogDemo() {
|
||||
this.exampleLog = {
|
||||
id: 1,
|
||||
level: 'ERROR',
|
||||
timestamp: new Date().toISOString(),
|
||||
logger_name: 'app.services.import',
|
||||
module: 'import_service',
|
||||
message: 'Failed to import product: Invalid GTIN format',
|
||||
exception_type: 'ValidationError',
|
||||
exception_message: 'GTIN must be 13 digits',
|
||||
stack_trace: 'Traceback (most recent call last):\n File "/app/services/import.py", line 42, in process\n validate_gtin(product.gtin)\n File "/app/validators.py", line 15, in validate_gtin\n raise ValidationError("GTIN must be 13 digits")\nValidationError: GTIN must be 13 digits'
|
||||
};
|
||||
this.showLogModal = true;
|
||||
},
|
||||
|
||||
showWarningLogDemo() {
|
||||
this.exampleLog = {
|
||||
id: 2,
|
||||
level: 'WARNING',
|
||||
timestamp: new Date().toISOString(),
|
||||
logger_name: 'app.utils.cache',
|
||||
module: 'cache',
|
||||
message: 'Cache miss for key: product_list_vendor_5. Fetching from database.',
|
||||
exception_type: null,
|
||||
exception_message: null,
|
||||
stack_trace: null
|
||||
};
|
||||
this.showLogModal = true;
|
||||
},
|
||||
|
||||
// ✅ CRITICAL: Proper initialization with guard
|
||||
async init() {
|
||||
|
||||
Reference in New Issue
Block a user