-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Scaffold initial React dashboard app within the website repo #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vanshika2720
wants to merge
1
commit into
kmesh-net:main
Choose a base branch
from
vanshika2720:feature/dashboard-scaffold
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
|
|
||
| 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"}> | ||
|
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 + "/"; | ||
|
vanshika2720 marked this conversation as resolved.
|
||
| return ( | ||
| <Link | ||
| key={item.path} | ||
| to={item.path} | ||
| className={`dashboard-sidebar-link ${isActive ? "active" : ""}`} | ||
|
vanshika2720 marked this conversation as resolved.
|
||
| > | ||
| {item.label} | ||
|
vanshika2720 marked this conversation as resolved.
|
||
| </Link> | ||
| ); | ||
| })} | ||
| </aside> | ||
| <main className="dashboard-content">{children}</main> | ||
| </div> | ||
| </Layout> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| .dashboard-container { | ||
| display: flex; | ||
| min-height: calc(100vh - 60px); | ||
|
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); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import React from "react"; | ||
| import DashboardLayout from "../../components/DashboardLayout"; | ||
|
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> | ||
|
vanshika2720 marked this conversation as resolved.
|
||
| </DashboardLayout> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.