diff scid/page-index.c @ 48:3cf148705724

scid: refactor status classes in bulma
author David Demelier <markand@malikania.fr>
date Tue, 16 Aug 2022 18:40:01 +0200
parents 16f1c72d1635
children bc617784ec97
line wrap: on
line diff
--- a/scid/page-index.c	Tue Aug 16 18:29:08 2022 +0200
+++ b/scid/page-index.c	Tue Aug 16 18:40:01 2022 +0200
@@ -28,10 +28,11 @@
 static void
 set_job_status(json_t *project, json_t *job, json_t *jobresults)
 {
-	json_t *iter, *status;
+	json_t *iter;
 	int exitcode, sigcode;
 	size_t i, ns = 0, nf = 0;
 
+	/* Compute number of failures and number of success. */
 	json_array_foreach(jobresults, i, iter) {
 		json_unpack(iter, "{si si}", "exitcode", &exitcode, "sigcode", &sigcode);
 
@@ -39,14 +40,12 @@
 			ns++;
 		else
 			nf++;
+
+		/* Also add exitcode and sigcode to the job object. */
+		json_object_set_new(job, "exitcode", json_integer(exitcode));
+		json_object_set_new(job, "sigcode", json_integer(sigcode));
 	}
 
-	if (nf)
-		status = json_string("failed");
-	else
-		status = json_string("success");
-
-	json_object_set_new(job, "status", status);
 	json_object_set_new(project, "n-failed", json_integer(nf));
 	json_object_set_new(project, "n-success", json_integer(ns));
 }