Skip to content

Commit 75ba52b

Browse files
authored
job cancellation dashboard (#6577)
Adds first Grafana dashboard as iframe in HUD - related to job cancellation counts over time - embeds an iframe pointing to a cloudfront in front of grafana - adds theme based on dark theme setting in HUD See https://torchci-git-wdvr-jobcancellationdashboard-fbopensource.vercel.app/job_cancellation_dashboard
1 parent b225c03 commit 75ba52b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

torchci/components/NavBar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ function NavBar() {
9696
name: "Nightly Dashboard",
9797
href: "/nightlies",
9898
},
99+
{
100+
name: "Cancelled Jobs",
101+
href: "/job_cancellation_dashboard",
102+
},
99103
{
100104
name: "Failures Metric",
101105
href: "/reliability",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Head from "next/head";
2+
import React from "react";
3+
import { useDarkMode } from "../lib/DarkModeContext";
4+
5+
const JobCancellationDashboard: React.FC = () => {
6+
const { themeMode, darkMode } = useDarkMode();
7+
8+
// Set theme parameter based on dark mode context
9+
let theme = "light";
10+
if (themeMode === "system") {
11+
theme = darkMode ? "dark" : "light";
12+
} else {
13+
theme = themeMode;
14+
}
15+
16+
const dashboardUrl = `https://disz2yd9jqnwc.cloudfront.net/public-dashboards/c540578db0b741168e1a94e80e21f6f7?theme=${theme}`;
17+
18+
return (
19+
<>
20+
<Head>
21+
<title>Job Cancellation Dashboard</title>
22+
</Head>
23+
<div
24+
style={{
25+
width: "100%",
26+
height: "calc(100vh - 60px)",
27+
overflow: "hidden",
28+
}}
29+
>
30+
<iframe
31+
src={dashboardUrl}
32+
width="100%"
33+
height="100%"
34+
frameBorder="0"
35+
allowTransparency={true}
36+
/>
37+
</div>
38+
</>
39+
);
40+
};
41+
42+
export default JobCancellationDashboard;

0 commit comments

Comments
 (0)