Skip to content

Commit

Permalink
improve the layout
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelaziz-mahdy committed May 28, 2024
1 parent e817afa commit 9e6e457
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
25 changes: 24 additions & 1 deletion benchmark-app/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,30 @@ header {
height: 100%;
}

@media (max-width: 768px) {
.main-content {
flex-direction: column;
}

.sidebar, .fields {
width: 100%;
}

.chart-container {
padding: 10px;
}

.checkbox-container {
flex-direction: column;
align-items: flex-start;
}

.checkbox-container input[type="checkbox"] {
margin-bottom: 5px;
}
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
100% { transform: rotate(360deg); }
}
6 changes: 3 additions & 3 deletions benchmark-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function App() {
axios.get(`${baseURL}/data.json`, {
cancelToken: source.token,
onDownloadProgress: (progressEvent) => {
const total = progressEvent.total;
const total = progressEvent.total || 1; // Ensure total is not 0 or undefined
const current = progressEvent.loaded;
setProgress(Math.floor((current / total) * 100));
}
Expand Down Expand Up @@ -96,7 +96,7 @@ function App() {
<header>
<h1>Service Benchmarks</h1>
<div className="legend">
<p className="info-text">Below are the tests and their corresponding colors used:</p>
<p className="info-text">Below are the services and their corresponding colors used in the chart:</p>
<ul>
{Object.entries(colorMap).map(([service, color]) => (
<li key={service} style={{ color }}>
Expand Down Expand Up @@ -129,7 +129,7 @@ function App() {
<div className="fields">
<label>Select Fields for Y-axis:</label>
{Object.keys(data[selectedServices[0]].data[0])
.filter(field => !['timestamp','Timestamp', 'Time Difference', 'Name', 'Type'].includes(field)) // Exclude specific fields from selection
.filter(field => !['timestamp', 'Timestamp', 'Time Difference', 'Name', 'Type'].includes(field)) // Exclude specific fields from selection
.map(field => (
<div key={field} className="checkbox-container" onClick={() => handleFieldChange({ target: { value: field } })}>
<input
Expand Down

0 comments on commit 9e6e457

Please sign in to comment.