diff --git a/src/main.rs b/src/main.rs index 3ff3c8c..639de19 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,9 +11,10 @@ mod webhook; use anyhow::{Context, Result, anyhow}; use axum::{ - Router, + Json, Router, extract::{Path, Query, State}, - response::Html, + http::{HeaderMap, header::ACCEPT}, + response::{Html, IntoResponse}, routing::{get, post}, }; use chrono::{DateTime, Duration, Utc}; @@ -381,6 +382,44 @@ input[type="datetime-local"] { background: #111827; color: #f9fafb; } +.row-progress { + display: none; + height: 6px; + width: 220px; + max-width: 100%; + margin-top: .5rem; + border-radius: 4px; + background: #374151; + overflow: hidden; +} +.row-progress.active { + display: block; +} +.row-progress-bar { + height: 100%; + width: 30%; + border-radius: 4px; + background: #2563eb; + animation: row-progress-indeterminate 1.1s ease-in-out infinite; +} +@keyframes row-progress-indeterminate { + 0% { margin-left: -30%; } + 100% { margin-left: 100%; } +} +.row-status { + margin-top: .3rem; + min-height: 1.1em; + font-size: .9rem; +} +.row-status.ok { + color: #4ade80; +} +.row-status.error { + color: #f87171; +} +.activity-row.done { + opacity: .6; +} @@ -451,7 +490,8 @@ input[type="datetime-local"] { if !visible.is_empty() { html.push_str(&format!( r#"
-
"#); + html.push_str(&format!( + r#"
"#, + html::escape(&athlete_id), + html::escape(&activity.id), + )); html.push_str(&format!( r#"
@@ -494,6 +538,8 @@ input[type="datetime-local"] {
{} · {} · {}
+
+
"#, html::escape(&activity.name), html::escape(&activity.activity_type), @@ -502,7 +548,8 @@ input[type="datetime-local"] { )); html.push_str(&format!( - r#"