Skip to content

Commit dce1195

Browse files
fix: runtime error andd images issues
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
1 parent 7b23ff1 commit dce1195

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

src/sections/Meshery/Features-Col/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,21 @@ const Features = () => {
6464

6565
useEffect(() => {
6666
fetch(performanceCountEndpoint)
67-
.then((response) => response.json())
68-
.then((resultcount) => setPerformanceCount(resultcount.total_runs));
67+
.then((response) => {
68+
if (!response.ok) {
69+
throw new Error(`HTTP error! status: ${response.status}`);
70+
}
71+
return response.json();
72+
})
73+
.then((resultcount) => {
74+
if (resultcount && typeof resultcount.total_runs === "number") {
75+
setPerformanceCount(resultcount.total_runs);
76+
}
77+
})
78+
.catch((error) => {
79+
console.log("Failed to fetch performance count:", error.message);
80+
// Keep default value of 0 if fetch fails
81+
});
6982
}, []);
7083

7184
const data = LifecycleFeature().features;
156 KB
Loading

src/sections/Meshery/Meshery-features/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import img6 from "./feature-images/edge_mount_relationship_pod_persistent_volume
99
import { StaticImage } from "gatsby-plugin-image";
1010
import img2 from "./feature-images/workspace.gif";
1111
import multiClusterGif from "./feature-images/multi-cluster-management.gif";
12-
const img1 = "../../../assets/images/kanvas/KanvasDesigner.webp";
13-
const img4 = "./feature-images/meshery-catalog.webp";
14-
const img7 = "./feature-images/extensions.webp";
12+
import img1 from "./feature-images/KanvasDesigner.webp";
13+
import img4 from "./feature-images/meshery-catalog.webp";
14+
import img7 from "./feature-images/extensions.webp";
1515

1616
const MesheryFeaturesWrapper = styled.div`
1717
margin: auto;
@@ -50,7 +50,7 @@ const MesheryFeatures = () => {
5050
description:
5151
"Visually and collaboratively design your cloud native infrastructure using Meshery's drag-and-drop designer. Leverage 300+ integrations and context-aware relationships between components.",
5252
learnMoreLink: "/kanvas",
53-
content: <StaticImage src={img1} alt="Infrastructure as Design with Kanvas" loading="lazy" />,
53+
content: <img src={img1} alt="Infrastructure as Design with Kanvas" loading="lazy" />,
5454
},
5555
{
5656
id: "second",
@@ -79,7 +79,7 @@ const MesheryFeatures = () => {
7979
"Build your internal developer platform with Meshery's extensive extensibility. Includes REST/GraphQL APIs, gRPC adapters, hot-loadable ReactJS components, and Golang plugins.",
8080
content: (
8181
<div className="feature-expose-full">
82-
<StaticImage src={img7} alt="Platform Engineering Extension Points" loading="lazy" />
82+
<img src={img7} alt="Platform Engineering Extension Points" loading="lazy" />
8383
<p>
8484
Meshery's numerous extension points make it ideal as the foundation of your internal developer platform.
8585
Create custom models, import/export as OCI images, and extend functionality through multiple integration patterns.
@@ -114,7 +114,7 @@ const MesheryFeatures = () => {
114114
description:
115115
"Access 400+ curated design patterns and templates. Share, clone, and customize designs with built -in best practices for common deployment scenarios.", content: (
116116
<div className="feature-expose-full">
117-
<StaticImage
117+
<img
118118
src={img4}
119119
alt="Cloud Native Catalog and Patterns"
120120
loading="lazy"

0 commit comments

Comments
 (0)