Config template

This commit is contained in:
2023-06-07 01:38:03 +02:00
parent f0c8d51682
commit 3a6f831da8
3 changed files with 25 additions and 3 deletions

Binary file not shown.

View File

@@ -1,8 +1,10 @@
import os
import dotenv
from benchmark.utils import Files
from flask import (
Blueprint,
render_template,
current_app,
url_for,
flash,
redirect,
@@ -56,7 +58,10 @@ def set_benchmark(benchmark_id):
@main.route("/config")
@login_required
def config():
return render_template("config.html")
os.chdir(current_user.benchmark.folder)
env = dotenv.dotenv_values(".env")
print(env)
return render_template("config.html", config_env=env)
@main.route("/login", methods=["GET", "POST"])

View File

@@ -1,5 +1,22 @@
{% extends "base.html" %}
{% block content %}
<h1>Home</h1>
<p>Welcome to the home page!</p>
<div class="alert alert-primary" role="alert">
<h3>Configuration</h3>
<table class="table table-stripped table-hover bg-light">
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% for item, value in config_env.items() %}
<tr>
<td>{{ item }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock content %}