From 15103b790555c99a0072f1042fa5c03b7e1eb42f Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 18:34:19 +0200 Subject: [PATCH 1/8] okay normalement le numero de version marche --- Flask/app.py | 20 ++++---------------- Flask/templates/base.html | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Flask/app.py b/Flask/app.py index 706a18a..5ee0ca7 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -90,25 +90,16 @@ 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(): + version = f.readline().replace("\n", '') + return dict(version=version) """ #Login stuff """ @@ -292,7 +283,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 +290,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) @@ -418,5 +407,4 @@ def maxi(dict): update_jobs() -edit_version() subprocess.Popen(["bash",'/app/MsRewards-Reborn/config/request.sh']) 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 %} - + From 74ea8ee8545f4720c55835c2f957448a303b455a Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 18:36:22 +0200 Subject: [PATCH 2/8] =?UTF-8?q?bah=20tu=20=C3=A9tais=20pass=C3=A9=20ou=20t?= =?UTF-8?q?oi=20=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Flask/app.py | 3 ++- version | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Flask/app.py b/Flask/app.py index 5ee0ca7..ce924be 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -98,7 +98,8 @@ app = Flask(__name__) @app.context_processor def inject_default_variables(): - version = f.readline().replace("\n", '') + with open("/app/MsRewards-Reborn/version", "r") as f: + version = f.readline().replace("\n", '') return dict(version=version) """ #Login stuff diff --git a/version b/version index 9c173b8..76f75c6 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.2.11 +v6.2.12 From fa45d97576159d2536e120bb8c48244a6d61438e Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 18:53:06 +0200 Subject: [PATCH 3/8] should be embeded now --- Flask/app.py | 6 ++++- Flask/templates/override.html | 2 +- Flask/templates/stats.html | 51 +++++++++++++++++++++++++++++++++++ config/grafana.ini | 2 +- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 Flask/templates/stats.html diff --git a/Flask/app.py b/Flask/app.py index ce924be..88bd960 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -159,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 @@ -363,6 +363,10 @@ def logs(): print(configs) return(render_template("logs.html", data=configs)) +@app.route("/stats/", methods=["GET", "POST"]) +def logs(): + return(render_template("stats.html")) + @app.route('/download/', methods=['GET', 'POST']) 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/stats.html b/Flask/templates/stats.html new file mode 100644 index 0000000..816f265 --- /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 , + {% endif %} {%endblock %} \ No newline at end of file diff --git a/version b/version index 8c98679..86011bc 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.2.13 +v6.2.14 From 10e8fe1dd07317e7a2391ae5d381360a24cb313a Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 19:28:13 +0200 Subject: [PATCH 6/8] yeah i even consider that as a big update --- Flask/static/css/flask.css | 4 ++-- version | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Flask/static/css/flask.css b/Flask/static/css/flask.css index 0164a00..2c3458b 100644 --- a/Flask/static/css/flask.css +++ b/Flask/static/css/flask.css @@ -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/version b/version index 86011bc..dffc266 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.2.14 +v6.3.0 From efd53fb5d9e0f1a1ac0a35145ee32e31cdd22317 Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 19:31:29 +0200 Subject: [PATCH 7/8] comeback, version number --- Flask/static/css/flask.css | 2 +- version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flask/static/css/flask.css b/Flask/static/css/flask.css index 2c3458b..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 { diff --git a/version b/version index dffc266..bb83eee 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.3.0 +v6.3.1 From ae6707ef538df0db066d1f4fb4ebe5b6e3396f56 Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 29 Aug 2023 19:34:52 +0200 Subject: [PATCH 8/8] whoops, btw, clicking again on stats open grafana --- Flask/templates/stats.html | 4 ++-- version | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Flask/templates/stats.html b/Flask/templates/stats.html index aaa7291..94e5d3d 100644 --- a/Flask/templates/stats.html +++ b/Flask/templates/stats.html @@ -24,12 +24,12 @@ - + - + diff --git a/version b/version index bb83eee..68380a8 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.3.1 +v6.3.2