uéuéué ca test des trucs (un viewer de logs)
This commit is contained in:
parent
466ab6d880
commit
d16715dbf5
11
Flask/app.py
11
Flask/app.py
@ -48,7 +48,7 @@ scheduler.add_job( # on relance le job
|
||||
|
||||
def start_ms(i):
|
||||
print("\033[32m" + f"Starting config {i}" + "\033[0m")
|
||||
log = open(f"/app/MsRewards-Reborn/user_data/logs/{i}.txt", 'a') # so that data written to it will be appended
|
||||
log = open(f"/app/MsRewards-Reborn/Flask/static/logs/{i}.txt", 'a') # so that data written to it will be appended
|
||||
subprocess.Popen([f"python3 -u /app/MsRewards-Reborn/V6.py -c {i}"], stdout=log, stderr=log, shell=True)
|
||||
log.close()
|
||||
|
||||
@ -137,13 +137,16 @@ def login():
|
||||
user = User(id)
|
||||
login_user(user)
|
||||
if password == "ChangeMe":
|
||||
return(render_template("change_password.html"))
|
||||
return(redirect('override'))
|
||||
return(redirect('/change_password'))
|
||||
return(redirect('/override'))
|
||||
else:
|
||||
return abort(401)
|
||||
else:
|
||||
return(render_template("login.html"))
|
||||
|
||||
@app.route("/logs/", methods=["GET"])
|
||||
def login():
|
||||
return(render_template("logs.html"))
|
||||
|
||||
@app.route("/change_password/", methods=["GET", "POST"])
|
||||
@login_required
|
||||
@ -157,7 +160,7 @@ def change_password():
|
||||
"secret": secret
|
||||
}
|
||||
json.dump(data, inFile)
|
||||
return(render_template("override.html"))
|
||||
return(render_template("change_password.html"))
|
||||
|
||||
|
||||
# handle login failed
|
||||
|
1
Flask/static/logs/.gitignore
vendored
Normal file
1
Flask/static/logs/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.txt
|
@ -1 +1,44 @@
|
||||
<iframe src="../user_data/log1.txt" width=200 height=200 frameborder=0 id="frame">
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/config';">config</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/grafana';">stats</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<h1>Already logged in</h1>
|
||||
{% else %}
|
||||
<embed type="text/html" src="https://piair.xyz/download/1.log">
|
||||
{% endif %}
|
||||
{% endblock %}
|
@ -59,10 +59,12 @@
|
||||
<li>reorder config</li>
|
||||
<li>real override</li>
|
||||
<li>ban button</li>
|
||||
<li>pourquoi tout ne se lance pas bien ?</li>
|
||||
<li>logs viewer</li>
|
||||
<li>pourquoi tout ne se lance pas bien ? - </li>
|
||||
<li>avoir un afficheur de logs</li>
|
||||
<li>permettre de changer le mot de passe</li>
|
||||
<li>synchroniser le mot de passe de grafana et celui du bot</li>
|
||||
</ul>
|
||||
<br>
|
||||
<br><br>
|
||||
<h2>Backup config files</h2>
|
||||
<ul>
|
||||
<li><a href="/download/configs.json">download account config</a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user