Add more logs (custom.txt..) to logs view
This commit is contained in:
parent
fae2033061
commit
1d16294c04
14
Flask/app.py
14
Flask/app.py
@ -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"])
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user