✨ feat: add dedicated Karmada Ops dashboard page#4014
Conversation
Add a proper dashboard page at /karmada-ops that appears in the sidebar navigation. The dashboard pre-arranges all 4 new Karmada cards (KubeRay Fleet, SLO Compliance, Failover Timeline, Trino Gateway) alongside Karmada Status and Cluster Health into a unified operations view. Registration: - Dashboard config: config/dashboards/karmada-ops.ts - Page component: components/karmada-ops/KarmadaOps.tsx - Route: ROUTES.KARMADA_OPS (/karmada-ops) - Sidebar: DISCOVERABLE_DASHBOARDS (users can pin it) - Stats type: DashboardStatsType union - Search index: DASHBOARD_NAMES + DASHBOARD_ROUTES - Analytics: ROUTE_TITLES Signed-off-by: Andrew Anderson <andy@clubanderson.com>
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
There was a problem hiding this comment.
Pull request overview
Adds a dedicated Karmada Ops dashboard page at /karmada-ops, wiring it into the app’s routing, unified dashboard registry, sidebar discoverability, and search metadata.
Changes:
- Introduces a new unified dashboard config (
karmada-ops) defining a 6-card 2×3 layout. - Adds a new page component and route to render the dashboard at
/karmada-ops. - Registers the dashboard across sidebar navigation and (partial) global search metadata.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/hooks/useSidebarConfig.ts | Adds “Karmada Ops” as a discoverable dashboard link in the sidebar customizer. |
| web/src/hooks/useSearchIndex.ts | Adds karmada-ops to dashboard name/route maps used by stat scanning. |
| web/src/config/routes.ts | Adds ROUTES.KARMADA_OPS constant. |
| web/src/config/dashboards/karmada-ops.ts | New unified dashboard config defining cards, route, statsType, and storageKey. |
| web/src/config/dashboards/index.ts | Registers the new dashboard config in DASHBOARD_CONFIGS exports/registry. |
| web/src/components/ui/StatsBlockDefinitions.ts | Extends DashboardStatsType union to include karmada-ops. |
| web/src/components/karmada-ops/KarmadaOps.tsx | New dashboard page component using DashboardPage with MCP cluster data + stats plumbing. |
| web/src/App.tsx | Lazy-loads and routes /karmada-ops, and adds a route title entry. |
| 'multi-tenancy': 'Multi-Tenancy', | ||
| 'ci-cd': 'CI/CD', | ||
| 'karmada-ops': 'Karmada Ops', | ||
| } |
There was a problem hiding this comment.
The global search “page” results come from PAGE_ITEMS, and /karmada-ops isn’t listed there. Adding 'karmada-ops' to DASHBOARD_NAMES / DASHBOARD_ROUTES alone won’t make the new dashboard show up when searching for “Karmada” as described in the PR test plan. Add a PAGE_ITEMS entry for Karmada Ops (or generate page items from the dashboard registry) so the route is searchable.
| | 'insights' | ||
| | 'multi-tenancy' | ||
| | 'ci-cd' | ||
| | 'karmada-ops' | ||
|
|
There was a problem hiding this comment.
This dashboard introduces a new DashboardStatsType ('karmada-ops'), but getDefaultStatBlocks() has no case for it, so the StatsOverview section will render with an empty grid by default. Define default stat blocks for 'karmada-ops' (even a small set like clusters/healthy/unhealthy/offline) and handle it in getDefaultStatBlocks().
| import { DashboardPage } from '../../lib/dashboards/DashboardPage' | ||
| import { getDefaultCards } from '../../config/dashboards' | ||
|
|
||
| const KARMADA_OPS_CARDS_KEY = 'kubestellar-karmada-ops-cards' |
There was a problem hiding this comment.
The card layout storage key here (kubestellar-karmada-ops-cards) does not match the unified dashboard config’s storageKey (karmada-ops-dashboard-cards). This will split persisted layouts and also prevents useSearchIndex’s DASHBOARD_STORAGE scan (built from DASHBOARD_CONFIGS) from finding cards placed on this dashboard. Use the config storageKey (or update the config to match) so there’s a single source of truth.
| const KARMADA_OPS_CARDS_KEY = 'kubestellar-karmada-ops-cards' | |
| const KARMADA_OPS_CARDS_KEY = 'karmada-ops-dashboard-cards' |
| autoRefresh: true, | ||
| autoRefreshInterval: 30000, | ||
| }, | ||
| storageKey: 'karmada-ops-dashboard-cards', |
There was a problem hiding this comment.
storageKey here ('karmada-ops-dashboard-cards') is currently different from the DashboardPage’s storageKey for this dashboard ('kubestellar-karmada-ops-cards'). Because search indexing and other tooling build dashboard storage keys from DASHBOARD_CONFIGS, the config and page should agree on a single key to avoid missing/duplicated persisted layouts.
| storageKey: 'karmada-ops-dashboard-cards', | |
| storageKey: 'kubestellar-karmada-ops-cards', |
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 2 code suggestion(s) and 2 general comment(s). @copilot Please apply all of the following code review suggestions:
Also address these general comments:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
Summary
Adds a dedicated Karmada Ops dashboard page at
/karmada-opsthat appears in the sidebar navigation. This provides a single-pane view for operating Karmada-based multi-cluster environments.Dashboard Layout (6 cards, 2x3 grid)
Registration (all 7 locations)
config/dashboards/karmada-ops.ts— dashboard configconfig/dashboards/index.ts— DASHBOARD_CONFIGS registryconfig/routes.ts— ROUTES.KARMADA_OPShooks/useSidebarConfig.ts— DISCOVERABLE_DASHBOARDShooks/useSearchIndex.ts— DASHBOARD_NAMES + DASHBOARD_ROUTEScomponents/ui/StatsBlockDefinitions.ts— DashboardStatsType unionApp.tsx— lazy import + Route + ROUTE_TITLESTest plan
npm run buildpasses/karmada-ops— dashboard loads with 6 cards