fixxed admin route build error
This commit is contained in:
parent
d3ba2c270d
commit
aa5b835e44
7
app.py
7
app.py
@ -76,6 +76,13 @@ def control_page():
|
||||
return render_template('control.html', config=current_config)
|
||||
|
||||
|
||||
@app.route('/admin')
|
||||
def admin():
|
||||
"""Admin-Übersicht: Configs anzeigen, bearbeiten, Logs etc."""
|
||||
configs = load_configs()
|
||||
return render_template('admin.html', configs=configs)
|
||||
|
||||
|
||||
@app.route('/configs/<path:filename>')
|
||||
def serve_config_file(filename):
|
||||
return send_from_directory(app.config['CONFIG_DIR'], filename)
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Admin – MK Control{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container my-5">
|
||||
<h1>Admin-Bereich</h1>
|
||||
<p class="lead mb-4">Konfigurationen verwalten, Logs einsehen, etc.</p>
|
||||
|
||||
<h3>Vorhandene Konfigurationen</h3>
|
||||
{% if configs %}
|
||||
<ul class="list-group">
|
||||
{% for cfg in configs %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
{{ cfg.name }} ({{ cfg.filename }})
|
||||
<span>
|
||||
<a href="#" class="btn btn-sm btn-outline-primary">Bearbeiten</a>
|
||||
</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<div class="alert alert-info">Noch keine Konfigurationen vorhanden.</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-5">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-secondary">Zurück zur Übersicht</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
x
Reference in New Issue
Block a user