Initial artdag-common shared library
Shared components for L1 and L2 servers: - Jinja2 template system with base template and components - Middleware for auth and content negotiation - Pydantic models for requests/responses - Utility functions for pagination, media, formatting - Constants for Tailwind/HTMX/Cytoscape CDNs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
54
artdag_common/constants.py
Normal file
54
artdag_common/constants.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""
|
||||
Shared constants for Art-DAG servers.
|
||||
"""
|
||||
|
||||
# CDN URLs
|
||||
TAILWIND_CDN = "https://cdn.tailwindcss.com"
|
||||
HTMX_CDN = "https://unpkg.com/htmx.org@1.9.10"
|
||||
CYTOSCAPE_CDN = "https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.28.1/cytoscape.min.js"
|
||||
DAGRE_CDN = "https://cdnjs.cloudflare.com/ajax/libs/dagre/0.8.5/dagre.min.js"
|
||||
CYTOSCAPE_DAGRE_CDN = "https://cdn.jsdelivr.net/npm/cytoscape-dagre@2.5.0/cytoscape-dagre.min.js"
|
||||
|
||||
# Node colors for DAG visualization
|
||||
NODE_COLORS = {
|
||||
"SOURCE": "#3b82f6", # Blue - input sources
|
||||
"EFFECT": "#22c55e", # Green - processing effects
|
||||
"OUTPUT": "#a855f7", # Purple - final outputs
|
||||
"ANALYSIS": "#f59e0b", # Amber - analysis nodes
|
||||
"_LIST": "#6366f1", # Indigo - list aggregation
|
||||
"default": "#6b7280", # Gray - unknown types
|
||||
}
|
||||
|
||||
# Status colors
|
||||
STATUS_COLORS = {
|
||||
"completed": "bg-green-600",
|
||||
"cached": "bg-blue-600",
|
||||
"running": "bg-yellow-600",
|
||||
"pending": "bg-gray-600",
|
||||
"failed": "bg-red-600",
|
||||
}
|
||||
|
||||
# Tailwind dark theme configuration
|
||||
TAILWIND_CONFIG = """
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class',
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
dark: {
|
||||
600: '#374151',
|
||||
700: '#1f2937',
|
||||
800: '#111827',
|
||||
900: '#030712',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
"""
|
||||
|
||||
# Default pagination settings
|
||||
DEFAULT_PAGE_SIZE = 20
|
||||
MAX_PAGE_SIZE = 100
|
||||
Reference in New Issue
Block a user