From 1a28e958eeb049fc24acd0f736ef919e8b657c4f Mon Sep 17 00:00:00 2001 From: Benno Date: Sun, 30 Jun 2024 18:36:51 +0200 Subject: [PATCH 1/2] * Add basic passkey creation and login * Add option to select activity chart time range * Add sticky nav bar * Add login button to nav bar * Distinguish between theme modes light, dark and auto. Swich without reloading page. * Use public URL from configuration in chat messages. --- .idea/Spybot2.iml | 1 + .idea/misc.xml | 6 + Spybot2/settings.py | 25 +- frontend/main.js | 6 +- frontend/package-lock.json | 14 ++ frontend/package.json | 1 + frontend/passkeys.js | 79 ++++++ frontend/rollup.config.mjs | 3 +- poetry.lock | 137 ++++++++--- pyproject.toml | 2 + spybot/auth/auth.py | 2 +- spybot/auth/backend/__init__.py | 0 .../{backend.py => backend/link_backend.py} | 5 +- spybot/auth/backend/passkey_backend.py | 20 ++ spybot/auth/last_seen_middleware.py | 22 ++ spybot/auth/passkeys.py | 149 ++++++++++++ spybot/migrations/0001_initial.py | 22 ++ spybot/migrations/0021_userpasskey.py | 29 +++ spybot/models.py | 20 ++ spybot/recorder/client.py | 3 +- spybot/recorder/cron/cron.py | 6 +- spybot/static/styles.css | 14 +- spybot/static/theme.js | 62 +++-- spybot/templates/base.html | 14 ++ spybot/templates/spybot/base/navbar.html | 162 +++++++------ .../templates/spybot/home/activity_chart.html | 228 +++++++++--------- .../templates/spybot/home/tod_histogram.html | 2 +- spybot/templates/spybot/login.html | 42 ++++ spybot/templates/spybot/login_teamspeak.html | 32 +++ spybot/templates/spybot/profile.html | 30 ++- spybot/templates/spybot/util/dropdown.html | 9 + spybot/urls.py | 11 +- spybot/views/common.py | 31 +++ spybot/views/fragments/activity_chart.py | 28 +++ spybot/{ => views}/views.py | 39 +-- spybot/visualization.py | 14 +- 36 files changed, 998 insertions(+), 272 deletions(-) create mode 100644 frontend/passkeys.js create mode 100644 spybot/auth/backend/__init__.py rename spybot/auth/{backend.py => backend/link_backend.py} (90%) create mode 100644 spybot/auth/backend/passkey_backend.py create mode 100644 spybot/auth/last_seen_middleware.py create mode 100644 spybot/auth/passkeys.py create mode 100644 spybot/migrations/0021_userpasskey.py create mode 100644 spybot/templates/base.html create mode 100644 spybot/templates/spybot/login.html create mode 100644 spybot/templates/spybot/login_teamspeak.html create mode 100644 spybot/templates/spybot/util/dropdown.html create mode 100644 spybot/views/common.py create mode 100644 spybot/views/fragments/activity_chart.py rename spybot/{ => views}/views.py (91%) diff --git a/.idea/Spybot2.iml b/.idea/Spybot2.iml index 37ef5e8..039a6ff 100644 --- a/.idea/Spybot2.iml +++ b/.idea/Spybot2.iml @@ -18,6 +18,7 @@ +