From de2ea3b7cb3bce0af6ff0f86bc31a93c735f7e9c Mon Sep 17 00:00:00 2001 From: buenosairesam Date: Mon, 26 Jan 2026 21:39:21 -0300 Subject: [PATCH] deploy updates --- ctrl/deploy.sh | 19 +++ dmapp/dmdb/sync.py | 1 + dmapp/dmweb/templates/calendar_view.html | 202 +++++++++++++---------- dmapp/dmweb/templates/main.html | 1 - dmapp/dmweb/templates/switches_view.html | 111 ++++++++----- docker-compose.yml | 1 + 6 files changed, 205 insertions(+), 130 deletions(-) create mode 100644 ctrl/deploy.sh diff --git a/ctrl/deploy.sh b/ctrl/deploy.sh new file mode 100644 index 0000000..59dcd27 --- /dev/null +++ b/ctrl/deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Deploy deskmeter to server +# Usage: ./ctrl/deploy.sh + +set -e +cd "$(dirname "$0")/.." + +echo "Building dmweb image..." +docker build -t registry.mcrn.ar/dmweb:latest . + +echo "Pushing to registry..." +docker push registry.mcrn.ar/dmweb:latest + +echo "Deploying on server..." +rsync -avz docker-compose.yml mcrn.ar:~/dm/ +ssh mcrn.ar "cd ~/dm && docker compose pull && docker compose up -d --remove-orphans" + +echo "Deploy complete" +ssh mcrn.ar "cd ~/dm && docker compose ps" diff --git a/dmapp/dmdb/sync.py b/dmapp/dmdb/sync.py index 0c41188..f532125 100644 --- a/dmapp/dmdb/sync.py +++ b/dmapp/dmdb/sync.py @@ -59,6 +59,7 @@ def sync(): log.info("Resuming from saved token") watch_kwargs = {"resume_after": resume_token} if resume_token else {} + watch_kwargs["full_document"] = "updateLookup" # Get full doc on updates # Watch for inserts, updates, and replaces on the database pipeline = [{"$match": {"operationType": {"$in": ["insert", "update", "replace"]}}}] diff --git a/dmapp/dmweb/templates/calendar_view.html b/dmapp/dmweb/templates/calendar_view.html index cdb3aed..6c13095 100644 --- a/dmapp/dmweb/templates/calendar_view.html +++ b/dmapp/dmweb/templates/calendar_view.html @@ -1,6 +1,4 @@ -{% extends 'layout.html' %} - -{% block head %} +{% extends 'layout.html' %} {% block head %} -{% endblock head %} +{% endblock head %} {% block content %} -{% block content %} - - diff --git a/dmapp/dmweb/templates/switches_view.html b/dmapp/dmweb/templates/switches_view.html index 1291f31..575dcfb 100644 --- a/dmapp/dmweb/templates/switches_view.html +++ b/dmapp/dmweb/templates/switches_view.html @@ -1,6 +1,4 @@ -{% extends 'layout.html' %} - -{% block head %} +{% extends 'layout.html' %} {% block head %} -{% endblock head %} +{% endblock head %} {% block content %} -{% block content %} - - @@ -184,34 +209,36 @@
{% set max_delta = switches|map(attribute='delta')|max if switches else 1 %} - {% set base_height = 30 %} - {% set max_height = 200 %} - {% for switch in switches %} - {% set is_active = switch.workspace in ['Plan', 'Think', 'Work'] %} - {% set task_hash = switch.task_path|hash if switch.task_path else 0 %} - {% set border_hue = task_hash % 360 %} - {% set border_color = 'hsl(%d, 70%%, 50%%)'|format(border_hue) %} - {% set bg_color = 'hsl(%d, 30%%, 20%%)'|format(border_hue) %} - {% set height_ratio = (switch.delta / max_delta) if max_delta > 0 else 0 %} - {% set cell_height = (base_height + (height_ratio * (max_height - base_height)))|int %} -
-
{{ switch.date.strftime('%m/%d %H:%M:%S') }}
+ {% set base_height = 30 %} {% set max_height = 200 %} {% for switch in + switches %} {% set is_active = switch.workspace in ['Plan', 'Think', 'Work'] + %} {% set task_hash = switch.task_path|hash if switch.task_path else 0 %} {% + set border_hue = task_hash % 360 %} {% set border_color = 'hsl(%d, 70%%, + 50%%)'|format(border_hue) %} {% set bg_color = 'hsl(%d, 30%%, + 20%%)'|format(border_hue) %} {% set height_ratio = (switch.delta / + max_delta) if max_delta > 0 else 0 %} {% set cell_height = (base_height + + (height_ratio * (max_height - base_height)))|int %} +
+
+ {{ switch.date.strftime('%m/%d %H:%M:%S') }} +
{{ switch.workspace }}
{{ switch.task_path }}
- {% if switch.delta >= 3600 %} - {{ (switch.delta // 3600)|int }}h {{ ((switch.delta % 3600) // 60)|int }}m - {% else %} - {{ (switch.delta // 60)|int }}m {{ (switch.delta % 60)|int }}s - {% endif %} + {% if switch.delta >= 3600 %} {{ (switch.delta // 3600)|int }}h {{ + ((switch.delta % 3600) // 60)|int }}m {% else %} {{ (switch.delta // + 60)|int }}m {{ (switch.delta % 60)|int }}s {% endif %}
{% endfor %}
{% if not switches %} -

No switches in this period

+

+ No switches in this period +

{% endif %}