From f5f04ec782c72b7cdb7633a5710aa8045f199268 Mon Sep 17 00:00:00 2001 From: Namonay Date: Mon, 8 Sep 2025 08:24:49 +0200 Subject: [PATCH] add: data --- main.py | 4 +- templates/data.html | 115 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 templates/data.html diff --git a/main.py b/main.py index 9dafa75..ec68392 100644 --- a/main.py +++ b/main.py @@ -43,7 +43,9 @@ def record(): @app.route("/", methods = ['GET']) def normal(): return render_template('home.html', longer = record(), dates = wrap(values, 10), total = len(values.split(' ')), days = (datetime.datetime.today().date() - datetime.datetime.strptime(values.split(' ')[-1], "%Y-%m-%d").date()).days) - +@app.route("/data", methods = ['GET']) +def data(): + return render_template('data.html') if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=1) diff --git a/templates/data.html b/templates/data.html new file mode 100644 index 0000000..8d4bba8 --- /dev/null +++ b/templates/data.html @@ -0,0 +1,115 @@ + + + + + CA42 - Compteur + + + + + + + + +
+

ca42

+
+ +
+

+ Data sur les incidents enregistrés +

+
+ +
+

Année avec le plus d'incident:

+

{{days}}

+
+

+
+
+

+ Nombre total de problèmes : {{total}}
+ Record de jours sans problèmes: {{longer}} +

+
+
+ + + \ No newline at end of file