diff --git a/src/sections/Counters/index.js b/src/sections/Counters/index.js index 7f90f142f3e0d..a9bf3b24a7a79 100644 --- a/src/sections/Counters/index.js +++ b/src/sections/Counters/index.js @@ -12,8 +12,11 @@ const Counters = () => { useEffect(() => { fetch(URL) - .then(response => response.json()) - .then(result => setPerformanceCount(result.total_runs)); + .then((response) => response.json()) + .then((result) => setPerformanceCount(result.totalRuns)) + .catch((error) => + console.error("Error fetching performance test count:", error), + ); }, []); return ( diff --git a/src/sections/Meshery/Features-Col/index.js b/src/sections/Meshery/Features-Col/index.js index 9b33e6683ad9b..549ad63470752 100644 --- a/src/sections/Meshery/Features-Col/index.js +++ b/src/sections/Meshery/Features-Col/index.js @@ -18,7 +18,22 @@ function getServiceFeature(service, index) { - + + + + {service.content} @@ -38,7 +53,7 @@ function getFeatureBlock(feature, index, performanceCount) { {feature.services.map((service, index) => - getServiceFeature(service, index) + getServiceFeature(service, index), )} @@ -49,7 +64,12 @@ function getFeatureBlock(feature, index, performanceCount) { end={ feature.count.value !== 0 ? feature.count.value : performanceCount } - suffix= {(feature.count.description == "components" || feature.count.description == "cloud native integrations") ? "+" : " "} + suffix={ + feature.count.description == "components" || + feature.count.description == "cloud native integrations" + ? "+" + : " " + } />

{feature.count.description}

@@ -60,7 +80,8 @@ function getFeatureBlock(feature, index, performanceCount) { const Features = () => { const [performanceCount, setPerformanceCount] = useState(0); - const performanceCountEndpoint = "https://cloud.layer5.io/api/performance/results/total"; + const performanceCountEndpoint = + "https://cloud.layer5.io/api/performance/results/total"; useEffect(() => { fetch(performanceCountEndpoint) @@ -72,13 +93,13 @@ const Features = () => { return response.json(); }) .then((resultcount) => { - if (resultcount && typeof resultcount.total_runs === "number") { - setPerformanceCount(resultcount.total_runs); + if (resultcount && typeof resultcount.totalRuns === "number") { + setPerformanceCount(resultcount.totalRuns); } }) .catch((error) => { - console.log("Failed to fetch performance count:", error.message); - // Keep default value of 0 if fetch fails + console.error("Failed to fetch performance count:", error.message); + // Keep default value of 0 if fetch fails }); }, []); @@ -94,12 +115,11 @@ const Features = () => { {data.map((feature, index) => - getFeatureBlock(feature, index, performanceCount) + getFeatureBlock(feature, index, performanceCount), )} ); }; - export default Features; diff --git a/src/sections/Meshery/How-meshery-works/specs/data-card.js b/src/sections/Meshery/How-meshery-works/specs/data-card.js index 1925ab2a72e0c..d275f300a57fc 100644 --- a/src/sections/Meshery/How-meshery-works/specs/data-card.js +++ b/src/sections/Meshery/How-meshery-works/specs/data-card.js @@ -8,41 +8,39 @@ import Counter from "../../../../reusecore/Counter"; import { URL } from "../../../Counters/index"; const DataCardWrapper = styled.div` - background: ${props => props.theme.grey222222ToWhite}; + background: ${(props) => props.theme.grey222222ToWhite}; border-radius: 10px; - color: ${props => props.theme.text}; + color: ${(props) => props.theme.text}; padding: 2rem; transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); - - ul{ + + ul { list-style: none; padding: 0; } - .col-1 li{ - display: flex; - align-items: center; - vertical-align: center; - margin-bottom: 1.5rem; - img{ - margin-right: 1rem; - } - h5{ - font-weight: 600; - transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); - } - } - - .col-2 li { - h3{ - color: ${props => props.theme.secondaryColor}; - font-weight: 700; - } - p { - font-size: 16px; - } - } - - + .col-1 li { + display: flex; + align-items: center; + vertical-align: center; + margin-bottom: 1.5rem; + img { + margin-right: 1rem; + } + h5 { + font-weight: 600; + transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); + } + } + + .col-2 li { + h3 { + color: ${(props) => props.theme.secondaryColor}; + font-weight: 700; + } + p { + font-size: 16px; + } + } `; const DataCard = () => { @@ -51,7 +49,10 @@ const DataCard = () => { useEffect(() => { fetch(URL) .then((response) => response.json()) - .then((result) => setPerformanceCount(result.total_runs)); + .then((result) => setPerformanceCount(result.totalRuns)) + .catch((error) => + console.error("Error fetching performance test count:", error), + ); }, []); return ( @@ -77,22 +78,13 @@ const DataCard = () => {