diff --git a/logs/app.log b/logs/app.log
index 82ed580..a6e15b0 100644
--- a/logs/app.log
+++ b/logs/app.log
@@ -14,3 +14,54 @@
2025-05-14 11:23:02,222 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
2025-05-14 11:23:04,911 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
2025-05-14 11:23:04,911 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:23:30,306 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:23:32,842 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:23:32,842 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:05,060 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:07,477 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:07,477 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:11,604 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:14,428 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:24:14,428 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:25:57,023 ERROR: Fehler 404: 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.
+Endpoint: /.well-known/appspecific/com.chrome.devtools.json, Method: GET, IP: 127.0.0.1
+Nicht angemeldet
+Traceback (most recent call last):
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1484, in full_dispatch_request
+ rv = self.dispatch_request()
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1458, in dispatch_request
+ self.raise_routing_exception(req)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1440, in raise_routing_exception
+ raise request.routing_exception # type: ignore
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\ctx.py", line 353, in match_request
+ result = self.url_adapter.match(return_rule=True) # type: ignore
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\werkzeug\routing\map.py", line 655, in match
+ 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\TTOMCZA.EMEA\Dev\website\app.py:93]
+2025-05-14 11:25:57,023 ERROR: Fehler 404: 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.
+Endpoint: /.well-known/appspecific/com.chrome.devtools.json, Method: GET, IP: 127.0.0.1
+Nicht angemeldet
+Traceback (most recent call last):
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1484, in full_dispatch_request
+ rv = self.dispatch_request()
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1458, in dispatch_request
+ self.raise_routing_exception(req)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\app.py", line 1440, in raise_routing_exception
+ raise request.routing_exception # type: ignore
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\flask\ctx.py", line 353, in match_request
+ result = self.url_adapter.match(return_rule=True) # type: ignore
+ File "C:\Users\TTOMCZA.EMEA\AppData\Roaming\Python\Python313\site-packages\werkzeug\routing\map.py", line 655, in match
+ 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\TTOMCZA.EMEA\Dev\website\app.py:93]
+2025-05-14 11:27:26,252 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:27:26,419 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:27:28,763 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:27:28,763 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:27:28,854 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
+2025-05-14 11:27:28,854 INFO: Anwendung gestartet [in C:\Users\TTOMCZA.EMEA\Dev\website\app.py:77]
diff --git a/static/js/update_mindmap.js b/static/js/update_mindmap.js
index 419cf71..c1cd5b8 100644
--- a/static/js/update_mindmap.js
+++ b/static/js/update_mindmap.js
@@ -136,11 +136,7 @@ async function loadMindmapData(nodeId = null) {
let errorData;
try {
errorData = await response.json();
- console.log('API-Fehler Details:', {
- status: response.status,
- statusText: response.statusText,
- errorData
- });
+ console.log('API-Fehler Details:', errorData);
} catch (e) {
console.error('Fehler beim Parsen der Fehlerantwort:', e);
errorData = {
@@ -149,25 +145,26 @@ async function loadMindmapData(nodeId = null) {
}
// Fehlerobjekt für die Benachrichtigung erstellen
- const errorMessage = {
- error: errorData.error || errorData.message || 'Unbekannter Fehler',
- details: errorData.details || null
- };
+ const errorMessage = errorData.error || 'Unbekannter Fehler';
showUINotification(errorMessage, 'error');
- throw new Error(errorMessage.error);
+ throw new Error(errorMessage);
}
const data = await response.json();
console.log('Geladene Mindmap-Daten:', data);
if (!data.success) {
- const errorMessage = {
- error: data.error || 'Mindmap-Daten konnten nicht geladen werden',
- details: data.details || null
- };
+ const errorMessage = data.error || 'Mindmap-Daten konnten nicht geladen werden';
showUINotification(errorMessage, 'error');
- throw new Error(errorMessage.error);
+ throw new Error(errorMessage);
+ }
+
+ // Überprüfen, ob Nodes und Edges existieren
+ if (!data.nodes || !data.edges) {
+ const errorMessage = 'Ungültiges Datenformat: Nodes oder Edges fehlen';
+ showUINotification(errorMessage, 'error');
+ throw new Error(errorMessage);
}
// Erfolgreiche Antwort
@@ -175,17 +172,10 @@ async function loadMindmapData(nodeId = null) {
showUINotification('Mindmap-Daten erfolgreich geladen', 'success');
return data;
} catch (error) {
- console.error('Fehler beim Laden der Mindmap-Daten:', {
- message: error.message,
- stack: error.stack,
- nodeId
- });
+ console.error('Fehler beim Laden der Mindmap-Daten:', error);
// Stelle sicher, dass wir eine aussagekräftige Fehlermeldung haben
- const errorMessage = {
- error: error.message || 'Unbekannter Fehler beim Laden der Mindmap-Daten',
- details: error.stack
- };
+ const errorMessage = error.message || 'Unbekannter Fehler beim Laden der Mindmap-Daten';
showUINotification(errorMessage, 'error');
throw error;
@@ -754,609 +744,75 @@ function showFlash(message, type = 'info') {
* @param {number} duration - Die Anzeigedauer in Millisekunden (Standard: 3000)
*/
function showUINotification(message, type = 'info', duration = 3000) {
- // Überprüfe und formatiere die Nachricht
- let displayMessage;
- if (typeof message === 'object') {
- if (message.message) {
- displayMessage = message.message;
- } else if (message.error) {
- displayMessage = message.error;
- } else if (message.details) {
- displayMessage = message.details;
- } else {
- console.error('Ungültiges Nachrichtenobjekt:', message);
- displayMessage = 'Ein unbekannter Fehler ist aufgetreten';
- }
- } else if (typeof message === 'string') {
- displayMessage = message;
+ // Container erstellen, falls er nicht existiert
+ let container = document.getElementById('notification-container');
+ if (!container) {
+ container = document.createElement('div');
+ container.id = 'notification-container';
+ container.style.position = 'fixed';
+ container.style.top = '1rem';
+ container.style.right = '1rem';
+ container.style.zIndex = '1000';
+ container.style.maxWidth = '400px';
+ document.body.appendChild(container);
+ }
+
+ // Benachrichtigung erstellen
+ const notification = document.createElement('div');
+ notification.className = `notification notification-${type}`;
+ notification.style.padding = '1rem';
+ notification.style.marginBottom = '0.5rem';
+ notification.style.borderRadius = '0.25rem';
+ notification.style.boxShadow = '0 2px 5px rgba(0, 0, 0, 0.2)';
+ notification.style.position = 'relative';
+ notification.style.opacity = '0';
+ notification.style.transform = 'translateY(-20px)';
+ notification.style.transition = 'all 0.3s ease-in-out';
+
+ // Farben nach Typ
+ if (type === 'success') {
+ notification.style.backgroundColor = '#059669';
+ notification.style.color = '#ffffff';
+ } else if (type === 'error') {
+ notification.style.backgroundColor = '#DC2626';
+ notification.style.color = '#ffffff';
+ } else if (type === 'warning') {
+ notification.style.backgroundColor = '#F59E0B';
+ notification.style.color = '#ffffff';
} else {
- console.error('Ungültige Nachricht für UI-Benachrichtigung:', message);
- displayMessage = 'Ein unbekannter Fehler ist aufgetreten';
+ notification.style.backgroundColor = '#3B82F6';
+ notification.style.color = '#ffffff';
}
-
- // Validiere den Typ
- const validTypes = ['info', 'success', 'warning', 'error'];
- if (!validTypes.includes(type)) {
- console.warn(`Ungültiger Benachrichtigungstyp: ${type}. Verwende 'info' als Fallback.`);
- type = 'info';
- }
-
- // Validiere die Dauer
- if (typeof duration !== 'number' || duration < 1000 || duration > 10000) {
- console.warn(`Ungültige Dauer: ${duration}ms. Verwende 3000ms als Fallback.`);
- duration = 3000;
- }
-
- // Zeige die Benachrichtigung an
- showFlash(displayMessage, type);
-
- // Logging für Debugging-Zwecke
- console.log(`UI-Benachrichtigung [${type}]:`, displayMessage);
-}
-
-// Hilfsfunktion zum Erstellen eines Flash-Containers, falls keiner existiert
-function createFlashContainer() {
- const container = document.createElement('div');
- container.id = 'flash-messages';
- container.className = 'fixed top-4 right-4 z-50 w-64';
- document.body.appendChild(container);
- return container;
-}
-
-// Funktion zum Laden der Subthemen
-async function loadSubthemes(node) {
- try {
- // Prüfe zuerst, ob die Node gültig ist
- if (!node || !node.id) {
- console.error('Ungültige Node beim Laden der Subthemen');
- showUINotification('Fehler: Ungültiger Knoten für Subthemen', 'error');
- return;
- }
-
- // Zeige Ladebenachrichtigung
- showUINotification('Lade Subthemen...', 'info');
- console.log('Lade Subthemen für Node:', node.id());
-
- // Lade die Daten für die Unterthemen
- const data = await loadMindmapData(node.id());
- if (!data || !data.nodes || !data.edges) {
- throw new Error('Ungültiges Datenformat: Subthemen-Daten fehlen oder sind unvollständig');
- }
-
- // Markiere den aktuellen Knoten als erweitert
- node.data('expanded', true);
-
- // Finde den Mindmap-Container
- let mindmapContainer = document.querySelector('.mindmap-container');
- if (!mindmapContainer) {
- // Falls der Container nicht existiert, versuche den cy-Container zu finden und erstelle einen Wrapper
- const cyContainer = document.getElementById('cy');
- if (!cyContainer) {
- throw new Error('Mindmap-Container nicht gefunden');
+
+ // Nachrichteninhalt formatieren
+ let content = '';
+
+ if (typeof message === 'object' && message !== null) {
+ // Wenn es ein Fehler-Objekt ist
+ if (message.error) {
+ content = message.error;
+ if (message.details) {
+ content += `
${message.details}`;
}
-
- // Erstelle einen Container für die Mindmap-Seiten
- const parentElement = cyContainer.parentElement;
- mindmapContainer = document.createElement('div');
- mindmapContainer.className = 'mindmap-container';
- parentElement.insertBefore(mindmapContainer, cyContainer);
- parentElement.removeChild(cyContainer);
- mindmapContainer.appendChild(cyContainer);
- }
-
- // Erstelle eine neue Seite für die Unterthemen
- const newPage = document.createElement('div');
- newPage.className = 'mindmap-page';
- newPage.setAttribute('data-parent-node', node.id());
-
- // Erstelle den Header der Seite
- const header = document.createElement('div');
- header.className = 'mindmap-header';
- header.innerHTML = `
-
-