From 173f8d8942cd3e41a3117e6b9c4da45f045ccb07 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 21 Jul 2022 15:40:38 +0200 Subject: give table rows a hover color, differentiate between logs and raw logs --- src/ui.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui.c b/src/ui.c index 53ef358..027e5de 100644 --- a/src/ui.c +++ b/src/ui.c @@ -23,11 +23,29 @@ void print_html() { if (context.extra) { - printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); - printf("%s", current_build->log); + if (!strcmp(context.extra, "raw_log")) + { + printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); + printf("%s", current_build->log); + } + else if (!strcmp(context.extra, "log")) + { + printf(CONTENT_TYPE_FORMAT, TEXT_HTML); + print_head(); + printf( + "
%s
", + current_build->log + ); + } + else + { + printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); + printf("Invalid path"); + } + } else - { + { printf(CONTENT_TYPE_FORMAT, TEXT_HTML); printf(HTML_START); print_head(); @@ -45,7 +63,7 @@ void print_html() printf(CONTENT_TYPE_FORMAT, TEXT_HTML); printf(HTML_START); - print_head(); + print_head(); printf(HTML_END); } else @@ -54,7 +72,7 @@ void print_html() printf(HTML_START); print_head(); print_title(); - print_build_nav(); + print_build_nav(); print_build_trigger(); printf(HTML_END); } @@ -192,7 +210,7 @@ void print_build_info() "" "Log" "" - "Raw" + "Raw" "" "" "