Skip to content

Commit 8055c8b

Browse files
committed
Add self-hosted playgrounds
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent d68a3bd commit 8055c8b

File tree

2 files changed

+113
-18
lines changed

2 files changed

+113
-18
lines changed

site/src/components/VendorSelection/index.js

Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,110 @@ import {
66
AddYourOwnCard,
77
} from "./vendorSelection.style";
88

9+
10+
// Meshery Extension Point
11+
// This component serves as a point of extension for adding new playground providers.
12+
// Add your provider by including it in the vendors array below.
913
const VendorSelection = () => {
1014
const vendors = [
15+
{
16+
name: "ID10",
17+
description: "Meshery Playground hosted by ID10",
18+
url: "https://id10.playground.meshery.io",
19+
logo: null, // We can add logos later
20+
available: false,
21+
hosting: "hosted",
22+
},
1123
{
1224
name: "Layer5",
13-
description: "Meshery Playground provided by Layer5",
25+
description: "Meshery Playground hosted by Layer5",
1426
url: "https://playground.meshery.io",
1527
logo: null, // We can add logos later
1628
available: true,
29+
hosting: "hosted",
30+
},
31+
{
32+
name: "AWS",
33+
description: "Host your own Meshery Playground on AWS EKS",
34+
url: "https://docs.meshery.io/installation/kubernetes/eks",
35+
logo: null, // We can add logos later
36+
available: true,
37+
hosting: "self-hosted",
38+
},
39+
{
40+
name: "GCP",
41+
description: "Host your own Meshery Playground on Google Cloud Platform (GKE)",
42+
url: "https://docs.meshery.io/installation/kubernetes/gke",
43+
logo: null, // We can add logos later
44+
available: false,
45+
hosting: "self-hosted",
1746
},
1847
];
1948

2049
return (
2150
<VendorSelectionWrapper>
22-
<h2>Choose Your Playground Provider</h2>
51+
<div>
52+
<h2 style={{ marginTop: "3rem" }}>Hosted Playgrounds</h2>
53+
<div className="vendors-grid">
54+
{vendors.map((vendor, index) => (
55+
<div>
56+
{vendor.hosting === "hosted" && (
57+
<VendorCard key={vendor.name} available={vendor.available}>
58+
<div className="vendor-info">
59+
<p>{vendor.description}</p>
60+
</div>
61+
<div className="vendor-action">
62+
{vendor.available ? (
63+
<a href={vendor.url} target="_blank" rel="noopener noreferrer">
64+
<Button
65+
className={vendor.hosting === "hosted" ? "vendor-btn hosted" : "vendor-btn self-hosted"}
66+
>
67+
<ArrowIcon />
68+
{vendor.hosting === "hosted" ? "Launch Playground" : "Install Playground"}
69+
</Button>
70+
</a>
71+
) : (
72+
<Button className="vendor-btn disabled" disabled>
73+
Coming Soon
74+
</Button>
75+
)}
76+
</div>
77+
</VendorCard>
78+
)}
79+
</div>
80+
))}
81+
<AddYourOwnCard>
82+
<div className="add-your-own-content">
83+
{/* <h3>Other</h3> */}
84+
<p><i>Have a provider to list?</i></p>
85+
<a
86+
href="https://docs.meshery.io/extensibility/providers"
87+
target="_blank"
88+
rel="noopener noreferrer"
89+
>
90+
<Button className="add-btn">+ Add your Playground here</Button>
91+
</a>
92+
</div>
93+
</AddYourOwnCard>
94+
</div>
95+
96+
<h2 style={{ marginTop: "3rem" }}>Self-Hosted Playgrounds</h2>
2397
<div className="vendors-grid">
2498
{vendors.map((vendor, index) => (
99+
<div>
100+
{vendor.hosting === "self-hosted" && (
25101
<VendorCard key={vendor.name} available={vendor.available}>
26102
<div className="vendor-info">
27-
<h3>{vendor.name}</h3>
28103
<p>{vendor.description}</p>
29104
</div>
30105
<div className="vendor-action">
31106
{vendor.available ? (
32107
<a href={vendor.url} target="_blank" rel="noopener noreferrer">
33108
<Button
34-
className="vendor-btn"
35-
style={{ background: "rgb(235, 192, 23)" }}
109+
className={vendor.hosting === "hosted" ? "vendor-btn hosted" : "vendor-btn self-hosted"}
36110
>
37111
<ArrowIcon />
38-
Launch Playground
112+
{vendor.hosting === "hosted" ? "Launch Playground" : "Install Playground"}
39113
</Button>
40114
</a>
41115
) : (
@@ -45,12 +119,13 @@ const VendorSelection = () => {
45119
)}
46120
</div>
47121
</VendorCard>
48-
))}
49-
50-
<AddYourOwnCard>
51-
<div className="add-your-own-content">
52-
<h3>Other</h3>
53-
<p><i>Learn about Providers</i></p>
122+
)}
123+
</div>
124+
))}
125+
<AddYourOwnCard>
126+
<div className="add-your-own-content">
127+
{/* <h3>Other</h3> */}
128+
<p><i>Have a provider to list?</i></p>
54129
<a
55130
href="https://docs.meshery.io/extensibility/providers"
56131
target="_blank"
@@ -61,6 +136,7 @@ const VendorSelection = () => {
61136
</div>
62137
</AddYourOwnCard>
63138
</div>
139+
</div>
64140
</VendorSelectionWrapper>
65141
);
66142
};

site/src/components/VendorSelection/vendorSelection.style.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from "styled-components";
33
export const VendorSelectionWrapper = styled.div`
44
padding: 1rem;
55
text-align: center;
6+
align-items: center;
67
78
h2 {
89
margin-bottom: 1rem;
@@ -18,8 +19,14 @@ export const VendorSelectionWrapper = styled.div`
1819
}
1920
2021
.vendors-grid {
21-
display: grid;
22-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
22+
display: flex;
23+
max-width: 800px;
24+
margin: 0 auto;
25+
26+
flex-direction: row;
27+
flex-wrap: wrap;
28+
justify-content: space-between;
29+
// grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
2330
gap: 1rem;
2431
margin-bottom: 1rem;
2532
}
@@ -47,6 +54,7 @@ export const VendorCard = styled.div`
4754
border-radius: 12px;
4855
padding: 0.5rem;
4956
display: flex;
57+
width: 300px;
5058
flex-direction: column;
5159
transition: all 0.3s ease;
5260
opacity: ${(props) => (props.available ? 1 : 0.7)};
@@ -85,17 +93,28 @@ export const VendorCard = styled.div`
8593
color: rgba(128, 128, 128, 0.7) !important;
8694
cursor: not-allowed;
8795
}
88-
89-
&:not(.disabled):hover {
90-
background: rgba(255, 208, 25, 0.9) !important;
91-
transform: translateY(-1px);
96+
&.hosted {
97+
background: rgb(235, 192, 23);
98+
&:not(.disabled):hover {
99+
background: rgba(0, 179, 159 0.9) !important;
100+
transform: translateY(-1px);
101+
}
102+
}
103+
&.self-hosted {
104+
background: rgb(0, 179, 159);
105+
&:not(.disabled):hover {
106+
background: rgba(255, 208, 25, 0.9) !important;
107+
transform: translateY(-1px);
108+
}
92109
}
93110
}
111+
94112
95113
a {
96114
text-decoration: none;
97115
display: block;
98116
}
117+
99118
}
100119
`;
101120

0 commit comments

Comments
 (0)