Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit f7a686b

Browse files
committed
chore: extended dashboard for cloud
1 parent 7453c85 commit f7a686b

File tree

7 files changed

+583
-9
lines changed

7 files changed

+583
-9
lines changed

src/layouts/AdminLayout/AdminLayout.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ import Error404 from "~/components/Errors/Error404";
66
import Card from "~/components/Card";
77
import CardHeader from "~/components/CardHeader";
88
import MenuLink from "~/components/MenuLink";
9+
import System from "~/pages/admin/System";
10+
import { RootContext } from "~/pages/Root.context";
911
import { useSelectedTeam } from "../TopMenu/Teams/actions";
1012
import TopMenu from "../TopMenu";
11-
import System from "~/pages/admin/System";
1213

1314
interface Props {
1415
children: React.ReactNode;
1516
}
1617

1718
export default function AdminLayout({ children }: Props) {
19+
const { details } = useContext(RootContext);
1820
const { user, teams } = useContext(AuthContext);
1921
const selectedTeam = useSelectedTeam({ teams });
2022
const { pathname } = useLocation();
@@ -23,6 +25,8 @@ export default function AdminLayout({ children }: Props) {
2325
return <Error404 />;
2426
}
2527

28+
const isCloud = details?.stormkit?.edition === "cloud";
29+
2630
return (
2731
<Box
2832
component="main"
@@ -100,6 +104,15 @@ export default function AdminLayout({ children }: Props) {
100104
isActive: pathname.includes("/admin/proxies"),
101105
}}
102106
/>
107+
{isCloud && (
108+
<MenuLink
109+
item={{
110+
path: "/admin/cloud/apps",
111+
text: "Apps",
112+
isActive: pathname.includes("/admin/cloud/apps"),
113+
}}
114+
/>
115+
)}
103116
</Box>
104117
{pathname === "/admin" ? <System /> : children}
105118
</Card>

src/pages/Root.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,25 @@ export default function Root({ Router }: Props) {
5151
<Router>
5252
<AuthContext>
5353
<Routes>
54-
{routes.map(route => (
55-
<Route
56-
{...route}
57-
key={Array.isArray(route.path) ? route.path[0] : route.path}
58-
/>
59-
))}
54+
{routes
55+
.map(route => {
56+
if (
57+
route.cloudOnly &&
58+
details?.stormkit?.edition !== "cloud"
59+
) {
60+
return null;
61+
}
62+
63+
return (
64+
<Route
65+
{...route}
66+
key={
67+
Array.isArray(route.path) ? route.path[0] : route.path
68+
}
69+
/>
70+
);
71+
})
72+
.filter(i => i)}
6073
</Routes>
6174
</AuthContext>
6275
</Router>

0 commit comments

Comments
 (0)