File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -36,3 +36,4 @@ yarn-error.log*
3636* .tsbuildinfo
3737next-env.d.ts
3838
39+ /job_stats.json
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ Follow these steps to set up the development environment for the Kata Containers
72723 . ** Run the development server** :
7373 Start the Next.js development server with hot-reloading enabled.
7474 ``` bash
75+ node scripts/fetch-ci-nightly-data.js > job_stats.json
7576 npm run dev
7677 ```
7778
@@ -96,5 +97,5 @@ Follow these steps to set up the development environment for the Kata Containers
9697- ** Fetch CI Nightly Data** :
9798 The ` fetch-ci-nightly-data.js ` script can be executed manually to pull the latest CI test data from the Kata Containers repository:
9899 ``` bash
99- node scripts/fetch-ci-nightly-data.js
100+ node scripts/fetch-ci-nightly-data.js > job_stats.json
100101 ```
Original file line number Diff line number Diff line change @@ -13,11 +13,16 @@ export default function Home() {
1313 useEffect ( ( ) => {
1414 const fetchData = async ( ) => {
1515 let data = { } ;
16- const response = await fetch (
17- "https://raw.githubusercontent.com/kata-containers/kata-containers.github.io" +
18- "/refs/heads/latest-dashboard-data/data/job_stats.json"
19- ) ;
20- data = await response . json ( ) ;
16+
17+ if ( process . env . NODE_ENV === "development" ) {
18+ data = ( await import ( "../job_stats.json" ) ) . default ;
19+ } else {
20+ const response = await fetch (
21+ "https://raw.githubusercontent.com/kata-containers/kata-containers.github.io" +
22+ "/refs/heads/latest-dashboard-data/data/job_stats.json"
23+ ) ;
24+ data = await response . json ( ) ;
25+ }
2126
2227 try {
2328 const jobData = Object . keys ( data ) . map ( ( key ) => {
You can’t perform that action at this time.
0 commit comments