remove broken pwa feature and fix weekly analytics counter

This commit is contained in:
2026-04-20 15:34:04 +02:00
parent c14a86b190
commit 0cd500e9f2
7 changed files with 7 additions and 48 deletions

View File

@@ -11,8 +11,8 @@ connection = st.connection("sqlite")
with connection.session as configure_session:
configure_session.execute(text('PRAGMA foreign_keys=ON'))
def create_counter(title:str, counter_type:CounterType, counter_color) -> None:
logger.info("Adding counter %s", counter_type)
with connection.session as session:
try:
query = text('INSERT INTO counters (name, type, color) VALUES (:title, :type, :color)')
@@ -22,7 +22,6 @@ def create_counter(title:str, counter_type:CounterType, counter_color) -> None:
logger.error(e)
session.rollback()
def get_counters():
try:
return connection.query('SELECT id, name, type, color FROM counters', ttl=0)
@@ -31,6 +30,7 @@ def get_counters():
return st.dataframe()
def increment_counter(counter_id:int) -> None:
logger.info("Incrementing counter %s", counter_id)
with connection.session as session:
try:
query = text('INSERT INTO entries (counter_id) VALUES (:id)')
@@ -42,6 +42,7 @@ def increment_counter(counter_id:int) -> None:
def remove_counter(counter_id:int) -> None:
logger.info("Removing counter %s", counter_id)
with connection.session as session:
try:
query = text('DELETE FROM counters WHERE id = :id')