From 43bce4789cd082157624eb549496ff6862d85717 Mon Sep 17 00:00:00 2001 From: Anika Date: Mon, 4 Mar 2024 22:22:58 +0100 Subject: [PATCH] closes #2 --- __pycache__/test.cpython-38.pyc | Bin 2871 -> 3077 bytes alarms.json | 16 ++++++++++------ logs.json | 20 ++++---------------- static/css/style.css | 6 ++++++ templates/index.html | 29 +++++++++++++++++++---------- test.py | 10 ++++++++-- 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/__pycache__/test.cpython-38.pyc b/__pycache__/test.cpython-38.pyc index 3bb781f202e268e371a82d91e074e9d78d727b7f..4fe90b192703b204d1a08af2a20ed490dd4b7118 100644 GIT binary patch delta 937 zcmZuv&rcIk5PtJ^x4T`o3zR}zB!)B;ZL~{2h;2Aj zk3^Gq_0YX}6Hi|Bf8e|~FDCvAUUa5a(}TNt-_Fc8^WHb}_Vd`AjQcQ=uo*tnSHF8x z&L`K^4^zNcz$zf1%HM&s0*;<0c$Nt*O^hb=EK9RCK+hw_sA_WiFZajOJI4PjMJ(hk zR$uwY8dWZj1HBW&b!dhRKfO{sNSGn-SRtd5CNc4lRhc|S+ZL9HA3>V6dP3|hYe6v3 zaWE^VeVy z{J=@F0#N!(f72=Nm1S+!^ZoLUC*w$|FM4TXRBE(ktmXyJ8zM6HS4ECyVvffz1P_3*DVXU*FhYk{!GPh)a5z!CH+V8 zJV6ej;CB0xGZdI5=r+@pe39G~0ZEoFfkSYKpoEZ-oXi+PL6eus9wV4jvv$hzy}G#D z*qKwmVp&*FS#uf!b;F#5eN{HsY|<_mURPXwHE-n#!+lEVn8*+>YWsd~XcsV`iq<{2 zsajV0)DpTrsbbs)8*!Vx4%>#<*Nm*W<4fkNP4@>LmUuyV)06M!S&h nb$3k(dux0iBXWUYlwgs7PL<2*n|*s^)B!tz%dx=5OQH1}NA$jX delta 722 zcmYk3%WD%s9LMK3yV=L=qc2U9D&hlcGe-WH=&nG9oDE?JJC{hsYl-t(gs>5= z##6t2&=&E%C{5dYkvcBa@6HHA7ji3(l*acS8Jbf#=R4|Ln^*nvr9); zbi+&cAlXY-duehguIgCeAjLA`vc}IE5b^bqTry82}=!wYr6xd>8iI<1hqoS|e+v}{kE zI*nDaj%_vEXl_ano|YH*^SGZ*hLjijqI)RSZ|8n(13MP~qlDgBjZJOozris*JO@fJ zuLsDe8o0xtg>}?TsMt~gI}Wy|G7a^fy(&MN$~3iKDgV9r9kuT5E>(3#)Dd`|*g`ZA UP4&@hF3kAA0&SrKOurV|9|hEl+yDRo diff --git a/alarms.json b/alarms.json index 3078929..707351b 100644 --- a/alarms.json +++ b/alarms.json @@ -1,14 +1,18 @@ [ { - "datetime": "05.04.2025 06:33", - "message": "Test" + "datetime": "05.03.2024 21:16", + "message": "lkjasdf" }, { - "datetime": "05.04.2025 06:57", - "message": "EEh" + "datetime": "05.03.2024 21:16", + "message": "lkjasdf" }, { - "datetime": "04.03.2024 18:40", - "message": "PREVIOUS" + "datetime": "05.03.2024 20:20", + "message": "gestern" + }, + { + "datetime": "04.03.2024 23:22", + "message": "nachher" } ] \ No newline at end of file diff --git a/logs.json b/logs.json index 9b7792e..5eb71b9 100644 --- a/logs.json +++ b/logs.json @@ -1,22 +1,10 @@ [ { - "datetime": "11.02.2024 22:58", - "message": "Nice" + "datetime": "04.03.2024 18:44", + "message": "j\u00f6lasdf" }, { - "datetime": "12.02.2024 15:03", - "message": "Lololol" - }, - { - "datetime": "22.02.2024 11:14", - "message": "Seitenschneider an Leon" - }, - { - "datetime": "04.03.2024 13:02", - "message": "hkjaflksaflksafl kisafjdbsafdo\u00f6ijar\u00f6oirpijwfeij" - }, - { - "datetime": "04.03.2024 18:02", - "message": "hdhdh" + "datetime": "04.03.2024 18:44", + "message": "lkjasdf" } ] \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index ebed8c4..4c013ca 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -8,9 +8,14 @@ "log alarms"; } +div.datetime { + display: inline-block; +} + div.log { grid-area: log; margin-bottom: 1cm; + margin-right: 2cm; } div.alarms { @@ -22,6 +27,7 @@ div.savedLogs { border-radius: 20px; border-width: 5px; grid-area: savedLogs; + margin-right: 2cm; } div.savedAlarms { diff --git a/templates/index.html b/templates/index.html index b40c6bd..08051d6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -28,7 +28,7 @@ - + @@ -36,15 +36,24 @@
- - - - - +
+ + +
+
+ + +
+
+ + +
+
diff --git a/test.py b/test.py index cb0bf16..dafa666 100644 --- a/test.py +++ b/test.py @@ -33,9 +33,15 @@ def index(): @app.route('/setAlarm', methods=('GET', 'POST')) def setAlarm(): if request.method == 'POST': - time = datetime.fromisoformat(request.form['datetime']).strftime("%d.%m.%Y %H:%M") + print(request.form['date']+' '+request.form['time']) + if request.form['date'] !="" and request.form['time']!="": + time = datetime.strptime(request.form['date']+' '+request.form['time'], "%Y-%m-%d %H:%M") + elif request.form['date'] == "": + time = datetime.combine(datetime.today(),datetime.strptime(request.form['time'], "%H:%M").time()) + if time