🎉 Improved Backend Structure & Logging 🖥️📝
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -329,6 +329,22 @@ def save_avatar_file(file, user_id: int) -> Optional[Tuple[str, str, Dict]]:
|
||||
"""Speichert eine Avatar-Datei"""
|
||||
return file_manager.save_file(file, 'avatars', user_id, 'avatar')
|
||||
|
||||
def save_temp_file(file, user_id: int = None, metadata: Dict = None) -> Optional[Tuple[str, str, Dict]]:
|
||||
"""Speichert eine temporäre Datei"""
|
||||
return file_manager.save_file(file, 'temp', user_id, 'temp', metadata)
|
||||
|
||||
def save_asset_file(file, metadata: Dict = None) -> Optional[Tuple[str, str, Dict]]:
|
||||
"""Speichert eine Asset-Datei"""
|
||||
return file_manager.save_file(file, 'assets', None, 'asset', metadata)
|
||||
|
||||
def save_log_file(file, metadata: Dict = None) -> Optional[Tuple[str, str, Dict]]:
|
||||
"""Speichert eine Log-Datei"""
|
||||
return file_manager.save_file(file, 'logs', None, 'log', metadata)
|
||||
|
||||
def save_backup_file(file, metadata: Dict = None) -> Optional[Tuple[str, str, Dict]]:
|
||||
"""Speichert eine Backup-Datei"""
|
||||
return file_manager.save_file(file, 'backups', None, 'backup', metadata)
|
||||
|
||||
def delete_file(relative_path: str) -> bool:
|
||||
"""Löscht eine Datei"""
|
||||
return file_manager.delete_file(relative_path)
|
||||
|
||||
@@ -20,6 +20,7 @@ import queue
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Dict, List, Any, Optional, Callable
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
|
||||
from utils.logging_config import get_logger
|
||||
from utils.hardware_integration import tapo_controller
|
||||
@@ -27,6 +28,23 @@ from utils.hardware_integration import tapo_controller
|
||||
# Logger
|
||||
job_logger = get_logger("job_queue_system")
|
||||
|
||||
# ===== ENUMS =====
|
||||
|
||||
class ConflictType(Enum):
|
||||
"""Arten von Konflikten"""
|
||||
TIME_OVERLAP = "time_overlap"
|
||||
RESOURCE_CONFLICT = "resource_conflict"
|
||||
DEPENDENCY_CONFLICT = "dependency_conflict"
|
||||
PRIORITY_CONFLICT = "priority_conflict"
|
||||
|
||||
class ConflictSeverity(Enum):
|
||||
"""Schweregrad von Konflikten"""
|
||||
CRITICAL = "critical"
|
||||
HIGH = "high"
|
||||
MEDIUM = "medium"
|
||||
LOW = "low"
|
||||
INFO = "info"
|
||||
|
||||
# ===== DATA STRUCTURES =====
|
||||
|
||||
@dataclass
|
||||
@@ -470,6 +488,16 @@ class LegacyQueueManager:
|
||||
def add_to_queue(job_data):
|
||||
return queue_manager.add_job(job_data)
|
||||
|
||||
def start_queue_manager():
|
||||
"""Legacy-Kompatibilität für Queue Manager Start"""
|
||||
job_logger.info("Queue Manager gestartet (Legacy-Kompatibilität)")
|
||||
return True
|
||||
|
||||
def stop_queue_manager():
|
||||
"""Legacy-Kompatibilität für Queue Manager Stop"""
|
||||
job_logger.info("Queue Manager gestoppt (Legacy-Kompatibilität)")
|
||||
return True
|
||||
|
||||
# Original conflict_manager.py compatibility
|
||||
class LegacyConflictManager:
|
||||
@staticmethod
|
||||
|
||||
@@ -33,6 +33,9 @@ class Permission(Enum):
|
||||
LOGIN = "login"
|
||||
VIEW_DASHBOARD = "view_dashboard"
|
||||
VIEW_PRINTERS = "view_printers"
|
||||
CONTROL_PRINTER = "control_printer"
|
||||
START_JOBS = "start_jobs"
|
||||
APPROVE_JOBS = "approve_jobs"
|
||||
ADMIN = "admin"
|
||||
|
||||
class Role(Enum):
|
||||
|
||||
Reference in New Issue
Block a user