🗑️ Refactor: Remove obsolete printer check scripts and update app logic
**Änderungen:** - ✅ check_printer_ips.py und check_printers.py: Entfernt nicht mehr benötigte Skripte zur Überprüfung von Drucker-IP-Adressen. - ✅ DRUCKER_STATUS_REQUIREMENTS.md: Veraltete Anforderungen entfernt. - ✅ setup_standard_printers.py: Anpassungen zur Vereinheitlichung der Drucker-IP. - ✅ app.py: Logik zur Filterung offline/unreachable Drucker aktualisiert. **Ergebnis:** - Bereinigung des Codes durch Entfernen nicht mehr benötigter Dateien. - Optimierte Logik zur Handhabung von Druckerstatus in der Anwendung. 🤖 Generated with [Claude Code](https://claude.ai/code)
This commit is contained in:
BIN
backend/utils/__pycache__/database_suite.cpython-311.pyc
Normal file
BIN
backend/utils/__pycache__/database_suite.cpython-311.pyc
Normal file
Binary file not shown.
BIN
backend/utils/__pycache__/system_management.cpython-311.pyc
Normal file
BIN
backend/utils/__pycache__/system_management.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
@@ -35,8 +35,8 @@ class DatabaseCore:
|
||||
"""Database-Core-Management"""
|
||||
|
||||
def __init__(self):
|
||||
self.database_path = "backend/database/myp.db"
|
||||
self.backup_path = "backend/database/backups/"
|
||||
self.database_path = "./database/myp.db"
|
||||
self.backup_path = "./database/backups/"
|
||||
|
||||
def get_connection(self):
|
||||
"""Holt Datenbank-Verbindung"""
|
||||
|
BIN
backend/utils/image/system_management/1750021899932.png
Normal file
BIN
backend/utils/image/system_management/1750021899932.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 136 KiB |
@@ -4,7 +4,7 @@ IP Security Module für MYP Platform
|
||||
===================================
|
||||
|
||||
Implementiert IP-Beschränkungen für Steckdosen-Zugriff
|
||||
Erlaubt nur IPs von 192.168.0.100 bis 192.168.0.106, mit Ausnahme von 192.168.0.105
|
||||
Erlaubt nur IPs von 192.168.0.100 bis 192.168.0.106, mit Ausnahme von 192.168.0.105 (VERBOTEN)
|
||||
|
||||
Author: Till Tomczak
|
||||
"""
|
||||
@@ -41,7 +41,7 @@ class IPSecurityManager:
|
||||
]
|
||||
|
||||
logger.info(f"✅ IP-Sicherheit initialisiert: {len(self.allowed_ips)} erlaubte Steckdosen-IPs")
|
||||
logger.info(f"🚫 Gesperrte IP: 192.168.0.105")
|
||||
logger.warning(f"🚫 VERBOTENE IP BLOCKIERT: 192.168.0.105 - NIEMALS VERWENDEN!")
|
||||
|
||||
def is_plug_ip_allowed(self, ip: str) -> bool:
|
||||
"""
|
||||
@@ -157,7 +157,7 @@ class IPSecurityManager:
|
||||
Returns:
|
||||
bool: True wenn gesperrt
|
||||
"""
|
||||
# 192.168.0.105 ist explizit gesperrt
|
||||
# 192.168.0.105 ist VERBOTEN und darf NIEMALS verwendet werden
|
||||
return ip == "192.168.0.105"
|
||||
|
||||
class SecurityError(Exception):
|
||||
|
@@ -13,7 +13,7 @@ sys_logger = get_logger("system_management")
|
||||
class SettingsManager:
|
||||
def __init__(self):
|
||||
self.default_settings = {
|
||||
'database_path': 'backend/database/myp.db',
|
||||
'database_path': './database/myp.db',
|
||||
'secret_key': 'your-secret-key-here',
|
||||
'session_lifetime': 3600
|
||||
}
|
||||
@@ -33,7 +33,7 @@ settings_manager = SettingsManager()
|
||||
offline_config = OfflineConfig()
|
||||
|
||||
# Legacy compatibility
|
||||
DATABASE_PATH = 'backend/database/myp.db'
|
||||
DATABASE_PATH = './database/myp.db'
|
||||
SECRET_KEY = 'your-secret-key-here'
|
||||
SESSION_LIFETIME = 3600
|
||||
|
||||
|
@@ -33,12 +33,12 @@ util_logger = get_logger("utilities_collection")
|
||||
class Config:
|
||||
"""Zentrale Konfiguration"""
|
||||
|
||||
DATABASE_PATH = "backend/database/myp.db"
|
||||
SECRET_KEY = "your-secret-key-here"
|
||||
DATABASE_PATH = "./database/myp.db"
|
||||
SECRET_KEY = "datedsss344requiresdasda"
|
||||
SESSION_LIFETIME = 3600
|
||||
MAX_FILE_SIZE = 100 * 1024 * 1024 # 100MB
|
||||
ALLOWED_EXTENSIONS = ['.gcode', '.stl', '.obj']
|
||||
UPLOAD_FOLDER = "backend/uploads"
|
||||
UPLOAD_FOLDER = "./uploads"
|
||||
|
||||
# TAPO Smart Plug Configuration
|
||||
TAPO_USERNAME = "till.tomczak@mercedes-benz.com"
|
||||
@@ -96,9 +96,60 @@ class PrinterUtilities:
|
||||
db_session = get_db_session()
|
||||
|
||||
default_printers = [
|
||||
{"name": "Prusa i3 MK3S+", "location": "Werkstatt 1", "status": "offline"},
|
||||
{"name": "Bambu Lab X1 Carbon", "location": "Werkstatt 2", "status": "offline"},
|
||||
{"name": "Ultimaker S5", "location": "Büro", "status": "offline"}
|
||||
{
|
||||
"name": "Drucker 1",
|
||||
"ip_address": "192.168.0.100",
|
||||
"plug_ip": "192.168.0.100",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
},
|
||||
{
|
||||
"name": "Drucker 2",
|
||||
"ip_address": "192.168.0.101",
|
||||
"plug_ip": "192.168.0.101",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
},
|
||||
{
|
||||
"name": "Drucker 3",
|
||||
"ip_address": "192.168.0.102",
|
||||
"plug_ip": "192.168.0.102",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
},
|
||||
{
|
||||
"name": "Drucker 4",
|
||||
"ip_address": "192.168.0.103",
|
||||
"plug_ip": "192.168.0.103",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
},
|
||||
{
|
||||
"name": "Drucker 5",
|
||||
"ip_address": "192.168.0.104",
|
||||
"plug_ip": "192.168.0.104",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
},
|
||||
{
|
||||
"name": "Drucker 6",
|
||||
"ip_address": "192.168.0.106",
|
||||
"plug_ip": "192.168.0.106",
|
||||
"location": "TBA Marienfelde",
|
||||
"model": "Mercedes 3D Printer",
|
||||
"status": "offline",
|
||||
"active": True
|
||||
}
|
||||
]
|
||||
|
||||
for printer_data in default_printers:
|
||||
|
Reference in New Issue
Block a user