diff --git a/__pycache__/app.cpython-311.pyc b/__pycache__/app.cpython-311.pyc index 491a265..61c40f8 100644 Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ diff --git a/__pycache__/models.cpython-311.pyc b/__pycache__/models.cpython-311.pyc index f4e031e..3f6911b 100644 Binary files a/__pycache__/models.cpython-311.pyc and b/__pycache__/models.cpython-311.pyc differ diff --git a/database/systades.db b/database/systades.db index 65f597f..0061f99 100644 Binary files a/database/systades.db and b/database/systades.db differ diff --git a/logs/app.log b/logs/app.log index 346ab8c..45c5f0c 100644 --- a/logs/app.log +++ b/logs/app.log @@ -5870,3 +5870,7 @@ Traceback (most recent call last): raise NotFound() from None werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. [in C:\Users\firem\Desktop\111\Systades\website\app.py:93] +2025-05-12 20:27:21,822 INFO: Anwendung gestartet [in /home/core/dev/website/app.py:77] +2025-05-12 20:27:23,378 INFO: Anwendung gestartet [in /home/core/dev/website/app.py:77] +2025-05-12 20:27:23,378 INFO: Anwendung gestartet [in /home/core/dev/website/app.py:77] +2025-05-12 20:27:37,548 INFO: Anwendung gestartet [in /home/core/dev/website/app.py:77] diff --git a/static/js/update_mindmap.js b/static/js/update_mindmap.js index f75977e..a0dad1c 100644 --- a/static/js/update_mindmap.js +++ b/static/js/update_mindmap.js @@ -226,20 +226,74 @@ async function initializeMindmap() { ]; // Bestehende Cytoscape-Instanz entfernen, falls vorhanden - if (window.cy) { + if (window.cy && typeof window.cy.destroy === 'function') { window.cy.destroy(); } + const cyContainer = document.getElementById('cy'); + if (!cyContainer) { + throw new Error('Mindmap-Container #cy nicht gefunden!'); + } + window.cy = cytoscape({ - container: document.getElementById('cy'), + container: cyContainer, elements: elements, - style: mindmapStyles, + style: [ + { + selector: 'node', + style: mindmapStyles.node.base + }, + { + selector: 'node[isCenter]', + style: mindmapStyles.node.center + }, + { + selector: 'node:selected', + style: mindmapStyles.node.selected + }, + { + selector: 'edge', + style: mindmapStyles.edge.base + } + ], layout: mindmapStyles.layout.base }); + // Füge neuronale Eigenschaften zu allen Knoten hinzu + cy.nodes().forEach(node => { + const data = node.data(); + // Verwende mindmapConfig für Kategorie-Farben oder einen Standardwert + const categoryColor = data.category && mindmapConfig.categories[data.category] + ? mindmapConfig.categories[data.category].color + : '#60a5fa'; + + node.data({ + ...data, + neuronSize: data.neuronSize || 8, + neuronActivity: data.neuronActivity || 0.8, + refractionPeriod: Math.random() * 300 + 700, + threshold: Math.random() * 0.3 + 0.6, + lastFired: 0, + color: data.color || categoryColor + }); + }); + + // Füge synaptische Eigenschaften zu allen Kanten hinzu + cy.edges().forEach(edge => { + const data = edge.data(); + edge.data({ + ...data, + strength: data.strength || 0.5, + conductionVelocity: Math.random() * 0.5 + 0.3, + latency: Math.random() * 100 + 50 + }); + }); + // Event-Listener für Knoten-Klicks cy.on('tap', 'node', async function(evt) { const node = evt.target; + console.log('Node clicked:', node.id(), 'hasChildren:', node.data('hasChildren'), 'expanded:', node.data('expanded')); + if (node.data('hasChildren') && !node.data('expanded')) { await loadSubthemes(node); } @@ -248,6 +302,12 @@ async function initializeMindmap() { // Layout ausführen cy.layout(mindmapStyles.layout.base).run(); + // Starte neuronale Aktivitätssimulation + startNeuralActivitySimulation(cy); + + // Mindmap mit echten Daten befüllen (Styles, Farben etc.) + updateMindmap(); + return true; } catch (error) { console.error('Fehler bei der Mindmap-Initialisierung:', error); @@ -279,115 +339,25 @@ document.addEventListener('DOMContentLoaded', function() { } console.log('Cytoscape ist verfügbar'); - // Beispiel-Daten entfernt, stattdessen große Mindmap-Daten verwenden - const elements = [ - // Knoten - ...mindmapData.nodes.map(node => ({ - data: { - id: node.id, - label: node.label, - category: node.category, - description: node.description, - hasChildren: node.hasChildren, - expanded: node.expanded, - neuronSize: node.neuronSize, - neuronActivity: node.neuronActivity, - color: node.color, - icon: node.icon, - fontColor: node.fontColor, - fontSize: node.fontSize + // Initialisiere die Mindmap + initializeMindmap() + .then(success => { + if (success) { + console.log('Mindmap wurde erfolgreich initialisiert'); + // Event auslösen, damit andere Scripte reagieren können + document.dispatchEvent(new Event('mindmap-loaded')); + console.log('mindmap-loaded Event ausgelöst'); + } else { + console.error('Mindmap-Initialisierung fehlgeschlagen'); } - })), - // Kanten - ...mindmapData.edges.map(edge => ({ - data: { - source: edge.source, - target: edge.target, - label: edge.label, - strength: edge.strength - } - })) - ]; - - console.log('Initialisiere Cytoscape...'); - - // Initialisiere Cytoscape mit einem schlichten, modernen Design - window.cy = cytoscape({ - container: cyContainer, - elements: elements, - style: [ - { - selector: 'node', - style: mindmapStyles.node.base - }, - { - selector: 'node[isCenter]', - style: mindmapStyles.node.center - }, - { - selector: 'node:selected', - style: mindmapStyles.node.selected - }, - { - selector: 'edge', - style: mindmapStyles.edge.base - } - ], - layout: mindmapStyles.layout.base - }); - - console.log('Cytoscape initialisiert'); - - // Füge neuronale Eigenschaften zu allen Knoten hinzu - cy.nodes().forEach(node => { - const data = node.data(); - node.data({ - ...data, - neuronSize: data.neuronSize || 8, - neuronActivity: data.neuronActivity || 0.8, - refractionPeriod: Math.random() * 300 + 700, - threshold: Math.random() * 0.3 + 0.6, - lastFired: 0, - color: categoryColors[data.category] || '#60a5fa' + }) + .catch(error => { + console.error('Fehler bei der Mindmap-Initialisierung:', error); + showUINotification({ + error: 'Mindmap konnte nicht initialisiert werden', + details: error.message + }, 'error'); }); - }); - - // Füge synaptische Eigenschaften zu allen Kanten hinzu - cy.edges().forEach(edge => { - const data = edge.data(); - edge.data({ - ...data, - strength: data.strength || 0.5, - conductionVelocity: Math.random() * 0.5 + 0.3, - latency: Math.random() * 100 + 50 - }); - }); - - // Starte neuronale Aktivitätssimulation - startNeuralActivitySimulation(cy); - - // Mindmap mit echten Daten befüllen (Styles, Farben etc.) - updateMindmap(); - - // Event auslösen, damit andere Scripte reagieren können - document.dispatchEvent(new Event('mindmap-loaded')); - console.log('mindmap-loaded Event ausgelöst'); - - // Event-Listener für Knoten-Klicks - cy.on('tap', 'node', async function(evt) { - const node = evt.target; - console.log('Node clicked:', node.id(), 'hasChildren:', node.data('hasChildren'), 'expanded:', node.data('expanded')); - - if (node.data('hasChildren') && !node.data('expanded')) { - await loadSubthemes(node); - } - }); - - // Entferne den Icon-Overlay-Code - setTimeout(() => { - // Entferne alle existierenden Icon-Overlays - document.querySelectorAll('.cy-node-icon').forEach(icon => icon.remove()); - }, 0); }); // Funktion zum Initialisieren des neuronalen Designs diff --git a/utils/__pycache__/__init__.cpython-311.pyc b/utils/__pycache__/__init__.cpython-311.pyc index 613d2b4..06a0b36 100644 Binary files a/utils/__pycache__/__init__.cpython-311.pyc and b/utils/__pycache__/__init__.cpython-311.pyc differ diff --git a/utils/__pycache__/db_check.cpython-311.pyc b/utils/__pycache__/db_check.cpython-311.pyc index 0b4f11f..f594fb5 100644 Binary files a/utils/__pycache__/db_check.cpython-311.pyc and b/utils/__pycache__/db_check.cpython-311.pyc differ diff --git a/utils/__pycache__/db_fix.cpython-311.pyc b/utils/__pycache__/db_fix.cpython-311.pyc index fe2d90b..4262376 100644 Binary files a/utils/__pycache__/db_fix.cpython-311.pyc and b/utils/__pycache__/db_fix.cpython-311.pyc differ diff --git a/utils/__pycache__/db_rebuild.cpython-311.pyc b/utils/__pycache__/db_rebuild.cpython-311.pyc index a059a74..47a47c9 100644 Binary files a/utils/__pycache__/db_rebuild.cpython-311.pyc and b/utils/__pycache__/db_rebuild.cpython-311.pyc differ diff --git a/utils/__pycache__/db_test.cpython-311.pyc b/utils/__pycache__/db_test.cpython-311.pyc index 9fc961e..5d503e8 100644 Binary files a/utils/__pycache__/db_test.cpython-311.pyc and b/utils/__pycache__/db_test.cpython-311.pyc differ diff --git a/utils/__pycache__/server.cpython-311.pyc b/utils/__pycache__/server.cpython-311.pyc index 9e1d591..76865ca 100644 Binary files a/utils/__pycache__/server.cpython-311.pyc and b/utils/__pycache__/server.cpython-311.pyc differ diff --git a/utils/__pycache__/user_manager.cpython-311.pyc b/utils/__pycache__/user_manager.cpython-311.pyc index 40def1d..2400ee6 100644 Binary files a/utils/__pycache__/user_manager.cpython-311.pyc and b/utils/__pycache__/user_manager.cpython-311.pyc differ diff --git a/check_db.py b/utils/check_db.py similarity index 100% rename from check_db.py rename to utils/check_db.py diff --git a/db_operations.py b/utils/db_operations.py similarity index 100% rename from db_operations.py rename to utils/db_operations.py diff --git a/fix_routes.py b/utils/fix_routes.py similarity index 100% rename from fix_routes.py rename to utils/fix_routes.py diff --git a/update_routes.py b/utils/update_routes.py similarity index 100% rename from update_routes.py rename to utils/update_routes.py