Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const config = {
label: "Documentation",
},
{ to: "/blog", label: "Blog", position: "left" },
{ to: "/dashboard", label: "Dashboard", position: "left" },
{
href: "https://github.com/kmesh-net/kmesh/releases",
label: "Downloads",
Expand Down Expand Up @@ -152,11 +153,11 @@ const config = {
[
"docusaurus-lunr-search",
{
languages: ["en",'zh'],
languages: ["en", "zh"],
indexDocs: true,
indexBlog: true,
indexPages: false,
}
},
],
],
};
Expand Down
41 changes: 41 additions & 0 deletions src/components/DashboardLayout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import { useLocation } from "@docusaurus/router";
import "../css/dashboard.css";
Comment thread
vanshika2720 marked this conversation as resolved.

const SIDEBAR_ITEMS = [
{ label: "Overview", path: "/dashboard" },
{ label: "Topology", path: "/dashboard/topology" },
{ label: "Waypoints", path: "/dashboard/waypoints" },
{ label: "Policies", path: "/dashboard/policies" },
{ label: "Metrics", path: "/dashboard/metrics" },
];

export default function DashboardLayout({ children, title }) {
const location = useLocation();

return (
<Layout title={title || "Dashboard"}>
Comment thread
vanshika2720 marked this conversation as resolved.
<div className="dashboard-container">
<aside className="dashboard-sidebar">
{SIDEBAR_ITEMS.map((item) => {
const isActive =
location.pathname === item.path ||
location.pathname === item.path + "/";
Comment thread
vanshika2720 marked this conversation as resolved.
return (
<Link
key={item.path}
to={item.path}
className={`dashboard-sidebar-link ${isActive ? "active" : ""}`}
Comment thread
vanshika2720 marked this conversation as resolved.
>
{item.label}
Comment thread
vanshika2720 marked this conversation as resolved.
</Link>
);
})}
</aside>
<main className="dashboard-content">{children}</main>
</div>
</Layout>
);
}
52 changes: 52 additions & 0 deletions src/css/dashboard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.dashboard-container {
display: flex;
min-height: calc(100vh - 60px);
Comment thread
vanshika2720 marked this conversation as resolved.
}

.dashboard-sidebar {
width: 250px;
flex-shrink: 0;
border-right: 1px solid var(--ifm-toc-border-color);
background-color: var(--ifm-background-surface-color);
padding: 1rem 0;
display: flex;
flex-direction: column;
}

.dashboard-sidebar-link {
padding: 0.75rem 1.5rem;
color: var(--ifm-font-color-base);
text-decoration: none;
font-weight: 500;
transition:
background-color 0.2s,
color 0.2s;
}

.dashboard-sidebar-link:hover {
background-color: var(--ifm-color-primary-lightest);
color: var(--ifm-color-primary-dark);
text-decoration: none;
}

[data-theme="dark"] .dashboard-sidebar-link:hover {
background-color: var(--ifm-color-primary-darkest);
color: var(--ifm-color-primary-light);
}

.dashboard-sidebar-link.active {
background-color: var(--ifm-color-primary-lightest);
color: var(--ifm-color-primary-dark);
border-right: 3px solid var(--ifm-color-primary);
}

[data-theme="dark"] .dashboard-sidebar-link.active {
background-color: var(--ifm-color-primary-darkest);
color: var(--ifm-color-primary-light);
}

.dashboard-content {
flex-grow: 1;
padding: 2rem;
background-color: var(--ifm-background-color);
}
11 changes: 11 additions & 0 deletions src/pages/dashboard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import DashboardLayout from "../../components/DashboardLayout";
Comment thread
vanshika2720 marked this conversation as resolved.

export default function DashboardOverview() {
return (
<DashboardLayout title="Overview - Dashboard">
<h1>Overview</h1>
<p>Welcome to the Kmesh Dashboard. This is the overview page.</p>
Comment thread
vanshika2720 marked this conversation as resolved.
</DashboardLayout>
);
}
11 changes: 11 additions & 0 deletions src/pages/dashboard/metrics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import DashboardLayout from "../../components/DashboardLayout";

export default function DashboardMetrics() {
return (
<DashboardLayout title="Metrics - Dashboard">
<h1>Metrics</h1>
<p>Performance and observability metrics will be displayed here.</p>
</DashboardLayout>
);
}
11 changes: 11 additions & 0 deletions src/pages/dashboard/policies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import DashboardLayout from "../../components/DashboardLayout";

export default function DashboardPolicies() {
return (
<DashboardLayout title="Policies - Dashboard">
<h1>Policies</h1>
<p>Configure routing and security policies here.</p>
</DashboardLayout>
);
}
11 changes: 11 additions & 0 deletions src/pages/dashboard/topology.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import DashboardLayout from "../../components/DashboardLayout";

export default function DashboardTopology() {
return (
<DashboardLayout title="Topology - Dashboard">
<h1>Topology</h1>
<p>Service mesh topology will be visualized here.</p>
</DashboardLayout>
);
}
11 changes: 11 additions & 0 deletions src/pages/dashboard/waypoints.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import DashboardLayout from "../../components/DashboardLayout";

export default function DashboardWaypoints() {
return (
<DashboardLayout title="Waypoints - Dashboard">
<h1>Waypoints</h1>
<p>Manage and monitor waypoint proxies here.</p>
</DashboardLayout>
);
}
Loading