|
3 | 3 | import { useEffect, useState } from "react"; |
4 | 4 | import { IfcWallDisplayJob, IfcWallDisplayResponse } from "@/app/types"; |
5 | 5 |
|
6 | | -const successColour = "[#90EE90]"; |
7 | | -const failureColour = "[#F08080]"; |
8 | | -const abortedColour = "gray-400"; |
9 | | - |
10 | 6 | const jenkinsColourToWebDashColour = new Map<string, string>([ |
11 | | - ["red", `bg-${failureColour}`], // build broken |
12 | | - ["blue", `bg-${successColour}`], // build success |
13 | | - ["aborted", `bg-${abortedColour}`], // build aborted |
| 7 | + // these map to https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/BallColor.java#L57 |
| 8 | + ["red", `bg-[#F08080]`], // build broken |
| 9 | + ["blue", `bg-[#90EE90]`], // build success |
| 10 | + ["aborted", `bg-[#99a1af]`], // build aborted |
| 11 | + |
| 12 | + ["yellow", `bg-[#dddd00]`], |
| 13 | + [ |
| 14 | + "yellow_anime", |
| 15 | + `bg-[repeating-linear-gradient(45deg,#dddd00_0px,#dddd00_20px,#eeee00_20px,#eeee00_40px)]`, |
| 16 | + ], // build running but was broken |
14 | 17 | [ |
15 | 18 | "red_anime", |
16 | | - `bg-[repeating-linear-gradient(45deg,#F08080_0px,#F08080_20px,#99a1af_20px,#99a1af_40px)]`, |
| 19 | + `bg-[repeating-linear-gradient(45deg,#F08080_0px,#F08080_20px,#F09090_20px,#F09090_40px)]`, |
17 | 20 | ], // build running but was broken |
18 | 21 | [ |
19 | 22 | "blue_anime", |
20 | | - "bg-[repeating-linear-gradient(45deg,#90EE90_0px,#90EE90_20px,#99a1af_20px,#99a1af_40px)]", |
| 23 | + "bg-[repeating-linear-gradient(45deg,#90EE90_0px,#90EE90_20px,#90DD90_20px,#90DD90_40px)]", |
21 | 24 | ], // build running but was successful |
| 25 | + [ |
| 26 | + "aborted_anime", |
| 27 | + "bg-[repeating-linear-gradient(45deg,#99A1AF_0px,#99A1AF_20px,#7F7F7F_20px,#7F7F7F_40px)]", |
| 28 | + ], // build aborted but now running |
22 | 29 | ]); |
23 | 30 |
|
24 | | -export default function JenkinsJobIframe() { |
| 31 | +export default function JenkinsJobs() { |
25 | 32 | const [data, setData] = useState<Array<IfcWallDisplayJob>>([]); |
26 | 33 |
|
27 | 34 | useEffect(() => { |
@@ -61,7 +68,8 @@ export default function JenkinsJobIframe() { |
61 | 68 | href={job["url"] + "#:~:text=Builds"} // link to text fragment for "builds" |
62 | 69 | className={ |
63 | 70 | "text-black h-10 font-bold text-xl capitalize rounded-lg text-center border-2 border-black hover:border-white " + |
64 | | - jenkinsColourToWebDashColour.get(job["color"]) |
| 71 | + jenkinsColourToWebDashColour.get(job["color"]) + |
| 72 | + ` wd-state-${job["color"]}` |
65 | 73 | } |
66 | 74 | target={"_blank"} |
67 | 75 | > |
|
0 commit comments