Skip to content

Commit e11d25e

Browse files
authored
Merge pull request #95 from ISISComputingGroup/flash_fix_colours
fix colours
2 parents 5b7798d + c43b9c3 commit e11d25e

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

app/components/JenkinsJobs.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@
33
import { useEffect, useState } from "react";
44
import { IfcWallDisplayJob, IfcWallDisplayResponse } from "@/app/types";
55

6-
const successColour = "[#90EE90]";
7-
const failureColour = "[#F08080]";
8-
const abortedColour = "gray-400";
9-
106
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
1417
[
1518
"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)]`,
1720
], // build running but was broken
1821
[
1922
"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)]",
2124
], // 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
2229
]);
2330

24-
export default function JenkinsJobIframe() {
31+
export default function JenkinsJobs() {
2532
const [data, setData] = useState<Array<IfcWallDisplayJob>>([]);
2633

2734
useEffect(() => {
@@ -61,7 +68,8 @@ export default function JenkinsJobIframe() {
6168
href={job["url"] + "#:~:text=Builds"} // link to text fragment for "builds"
6269
className={
6370
"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"]}`
6573
}
6674
target={"_blank"}
6775
>

app/wall/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ShowHideBeamInfo from "../components/ShowHideBeamInfo";
2-
import JenkinsJobIframe from "../components/JenkinsJobs";
2+
import JenkinsJobs from "../components/JenkinsJobs";
33
import InstrumentsDisplay from "@/app/components/InstrumentsDisplay";
44

55
export default function WallDisplay() {
@@ -25,7 +25,7 @@ export default function WallDisplay() {
2525
<h1 className="w-full text-left text-black dark:text-white font-semibold text-2xl pb-2 ">
2626
Jenkins jobs:
2727
</h1>
28-
<JenkinsJobIframe />
28+
<JenkinsJobs />
2929
</div>
3030
</section>
3131
</main>

0 commit comments

Comments
 (0)