File tree Expand file tree Collapse file tree 2 files changed +32
-22
lines changed Expand file tree Collapse file tree 2 files changed +32
-22
lines changed Original file line number Diff line number Diff line change 11ASSET_PREFIX = http://localhost:3000
22BASE_PATH = http://localhost:3000
33NEXT_PUBLIC_USE_MOCK_API = true
4+ USE_MOCK_DATA = true
Original file line number Diff line number Diff line change @@ -31,30 +31,39 @@ export default function RootLayout({
3131} : Readonly < {
3232 children : React . ReactNode ;
3333} > ) {
34+ const emptyDataScript = (
35+ < script
36+ dangerouslySetInnerHTML = { {
37+ __html :
38+ 'window.run_info = {}; window.workload_details = {}; window.benchmarks = {};' ,
39+ } }
40+ />
41+ ) ;
42+ const mockDataScript = (
43+ < >
44+ < script
45+ dangerouslySetInnerHTML = { {
46+ __html : runInfoScript ,
47+ } }
48+ />
49+ < script
50+ dangerouslySetInnerHTML = { {
51+ __html : workloadDetailsScript ,
52+ } }
53+ />
54+ < script
55+ dangerouslySetInnerHTML = { {
56+ __html : benchmarksScript ,
57+ } }
58+ />
59+ </ >
60+ ) ;
61+ const dataScript =
62+ process . env . USE_MOCK_DATA === 'true' ? mockDataScript : emptyDataScript ;
63+
3464 return (
3565 < html lang = "en" >
36- < head >
37- { /* <script
38- dangerouslySetInnerHTML={{
39- __html: 'window.run_info = {}; window.workload_details = {}; window.benchmarks = {};',
40- }}
41- /> */ }
42- < script
43- dangerouslySetInnerHTML = { {
44- __html : runInfoScript ,
45- } }
46- />
47- < script
48- dangerouslySetInnerHTML = { {
49- __html : workloadDetailsScript ,
50- } }
51- />
52- < script
53- dangerouslySetInnerHTML = { {
54- __html : benchmarksScript ,
55- } }
56- />
57- </ head >
66+ < head > { dataScript } </ head >
5867 < body > { children } </ body >
5968 </ html >
6069 ) ;
You can’t perform that action at this time.
0 commit comments