deploy updates
This commit is contained in:
19
ctrl/deploy.sh
Normal file
19
ctrl/deploy.sh
Normal file
@@ -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"
|
||||||
@@ -59,6 +59,7 @@ def sync():
|
|||||||
log.info("Resuming from saved token")
|
log.info("Resuming from saved token")
|
||||||
|
|
||||||
watch_kwargs = {"resume_after": resume_token} if resume_token else {}
|
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
|
# Watch for inserts, updates, and replaces on the database
|
||||||
pipeline = [{"$match": {"operationType": {"$in": ["insert", "update", "replace"]}}}]
|
pipeline = [{"$match": {"operationType": {"$in": ["insert", "update", "replace"]}}}]
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %} {% block head %}
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
@@ -140,14 +138,14 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
box-shadow: 0 2px 4px rgba(0,0,0,0.5);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||||
border: 1px solid rgba(0,0,0,0.3);
|
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-block:hover {
|
.task-block:hover {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
box-shadow: 0 4px 12px rgba(0,0,0,0.7);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-label {
|
.task-label {
|
||||||
@@ -175,59 +173,99 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
border: 1px solid #444;
|
border: 1px solid #444;
|
||||||
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-block:hover .block-tooltip {
|
.task-block:hover .block-tooltip {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock head %}
|
{% endblock head %} {% block content %}
|
||||||
|
|
||||||
{% block content %}
|
<div
|
||||||
|
class="nav-bar"
|
||||||
<div class="nav-bar" style="margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #444; font-size: 12pt;">
|
style="
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
border-bottom: 2px solid #444;
|
||||||
|
font-size: 12pt;
|
||||||
|
"
|
||||||
|
>
|
||||||
<a href="/">Today</a>
|
<a href="/">Today</a>
|
||||||
<a href="/switches/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}">Switches</a>
|
<a href="/calendar/daily">Calendar</a>
|
||||||
<a href="/work">Work</a>
|
<a
|
||||||
|
href="/switches/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||||
|
>Switches</a
|
||||||
|
>
|
||||||
<a href="/totals">All Time</a>
|
<a href="/totals">All Time</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav-tabs">
|
<div class="nav-tabs">
|
||||||
<a href="/calendar/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
<a
|
||||||
class="{% if scope == 'daily' %}active{% endif %}">Daily</a>
|
href="/calendar/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
||||||
<a href="/calendar/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
class="{% if scope == 'daily' %}active{% endif %}"
|
||||||
class="{% if scope == 'weekly' %}active{% endif %}">Weekly</a>
|
>Daily</a
|
||||||
<a href="/calendar/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
>
|
||||||
class="{% if scope == 'monthly' %}active{% endif %}">Monthly</a>
|
<a
|
||||||
<span style="margin-left: auto; display: flex; gap: 15px; align-items: center;">
|
href="/calendar/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
||||||
<span style="color: #999; font-size: 11pt;">Grid:</span>
|
class="{% if scope == 'weekly' %}active{% endif %}"
|
||||||
<a href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=1"
|
>Weekly</a
|
||||||
class="{% if grid == 1 %}active{% endif %}" style="font-size: 11pt;">1h</a>
|
>
|
||||||
<a href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=3"
|
<a
|
||||||
class="{% if grid == 3 %}active{% endif %}" style="font-size: 11pt;">3h</a>
|
href="/calendar/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid={{ grid }}"
|
||||||
<a href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=6"
|
class="{% if scope == 'monthly' %}active{% endif %}"
|
||||||
class="{% if grid == 6 %}active{% endif %}" style="font-size: 11pt;">6h</a>
|
>Monthly</a
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style="margin-left: auto; display: flex; gap: 15px; align-items: center"
|
||||||
|
>
|
||||||
|
<span style="color: #999; font-size: 11pt">Grid:</span>
|
||||||
|
<a
|
||||||
|
href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=1"
|
||||||
|
class="{% if grid == 1 %}active{% endif %}"
|
||||||
|
style="font-size: 11pt"
|
||||||
|
>1h</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=3"
|
||||||
|
class="{% if grid == 3 %}active{% endif %}"
|
||||||
|
style="font-size: 11pt"
|
||||||
|
>3h</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}?grid=6"
|
||||||
|
class="{% if grid == 6 %}active{% endif %}"
|
||||||
|
style="font-size: 11pt"
|
||||||
|
>6h</a
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="date-nav">
|
<div class="date-nav">
|
||||||
<a href="/calendar/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}?grid={{ grid }}">←</a>
|
<a
|
||||||
|
href="/calendar/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}?grid={{ grid }}"
|
||||||
|
>←</a
|
||||||
|
>
|
||||||
{% if scope == 'daily' %}
|
{% if scope == 'daily' %}
|
||||||
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
||||||
{% elif scope == 'weekly' %}
|
{% elif scope == 'weekly' %}
|
||||||
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
||||||
{% elif scope == 'monthly' %}
|
{% elif scope == 'monthly' %}
|
||||||
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/calendar/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}?grid={{ grid }}">→</a>
|
<a
|
||||||
|
href="/calendar/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}?grid={{ grid }}"
|
||||||
|
>→</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="calendar-grid">
|
<div class="calendar-grid">
|
||||||
<div class="time-column">
|
<div class="time-column">
|
||||||
<div class="day-header" style="height: 40px;"></div>
|
<div class="day-header" style="height: 40px"></div>
|
||||||
{% for hour in range(0, 24, grid) %}
|
{% for hour in range(0, 24, grid) %}
|
||||||
<div class="time-slot" style="height: {{ grid * 60 }}px;">{{ '%02d:00'|format(hour) }}</div>
|
<div class="time-slot" style="height: {{ grid * 60 }}px;">
|
||||||
|
{{ '%02d:00'|format(hour) }}
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -235,64 +273,54 @@
|
|||||||
{% for day in days %}
|
{% for day in days %}
|
||||||
<div class="day-column">
|
<div class="day-column">
|
||||||
<div class="day-header">
|
<div class="day-header">
|
||||||
{{ day.strftime('%a %d') if scope != 'daily' else day.strftime('%A') }}
|
{{ day.strftime('%a %d') if scope != 'daily' else
|
||||||
|
day.strftime('%A') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="day-grid">
|
<div class="day-grid">
|
||||||
{% for hour in range(0, 24, grid) %}
|
{% for hour in range(0, 24, grid) %}
|
||||||
<div class="hour-line" style="top: {{ hour * 60 }}px; height: {{ grid * 60 }}px;"></div>
|
<div
|
||||||
{% endfor %}
|
class="hour-line"
|
||||||
|
style="top: {{ hour * 60 }}px; height: {{ grid * 60 }}px;"
|
||||||
|
></div>
|
||||||
|
{% endfor %} {% set day_blocks = [] %} {% for block in blocks %}
|
||||||
|
{% if block.start.date() == day.date() %} {% set _ =
|
||||||
|
day_blocks.append(block) %} {% endif %} {% endfor %} {# Group
|
||||||
|
blocks by hour for stacking #} {% set hour_groups = {} %} {% for
|
||||||
|
block in day_blocks %} {% set hour_key = block.hour %} {% if
|
||||||
|
hour_key not in hour_groups %} {% set _ =
|
||||||
|
hour_groups.update({hour_key: []}) %} {% endif %} {% set _ =
|
||||||
|
hour_groups[hour_key].append(block) %} {% endfor %} {# Render
|
||||||
|
blocks stacked within each hour #} {% for hour_key, hour_blocks
|
||||||
|
in hour_groups.items() %} {% for block in hour_blocks %} {% set
|
||||||
|
idx = loop.index0 %} {% set base_top_px = block.hour * 60 %} {%
|
||||||
|
set duration_hours = block.duration / 3600.0 %} {% set height_px
|
||||||
|
= duration_hours * 60 %} {% if height_px < 2 %}{% set height_px
|
||||||
|
= 2 %}{% endif %} {% set task_hash = block.task_path|hash if
|
||||||
|
block.task_path else 0 %} {% set base_color_hue = task_hash %
|
||||||
|
360 %} {% set active_color = 'hsl(%d, 60%%,
|
||||||
|
45%%)'|format(base_color_hue) %} {# Cascade effect: shift right
|
||||||
|
and down for overlapping blocks #} {# Each block shifts 8% right
|
||||||
|
and 4px down #} {% set offset_pct = idx * 8 %} {% set width_pct
|
||||||
|
= 100 - (idx * 8) - 2 %} {% set vertical_offset_px = idx * 4 %}
|
||||||
|
{% set top_px = base_top_px + vertical_offset_px %}
|
||||||
|
|
||||||
{% set day_blocks = [] %}
|
<div
|
||||||
{% for block in blocks %}
|
class="task-block"
|
||||||
{% if block.start.date() == day.date() %}
|
style="top: {{ top_px }}px; height: {{ height_px }}px;
|
||||||
{% set _ = day_blocks.append(block) %}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{# Group blocks by hour for stacking #}
|
|
||||||
{% set hour_groups = {} %}
|
|
||||||
{% for block in day_blocks %}
|
|
||||||
{% set hour_key = block.hour %}
|
|
||||||
{% if hour_key not in hour_groups %}
|
|
||||||
{% set _ = hour_groups.update({hour_key: []}) %}
|
|
||||||
{% endif %}
|
|
||||||
{% set _ = hour_groups[hour_key].append(block) %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{# Render blocks stacked within each hour #}
|
|
||||||
{% for hour_key, hour_blocks in hour_groups.items() %}
|
|
||||||
{% for block in hour_blocks %}
|
|
||||||
{% set idx = loop.index0 %}
|
|
||||||
{% set base_top_px = block.hour * 60 %}
|
|
||||||
{% set duration_hours = block.duration / 3600.0 %}
|
|
||||||
{% set height_px = duration_hours * 60 %}
|
|
||||||
{% if height_px < 2 %}{% set height_px = 2 %}{% endif %}
|
|
||||||
|
|
||||||
{% set task_hash = block.task_path|hash if block.task_path else 0 %}
|
|
||||||
{% set base_color_hue = task_hash % 360 %}
|
|
||||||
{% set active_color = 'hsl(%d, 60%%, 45%%)'|format(base_color_hue) %}
|
|
||||||
|
|
||||||
{# Cascade effect: shift right and down for overlapping blocks #}
|
|
||||||
{# Each block shifts 8% right and 4px down #}
|
|
||||||
{% set offset_pct = idx * 8 %}
|
|
||||||
{% set width_pct = 100 - (idx * 8) - 2 %}
|
|
||||||
{% set vertical_offset_px = idx * 4 %}
|
|
||||||
{% set top_px = base_top_px + vertical_offset_px %}
|
|
||||||
|
|
||||||
<div class="task-block"
|
|
||||||
style="top: {{ top_px }}px; height: {{ height_px }}px;
|
|
||||||
left: {{ offset_pct }}%; width: {{ width_pct }}%;
|
left: {{ offset_pct }}%; width: {{ width_pct }}%;
|
||||||
background: {{ active_color }}; opacity: 0.9;">
|
background: {{ active_color }}; opacity: 0.9;"
|
||||||
<div class="task-label">{{ block.task_path }}</div>
|
>
|
||||||
<div class="task-time">{{ (block.duration // 60)|int }}m</div>
|
<div class="task-label">{{ block.task_path }}</div>
|
||||||
<div class="block-tooltip">
|
<div class="task-time">
|
||||||
<strong>{{ block.task_path }}</strong><br>
|
{{ (block.duration // 60)|int }}m
|
||||||
Hour: {{ '%02d:00'|format(block.hour) }}<br>
|
</div>
|
||||||
Duration: {{ (block.duration // 60)|int }} minutes
|
<div class="block-tooltip">
|
||||||
</div>
|
<strong>{{ block.task_path }}</strong><br />
|
||||||
</div>
|
Hour: {{ '%02d:00'|format(block.hour) }}<br />
|
||||||
{% endfor %}
|
Duration: {{ (block.duration // 60)|int }} minutes
|
||||||
{% endfor %}
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %} {% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -106,7 +106,6 @@
|
|||||||
<a href="/">Today</a>
|
<a href="/">Today</a>
|
||||||
<a href="/calendar/daily">Calendar</a>
|
<a href="/calendar/daily">Calendar</a>
|
||||||
<a href="/switches/daily">Switches</a>
|
<a href="/switches/daily">Switches</a>
|
||||||
<a href="/work">Work</a>
|
|
||||||
<a href="/totals">All Time</a>
|
<a href="/totals">All Time</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %} {% block head %}
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
@@ -104,8 +102,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Active vs idle workspace indicator */
|
/* Active vs idle workspace indicator */
|
||||||
.ws-active { font-weight: bold; }
|
.ws-active {
|
||||||
.ws-idle { opacity: 0.5; }
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.ws-idle {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.stats {
|
.stats {
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
@@ -135,36 +137,56 @@
|
|||||||
color: #e0e0e0;
|
color: #e0e0e0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock head %}
|
{% endblock head %} {% block content %}
|
||||||
|
|
||||||
{% block content %}
|
<div
|
||||||
|
class="nav-bar"
|
||||||
<div class="nav-bar" style="margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #444;">
|
style="
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
border-bottom: 2px solid #444;
|
||||||
|
"
|
||||||
|
>
|
||||||
<a href="/">Today</a>
|
<a href="/">Today</a>
|
||||||
<a href="/calendar/{{ scope }}/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}">Calendar</a>
|
<a href="/calendar/daily">Calendar</a>
|
||||||
<a href="/work">Work</a>
|
<a href="/switches/daily">Switches</a>
|
||||||
<a href="/totals">All Time</a>
|
<a href="/totals">All Time</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav-tabs">
|
<div class="nav-tabs">
|
||||||
<a href="/switches/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
<a
|
||||||
class="{% if scope == 'daily' %}active{% endif %}">Daily</a>
|
href="/switches/daily/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||||
<a href="/switches/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
class="{% if scope == 'daily' %}active{% endif %}"
|
||||||
class="{% if scope == 'weekly' %}active{% endif %}">Weekly</a>
|
>Daily</a
|
||||||
<a href="/switches/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
>
|
||||||
class="{% if scope == 'monthly' %}active{% endif %}">Monthly</a>
|
<a
|
||||||
|
href="/switches/weekly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||||
|
class="{% if scope == 'weekly' %}active{% endif %}"
|
||||||
|
>Weekly</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="/switches/monthly/{{ base_date.year }}/{{ base_date.month }}/{{ base_date.day }}"
|
||||||
|
class="{% if scope == 'monthly' %}active{% endif %}"
|
||||||
|
>Monthly</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="date-nav">
|
<div class="date-nav">
|
||||||
<a href="/switches/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}">←</a>
|
<a
|
||||||
|
href="/switches/{{ scope }}/{{ prev_date.year }}/{{ prev_date.month }}/{{ prev_date.day }}"
|
||||||
|
>←</a
|
||||||
|
>
|
||||||
{% if scope == 'daily' %}
|
{% if scope == 'daily' %}
|
||||||
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
<span class="date-info">{{ base_date.strftime('%Y-%m-%d %A') }}</span>
|
||||||
{% elif scope == 'weekly' %}
|
{% elif scope == 'weekly' %}
|
||||||
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
<span class="date-info">Week of {{ start.strftime('%Y-%m-%d') }}</span>
|
||||||
{% elif scope == 'monthly' %}
|
{% elif scope == 'monthly' %}
|
||||||
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
<span class="date-info">{{ base_date.strftime('%B %Y') }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/switches/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}">→</a>
|
<a
|
||||||
|
href="/switches/{{ scope }}/{{ next_date.year }}/{{ next_date.month }}/{{ next_date.day }}"
|
||||||
|
>→</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="stats">
|
<div class="stats">
|
||||||
@@ -175,7 +197,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="stat-item">
|
<div class="stat-item">
|
||||||
<span class="stat-label">Total Time:</span>
|
<span class="stat-label">Total Time:</span>
|
||||||
<span class="stat-value">{{ (switches|sum(attribute='delta') // 3600)|int }}h {{ ((switches|sum(attribute='delta') % 3600) // 60)|int }}m</span>
|
<span class="stat-value"
|
||||||
|
>{{ (switches|sum(attribute='delta') // 3600)|int }}h {{
|
||||||
|
((switches|sum(attribute='delta') % 3600) // 60)|int }}m</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -184,34 +209,36 @@
|
|||||||
|
|
||||||
<div class="switches-container">
|
<div class="switches-container">
|
||||||
{% set max_delta = switches|map(attribute='delta')|max if switches else 1 %}
|
{% set max_delta = switches|map(attribute='delta')|max if switches else 1 %}
|
||||||
{% set base_height = 30 %}
|
{% set base_height = 30 %} {% set max_height = 200 %} {% for switch in
|
||||||
{% set max_height = 200 %}
|
switches %} {% set is_active = switch.workspace in ['Plan', 'Think', 'Work']
|
||||||
{% for switch in switches %}
|
%} {% set task_hash = switch.task_path|hash if switch.task_path else 0 %} {%
|
||||||
{% set is_active = switch.workspace in ['Plan', 'Think', 'Work'] %}
|
set border_hue = task_hash % 360 %} {% set border_color = 'hsl(%d, 70%%,
|
||||||
{% set task_hash = switch.task_path|hash if switch.task_path else 0 %}
|
50%%)'|format(border_hue) %} {% set bg_color = 'hsl(%d, 30%%,
|
||||||
{% set border_hue = task_hash % 360 %}
|
20%%)'|format(border_hue) %} {% set height_ratio = (switch.delta /
|
||||||
{% set border_color = 'hsl(%d, 70%%, 50%%)'|format(border_hue) %}
|
max_delta) if max_delta > 0 else 0 %} {% set cell_height = (base_height +
|
||||||
{% set bg_color = 'hsl(%d, 30%%, 20%%)'|format(border_hue) %}
|
(height_ratio * (max_height - base_height)))|int %}
|
||||||
{% set height_ratio = (switch.delta / max_delta) if max_delta > 0 else 0 %}
|
<div
|
||||||
{% set cell_height = (base_height + (height_ratio * (max_height - base_height)))|int %}
|
class="switch-row {{ 'ws-active' if is_active else 'ws-idle' }}"
|
||||||
<div class="switch-row {{ 'ws-active' if is_active else 'ws-idle' }}"
|
style="border-left-color: {{ border_color }}; background-color: {{ bg_color }}; height: {{ cell_height }}px;"
|
||||||
style="border-left-color: {{ border_color }}; background-color: {{ bg_color }}; height: {{ cell_height }}px;">
|
>
|
||||||
<div class="switch-time">{{ switch.date.strftime('%m/%d %H:%M:%S') }}</div>
|
<div class="switch-time">
|
||||||
|
{{ switch.date.strftime('%m/%d %H:%M:%S') }}
|
||||||
|
</div>
|
||||||
<div class="switch-workspace">{{ switch.workspace }}</div>
|
<div class="switch-workspace">{{ switch.workspace }}</div>
|
||||||
<div class="switch-task">{{ switch.task_path }}</div>
|
<div class="switch-task">{{ switch.task_path }}</div>
|
||||||
<div class="switch-duration">
|
<div class="switch-duration">
|
||||||
{% if switch.delta >= 3600 %}
|
{% if switch.delta >= 3600 %} {{ (switch.delta // 3600)|int }}h {{
|
||||||
{{ (switch.delta // 3600)|int }}h {{ ((switch.delta % 3600) // 60)|int }}m
|
((switch.delta % 3600) // 60)|int }}m {% else %} {{ (switch.delta //
|
||||||
{% else %}
|
60)|int }}m {{ (switch.delta % 60)|int }}s {% endif %}
|
||||||
{{ (switch.delta // 60)|int }}m {{ (switch.delta % 60)|int }}s
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if not switches %}
|
{% if not switches %}
|
||||||
<p style="text-align: center; color: #666; margin-top: 40px;">No switches in this period</p>
|
<p style="text-align: center; color: #666; margin-top: 40px">
|
||||||
|
No switches in this period
|
||||||
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ services:
|
|||||||
- mongo
|
- mongo
|
||||||
environment:
|
environment:
|
||||||
- MONGODB_HOST=mongo
|
- MONGODB_HOST=mongo
|
||||||
|
- TZ=America/Argentina/Buenos_Aires
|
||||||
networks:
|
networks:
|
||||||
- gateway
|
- gateway
|
||||||
- internal
|
- internal
|
||||||
|
|||||||
Reference in New Issue
Block a user