This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from att/static-web-page/US63/conditional-mai…
…n-page Static web page/us63/conditional main page
- Loading branch information
Showing
10 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
REACT_APP__ENVIRONMENT=gh-pages | ||
REACT_APP__BASE_API_URL='' | ||
REACT_APP__DASHBOARD_LINK_HOST=http://localhost:3000 | ||
REACT_APP__PUBLIC_URL='qujata' | ||
PUBLIC_URL='qujata' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export interface IEnvironment { | ||
baseApiUrl: string; | ||
dashboardLinkHost: string; | ||
environment: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Reports } from "./reports"; | ||
|
||
export const GHPages: React.FC = () => ( | ||
<Reports /> | ||
); | ||
|
||
// export default GHPages; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useState, useEffect, ChangeEvent } from "react"; | ||
interface File { | ||
path: string; | ||
name: string; | ||
} | ||
export const Reports: React.FC = () => { | ||
const [files, setFiles] = useState<File[]>([]); | ||
const [selectedFile, setSelectedFile] = useState<string | null>(null); | ||
const [fileContent, setFileContent] = useState<string>(""); | ||
useEffect(() => { | ||
const apiUrl = 'https://api.github.com/repos/att/qujata/contents/reports?ref=main'; | ||
fetch(apiUrl) | ||
.then(response => response.json()) | ||
.then((data: File[]) => { | ||
setFiles(data); | ||
if (data[0]) { // Check if there are any files | ||
setSelectedFile(data[0].path); // Set the first file as the default selected file | ||
} | ||
}) | ||
.catch(error => console.error("Error fetching files: ", error)); | ||
}, []); | ||
useEffect(() => { | ||
if (selectedFile) { | ||
fetch(`https://raw.githubusercontent.com/att/qujata/main/${selectedFile}`) | ||
.then(response => response.json()) | ||
.then((data: any) => { | ||
const fileContent = JSON.stringify(data, null, 2); // Decode the base64 content | ||
setFileContent(fileContent); | ||
}) | ||
.catch(error => console.error("Error fetching file content: ", error)); | ||
} | ||
}, [selectedFile]); // This useEffect hook is dependent on selectedFile | ||
const handleFileChange = (e: ChangeEvent<HTMLSelectElement>) => { | ||
const value = e.target.value; | ||
setSelectedFile(value); | ||
}; | ||
return ( | ||
<div><select value={selectedFile || ''} onChange={handleFileChange}> | ||
{files.map((file, index) => ( | ||
<option key={index} value={file.path}> | ||
{file.name} | ||
</option> | ||
))} | ||
</select><br/><br/><pre> | ||
{fileContent} | ||
</pre></div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"id": 1, | ||
"name": "test1", | ||
"description": "test1", | ||
"start_time": "Thu, 14 Dec 2023 15:37:31 GMT", | ||
"end_time": "Thu, 14 Dec 2023 15:38:39 GMT", | ||
"environment_info": { | ||
"codeRelease": "1.1.0", | ||
"cpu": "RELACE_WITH_CPU", | ||
"cpuArchitecture": "RELACE_WITH_CPU_ARCHITECTURE", | ||
"cpuClockSpeed": "RELACE_WITH_CLOCK_SPEED", | ||
"cpuCores": 0, | ||
"nodeSize": "RELACE_WITH_NODE_SIZE", | ||
"operatingSystem": "RELACE_WITH_OPERATING_SYSTEM", | ||
"resourceName": "RELACE_WITH_RESOURCE_NAME" | ||
}, | ||
|
||
"testRuns": [ | ||
{ | ||
"algorithm": "bikel1", | ||
"iterations": 200, | ||
"results": { | ||
"averageCPU": 4.1, | ||
"averageMemory": 200 | ||
} | ||
}, | ||
{ | ||
"algorithm": "bikel1", | ||
"iterations": 400, | ||
"results": { | ||
"averageCPU": 4.9, | ||
"averageMemory": 150 | ||
} | ||
}, | ||
{ | ||
"algorithm": "kyber512", | ||
"iterations": 1000, | ||
"results": { | ||
"averageCPU": 4.5, | ||
"averageMemory": 249 | ||
} | ||
}, | ||
{ | ||
"algorithm": "kyber512", | ||
"iterations": 2000, | ||
"results": { | ||
"averageCPU": 0.0, | ||
"averageMemory": 0 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"id": 2, | ||
"name": "test2", | ||
"description": "test2", | ||
"start_time": "Thu, 15 Dec 2023 15:37:31 GMT", | ||
"end_time": "Thu, 15 Dec 2023 15:38:39 GMT", | ||
"environment_info": { | ||
"codeRelease": "1.2.0", | ||
"cpu": "RELACE_WITH_CPU", | ||
"cpuArchitecture": "RELACE_WITH_CPU_ARCHITECTURE", | ||
"cpuClockSpeed": "RELACE_WITH_CLOCK_SPEED", | ||
"cpuCores": 0, | ||
"nodeSize": "RELACE_WITH_NODE_SIZE", | ||
"operatingSystem": "RELACE_WITH_OPERATING_SYSTEM", | ||
"resourceName": "RELACE_WITH_RESOURCE_NAME" | ||
}, | ||
|
||
"testRuns": [ | ||
{ | ||
"algorithm": "bikel1", | ||
"iterations": 200, | ||
"results": { | ||
"averageCPU": 4.0, | ||
"averageMemory": 210 | ||
} | ||
}, | ||
{ | ||
"algorithm": "bikel1", | ||
"iterations": 400, | ||
"results": { | ||
"averageCPU": 4.8, | ||
"averageMemory": 125 | ||
} | ||
}, | ||
{ | ||
"algorithm": "kyber512", | ||
"iterations": 1000, | ||
"results": { | ||
"averageCPU": 4.3, | ||
"averageMemory": 237 | ||
} | ||
}, | ||
{ | ||
"algorithm": "kyber512", | ||
"iterations": 2000, | ||
"results": { | ||
"averageCPU": 0.0, | ||
"averageMemory": 0 | ||
} | ||
} | ||
] | ||
} |