commit ba9dbd7cba8097928f9939579eb39779dc0dfc49
parent 4e463f5f9a91b443b6ce5dad7a08b63e598037e3
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 12 Sep 2026 00:59:15 +0530
parent 4e463f5f9a91b443b6ce5dad7a08b63e598037e3
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 12 Sep 2026 00:59:15 +0530
Show status on run listings
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/main.c b/main.c @@ -195,6 +195,9 @@ get_html_run_header(struct khtmlreq *req) "head report-id", KATTR__MAX); khtml_closeelem(req, 1); khtml_attr(req, KELEM_DIV, KATTR_CLASS, + "head report-status", KATTR__MAX); + khtml_closeelem(req, 1); + khtml_attr(req, KELEM_DIV, KATTR_CLASS, "head project-name", KATTR__MAX); khtml_closeelem(req, 1); khtml_attr(req, KELEM_DIV, KATTR_CLASS, @@ -686,11 +689,21 @@ get_single_html(struct kreq *r, const struct report *p) } static void +count_job(const struct job *p, void *arg) +{ + int *fail = arg; + + if (strcmp(p->status, "pass")) + *fail = 1; +} + +static void get_run_row(const struct run *p, void *arg) { struct runreq *r = arg; struct tm tm; char datebuf[32], commitshort[8], *urlrun, *urlproj; + int fail = 0; urlrun = khttp_urlpartx(r->r->pname, ksuffixes[KMIME_TEXT_HTML], pages[PAGE_INDEX], @@ -707,6 +720,15 @@ get_run_row(const struct run *p, void *arg) khtml_closeelem(r->html, 1); khtml_closeelem(r->html, 1); + db_job_iterate_byrun(r->r->arg, count_job, &fail, p->id); + khtml_attr(r->html, KELEM_DIV, KATTR_CLASS, + "cell report-status", KATTR__MAX); + khtml_attr(r->html, KELEM_SPAN, KATTR_CLASS, + fail ? "report-fail" : "report-pass", KATTR__MAX); + khtml_puts(r->html, fail ? "fail" : "pass"); + khtml_closeelem(r->html, 1); + khtml_closeelem(r->html, 1); + khtml_attr(r->html, KELEM_DIV, KATTR_CLASS, "cell project-name", KATTR__MAX); khtml_attr(r->html, KELEM_A, KATTR_HREF, urlproj, KATTR__MAX);
: nply/minci