admin: add a page to get configuration used
This commit is contained in:
parent
df745fd4a6
commit
da78d0da70
|
@ -2,7 +2,8 @@
|
|||
|
||||
from app.routes import index, search, users, tools, development
|
||||
from app.routes.account import login, account, notification
|
||||
from app.routes.admin import index, groups, account, trophies, forums, attachments
|
||||
from app.routes.admin import index, groups, account, trophies, forums, \
|
||||
attachments, config
|
||||
from app.routes.forum import index, topic
|
||||
from app.routes.programs import index
|
||||
from app.routes.posts import edit
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
from app.utils.priv_required import priv_required
|
||||
from app.utils.render import render
|
||||
from app import app
|
||||
from config import V5Config
|
||||
|
||||
@app.route('/admin/config', methods=['GET'])
|
||||
@priv_required('access-admin-panel')
|
||||
def adm_config():
|
||||
config = {k: getattr(V5Config, k) for k in [
|
||||
"DOMAIN", "DB_NAME", "USE_LDAP", "LDAP_ROOT", "LDAP_ENV",
|
||||
"ENABLE_GUEST_POST", "ENABLE_EMAIL_CONFIRMATION", "SEND_MAILS"
|
||||
]}
|
||||
return render('admin/config.html', config=config)
|
|
@ -0,0 +1,18 @@
|
|||
{% extends "base/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<a href="{{ url_for('adm') }}">Panneau d'administration</a> » <h1>Configuration du site</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section>
|
||||
<h2>Configuration du site</h2>
|
||||
|
||||
<table style='width: 90%; margin: auto'>
|
||||
<tr><th>Nom</th><th>Valeur</th></tr>
|
||||
{% for k in config %}
|
||||
<tr><td>{{ k }}</td><td style="font-family:monospace;">{{ config[k] }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</section>
|
||||
{% endblock %}
|
|
@ -12,6 +12,7 @@
|
|||
<li><a href="{{ url_for('adm_trophies') }}">Titres et trophées</a></li>
|
||||
<li><a href="{{ url_for('adm_forums') }}">Arbre des forums</a></li>
|
||||
<li><a href="{{ url_for('adm_attachments') }}">Pièces-jointes</a></li>
|
||||
<li><a href="{{ url_for('adm_config') }}">Configuration du site</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue