: nply/minci

commit f38fcc1e22279e006186e90bed5f09ad9a6d5f89
parent 1be0bfad8416ecc6fd07aa5b75af9ff0973eba68
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 12 Sep 2026 01:34:19 +0530

Include project in job headers
1 file changed, 18 insertions(+), 7 deletions(-)
M
main.c
|
25
++++++++++++++++++-------
diff --git a/main.c b/main.c
@@ -281,6 +281,7 @@ get_html_header(struct khtmlreq *req, const char *classes,
 	const char *href1, const char *text1,
 	const char *href2, const char *text2,
 	const char *href3, const char *text3,
+	const char *href4, const char *text4,
 	const char *runs, const char *jobs)
 {
 

@@ -295,6 +296,10 @@ get_html_header(struct khtmlreq *req, const char *classes,
 		khtml_ncr(req, 0x203a);
 		get_html_crumb(req, href3, text3);
 	}
+	if (text4 != NULL) {
+		khtml_ncr(req, 0x203a);
+		get_html_crumb(req, href4, text4);
+	}
 	khtml_closeelem(req, 1); /* h1 */
 	if (runs != NULL && jobs != NULL)
 		get_view_switch(req, runs, jobs);

@@ -938,7 +943,8 @@ get_run_html(struct kreq *r, const struct run *p)
 	html_open(&req.html, "Run");
 	req.r = r;
 	get_html_header(&req.html, "table", "index.html", "Dashboard",
-		urlproj, p->project.name, NULL, runbuf, NULL, NULL);
+		urlproj, p->project.name, NULL, runbuf, NULL, NULL,
+		NULL, NULL);
 
 	khtml_attr(&req.html, KELEM_DIV, KATTR_CLASS, "table alltable", KATTR__MAX);
 	get_html_job_header(&req.html);

@@ -987,9 +993,12 @@ static void
 get_job_html(struct kreq *r, const struct job *p)
 {
 	struct khtmlreq req;
-	char buf[64], *runbuf, *urlrun;
+	char buf[64], *runbuf, *urlproj, *urlrun;
 	size_t artc = 0;
 
+	urlproj = khttp_urlpartx(r->pname, ksuffixes[KMIME_TEXT_HTML],
+		pages[PAGE_INDEX], valid_keys[VALID_PROJECT_NAME].name,
+		KATTRX_STRING, p->run.project.name, NULL);
 	urlrun = khttp_urlpartx(r->pname, ksuffixes[KMIME_TEXT_HTML],
 		pages[PAGE_INDEX], valid_keys[VALID_RUN_ID].name,
 		KATTRX_INT, p->runid, NULL);

@@ -998,7 +1007,8 @@ get_job_html(struct kreq *r, const struct job *p)
 	html_open(&req, "Job");
 	kasprintf(&runbuf, "Run #%" PRId64, p->runid);
 	get_html_header(&req, "table", "index.html", "Dashboard",
-		urlrun, runbuf, NULL, p->name, NULL, NULL);
+		urlproj, p->run.project.name, urlrun, runbuf, NULL, p->name,
+		NULL, NULL);
 
 	khtml_attr(&req, KELEM_DIV, KATTR_CLASS, "singleton", KATTR__MAX);
 	khtml_attr(&req, KELEM_SPAN, KATTR_CLASS,

@@ -1045,6 +1055,7 @@ get_job_html(struct kreq *r, const struct job *p)
 	khtml_closeelem(&req, 1);
 	khtml_close(&req);
 	free(runbuf);
+	free(urlproj);
 	free(urlrun);
 }
 

@@ -1138,7 +1149,7 @@ get_dash(struct kreq *r, time_t mtime)
 	/* Output header. */
 
 	get_html_header(&req, "table", NULL, "Dashboard", NULL, "All",
-		NULL, NULL, "index.html", "index.html?view=jobs");
+		NULL, NULL, NULL, NULL, "index.html", "index.html?view=jobs");
 
 	/* Output data. */
 

@@ -1394,19 +1405,19 @@ get_last(struct kreq *r, time_t mtime)
 			kpn->parsed.s);
 		get_html_header(&req.html, "table", "index.html",
 			"Dashboard", NULL, kpn->parsed.s, NULL, NULL,
-			urlruns, urljobs);
+			NULL, NULL, urlruns, urljobs);
 		req.checkhash = 1;
 	} else if (kph != NULL)
 		get_html_header(&req.html, "table", "index.html",
 			"Dashboard", NULL, "Machine Dashboard", NULL, NULL,
-			NULL, NULL);
+			NULL, NULL, NULL, NULL);
 	else {
 		t = kpd->parsed.i;
 		gmtime_r(&t, &tm);
 		strftime(datebuf, sizeof(datebuf), "%F", &tm);
 		get_html_header(&req.html, "table", "index.html",
 			"Dashboard", NULL, datebuf, NULL, NULL,
-			NULL, NULL);
+			NULL, NULL, NULL, NULL);
 	}
 
 	/* Output data. */