Die Dateien wurden wie folgt geändert und hinzugefügt:

1. backend/logs - 'admin', 'admin_api', 'app', 'calendar', 'data_management', 'drucker_steuerung', 'energy_monitoring', 'guest', 'hardware_integration', 'job_queue_system', 'jobs', 'models', 'monitoring_analytics', 'permissions', 'scheduler', 'security_suite', 'startup', '
This commit is contained in:
2025-06-20 01:06:37 +02:00
parent 0fcf04833f
commit 321626e9d3
754 changed files with 3013 additions and 174 deletions

View File

@ -828,6 +828,43 @@ def inject_current_route():
current_route = getattr(request, 'endpoint', None) or ''
return {'current_route': current_route}
@app.context_processor
def inject_moment():
"""
Injiziert eine moment-ähnliche Funktion für Template-Kompatibilität.
Behebt UndefinedError: 'moment' is not defined in Templates.
Ersetzt moment.js durch native Python datetime-Funktionalität.
"""
def moment():
"""Mock moment() Funktion die ein datetime-ähnliches Objekt zurückgibt"""
class MomentLike:
def __init__(self):
self.dt = datetime.now()
def format(self, format_str):
"""Konvertiert moment.js Format-Strings zu Python strftime"""
# Moment.js -> Python strftime Mapping
format_mapping = {
'DD.MM.YYYY': '%d.%m.%Y',
'DD/MM/YYYY': '%d/%m/%Y',
'YYYY-MM-DD': '%Y-%m-%d',
'HH:mm': '%H:%M',
'HH:mm:ss': '%H:%M:%S',
'DD.MM.YYYY HH:mm': '%d.%m.%Y %H:%M'
}
# Direkte Ersetzung wenn bekanntes Format
if format_str in format_mapping:
return self.dt.strftime(format_mapping[format_str])
# Fallback: Standard deutsche Formatierung
return self.dt.strftime('%d.%m.%Y')
return MomentLike()
return {'moment': moment}
@app.template_filter('format_datetime')
def format_datetime_filter(value, format='%d.%m.%Y %H:%M'):
"""Template-Filter für Datums-Formatierung"""