From 16ee26f0453c37c9b13e47d44cde913b25bbd1bf Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Tue, 24 Feb 2026 21:52:05 +0100 Subject: Fix the duration check --- src/html.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/html.c b/src/html.c index d2e5704..28a2e3b 100644 --- a/src/html.c +++ b/src/html.c @@ -161,6 +161,7 @@ static void emit_stylesheet(FILE *f) { ".client-name { color: var(--hi); }\n" ".client-secret { font-size: 12px; color: var(--dim); letter-spacing: 1px; }\n" ".client-action { text-align: right; color: var(--dim); font-size: 12px; }\n" + ".client-action:after { content: \"→\"; margin-left: 1ex; vertical-align: 10%%; }\n" ".clients > a:hover .client-action { color: var(--green); }\n" ".clients > a.stale .client-name { border-left: 2px solid var(--purple); padding-left: 8px; }\n" ".clients > a.stale .client-time { color: var(--purple); }\n" @@ -352,7 +353,7 @@ char *html_render_clients_page(const struct Request *request, const struct ListC "
\n" "
\n" " \n" - " \n" + " \n" "
\n" " \n" "
\n" @@ -377,7 +378,7 @@ char *html_render_clients_page(const struct Request *request, const struct ListC " %s\n" " %s\n" " %s\n" - " View →\n" + " View\n" " \n", result->clients[i].id, result->clients[i].is_stale ? "stale" : "", @@ -476,11 +477,15 @@ char *html_render_client_detail_page(const struct Request *request, const struct fprintf(f, "
\n"); for (int i = 0; i < backups_result->backups_len; i++) { - bool duration_valid = false; - if (backups_result->backups[i].status == STATUS_INTERRUPTED) { - duration_valid = true; - } else { - duration_valid = true; + bool duration_valid; + switch(backups_result->backups[i].status) { + case STATUS_INTERRUPTED: + case STATUS_FINISHED: + duration_valid = true; + break; + case STATUS_RUNNING: + duration_valid = false; + break; } struct timespec duration = time_sub(&backups_result->backups[i].completed, &backups_result->backups[i].started); -- cgit v1.2.3