Compare commits

2 Commits

6 changed files with 24 additions and 24 deletions

Binary file not shown.

View File

@@ -41,7 +41,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=365) # Langlebige Session für Dark Mode-Einstellung app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=365) # Langlebige Session für Dark Mode-Einstellung
# OpenAI API-Konfiguration # OpenAI API-Konfiguration
client = OpenAI(api_key="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") client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
# Context processor für globale Template-Variablen # Context processor für globale Template-Variablen
@app.context_processor @app.context_processor
@@ -202,7 +202,7 @@ def settings():
current_user.set_password(new_password) current_user.set_password(new_password)
db.session.commit() db.session.commit()
flash('Passwort erfolgreich aktualisiert!', 'success') flash('Passwort erfolgreich aktualisiert!', 'success')
return redirect(url_for('settings')) return redirect(url_for('settings'))
return render_template('settings.html') return render_template('settings.html')
@@ -993,7 +993,7 @@ def chat_with_assistant():
return jsonify({ return jsonify({
'response': answer 'response': answer
}) })
except Exception as e: except Exception as e:
return jsonify({ return jsonify({
'error': f'Fehler bei der OpenAI-Anfrage: {str(e)}' 'error': f'Fehler bei der OpenAI-Anfrage: {str(e)}'
@@ -1108,8 +1108,8 @@ def create_default_categories():
for child_data in children_data: for child_data in children_data:
child = Category(**child_data, parent_id=category.id) child = Category(**child_data, parent_id=category.id)
db.session.add(child) db.session.add(child)
db.session.commit() db.session.commit()
print("Standard-Kategorien wurden erstellt!") print("Standard-Kategorien wurden erstellt!")
def initialize_database(): def initialize_database():

BIN
website/instance/mindmap.db Normal file

Binary file not shown.

View File

@@ -714,7 +714,7 @@
<!-- Initialization Script --> <!-- Initialization Script -->
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
// Mindmap-Container holen // Mindmap-Container holen
const mindmapContainer = document.getElementById('mindmap-container'); const mindmapContainer = document.getElementById('mindmap-container');
@@ -837,7 +837,7 @@ document.addEventListener('DOMContentLoaded', function() {
}); });
// UI Event-Handler einrichten // UI Event-Handler einrichten
document.getElementById('zoom-in-btn').addEventListener('click', function() { document.getElementById('zoom-in-btn').addEventListener('click', function() {
if (window.mindmap) { if (window.mindmap) {
const transform = d3.zoomTransform(window.mindmap.svg.node()); const transform = d3.zoomTransform(window.mindmap.svg.node());
window.mindmap.svg.call( window.mindmap.svg.call(
@@ -845,9 +845,9 @@ document.addEventListener('DOMContentLoaded', function() {
d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k * 1.3) d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k * 1.3)
); );
} }
}); });
document.getElementById('zoom-out-btn').addEventListener('click', function() { document.getElementById('zoom-out-btn').addEventListener('click', function() {
if (window.mindmap) { if (window.mindmap) {
const transform = d3.zoomTransform(window.mindmap.svg.node()); const transform = d3.zoomTransform(window.mindmap.svg.node());
window.mindmap.svg.call( window.mindmap.svg.call(
@@ -855,18 +855,18 @@ document.addEventListener('DOMContentLoaded', function() {
d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k / 1.3) d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k / 1.3)
); );
} }
}); });
document.getElementById('center-btn').addEventListener('click', function() { document.getElementById('center-btn').addEventListener('click', function() {
if (window.mindmap) { if (window.mindmap) {
window.mindmap.svg.call( window.mindmap.svg.call(
d3.zoom().transform, d3.zoom().transform,
d3.zoomIdentity d3.zoomIdentity
); );
} }
}); });
document.getElementById('add-thought-btn').addEventListener('click', function() { document.getElementById('add-thought-btn').addEventListener('click', function() {
if (window.mindmap && window.mindmap.selectedNode) { if (window.mindmap && window.mindmap.selectedNode) {
const nodeId = window.mindmap.selectedNode.id; const nodeId = window.mindmap.selectedNode.id;
const modal = document.getElementById('add-thought-modal'); const modal = document.getElementById('add-thought-modal');
@@ -923,13 +923,13 @@ document.addEventListener('DOMContentLoaded', function() {
alert('Fehler beim Hinzufügen des Gedankens.'); alert('Fehler beim Hinzufügen des Gedankens.');
}); });
} }
} }
} else { } else {
alert('Bitte wähle zuerst einen Knoten aus.'); alert('Bitte wähle zuerst einen Knoten aus.');
} }
}); });
document.getElementById('connect-btn').addEventListener('click', function() { document.getElementById('connect-btn').addEventListener('click', function() {
if (window.mindmap && window.mindmap.selectedNode) { if (window.mindmap && window.mindmap.selectedNode) {
// Speichere den ersten ausgewählten Knoten // Speichere den ersten ausgewählten Knoten
window.mindmap.sourceNode = window.mindmap.selectedNode; window.mindmap.sourceNode = window.mindmap.selectedNode;
@@ -962,7 +962,7 @@ document.addEventListener('DOMContentLoaded', function() {
// Cursor-Stil ändern, um den Verbindungsmodus anzuzeigen // Cursor-Stil ändern, um den Verbindungsmodus anzuzeigen
document.getElementById('mindmap-container').style.cursor = 'crosshair'; document.getElementById('mindmap-container').style.cursor = 'crosshair';
} else { } else {
alert('Bitte wähle zuerst einen Knoten aus.'); alert('Bitte wähle zuerst einen Knoten aus.');
} }
}); });
@@ -1019,8 +1019,8 @@ document.addEventListener('DOMContentLoaded', function() {
.catch(error => { .catch(error => {
console.error('Fehler beim Speichern des Gedankens:', error); console.error('Fehler beim Speichern des Gedankens:', error);
alert('Fehler beim Speichern des Gedankens. Bitte versuche es erneut.'); alert('Fehler beim Speichern des Gedankens. Bitte versuche es erneut.');
});
}); });
});
} }
// Fenstergrößen-Änderung behandeln // Fenstergrößen-Änderung behandeln