diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-07-21 15:40:38 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-07-21 15:40:38 +0200 |
commit | 173f8d8942cd3e41a3117e6b9c4da45f045ccb07 (patch) | |
tree | eb128c84a1cead4c54775fbfb6b700501c0080d5 /src | |
parent | 63b339b383294a032da86bc52bfb452fb494e62f (diff) | |
download | cgci-173f8d8942cd3e41a3117e6b9c4da45f045ccb07.tar.gz cgci-173f8d8942cd3e41a3117e6b9c4da45f045ccb07.zip |
give table rows a hover color, differentiate between logs and raw logs
Diffstat (limited to 'src')
-rw-r--r-- | src/ui.c | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -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( + "<pre>%s</pre>", + 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() "<tr>" "<td>Log</td>" "<td>" - "<a href=\"/%s/builds/%s/log\">Raw</a>" + "<a href=\"/%s/builds/%s/raw_log\">Raw</a>" "</td>" "</tr>" "<!--<tr>" @@ -242,7 +260,7 @@ void print_build_list() for (size_t i = 0; i < current_project->build_count; ++i) { - struct build_t* build = ¤t_project->builds[i]; + struct build_t* build = ¤t_project->builds[i]; // YYYY-MM-DD HH:MM char time[18]; @@ -369,7 +387,7 @@ void strdifftime(time_t time1, time_t time0, char* str, size_t size) return; double diff = difftime(time1, time0); - + if (diff > 0) { *str = '\0'; |