summaryrefslogtreecommitdiff
path: root/web/templates
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-04 11:12:44 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-03-04 11:12:44 -1000
commit0fd54eddc40f517cf491310d4f8a60b0d79dc937 (patch)
treeb026328a49b9583efb7c94b3777830c31c46fa33 /web/templates
parent4853a4a917bb7942776ffd8b3e003ee03fc49160 (diff)
feat: sync log, cache clear endpoint, Todoist projects from cached tasks
- migration 016: sync_log table - store: AddSyncLogEntry, GetRecentSyncLog, InvalidateAllCaches, GetProjectsFromTasks - settings: HandleClearCache (POST /settings/clear-cache), SyncLog in page data - settings: use GetProjectsFromTasks instead of deprecated Todoist REST /projects - handlers: populate atom projects from store - agent: log warning on registration failure instead of silently swallowing - google_tasks: simplify URL literal - tests: sync log CRUD, clear cache handler, settings page includes sync log, sync sources adds log entry, incremental sync paths, task completion response/headers, calendar cache fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'web/templates')
-rw-r--r--web/templates/partials/sync-log.html15
-rw-r--r--web/templates/settings.html24
2 files changed, 33 insertions, 6 deletions
diff --git a/web/templates/partials/sync-log.html b/web/templates/partials/sync-log.html
new file mode 100644
index 0000000..e7f8191
--- /dev/null
+++ b/web/templates/partials/sync-log.html
@@ -0,0 +1,15 @@
+{{define "sync-log"}}
+<div id="sync-log">
+ {{if .}}
+ <div style="margin-top: 12px;">
+ <div style="font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;">Sync Activity</div>
+ {{range .}}
+ <div style="display: flex; gap: 8px; align-items: baseline; font-size: 0.8rem; padding: 3px 0; border-bottom: 1px solid var(--border-color, #2a2a2a);">
+ <span style="color: var(--text-secondary); white-space: nowrap; font-family: monospace;">{{.CreatedAt.Format "15:04:05"}}</span>
+ <span style="color: var(--text-primary, #e0e0e0);">{{.Message}}</span>
+ </div>
+ {{end}}
+ </div>
+ {{end}}
+</div>
+{{end}}
diff --git a/web/templates/settings.html b/web/templates/settings.html
index 964d319..4df4cb0 100644
--- a/web/templates/settings.html
+++ b/web/templates/settings.html
@@ -157,7 +157,8 @@
.htmx-request .htmx-indicator { display: inline; }
</style>
</head>
-<body>
+<body hx-headers='{"X-CSRF-Token": "{{.CSRFToken}}"}'>
+
<div class="container">
<a href="/" class="back-link">&larr; Back to Dashboard</a>
<h1>Settings</h1>
@@ -312,12 +313,23 @@
<!-- Source Configuration Section -->
<h2>Data Sources</h2>
- <form hx-post="/settings/sync" hx-swap="outerHTML" hx-target="#sources-container" hx-indicator=".sync-indicator">
- <button type="submit" class="btn">
- <span class="sync-indicator htmx-indicator">Syncing...</span>
- Sync Available Sources
+ <div style="display: flex; gap: 8px; align-items: center;">
+ <form hx-post="/settings/sync" hx-swap="outerHTML" hx-target="#sources-container" hx-indicator=".sync-indicator">
+ <button type="submit" class="btn">
+ <span class="sync-indicator htmx-indicator">Syncing...</span>
+ Sync Available Sources
+ </button>
+ </form>
+ <button class="btn btn-danger"
+ hx-post="/settings/clear-cache"
+ hx-target="#sync-log"
+ hx-swap="outerHTML"
+ hx-confirm="Clear all cached data? Next page load will fetch fresh data from all sources.">
+ Clear Cache
</button>
- </form>
+ </div>
+
+ {{template "sync-log" .SyncLog}}
<div id="sources-container" style="margin-top: 16px;">
{{range .Sources}}