Add more logs to /logs view & Simplify Dockerfile #10

Merged
augustin64 merged 3 commits from augustin64/MsRewards-Reborn:augustin64-dev into master 2024-04-03 15:50:17 +02:00
2 changed files with 14 additions and 4 deletions
Showing only changes of commit 1d16294c04 - Show all commits

View File

@ -373,8 +373,18 @@ def config_post():
def logs():
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
configs = json.load(inFile)
print(configs)
return(render_template("logs.html", data=configs))
files = [(configs[i]["name"], i) for i in configs]
config_files = [i[1] for i in files]
for f in os.listdir("/app/MsRewards-Reborn/Flask/static/logs"):
fid = ".".join(f.split(".")[:-1]) # filename without .txt
if f != ".gitignore" and fid not in config_files:
files.append((f, fid))
return render_template(
"logs.html",
files=files
)
@app.route("/stats/", methods=["GET", "POST"])

View File

@ -8,8 +8,8 @@
<select name="select" onchange="change_logs(this.value)">
<option id="null" value="0">Choisir une config</option>
{% for i in data %}
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
{% for file in files %}
<option id="{{ file[0] }}" value="{{ file[1] }}">{{ file[0] }}</option>
{% endfor %}
</select>
<br><br>