Compare commits

...

11 Commits

6 changed files with 1749 additions and 679 deletions

Binary file not shown.

1264
app.py

File diff suppressed because it is too large Load Diff

38
check_db.py Normal file
View File

@@ -0,0 +1,38 @@
import sqlite3
def check_mindmap_nodes():
try:
conn = sqlite3.connect('database/systades.db')
cursor = conn.cursor()
# Check if the table exists
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='mind_map_node';")
table_exists = cursor.fetchone()
if not table_exists:
print("Die Tabelle 'mind_map_node' existiert nicht!")
return
# Check for the "Wissen" node
cursor.execute("SELECT * FROM mind_map_node WHERE name = 'Wissen';")
wissen_node = cursor.fetchone()
if wissen_node:
print(f"'Wissen'-Knoten gefunden: {wissen_node}")
else:
print("'Wissen'-Knoten NICHT gefunden!")
# Get all nodes
cursor.execute("SELECT id, name FROM mind_map_node LIMIT 10;")
nodes = cursor.fetchall()
print(f"\nVorhandene Knoten (max. 10):")
for node in nodes:
print(f" - {node}")
conn.close()
except Exception as e:
print(f"Fehler: {e}")
if __name__ == "__main__":
check_mindmap_nodes()

View File

@@ -1 +0,0 @@

File diff suppressed because it is too large Load Diff

View File

@@ -803,7 +803,20 @@ function createFlashContainer() {
// Funktion zum Laden der Mindmap-Daten aus der Datenbank
async function loadMindmapData(nodeId = null) {
try {
const response = await fetch(`/api/mindmap/${nodeId || 'root'}`);
let url;
// Wir müssen zwischen numerischen IDs und String-IDs unterscheiden
if (nodeId === null || nodeId === undefined) {
// Wenn keine ID angegeben ist, verwende 'root'
url = '/api/mindmap/root';
} else if (isNaN(parseInt(nodeId))) {
// Für String-IDs wie 'root', 'technology', 'arts' - direkte Route
url = `/api/mindmap/${nodeId}`;
} else {
// Für numerische IDs - neue Route mit /id/ Präfix
url = `/api/mindmap/id/${nodeId}`;
}
const response = await fetch(url);
if (!response.ok) throw new Error('Fehler beim Laden der Mindmap-Daten');
return await response.json();
} catch (error) {