docs: session close 2026-10-22 — Docker, metrics, auth-log, Task 6 (VTODO-create). feat: webui/radicale.py create/toggle_task, CalDAV REPORT, api endpoints. fix: login cookie (HTMX, method=post, stale cleanup). fix: SQLite WAL read-only mount.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{% if current %}
|
||||
<div style="display:flex;flex-direction:column;height:100%">
|
||||
<div class="ph">
|
||||
<div style="flex:1;min-width:0">
|
||||
<div class="ps">{{ current.meta.get('subject') or '(без темы)' }}</div>
|
||||
<div class="pm">
|
||||
<span><span class="pl">От:</span> {{ current.meta.get('from') or '?' }}</span>
|
||||
{% for r in current.meta.get('to', '').split(';') %}
|
||||
<span><span class="pl">Кому:</span> {{ r.strip() }}</span>
|
||||
{% endfor %}
|
||||
<span><span class="pl">Дата:</span> {{ current.meta.get('date') or '?' }}</span>
|
||||
</div>
|
||||
{% if current.attachments %}
|
||||
<div class="patts">
|
||||
{% for a in current.attachments %}
|
||||
<a class="pa" href="/attachments/{{ current.dir|replace('/opt/hermes/email/', '') }}/attachments/{{ a.name|urlencode }}">📄 {{ a.name }} ({{ a.size_hr }})</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<button class="pb-btn" title="Создать задачу в Radicale"
|
||||
onclick="var b=this;fetch('/api/tasks/create',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({subject:{{ current.meta.get('subject','(без темы)')|tojson|safe }},from:{{ current.meta.get('from','')|tojson|safe }},body:{{ current.body[:300]|tojson|safe }},path:{{ current.path|tojson|safe }}})}).then(r=>r.json()).then(d=>{if(d.ok){b.textContent='✅';b.disabled=true;b.title='Задача создана'}else{alert('Ошибка: '+d.error)}}).catch(e=>alert('Ошибка: '+e));return false">📋</button>
|
||||
<button class="pchev" onclick="this.classList.toggle('open');document.getElementById('phdrs').classList.toggle('open')">⌄</button>
|
||||
</div>
|
||||
<div class="phdrs" id="phdrs" style="flex-basis:100%">
|
||||
{% for k in current.meta %}
|
||||
<div><b>{{ k }}:</b> {{ current.meta[k] }}</div>
|
||||
{% endfor %}
|
||||
<div><b>Файл:</b> /opt/hermes/email/{{ current.path }}</div>
|
||||
{% if current.attachments %}<div><b>Вложений:</b> {{ current.attachments|length }}</div>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pb" style="white-space:pre-wrap;font-family:inherit">
|
||||
{{ current.body }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty">Выберите письмо</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% if is_search %}
|
||||
<div class="sep"></div>
|
||||
<div class="fi act"><span class="ic">🔍</span><span class="nm">Результаты: {{ rows|length }}</span></div>
|
||||
{% endif %}
|
||||
{% for r in rows %}
|
||||
<div class="er {{ 'sel' if current_path == r.path else '' }}"
|
||||
hx-get="/emails/{{ r.path }}" hx-target="#c3" hx-swap="innerHTML"
|
||||
hx-trigger="click, dblclick"
|
||||
hx-on::after-request="if (event.detail.elt.getAttribute('hx-trigger') == '' || true) { window.EA_CONTEXT = Object.assign({}, window.EA_CONTEXT||{}, {email:'{{ r.path }}'}); }">
|
||||
<span class="st {{ 'on' if r.uid and r.uid % 7 == 0 else '' }}">☆</span>
|
||||
<div class="info">
|
||||
<div class="from {{ '' if r.uid and r.uid % 3 == 0 else 'un' }}">
|
||||
{{ r.from_addr.split('<')[0].strip() or r.from_addr }}
|
||||
{% if r.has_attachments %}<span class="ai-c">📎</span>{% endif %}
|
||||
</div>
|
||||
<div class="subj">{{ r.subject or '(без темы)' }}
|
||||
{% for t in r.tags %}<span class="tag {{ TAG_COLORS.get(t, 'i') }}">{{ t }}</span>{% endfor %}
|
||||
<span class="pr">{{ r.body_preview[:60] }}</span>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<span>{{ (r.date or '')|replace('+03:00','')|replace('+00:00','')|truncate(16, True, '') }}</span>
|
||||
<span class="da">{{ (r.date or '')[:10] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty">Писем нет</div>
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,51 @@
|
||||
<!-- колонка 1: папки -->
|
||||
<div class="c1" id="c1">
|
||||
<div class="ch">
|
||||
<span>📁 Папки</span>
|
||||
<button onclick="document.getElementById('c1').classList.toggle('hide')">◀</button>
|
||||
</div>
|
||||
<div class="tw">
|
||||
{% for f in folders %}
|
||||
<a class="fi" href="/emails?folder={{ f.path|urlencode }}"
|
||||
style="padding-left:{{ 12 + f.depth * 14 }}px;color:inherit" {% if folder == f.path %}data-act="1"{% endif %}>
|
||||
<span class="ar">{{ '▶' if f.has_children else '' }}</span>
|
||||
<span class="ic">{{ '📁' if f.has_children else '📄' }}</span>
|
||||
<span class="nm">{{ f.name }}</span>
|
||||
{% if f.cnt %}<span class="bd">{{ f.cnt }}</span>{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- колонка 2: список -->
|
||||
<div class="c2">
|
||||
<div class="tb">
|
||||
<button class="btn" onclick="document.getElementById('c1').classList.toggle('hide')">☰</button>
|
||||
<div class="sw">
|
||||
<span class="si">🔍</span>
|
||||
<input type="search" name="q" value="{{ q }}"
|
||||
placeholder="Поиск в папке…"
|
||||
hx-get="/emails"
|
||||
hx-trigger="input changed delay:400ms, search"
|
||||
hx-target="#email-list" hx-swap="innerHTML"
|
||||
hx-include="this" hx-vals='{"folder": "{{ folder }}"}'>
|
||||
</div>
|
||||
<button class="btn" onclick="document.body.classList.toggle('f3')">⛶</button>
|
||||
</div>
|
||||
<div class="lw" id="email-list" hx-on::after-request="window.EA_CONTEXT=Object.assign({},window.EA_CONTEXT||{},{folder:'{{ folder }}'})">
|
||||
{% include "partials/email_list.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- колонка 3: превью -->
|
||||
<div class="c3" id="c3">
|
||||
{% include "partials/email_detail.html" %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.EA_CONTEXT = Object.assign({}, window.EA_CONTEXT || {}, {
|
||||
folder: '{{ folder }}', page: 'emails',
|
||||
email: '{{ current_path or "" }}', subject: '{{ (current.meta.get("subject") if current else "")|e }}'
|
||||
});
|
||||
document.querySelectorAll('.fi[data-act]').forEach(function(el){el.classList.add('act')});
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
<form hx-post="/login" hx-target="#login-form" hx-swap="outerHTML" id="login-form" method="post" action="/login" style="text-align:center">
|
||||
{% if error %}<div class="err">{{ error }}</div>{% endif %}
|
||||
<input type="password" name="password" placeholder="Пароль" autofocus required>
|
||||
<button type="submit">Войти</button>
|
||||
</form>
|
||||
@@ -0,0 +1 @@
|
||||
<div id="login-form">✓ Успешно — перенаправляю…</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div id="search-results">
|
||||
{% if q or folder or tag or df or dt %}
|
||||
<div class="ch" style="border:none;padding:8px 4px">
|
||||
<span>Найдено: {{ rows|length }}{% if body_fallback %} <span style="color:var(--fg3);font-weight:400">(поиск по полному телу — индекс FTS отстаёт)</span>{% endif %}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% for r in rows %}
|
||||
<div class="res-row" hx-get="/emails/{{ r.path }}" hx-target="#c3" hx-swap="innerHTML"
|
||||
onclick="this.querySelector('a') && (location='/emails?path={{ r.path }}')">
|
||||
<span class="d">{{ (r.date or '')[:10] }}</span>
|
||||
<span class="f">{{ r.from_addr.split('<')[0].strip() or r.from_addr }}</span>
|
||||
<span class="s">{{ r.subject or '(без темы)' }}
|
||||
{% for t in r.tags %}<span class="tag {{ TAG_COLORS.get(t, 'i') }}">{{ t }}</span>{% endfor %}
|
||||
<span style="color:var(--fg3)">— {{ r.body_preview[:60] }}</span></span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty">Ничего не найдено</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
Reference in New Issue
Block a user