chore: Änderungen commited
This commit is contained in:
Binary file not shown.
177
app.py
177
app.py
@@ -1226,7 +1226,7 @@ def get_user_mindmap(mindmap_id):
|
||||
'notes': notes_data
|
||||
})
|
||||
|
||||
@app.route('/api/mindmap/<int:mindmap_id>/add_node', methods=['POST'])
|
||||
@app.route('/api/mindmap/id/<int:mindmap_id>/add_node', methods=['POST'])
|
||||
@login_required
|
||||
def add_node_to_mindmap(mindmap_id):
|
||||
"""Fügt einen öffentlichen Knoten zur Benutzer-Mindmap hinzu."""
|
||||
@@ -1291,7 +1291,7 @@ def add_node_to_mindmap(mindmap_id):
|
||||
'y': y_pos
|
||||
})
|
||||
|
||||
@app.route('/api/mindmap/<int:mindmap_id>/remove_node/<int:node_id>', methods=['DELETE'])
|
||||
@app.route('/api/mindmap/id/<int:mindmap_id>/remove_node/<int:node_id>', methods=['DELETE'])
|
||||
@login_required
|
||||
def remove_node_from_mindmap(mindmap_id, node_id):
|
||||
"""Entfernt einen Knoten aus der Benutzer-Mindmap."""
|
||||
@@ -1329,7 +1329,7 @@ def get_node_info(node_id):
|
||||
print(f"Fehler in get_node_info: {str(e)}")
|
||||
return jsonify({'success': False, 'message': str(e)}), 500
|
||||
|
||||
@app.route('/api/mindmap/<int:mindmap_id>/update_node_position', methods=['POST'])
|
||||
@app.route('/api/mindmap/id/<int:mindmap_id>/update_node_position', methods=['POST'])
|
||||
@login_required
|
||||
def update_node_position(mindmap_id):
|
||||
"""Aktualisiert die Position eines Knotens in der Benutzer-Mindmap."""
|
||||
@@ -2817,173 +2817,4 @@ def get_fallback_mindmap_data(node_id):
|
||||
"edges": edges
|
||||
}
|
||||
|
||||
@app.route('/api/mindmap/root')
|
||||
def get_root_mindmap():
|
||||
"""
|
||||
Gibt die Root-Mindmap zurück, um Kompatibilität mit dem Frontend sicherzustellen.
|
||||
"""
|
||||
app.logger.info("Root-Mindmap-Daten werden angefordert.")
|
||||
|
||||
try:
|
||||
# Fallback-Daten
|
||||
nodes = [
|
||||
{
|
||||
"id": "center",
|
||||
"name": "Wissenskarte",
|
||||
"description": "Zentrale Wissenskarte mit allen Hauptthemen",
|
||||
"is_center": True,
|
||||
"color_code": "#f5f5f5",
|
||||
"has_children": True
|
||||
},
|
||||
{
|
||||
"id": "philosophy",
|
||||
"name": "Philosophie",
|
||||
"description": "Die Lehre vom Denken und der Erkenntnis",
|
||||
"category": "Philosophie",
|
||||
"has_children": True,
|
||||
"color_code": "#9F7AEA"
|
||||
},
|
||||
{
|
||||
"id": "science",
|
||||
"name": "Wissenschaft",
|
||||
"description": "Systematische Erforschung der Natur und Gesellschaft",
|
||||
"category": "Wissenschaft",
|
||||
"has_children": True,
|
||||
"color_code": "#f4b400"
|
||||
},
|
||||
{
|
||||
"id": "technology",
|
||||
"name": "Technologie",
|
||||
"description": "Anwendung wissenschaftlicher Erkenntnisse",
|
||||
"category": "Technologie",
|
||||
"has_children": True,
|
||||
"color_code": "#0d47a1"
|
||||
},
|
||||
{
|
||||
"id": "arts",
|
||||
"name": "Künste",
|
||||
"description": "Kreativer Ausdruck und künstlerische Gestaltung",
|
||||
"category": "Künste",
|
||||
"has_children": True,
|
||||
"color_code": "#c2185b"
|
||||
}
|
||||
]
|
||||
|
||||
edges = [
|
||||
{"source_id": "center", "target_id": "philosophy", "strength": 0.9},
|
||||
{"source_id": "center", "target_id": "science", "strength": 0.9},
|
||||
{"source_id": "center", "target_id": "technology", "strength": 0.9},
|
||||
{"source_id": "center", "target_id": "arts", "strength": 0.9}
|
||||
]
|
||||
|
||||
response = {
|
||||
"nodes": nodes,
|
||||
"edges": edges
|
||||
}
|
||||
|
||||
return jsonify(response)
|
||||
|
||||
except Exception as e:
|
||||
app.logger.error(f"Fehler beim Abrufen der Root-Mindmap-Daten: {str(e)}")
|
||||
app.logger.error(f"Stack Trace: {traceback.format_exc()}")
|
||||
return jsonify({"error": "Fehler beim Abrufen der Mindmap-Daten"}), 500
|
||||
|
||||
@app.route('/api/mindmap/technology')
|
||||
def get_technology_mindmap():
|
||||
"""
|
||||
Gibt die Technologie-Mindmap zurück für Frontend-Kompatibilität.
|
||||
"""
|
||||
app.logger.info("Technologie-Mindmap-Daten werden angefordert.")
|
||||
|
||||
try:
|
||||
nodes = [
|
||||
{
|
||||
"id": "ai",
|
||||
"name": "Künstliche Intelligenz",
|
||||
"description": "Maschinelles Lernen und intelligente Systeme",
|
||||
"category": "Technologie",
|
||||
"has_children": True,
|
||||
"color_code": "#0d47a1"
|
||||
},
|
||||
{
|
||||
"id": "robotics",
|
||||
"name": "Robotik",
|
||||
"description": "Entwicklung und Steuerung von Robotern",
|
||||
"category": "Technologie",
|
||||
"has_children": True,
|
||||
"color_code": "#0d47a1"
|
||||
},
|
||||
{
|
||||
"id": "quantum_computing",
|
||||
"name": "Quantencomputing",
|
||||
"description": "Computer basierend auf Quantenmechanik",
|
||||
"category": "Technologie",
|
||||
"has_children": True,
|
||||
"color_code": "#0d47a1"
|
||||
}
|
||||
]
|
||||
|
||||
edges = [
|
||||
{"source_id": "technology", "target_id": "ai", "strength": 0.8},
|
||||
{"source_id": "technology", "target_id": "robotics", "strength": 0.8},
|
||||
{"source_id": "technology", "target_id": "quantum_computing", "strength": 0.8}
|
||||
]
|
||||
|
||||
return jsonify({
|
||||
"nodes": nodes,
|
||||
"edges": edges
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
app.logger.error(f"Fehler beim Abrufen der Technologie-Mindmap-Daten: {str(e)}")
|
||||
return jsonify({"error": "Fehler beim Abrufen der Mindmap-Daten"}), 500
|
||||
|
||||
@app.route('/api/mindmap/arts')
|
||||
def get_arts_mindmap():
|
||||
"""
|
||||
Gibt die Künste-Mindmap zurück für Frontend-Kompatibilität.
|
||||
"""
|
||||
app.logger.info("Künste-Mindmap-Daten werden angefordert.")
|
||||
|
||||
try:
|
||||
nodes = [
|
||||
{
|
||||
"id": "visual_arts",
|
||||
"name": "Bildende Kunst",
|
||||
"description": "Malerei, Bildhauerei und andere visuelle Kunstformen",
|
||||
"category": "Künste",
|
||||
"has_children": True,
|
||||
"color_code": "#c2185b"
|
||||
},
|
||||
{
|
||||
"id": "music",
|
||||
"name": "Musik",
|
||||
"description": "Tonkunst und musikalische Komposition",
|
||||
"category": "Künste",
|
||||
"has_children": True,
|
||||
"color_code": "#c2185b"
|
||||
},
|
||||
{
|
||||
"id": "literature",
|
||||
"name": "Literatur",
|
||||
"description": "Schriftliche Kunstwerke und Poesie",
|
||||
"category": "Künste",
|
||||
"has_children": True,
|
||||
"color_code": "#c2185b"
|
||||
}
|
||||
]
|
||||
|
||||
edges = [
|
||||
{"source_id": "arts", "target_id": "visual_arts", "strength": 0.8},
|
||||
{"source_id": "arts", "target_id": "music", "strength": 0.8},
|
||||
{"source_id": "arts", "target_id": "literature", "strength": 0.8}
|
||||
]
|
||||
|
||||
return jsonify({
|
||||
"nodes": nodes,
|
||||
"edges": edges
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
app.logger.error(f"Fehler beim Abrufen der Künste-Mindmap-Daten: {str(e)}")
|
||||
return jsonify({"error": "Fehler beim Abrufen der Mindmap-Daten"}), 500
|
||||
# Diese Routen wurden an den Anfang der Datei verschoben und werden nicht mehr benötigt
|
||||
@@ -1456,3 +1456,9 @@ werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on
|
||||
2025-05-11 00:18:32,826 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:18:35,161 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:18:35,161 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:21:24,561 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:21:26,869 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:21:26,869 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:22:24,158 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:22:26,170 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
2025-05-11 00:22:26,170 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:76]
|
||||
|
||||
Reference in New Issue
Block a user