diff --git a/Flask/app.py b/Flask/app.py index b25aace..e587ea1 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -90,25 +90,17 @@ def update_jobs(): print(e) -def edit_version(): - with open("/app/MsRewards-Reborn/version", "r") as f: - version = f.readline().replace("\n", '') - f = open("/app/MsRewards-Reborn/Flask/templates/base.html", "r") - txt = f.readlines() - f.close() - f = open("/app/MsRewards-Reborn/Flask/templates/base.html", "w") - for i in txt: - i = re.sub('', f'', i) - f.write(i) - f.close() - - """ #Flask app """ app = Flask(__name__) +@app.context_processor +def inject_default_variables(): + with open("/app/MsRewards-Reborn/version", "r") as f: + version = f.readline().replace("\n", '') + return dict(version=version) """ #Login stuff """ @@ -167,7 +159,7 @@ def change_password(): # handle login failed @app.errorhandler(401) def unauthorized(e): - return(render_template("login.html")) + return(redirect("login")) # callback to reload the user object @@ -292,7 +284,6 @@ def proxy_post(): @app.route("/override/") def override_get(): - edit_version() with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) return(render_template("override.html", data=configs)) @@ -300,7 +291,6 @@ def override_get(): @app.route("/override/", methods=["post"]) def override_post(): - edit_version() with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) @@ -373,6 +363,10 @@ def logs(): print(configs) return(render_template("logs.html", data=configs)) +@app.route("/stats/", methods=["GET", "POST"]) +def stats(): + return(render_template("stats.html")) + @app.route('/download/', methods=['GET', 'POST']) @@ -418,5 +412,4 @@ def maxi(dict): update_jobs() -edit_version() subprocess.Popen(["bash",'/app/MsRewards-Reborn/config/request.sh']) diff --git a/Flask/static/css/flask.css b/Flask/static/css/flask.css index 0164a00..e1ecd79 100644 --- a/Flask/static/css/flask.css +++ b/Flask/static/css/flask.css @@ -26,7 +26,7 @@ html { text-align: center; font-family: Montserrat; - height: 90%; + height: 95%; } form { @@ -195,7 +195,7 @@ body { border-radius: 5px; padding: 20px; width: 80%; - height: 80%; + height: 90%; } @@ -205,7 +205,7 @@ body { border: 1px solid var(--color-border0); border-radius: 5px; padding: 20px; - height: 80%; + height: 90%; } diff --git a/Flask/templates/base.html b/Flask/templates/base.html index 0ab36a3..5fb9d51 100644 --- a/Flask/templates/base.html +++ b/Flask/templates/base.html @@ -32,7 +32,7 @@ {% endblock %} - + diff --git a/Flask/templates/config.html b/Flask/templates/config.html index de495e3..5835beb 100644 --- a/Flask/templates/config.html +++ b/Flask/templates/config.html @@ -28,7 +28,7 @@ - + diff --git a/Flask/templates/discord.html b/Flask/templates/discord.html index 6ab5861..803e0cf 100644 --- a/Flask/templates/discord.html +++ b/Flask/templates/discord.html @@ -29,7 +29,7 @@ - + diff --git a/Flask/templates/logs.html b/Flask/templates/logs.html index 39d48a9..741f238 100644 --- a/Flask/templates/logs.html +++ b/Flask/templates/logs.html @@ -29,7 +29,7 @@ - + diff --git a/Flask/templates/override.html b/Flask/templates/override.html index 107558e..436f6b6 100644 --- a/Flask/templates/override.html +++ b/Flask/templates/override.html @@ -29,7 +29,7 @@ - + diff --git a/Flask/templates/proxy.html b/Flask/templates/proxy.html index d545b10..e020772 100644 --- a/Flask/templates/proxy.html +++ b/Flask/templates/proxy.html @@ -29,7 +29,7 @@ - + diff --git a/Flask/templates/settings.html b/Flask/templates/settings.html index 576151d..284b2a0 100644 --- a/Flask/templates/settings.html +++ b/Flask/templates/settings.html @@ -29,7 +29,7 @@ - + @@ -61,10 +61,8 @@

TODO



diff --git a/Flask/templates/stats.html b/Flask/templates/stats.html new file mode 100644 index 0000000..94e5d3d --- /dev/null +++ b/Flask/templates/stats.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} +{% block left_pannel %} + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+{% endblock %} + +{% block content %} + +{%if not current_user.is_authenticated %} + +{% else %} + +{% endif %} + +{%endblock %} \ No newline at end of file diff --git a/config/grafana.ini b/config/grafana.ini index 755e01a..ea72204 100755 --- a/config/grafana.ini +++ b/config/grafana.ini @@ -328,7 +328,7 @@ root_url = %(protocol)s://localhost:3000/grafana/ ;cookie_samesite = lax # set to true if you want to allow browsers to render Grafana in a ,