From 0b6e8026a6b530c7d88607bfdf79b9692987abaa Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sat, 21 Feb 2026 09:15:49 +0100 Subject: split the generic badge css from colors --- src/web.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/web.c') diff --git a/src/web.c b/src/web.c index ed47196..6dd18e1 100644 --- a/src/web.c +++ b/src/web.c @@ -839,10 +839,11 @@ static void emit_stylesheet(FILE *f) { " .clients > a.stale > :first-child { border-left: none; padding-left: 0; }\n" "}\n" "/* BADGES */\n" - "b.ok { color: var(--green); background: #0a2e1a; border: 1px solid #1a5c34; padding: 2px 7px; font-size: 10px; letter-spacing: 1px; }\n" - "b.run { color: var(--yellow); background: #2e200a; border: 1px solid #5c400e; padding: 2px 7px; font-size: 10px; letter-spacing: 1px; animation: blink 1.2s steps(1) infinite; }\n" - "b.fail { color: var(--red); background: #2e0a0a; border: 1px solid #5c1a1a; padding: 2px 7px; font-size: 10px; letter-spacing: 1px; }\n" - "b.stale { color: var(--purple); background: #1e0a2e; border: 1px solid #5c1a8c; padding: 2px 7px; font-size: 10px; letter-spacing: 1px; }\n" + ".badge { border: 1px solid; padding: 2px 7px; font-size: 10px; letter-spacing: 1px; justify-self: center; }" + ".badge.ok { color: var(--green); background: #0a2e1a; border-color: #1a5c34; }\n" + ".badge.run { color: var(--yellow); background: #2e200a; border-color: #5c400e; }\n" + ".badge.fail { color: var(--red); background: #2e0a0a; border-color: #5c1a1a; }\n" + ".badge.stale { color: var(--purple); background: #1e0a2e; border-color: #5c1a8c; }\n" "@keyframes blink { 50%% { opacity: .4; } }\n" "/* ADD FORM */\n" "#add-form {\n" @@ -1028,7 +1029,7 @@ static char *render_clients_page(struct Request *request, size_t *out_len) { "\n" "
\n" " BorgFlag\n" - " admin  · 
\n" + "
\n" "
\n" "
\n" "

\n" @@ -1036,7 +1037,7 @@ static char *render_clients_page(struct Request *request, size_t *out_len) { " %d registered", result->clients_len); if (stale_count > 0) { - fprintf(f, "  ·  %d stale", stale_count); + fprintf(f, "%d stale", stale_count); } fprintf(f, @@ -1067,7 +1068,7 @@ static char *render_clients_page(struct Request *request, size_t *out_len) { " %s\n" " %s\n" " %s\n" - " %s\n" + " %s\n" " \n" " \n", result->clients[i].id, @@ -1153,13 +1154,13 @@ static char *render_client_detail_page(struct Request *request, int64_t client_i "\n" "
\n" " BorgFlag\n" - " admin  · 
\n" + "
\n" "
\n" "
\n" " ← Back to clients\n" " \n" "

%s

\n" - "

%d backups  ·  %s

\n", + "

%d backups %s

\n", is_stale ? " class=\"stale\"" : "", client_result.name, backups_result->backups_len, @@ -1233,7 +1234,7 @@ static char *render_client_detail_page(struct Request *request, int64_t client_i struct timespec duration = time_sub(&backups_result->backups[i].completed, &backups_result->backups[i].started); fprintf(f, - "
%s%s
\n", + "
%s%s
\n", format_time(backups_result->backups[i].started).buf, format_duration(duration).buf, badge_class, -- cgit v1.2.3