From: Max Value Date: Sat, 5 Apr 2025 22:56:20 +0000 (+0100) Subject: Some small control changes X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=48764f969ff2ac63963e494119793ecee3f55380;p=shopping-channel Some small control changes + markupsafe requirement + end_timer_main for tracking when the clock ticks should be + schedule marks to the clock control pannel ~ moved the note feild to the text pannel --- diff --git a/requirements.txt b/requirements.txt index 3517df0..83260ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ flask_httpauth flask +markupsafe werkzeug jinja2 diff --git a/schema b/schema index 13b859a..5869f54 100644 --- a/schema +++ b/schema @@ -28,6 +28,7 @@ CREATE TABLE state ( end_timer_4 INTEGER, end_timer_5 INTEGER, end_timer_6 INTEGER, + end_timer_main INTEGER, focus_timer_1 INTEGER, focus_timer_2 INTEGER, focus_timer_3 INTEGER, diff --git a/teleshopping.py b/teleshopping.py index 14122a1..5ea6743 100755 --- a/teleshopping.py +++ b/teleshopping.py @@ -7,6 +7,7 @@ from flask_httpauth import HTTPBasicAuth from datetime import datetime, timezone from os import path, environ, system from math import radians, cos, sin +from markupsafe import escape from ast import literal_eval import sqlite3 import json @@ -124,7 +125,7 @@ def admin_page(page): valid_data = {k: type_note[k].__call__(aggrigate_data[k]) for k in aggrigate_data if k in type_note} - data_list = ', '.join([f"{k} = '{v}'" if type(v) == str else f"{k} = {v}" for (k,v) in valid_data.items()]) + data_list = ', '.join([f"{k} = '{escape(v)}'" if type(v) == str else f"{k} = {v}" for (k,v) in valid_data.items()]) query = f""" UPDATE state SET {data_list} diff --git a/templates/clock.html b/templates/clock.html index 64a1d6b..00b3d6d 100644 --- a/templates/clock.html +++ b/templates/clock.html @@ -4,12 +4,6 @@ XMDV - + .. Back to admin pannel +
+ + +
+
Doomsday clock (Incr. {{positions[1].i}} deg)
+ {% for p in positions %} + + {% set extra = "" %} {% if p.i == data.current_position %} - + {% set next_index = loop.index %} + {% set extra = "checked='checked' style='outline: 2px solid red;'"|safe %} + {% endif %} + + {% if loop.first %} + T+00:00 + {% elif p.i == 180 %} + T+00:00 + {% elif p.i < 180 %} + T+00:00 {% else %} - + T+00:00 {% endif %} {% endfor %} - +

TX Start @ 00:00

+

Next tick in T+00:00

+ Time will reset automatically on clock reset
Movement @@ -96,5 +166,78 @@ media query to make sure the clock is always displayed well
+ + diff --git a/templates/price.html b/templates/price.html index 0515521..c4b7d4e 100644 --- a/templates/price.html +++ b/templates/price.html @@ -103,10 +103,6 @@ {% endif %} -
- Note - -
diff --git a/templates/text.html b/templates/text.html index 0a50f07..25218a7 100644 --- a/templates/text.html +++ b/templates/text.html @@ -78,6 +78,11 @@ {% endfor %} +
+ Note + +
+