From 0f8273514993c83da210109129dda19a3b3f09f8 Mon Sep 17 00:00:00 2001 From: shenlan Date: Fri, 17 Oct 2025 12:36:27 +0800 Subject: [PATCH] Move dashboard frontend out of ui namespace (#538) --- .github/workflows/build-and-release.yml | 60 +++++++++--------- .github/workflows/security-check.yml | 10 +-- .gitignore | 2 +- Makefile | 28 ++++---- README.md | 6 +- {ui/homepage => dashboard}/.eslintrc.json | 0 {ui/homepage => dashboard}/.gitignore | 0 {ui/homepage => dashboard}/.nvmrc | 0 {ui/homepage => dashboard}/.yarnrc.yml | 0 {ui/homepage => dashboard}/Dockerfile | 6 +- {ui/homepage => dashboard}/Makefile | 24 +++---- {ui/homepage => dashboard}/app/404/page.tsx | 0 dashboard/app/AppProviders.tsx | 23 +++++++ .../app/api/admin/settings/route.ts | 0 .../api/admin/users/[userId]/role/route.ts | 0 .../app/api/admin/users/metrics/route.ts | 0 .../app/api/askai/route.ts | 0 .../app/api/auth/login/route.ts | 0 .../app/api/auth/mfa/disable/route.ts | 0 .../app/api/auth/mfa/setup/route.ts | 0 .../app/api/auth/mfa/status/route.ts | 0 .../app/api/auth/mfa/verify/route.ts | 0 .../app/api/auth/register/route.ts | 0 .../app/api/auth/session/route.ts | 0 .../app/api/auth/verify-email/route.ts | 0 .../app/api/rag/query/route.ts | 0 .../app/api/users/route.ts | 0 .../app/cloud_iac/README.md | 2 +- .../cloud_iac/[provider]/[service]/page.tsx | 0 .../app/cloud_iac/[provider]/page.tsx | 0 .../app/cloud_iac/page.tsx | 0 .../app/components/ClientTime.tsx | 0 .../app/components/icons/WeChatIcon.tsx | 0 .../app/components/insight/ai/Assistant.tsx | 0 .../insight/explore/ExploreBuilder.tsx | 0 .../insight/layout/BreadcrumbBar.tsx | 0 .../app/components/insight/layout/Sidebar.tsx | 0 .../insight/layout/TimeRangePicker.tsx | 0 .../insight/layout/WorkspaceGrid.tsx | 0 .../insight/layout/WorkspaceHeader.tsx | 0 .../insight/services/adapters/logs.ts | 0 .../insight/services/adapters/openobserve.ts | 0 .../insight/services/adapters/prometheus.ts | 0 .../insight/services/adapters/traces.ts | 0 .../components/insight/services/correlator.ts | 0 .../app/components/insight/services/gitops.ts | 0 .../components/insight/slo/AlertWizard.tsx | 0 .../app/components/insight/slo/SLOPanel.tsx | 0 .../insight/snippets/SnippetLibrary.tsx | 0 .../app/components/insight/store/urlState.ts | 0 .../insight/store/useInsightState.ts | 0 .../insight/topology/NetworkTopologyPanel.tsx | 0 .../insight/topology/TopologyCanvas.tsx | 0 .../app/components/insight/topology/types.ts | 0 .../app/components/insight/viz/LogsTable.tsx | 0 .../components/insight/viz/LogsTopStats.tsx | 0 .../app/components/insight/viz/LogsViewer.tsx | 0 .../components/insight/viz/MetricsChart.tsx | 0 .../components/insight/viz/MetricsTable.tsx | 0 .../insight/viz/MetricsTopStats.tsx | 0 .../components/insight/viz/TracesTable.tsx | 0 .../components/insight/viz/TracesTopStats.tsx | 0 .../insight/viz/TracesWaterfall.tsx | 0 .../app/components/insight/viz/VizArea.tsx | 0 .../app/demo/DemoContent.tsx | 0 {ui/homepage => dashboard}/app/demo/page.tsx | 0 .../app/docs/DocCollectionCard.tsx | 0 .../[version]/DocCollectionView.tsx | 0 .../docs/[collection]/[version]/DocReader.tsx | 0 .../[collection]/[version]/DocViewSection.tsx | 0 .../app/docs/[collection]/[version]/page.tsx | 0 .../app/docs/[collection]/page.tsx | 0 {ui/homepage => dashboard}/app/docs/page.tsx | 0 .../app/docs/resources.server.ts | 0 {ui/homepage => dashboard}/app/docs/types.ts | 0 {ui/homepage => dashboard}/app/docs/utils.ts | 0 .../app/download/[...segments]/page.tsx | 0 .../app/download/page.tsx | 0 {ui/homepage => dashboard}/app/globals.css | 0 .../app/insight/InsightWorkbench.tsx | 0 .../app/insight/page.tsx | 0 dashboard/app/layout.tsx | 31 +++++++++ .../app/login/LoginContent.tsx | 0 .../app/login/LoginForm.tsx | 0 {ui/homepage => dashboard}/app/login/page.tsx | 0 .../app/logout/LogoutClient.tsx | 0 .../app/logout/page.tsx | 0 dashboard/app/page.tsx | 10 +++ .../app/panel/account/MfaSetupPanel.tsx | 0 .../app/panel/account/page.tsx | 0 .../app/panel/agent/page.tsx | 0 .../app/panel/api/page.tsx | 0 .../app/panel/components/Card.tsx | 0 .../app/panel/components/Header.tsx | 0 .../app/panel/components/Sidebar.tsx | 0 .../app/panel/components/UserOverview.tsx | 0 .../app/panel/layout.tsx | 0 .../app/panel/ldp/page.tsx | 0 .../app/panel/lib/api.ts | 0 .../app/panel/loading.tsx | 0 .../__tests__/ManagementComponents.test.tsx | 0 .../management/components/OverviewCards.tsx | 0 .../components/PermissionMatrixEditor.tsx | 0 .../management/components/TrendChart.tsx | 0 .../components/UserGroupManagement.tsx | 0 .../app/panel/management/page.tsx | 0 {ui/homepage => dashboard}/app/panel/page.tsx | 0 .../app/panel/subscription/page.tsx | 0 .../app/register/RegisterContent.tsx | 0 .../app/register/page.tsx | 0 dashboard/cms/config.ts | 55 ++++++++++++++++ dashboard/cms/content/ContentContext.tsx | 26 ++++++++ .../cms}/content/getting-started.md | 0 .../cms/content/homepage.ts | 5 +- .../homepage/contact/items/newsletter.md | 0 .../content/homepage/contact/items/support.md | 0 .../homepage/contact/items/wechat-group.md | 0 .../homepage/contact/items/wechat-official.md | 0 .../cms}/content/homepage/contact/panel.md | 0 .../cms}/content/homepage/hero.md | 0 .../posts/2024-07-12-community-events.md | 0 .../posts/2024-07-30-observability-insight.md | 0 .../posts/2024-08-15-release-notes.md | 0 .../content/homepage/sidebar/community.md | 0 .../content/homepage/sidebar/newsletter.md | 0 .../content/homepage/sidebar/resources.md | 0 .../cms}/content/homepage/sidebar/tags.md | 0 .../content/homepage/solutions/xcloudflow.md | 0 .../content/homepage/solutions/xcontrol.md | 0 .../content/homepage/solutions/xscopehub.md | 0 .../content/homepage/solutions/xstream.md | 0 dashboard/cms/content/index.ts | 1 + dashboard/cms/content/source.ts | 38 +++++++++++ dashboard/cms/extensions/appShell.tsx | 23 +++++++ dashboard/cms/extensions/markdownSync.tsx | 7 ++ dashboard/cms/index.ts | 59 +++++++++++++++++ dashboard/cms/templates/default/index.tsx | 38 +++++++++++ dashboard/cms/themes/default/index.tsx | 16 +++++ dashboard/cms/types.ts | 22 +++++++ .../components/AskAIButton.tsx | 0 .../components/AskAIDialog.tsx | 0 .../components/ChatBubble.tsx | 0 .../components/Contact.tsx | 0 .../components/DownloadSection.tsx | 0 .../components/Features.tsx | 0 .../components/Footer.tsx | 0 .../components/Hero.tsx | 0 .../components/LanguageToggle.tsx | 0 .../components/Navbar.tsx | 0 .../components/OpenSource.tsx | 0 .../components/ReleaseChannelSelector.tsx | 0 .../components/SourceHint.tsx | 0 .../components/Terms.tsx | 0 .../components/common/QueryChips.tsx | 0 .../components/common/QueryHistoryPanel.tsx | 0 .../components/download/Breadcrumbs.tsx | 0 .../components/download/CardGrid.tsx | 0 .../components/download/CopyButton.tsx | 0 .../components/download/DownloadBrowser.tsx | 0 .../download/DownloadListingContent.tsx | 0 .../components/download/DownloadNotFound.tsx | 0 .../components/download/DownloadSummary.tsx | 0 .../components/download/FileTable.tsx | 0 .../components/download/MarkdownPanel.tsx | 0 .../components/home/ArticleFeed.tsx | 2 +- .../components/home/ContactPanel.tsx | 2 +- .../components/home/ContactPanelClient.tsx | 2 +- .../components/home/HeroBanner.tsx | 2 +- .../components/home/HeroProductTabs.tsx | 2 +- .../components/home/ProductMatrix.tsx | 2 +- .../components/home/ProductMatrixClient.tsx | 2 +- .../components/home/Sidebar.tsx | 2 +- .../components/home/SidebarCard.tsx | 2 +- .../components/iac/CloudIacCatalog.tsx | 0 .../components/iac/RunModal.tsx | 0 .../components/iac/ServiceDetailView.tsx | 0 .../config/feature-toggles.json | 0 .../config/runtime-service-config.yaml | 0 .../i18n/LanguageProvider.tsx | 0 .../i18n/translations.ts | 0 .../lib/accessControl.ts | 0 {ui/homepage => dashboard}/lib/authGateway.ts | 0 .../lib/download-data.ts | 0 .../lib/download-manifest.ts | 0 .../lib/featureFlags.ts | 0 .../lib/featureToggles.ts | 0 {ui/homepage => dashboard}/lib/format.ts | 0 {ui/homepage => dashboard}/lib/iac/actions.ts | 0 {ui/homepage => dashboard}/lib/iac/catalog.ts | 0 .../lib/iac/detail-presets.ts | 0 {ui/homepage => dashboard}/lib/iac/types.ts | 0 .../lib/knowledgeBase.ts | 0 {ui/homepage => dashboard}/lib/markdown.ts | 0 {ui/homepage => dashboard}/lib/rbac.ts | 0 .../lib/serviceConfig.ts | 0 {ui/homepage => dashboard}/lib/userStore.tsx | 0 {ui/homepage => dashboard}/next-env.d.ts | 0 {ui/homepage => dashboard}/next.config.js | 0 {ui/homepage => dashboard}/package.json | 2 +- {ui/homepage => dashboard}/pages/500.tsx | 0 {ui/homepage => dashboard}/pages/_app.tsx | 0 {ui/homepage => dashboard}/postcss.config.js | 0 .../public/_build/cloud_iac_index.json | 0 .../public/_build/docs_index.json | 0 .../public/_build/docs_paths.json | 0 .../public/dl-index/all.json | 0 .../public/dl-index/artifacts-manifest.json | 0 .../public/dl-index/docs-manifest.json | 0 {ui/homepage => dashboard}/public/favicon.ico | Bin .../public/icons/cloudnative_32.png | Bin .../server/account/session.ts | 0 {ui/homepage => dashboard}/setup_20.x | 0 {ui/homepage => dashboard}/start.sh | 2 +- {ui/homepage => dashboard}/tailwind.config.js | 0 {ui/homepage => dashboard}/tsconfig.json | 2 + {ui/homepage => dashboard}/types/download.ts | 0 {ui/homepage => dashboard}/types/global.d.ts | 0 {ui/homepage => dashboard}/types/qrcode.d.ts | 0 {ui/homepage => dashboard}/vitest.config.ts | 1 + {ui/homepage => dashboard}/vitest.setup.ts | 0 {ui/homepage => dashboard}/yarn.lock | 4 +- deploy/nextjs/next.service | 4 +- docs/account-svc-plus.md | 2 +- docs/api-endpoints.md | 2 +- ...an.md => dashboard-deno-migration-plan.md} | 34 +++++----- docs/deployments/docker-compose.md | 2 +- docs/deployments/helm-chart.md | 4 +- docs/deployments/systemd-agent.md | 2 +- docs/management-page-plan.md | 4 +- docs/multi-tenant-rbac.md | 10 +-- docs/register-page-chunk-error.md | 2 +- docs/troubleshooting/register-404.md | 4 +- docs/ui/login-session-state-evaluation.md | 6 +- docs/ui/static-export/cloud_iac.md | 2 +- docs/ui/static-export/docs.md | 2 +- example/sit/nginx/dev.svc.plus.conf | 2 +- scripts/check-build.js | 4 +- scripts/export-slugs.ts | 12 ++-- scripts/gen_docs_manifest.py | 4 +- scripts/scan-md.ts | 6 +- ui/homepage/app/AppProviders.tsx | 12 ---- ui/homepage/app/layout.tsx | 19 ------ ui/homepage/app/page.tsx | 38 ----------- 243 files changed, 491 insertions(+), 207 deletions(-) rename {ui/homepage => dashboard}/.eslintrc.json (100%) rename {ui/homepage => dashboard}/.gitignore (100%) rename {ui/homepage => dashboard}/.nvmrc (100%) rename {ui/homepage => dashboard}/.yarnrc.yml (100%) rename {ui/homepage => dashboard}/Dockerfile (66%) rename {ui/homepage => dashboard}/Makefile (78%) rename {ui/homepage => dashboard}/app/404/page.tsx (100%) create mode 100644 dashboard/app/AppProviders.tsx rename {ui/homepage => dashboard}/app/api/admin/settings/route.ts (100%) rename {ui/homepage => dashboard}/app/api/admin/users/[userId]/role/route.ts (100%) rename {ui/homepage => dashboard}/app/api/admin/users/metrics/route.ts (100%) rename {ui/homepage => dashboard}/app/api/askai/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/login/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/mfa/disable/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/mfa/setup/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/mfa/status/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/mfa/verify/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/register/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/session/route.ts (100%) rename {ui/homepage => dashboard}/app/api/auth/verify-email/route.ts (100%) rename {ui/homepage => dashboard}/app/api/rag/query/route.ts (100%) rename {ui/homepage => dashboard}/app/api/users/route.ts (100%) rename {ui/homepage => dashboard}/app/cloud_iac/README.md (99%) rename {ui/homepage => dashboard}/app/cloud_iac/[provider]/[service]/page.tsx (100%) rename {ui/homepage => dashboard}/app/cloud_iac/[provider]/page.tsx (100%) rename {ui/homepage => dashboard}/app/cloud_iac/page.tsx (100%) rename {ui/homepage => dashboard}/app/components/ClientTime.tsx (100%) rename {ui/homepage => dashboard}/app/components/icons/WeChatIcon.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/ai/Assistant.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/explore/ExploreBuilder.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/layout/BreadcrumbBar.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/layout/Sidebar.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/layout/TimeRangePicker.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/layout/WorkspaceGrid.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/layout/WorkspaceHeader.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/services/adapters/logs.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/services/adapters/openobserve.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/services/adapters/prometheus.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/services/adapters/traces.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/services/correlator.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/services/gitops.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/slo/AlertWizard.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/slo/SLOPanel.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/snippets/SnippetLibrary.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/store/urlState.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/store/useInsightState.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/topology/NetworkTopologyPanel.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/topology/TopologyCanvas.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/topology/types.ts (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/LogsTable.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/LogsTopStats.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/LogsViewer.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/MetricsChart.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/MetricsTable.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/MetricsTopStats.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/TracesTable.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/TracesTopStats.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/TracesWaterfall.tsx (100%) rename {ui/homepage => dashboard}/app/components/insight/viz/VizArea.tsx (100%) rename {ui/homepage => dashboard}/app/demo/DemoContent.tsx (100%) rename {ui/homepage => dashboard}/app/demo/page.tsx (100%) rename {ui/homepage => dashboard}/app/docs/DocCollectionCard.tsx (100%) rename {ui/homepage => dashboard}/app/docs/[collection]/[version]/DocCollectionView.tsx (100%) rename {ui/homepage => dashboard}/app/docs/[collection]/[version]/DocReader.tsx (100%) rename {ui/homepage => dashboard}/app/docs/[collection]/[version]/DocViewSection.tsx (100%) rename {ui/homepage => dashboard}/app/docs/[collection]/[version]/page.tsx (100%) rename {ui/homepage => dashboard}/app/docs/[collection]/page.tsx (100%) rename {ui/homepage => dashboard}/app/docs/page.tsx (100%) rename {ui/homepage => dashboard}/app/docs/resources.server.ts (100%) rename {ui/homepage => dashboard}/app/docs/types.ts (100%) rename {ui/homepage => dashboard}/app/docs/utils.ts (100%) rename {ui/homepage => dashboard}/app/download/[...segments]/page.tsx (100%) rename {ui/homepage => dashboard}/app/download/page.tsx (100%) rename {ui/homepage => dashboard}/app/globals.css (100%) rename {ui/homepage => dashboard}/app/insight/InsightWorkbench.tsx (100%) rename {ui/homepage => dashboard}/app/insight/page.tsx (100%) create mode 100644 dashboard/app/layout.tsx rename {ui/homepage => dashboard}/app/login/LoginContent.tsx (100%) rename {ui/homepage => dashboard}/app/login/LoginForm.tsx (100%) rename {ui/homepage => dashboard}/app/login/page.tsx (100%) rename {ui/homepage => dashboard}/app/logout/LogoutClient.tsx (100%) rename {ui/homepage => dashboard}/app/logout/page.tsx (100%) create mode 100644 dashboard/app/page.tsx rename {ui/homepage => dashboard}/app/panel/account/MfaSetupPanel.tsx (100%) rename {ui/homepage => dashboard}/app/panel/account/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/agent/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/api/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/components/Card.tsx (100%) rename {ui/homepage => dashboard}/app/panel/components/Header.tsx (100%) rename {ui/homepage => dashboard}/app/panel/components/Sidebar.tsx (100%) rename {ui/homepage => dashboard}/app/panel/components/UserOverview.tsx (100%) rename {ui/homepage => dashboard}/app/panel/layout.tsx (100%) rename {ui/homepage => dashboard}/app/panel/ldp/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/lib/api.ts (100%) rename {ui/homepage => dashboard}/app/panel/loading.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/__tests__/ManagementComponents.test.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/components/OverviewCards.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/components/PermissionMatrixEditor.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/components/TrendChart.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/components/UserGroupManagement.tsx (100%) rename {ui/homepage => dashboard}/app/panel/management/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/page.tsx (100%) rename {ui/homepage => dashboard}/app/panel/subscription/page.tsx (100%) rename {ui/homepage => dashboard}/app/register/RegisterContent.tsx (100%) rename {ui/homepage => dashboard}/app/register/page.tsx (100%) create mode 100644 dashboard/cms/config.ts create mode 100644 dashboard/cms/content/ContentContext.tsx rename {ui/homepage => dashboard/cms}/content/getting-started.md (100%) rename ui/homepage/lib/homepageContent.ts => dashboard/cms/content/homepage.ts (97%) rename {ui/homepage => dashboard/cms}/content/homepage/contact/items/newsletter.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/contact/items/support.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/contact/items/wechat-group.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/contact/items/wechat-official.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/contact/panel.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/hero.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/posts/2024-07-12-community-events.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/posts/2024-07-30-observability-insight.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/posts/2024-08-15-release-notes.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/sidebar/community.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/sidebar/newsletter.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/sidebar/resources.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/sidebar/tags.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/solutions/xcloudflow.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/solutions/xcontrol.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/solutions/xscopehub.md (100%) rename {ui/homepage => dashboard/cms}/content/homepage/solutions/xstream.md (100%) create mode 100644 dashboard/cms/content/index.ts create mode 100644 dashboard/cms/content/source.ts create mode 100644 dashboard/cms/extensions/appShell.tsx create mode 100644 dashboard/cms/extensions/markdownSync.tsx create mode 100644 dashboard/cms/index.ts create mode 100644 dashboard/cms/templates/default/index.tsx create mode 100644 dashboard/cms/themes/default/index.tsx create mode 100644 dashboard/cms/types.ts rename {ui/homepage => dashboard}/components/AskAIButton.tsx (100%) rename {ui/homepage => dashboard}/components/AskAIDialog.tsx (100%) rename {ui/homepage => dashboard}/components/ChatBubble.tsx (100%) rename {ui/homepage => dashboard}/components/Contact.tsx (100%) rename {ui/homepage => dashboard}/components/DownloadSection.tsx (100%) rename {ui/homepage => dashboard}/components/Features.tsx (100%) rename {ui/homepage => dashboard}/components/Footer.tsx (100%) rename {ui/homepage => dashboard}/components/Hero.tsx (100%) rename {ui/homepage => dashboard}/components/LanguageToggle.tsx (100%) rename {ui/homepage => dashboard}/components/Navbar.tsx (100%) rename {ui/homepage => dashboard}/components/OpenSource.tsx (100%) rename {ui/homepage => dashboard}/components/ReleaseChannelSelector.tsx (100%) rename {ui/homepage => dashboard}/components/SourceHint.tsx (100%) rename {ui/homepage => dashboard}/components/Terms.tsx (100%) rename {ui/homepage => dashboard}/components/common/QueryChips.tsx (100%) rename {ui/homepage => dashboard}/components/common/QueryHistoryPanel.tsx (100%) rename {ui/homepage => dashboard}/components/download/Breadcrumbs.tsx (100%) rename {ui/homepage => dashboard}/components/download/CardGrid.tsx (100%) rename {ui/homepage => dashboard}/components/download/CopyButton.tsx (100%) rename {ui/homepage => dashboard}/components/download/DownloadBrowser.tsx (100%) rename {ui/homepage => dashboard}/components/download/DownloadListingContent.tsx (100%) rename {ui/homepage => dashboard}/components/download/DownloadNotFound.tsx (100%) rename {ui/homepage => dashboard}/components/download/DownloadSummary.tsx (100%) rename {ui/homepage => dashboard}/components/download/FileTable.tsx (100%) rename {ui/homepage => dashboard}/components/download/MarkdownPanel.tsx (100%) rename {ui/homepage => dashboard}/components/home/ArticleFeed.tsx (98%) rename {ui/homepage => dashboard}/components/home/ContactPanel.tsx (85%) rename {ui/homepage => dashboard}/components/home/ContactPanelClient.tsx (98%) rename {ui/homepage => dashboard}/components/home/HeroBanner.tsx (98%) rename {ui/homepage => dashboard}/components/home/HeroProductTabs.tsx (99%) rename {ui/homepage => dashboard}/components/home/ProductMatrix.tsx (89%) rename {ui/homepage => dashboard}/components/home/ProductMatrixClient.tsx (99%) rename {ui/homepage => dashboard}/components/home/Sidebar.tsx (83%) rename {ui/homepage => dashboard}/components/home/SidebarCard.tsx (96%) rename {ui/homepage => dashboard}/components/iac/CloudIacCatalog.tsx (100%) rename {ui/homepage => dashboard}/components/iac/RunModal.tsx (100%) rename {ui/homepage => dashboard}/components/iac/ServiceDetailView.tsx (100%) rename {ui/homepage => dashboard}/config/feature-toggles.json (100%) rename {ui/homepage => dashboard}/config/runtime-service-config.yaml (100%) rename {ui/homepage => dashboard}/i18n/LanguageProvider.tsx (100%) rename {ui/homepage => dashboard}/i18n/translations.ts (100%) rename {ui/homepage => dashboard}/lib/accessControl.ts (100%) rename {ui/homepage => dashboard}/lib/authGateway.ts (100%) rename {ui/homepage => dashboard}/lib/download-data.ts (100%) rename {ui/homepage => dashboard}/lib/download-manifest.ts (100%) rename {ui/homepage => dashboard}/lib/featureFlags.ts (100%) rename {ui/homepage => dashboard}/lib/featureToggles.ts (100%) rename {ui/homepage => dashboard}/lib/format.ts (100%) rename {ui/homepage => dashboard}/lib/iac/actions.ts (100%) rename {ui/homepage => dashboard}/lib/iac/catalog.ts (100%) rename {ui/homepage => dashboard}/lib/iac/detail-presets.ts (100%) rename {ui/homepage => dashboard}/lib/iac/types.ts (100%) rename {ui/homepage => dashboard}/lib/knowledgeBase.ts (100%) rename {ui/homepage => dashboard}/lib/markdown.ts (100%) rename {ui/homepage => dashboard}/lib/rbac.ts (100%) rename {ui/homepage => dashboard}/lib/serviceConfig.ts (100%) rename {ui/homepage => dashboard}/lib/userStore.tsx (100%) rename {ui/homepage => dashboard}/next-env.d.ts (100%) rename {ui/homepage => dashboard}/next.config.js (100%) rename {ui/homepage => dashboard}/package.json (97%) rename {ui/homepage => dashboard}/pages/500.tsx (100%) rename {ui/homepage => dashboard}/pages/_app.tsx (100%) rename {ui/homepage => dashboard}/postcss.config.js (100%) rename {ui/homepage => dashboard}/public/_build/cloud_iac_index.json (100%) rename {ui/homepage => dashboard}/public/_build/docs_index.json (100%) rename {ui/homepage => dashboard}/public/_build/docs_paths.json (100%) rename {ui/homepage => dashboard}/public/dl-index/all.json (100%) rename {ui/homepage => dashboard}/public/dl-index/artifacts-manifest.json (100%) rename {ui/homepage => dashboard}/public/dl-index/docs-manifest.json (100%) rename {ui/homepage => dashboard}/public/favicon.ico (100%) rename {ui/homepage => dashboard}/public/icons/cloudnative_32.png (100%) rename {ui/homepage => dashboard}/server/account/session.ts (100%) rename {ui/homepage => dashboard}/setup_20.x (100%) rename {ui/homepage => dashboard}/start.sh (93%) rename {ui/homepage => dashboard}/tailwind.config.js (100%) rename {ui/homepage => dashboard}/tsconfig.json (95%) rename {ui/homepage => dashboard}/types/download.ts (100%) rename {ui/homepage => dashboard}/types/global.d.ts (100%) rename {ui/homepage => dashboard}/types/qrcode.d.ts (100%) rename {ui/homepage => dashboard}/vitest.config.ts (93%) rename {ui/homepage => dashboard}/vitest.setup.ts (100%) rename {ui/homepage => dashboard}/yarn.lock (99%) rename docs/{ui-homepage-deno-migration-plan.md => dashboard-deno-migration-plan.md} (75%) delete mode 100644 ui/homepage/app/AppProviders.tsx delete mode 100644 ui/homepage/app/layout.tsx delete mode 100644 ui/homepage/app/page.tsx diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 8ff05b4..c9a6019 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -109,41 +109,41 @@ jobs: with: node-version: 20 cache: yarn - cache-dependency-path: ui/homepage/yarn.lock + cache-dependency-path: ui/dashboard/yarn.lock - - name: Install homepage dependencies + - name: Install dashboard dependencies if: github.ref == 'refs/heads/main' - working-directory: ui/homepage + working-directory: ui/dashboard run: yarn install --frozen-lockfile - - name: Run homepage export scripts + - name: Run dashboard export scripts if: github.ref == 'refs/heads/main' - working-directory: ui/homepage + working-directory: ui/dashboard run: yarn prebuild - - name: Build homepage static bundle + - name: Build dashboard static bundle if: github.ref == 'refs/heads/main' - working-directory: ui/homepage + working-directory: ui/dashboard run: yarn build:static - - name: Create homepage static archive + - name: Create dashboard static archive if: github.ref == 'refs/heads/main' run: | set -euo pipefail mkdir -p release-artifacts - src="ui/homepage/out" + src="ui/dashboard/out" if [[ ! -d "$src" ]]; then - echo "Homepage static export directory not found" >&2 + echo "Dashboard static export directory not found" >&2 exit 1 fi - tar -czf release-artifacts/homepage-static-export.tar.gz -C "$src" . + tar -czf release-artifacts/dashboard-static-export.tar.gz -C "$src" . - - name: Upload homepage static bundle artifact - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v4 - with: - name: homepage-static-export - path: ui/homepage/out + - name: Upload dashboard static bundle artifact + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4 + with: + name: dashboard-static-export + path: ui/dashboard/out - name: Prepare release assets run: | @@ -155,8 +155,8 @@ jobs: files+=("${file}") done < <(printf '%s\n' release-artifacts/xcontrol-*) fi - if [[ -f "release-artifacts/homepage-static-export.tar.gz" ]]; then - files+=("release-artifacts/homepage-static-export.tar.gz") + if [[ -f "release-artifacts/dashboard-static-export.tar.gz" ]]; then + files+=("release-artifacts/dashboard-static-export.tar.gz") fi if [[ ${#files[@]} -eq 0 ]]; then echo "No release assets were found" >&2 @@ -227,22 +227,22 @@ jobs: mv artifacts/bin/xcontrol-server-linux-amd64 artifacts/bin/xcontrol-server chmod +x artifacts/bin/xcontrol-server - - name: Download homepage static bundle + - name: Download dashboard static bundle uses: actions/download-artifact@v4 with: - name: homepage-static-export - path: artifacts/homepage + name: dashboard-static-export + path: artifacts/dashboard if-no-artifact-found: ignore - - name: Check homepage static bundle availability - id: homepage_static_export + - name: Check dashboard static bundle availability + id: dashboard_static_export run: | set -euo pipefail - artifact="artifacts/homepage/homepage-static-export.tar.gz" + artifact="artifacts/dashboard/dashboard-static-export.tar.gz" if [[ -f "${artifact}" ]]; then echo "available=true" >> "$GITHUB_OUTPUT" else - echo "Homepage static export artifact was not downloaded; skipping sync." >&2 + echo "Dashboard static export artifact was not downloaded; skipping sync." >&2 echo "available=false" >> "$GITHUB_OUTPUT" fi @@ -283,14 +283,14 @@ jobs: ssh "$REMOTE_HOST" "sudo install -m 755 /tmp/xcontrol-server /usr/bin/xcontrol-server" fi - - name: Sync homepage static export - if: steps.homepage_static_export.outputs.available == 'true' + - name: Sync dashboard static export + if: steps.dashboard_static_export.outputs.available == 'true' env: REMOTE_HOST: ${{ secrets.VPS_USER }}@${{ matrix.site }} run: | set -euo pipefail - artifact="artifacts/homepage/homepage-static-export.tar.gz" - dest_root="artifacts/homepage/out" + artifact="artifacts/dashboard/dashboard-static-export.tar.gz" + dest_root="artifacts/dashboard/out" rm -rf "${dest_root}" mkdir -p "${dest_root}" diff --git a/.github/workflows/security-check.yml b/.github/workflows/security-check.yml index 3278425..980e0d7 100644 --- a/.github/workflows/security-check.yml +++ b/.github/workflows/security-check.yml @@ -20,18 +20,18 @@ jobs: with: node-version: 20 cache: yarn - cache-dependency-path: ui/homepage/yarn.lock + cache-dependency-path: ui/dashboard/yarn.lock - name: Install dependencies - working-directory: ui/homepage + working-directory: ui/dashboard run: yarn install --frozen-lockfile - name: Run ESLint - working-directory: ui/homepage + working-directory: ui/dashboard run: yarn lint - name: Run npm audit (production) - working-directory: ui/homepage + working-directory: ui/dashboard run: npm audit --production continue-on-error: true @@ -39,7 +39,7 @@ jobs: uses: returntocorp/semgrep-action@v1 with: config: p/ci - paths: ui/homepage + paths: ui/dashboard go-security: name: go-security diff --git a/.gitignore b/.gitignore index bf5fad2..9234c77 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ account/xcontrol-account account/xcontrol-account.log server/xcontrol-server server/xcontrol-server.log -ui/homepage/.yarn/ +ui/dashboard/.yarn/ diff --git a/Makefile b/Makefile index e445e1b..89206b6 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ NODE_MAJOR ?= 22 export PATH := $(GO_BIN):$(PATH) .PHONY: install install-openresty install-redis install-postgresql init-db \ - build update-homepage-manifests build-server build-homepage \ - start start-openresty start-server start-homepage \ - stop stop-server stop-homepage stop-openresty restart +build update-dashboard-manifests build-server build-dashboard \ +start start-openresty start-server start-dashboard \ +stop stop-server stop-dashboard stop-openresty restart # ----------------------------------------------------------------------------- # Dependency installation @@ -86,7 +86,7 @@ init-db: # Build targets # ----------------------------------------------------------------------------- -build: update-homepage-manifests build-cli build-server build-homepage +build: update-dashboard-manifests build-cli build-server build-dashboard build-cli: $(MAKE) -C rag-server/cmd/rag-server-cli build @@ -94,32 +94,32 @@ build-cli: build-server: $(MAKE) -C rag-server build -build-homepage: - $(MAKE) -C ui/homepage build SKIP_SYNC=1 +build-dashboard: +$(MAKE) -C dashboard build SKIP_SYNC=1 -update-homepage-manifests: - $(MAKE) -C ui/homepage sync-dl-index +update-dashboard-manifests: +$(MAKE) -C dashboard sync-dl-index # ----------------------------------------------------------------------------- # Run targets # ----------------------------------------------------------------------------- -start: start-openresty start-server start-homepage start-dl start-docs +start: start-openresty start-server start-dashboard start-dl start-docs start-server: $(MAKE) -C rag-server start -start-homepage: - $(MAKE) -C ui/homepage start +start-dashboard: +$(MAKE) -C dashboard start -stop: stop-server stop-homepage stop-openresty +stop: stop-server stop-dashboard stop-openresty stop-server: $(MAKE) -C rag-server stop -stop-homepage: - $(MAKE) -C ui/homepage stop +stop-dashboard: +$(MAKE) -C dashboard stop start-openresty: ifeq ($(OS),Darwin) diff --git a/README.md b/README.md index a383a8c..2f59181 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository contains the API server, agent code and a Next.js-based UI. ## Components -- **ui-homepage** +- **dashboard** - **ui-panel** - **xcontrol-cli** - **xcontrol-server** @@ -50,7 +50,7 @@ make init-db # initialize database (optional) ## Frontend configuration -The Next.js homepage now resolves service endpoints through `ui/homepage/config/runtime-service-config.yaml`. The runtime +The Next.js dashboard now resolves service endpoints through `dashboard/config/runtime-service-config.yaml`. The runtime configuration selects values based on `NEXT_PUBLIC_RUNTIME_ENV` (falling back to `NODE_ENV` and the file's `defaultEnvironment`). Use `NEXT_PUBLIC_ACCOUNT_SERVICE_URL` for ad-hoc overrides, otherwise adjust the YAML file to specify environment-specific URLs such as `http://localhost:8080` for development/test and `https://account.svc.plus` for production. @@ -89,7 +89,7 @@ make test make start ``` -This launches the server, homepage and panel. Use `make stop` to stop all components. +This launches the server, dashboard and panel. Use `make stop` to stop all components. The API server also accepts a custom configuration file: diff --git a/ui/homepage/.eslintrc.json b/dashboard/.eslintrc.json similarity index 100% rename from ui/homepage/.eslintrc.json rename to dashboard/.eslintrc.json diff --git a/ui/homepage/.gitignore b/dashboard/.gitignore similarity index 100% rename from ui/homepage/.gitignore rename to dashboard/.gitignore diff --git a/ui/homepage/.nvmrc b/dashboard/.nvmrc similarity index 100% rename from ui/homepage/.nvmrc rename to dashboard/.nvmrc diff --git a/ui/homepage/.yarnrc.yml b/dashboard/.yarnrc.yml similarity index 100% rename from ui/homepage/.yarnrc.yml rename to dashboard/.yarnrc.yml diff --git a/ui/homepage/Dockerfile b/dashboard/Dockerfile similarity index 66% rename from ui/homepage/Dockerfile rename to dashboard/Dockerfile index 075010d..130416c 100644 --- a/ui/homepage/Dockerfile +++ b/dashboard/Dockerfile @@ -1,9 +1,9 @@ -# Build static homepage +# Build static dashboard FROM node:20 AS build WORKDIR /app -COPY ui/homepage/package.json ui/homepage/yarn.lock ./ +COPY dashboard/package.json dashboard/yarn.lock ./ RUN yarn install --frozen-lockfile -COPY ui/homepage . +COPY dashboard . RUN yarn build FROM nginx:alpine diff --git a/ui/homepage/Makefile b/dashboard/Makefile similarity index 78% rename from ui/homepage/Makefile rename to dashboard/Makefile index ade6f73..64cb787 100644 --- a/ui/homepage/Makefile +++ b/dashboard/Makefile @@ -20,12 +20,12 @@ icon: exit 1; \ fi @mkdir -p public/icons - @$(MAGICK) ../logo.png -resize 32x32 public/icons/cloudnative_32.png - @$(MAGICK) ../logo.png -resize 64x64 -background none -define icon:auto-resize=64,48,32,16 public/favicon.ico + @$(MAGICK) ../ui/logo.png -resize 32x32 public/icons/cloudnative_32.png + @$(MAGICK) ../ui/logo.png -resize 64x64 -background none -define icon:auto-resize=64,48,32,16 public/favicon.ico @echo "✅ Icons generated successfully." init: - @echo "🔧 Installing dependencies for homepage..." + @echo "🔧 Installing dependencies for dashboard..." @if [ -z "$(YARN)" ]; then \ echo "⚠️ Yarn not found. Attempting to install..."; \ if [ "$(OS)" = "Darwin" ]; then \ @@ -48,18 +48,18 @@ init: yarn install dev: - @echo "🚀 Starting Next.js dev server (homepage)..." + @echo "🚀 Starting Next.js dev server (dashboard)..." yarn dev -p 3001 start: - @echo "🚀 Starting Next.js dev server (homepage) in background..." - @nohup yarn dev -p 3001 >/tmp/homepage.log 2>&1 & echo $$! > homepage.pid + @echo "🚀 Starting Next.js dev server (dashboard) in background..." + @nohup yarn dev -p 3001 >/tmp/dashboard.log 2>&1 & echo $$! > dashboard.pid stop: - @echo "🛑 Stopping Next.js dev server (homepage)..." - @if [ -f homepage.pid ]; then \ - kill `cat homepage.pid` >/dev/null 2>&1 || true; \ - rm homepage.pid; \ + @echo "🛑 Stopping Next.js dev server (dashboard)..." + @if [ -f dashboard.pid ]; then \ + kill `cat dashboard.pid` >/dev/null 2>&1 || true; \ + rm dashboard.pid; \ else \ echo "No running server"; \ fi @@ -75,7 +75,7 @@ build: init @if [ -z "$(SKIP_SYNC)" ]; then \ $(MAKE) sync-dl-index; \ fi - @echo "🔨 Building homepage..." + @echo "🔨 Building dashboard..." yarn next build sync-dl-index: @@ -89,7 +89,7 @@ sync-dl-index: fi export: - @echo "📦 Exporting homepage static site to ./out ..." + @echo "📦 Exporting dashboard static site to ./out ..." @NEXT_SHOULD_EXPORT=true yarn next export clean: diff --git a/ui/homepage/app/404/page.tsx b/dashboard/app/404/page.tsx similarity index 100% rename from ui/homepage/app/404/page.tsx rename to dashboard/app/404/page.tsx diff --git a/dashboard/app/AppProviders.tsx b/dashboard/app/AppProviders.tsx new file mode 100644 index 0000000..f55bb0a --- /dev/null +++ b/dashboard/app/AppProviders.tsx @@ -0,0 +1,23 @@ +'use client' + +import type { ReactNode } from 'react' + +import { collectExtensionProviders } from '@cms' +import { LanguageProvider } from '@i18n/LanguageProvider' +import { UserProvider } from '@lib/userStore' + +const extensionProviders = collectExtensionProviders() + +export function AppProviders({ children }: { children: ReactNode }) { + let tree: ReactNode = ( + + {children} + + ) + + for (const Provider of extensionProviders) { + tree = {tree} + } + + return tree +} diff --git a/ui/homepage/app/api/admin/settings/route.ts b/dashboard/app/api/admin/settings/route.ts similarity index 100% rename from ui/homepage/app/api/admin/settings/route.ts rename to dashboard/app/api/admin/settings/route.ts diff --git a/ui/homepage/app/api/admin/users/[userId]/role/route.ts b/dashboard/app/api/admin/users/[userId]/role/route.ts similarity index 100% rename from ui/homepage/app/api/admin/users/[userId]/role/route.ts rename to dashboard/app/api/admin/users/[userId]/role/route.ts diff --git a/ui/homepage/app/api/admin/users/metrics/route.ts b/dashboard/app/api/admin/users/metrics/route.ts similarity index 100% rename from ui/homepage/app/api/admin/users/metrics/route.ts rename to dashboard/app/api/admin/users/metrics/route.ts diff --git a/ui/homepage/app/api/askai/route.ts b/dashboard/app/api/askai/route.ts similarity index 100% rename from ui/homepage/app/api/askai/route.ts rename to dashboard/app/api/askai/route.ts diff --git a/ui/homepage/app/api/auth/login/route.ts b/dashboard/app/api/auth/login/route.ts similarity index 100% rename from ui/homepage/app/api/auth/login/route.ts rename to dashboard/app/api/auth/login/route.ts diff --git a/ui/homepage/app/api/auth/mfa/disable/route.ts b/dashboard/app/api/auth/mfa/disable/route.ts similarity index 100% rename from ui/homepage/app/api/auth/mfa/disable/route.ts rename to dashboard/app/api/auth/mfa/disable/route.ts diff --git a/ui/homepage/app/api/auth/mfa/setup/route.ts b/dashboard/app/api/auth/mfa/setup/route.ts similarity index 100% rename from ui/homepage/app/api/auth/mfa/setup/route.ts rename to dashboard/app/api/auth/mfa/setup/route.ts diff --git a/ui/homepage/app/api/auth/mfa/status/route.ts b/dashboard/app/api/auth/mfa/status/route.ts similarity index 100% rename from ui/homepage/app/api/auth/mfa/status/route.ts rename to dashboard/app/api/auth/mfa/status/route.ts diff --git a/ui/homepage/app/api/auth/mfa/verify/route.ts b/dashboard/app/api/auth/mfa/verify/route.ts similarity index 100% rename from ui/homepage/app/api/auth/mfa/verify/route.ts rename to dashboard/app/api/auth/mfa/verify/route.ts diff --git a/ui/homepage/app/api/auth/register/route.ts b/dashboard/app/api/auth/register/route.ts similarity index 100% rename from ui/homepage/app/api/auth/register/route.ts rename to dashboard/app/api/auth/register/route.ts diff --git a/ui/homepage/app/api/auth/session/route.ts b/dashboard/app/api/auth/session/route.ts similarity index 100% rename from ui/homepage/app/api/auth/session/route.ts rename to dashboard/app/api/auth/session/route.ts diff --git a/ui/homepage/app/api/auth/verify-email/route.ts b/dashboard/app/api/auth/verify-email/route.ts similarity index 100% rename from ui/homepage/app/api/auth/verify-email/route.ts rename to dashboard/app/api/auth/verify-email/route.ts diff --git a/ui/homepage/app/api/rag/query/route.ts b/dashboard/app/api/rag/query/route.ts similarity index 100% rename from ui/homepage/app/api/rag/query/route.ts rename to dashboard/app/api/rag/query/route.ts diff --git a/ui/homepage/app/api/users/route.ts b/dashboard/app/api/users/route.ts similarity index 100% rename from ui/homepage/app/api/users/route.ts rename to dashboard/app/api/users/route.ts diff --git a/ui/homepage/app/cloud_iac/README.md b/dashboard/app/cloud_iac/README.md similarity index 99% rename from ui/homepage/app/cloud_iac/README.md rename to dashboard/app/cloud_iac/README.md index df6b92d..5d39485 100644 --- a/ui/homepage/app/cloud_iac/README.md +++ b/dashboard/app/cloud_iac/README.md @@ -5,7 +5,7 @@ Cloud IaC Catalog 提供跨云厂商(AWS、GCP、Azure、阿里云)的核心 ## 开发调试 ```bash -cd ui/homepage +cd dashboard yarn install yarn dev ``` diff --git a/ui/homepage/app/cloud_iac/[provider]/[service]/page.tsx b/dashboard/app/cloud_iac/[provider]/[service]/page.tsx similarity index 100% rename from ui/homepage/app/cloud_iac/[provider]/[service]/page.tsx rename to dashboard/app/cloud_iac/[provider]/[service]/page.tsx diff --git a/ui/homepage/app/cloud_iac/[provider]/page.tsx b/dashboard/app/cloud_iac/[provider]/page.tsx similarity index 100% rename from ui/homepage/app/cloud_iac/[provider]/page.tsx rename to dashboard/app/cloud_iac/[provider]/page.tsx diff --git a/ui/homepage/app/cloud_iac/page.tsx b/dashboard/app/cloud_iac/page.tsx similarity index 100% rename from ui/homepage/app/cloud_iac/page.tsx rename to dashboard/app/cloud_iac/page.tsx diff --git a/ui/homepage/app/components/ClientTime.tsx b/dashboard/app/components/ClientTime.tsx similarity index 100% rename from ui/homepage/app/components/ClientTime.tsx rename to dashboard/app/components/ClientTime.tsx diff --git a/ui/homepage/app/components/icons/WeChatIcon.tsx b/dashboard/app/components/icons/WeChatIcon.tsx similarity index 100% rename from ui/homepage/app/components/icons/WeChatIcon.tsx rename to dashboard/app/components/icons/WeChatIcon.tsx diff --git a/ui/homepage/app/components/insight/ai/Assistant.tsx b/dashboard/app/components/insight/ai/Assistant.tsx similarity index 100% rename from ui/homepage/app/components/insight/ai/Assistant.tsx rename to dashboard/app/components/insight/ai/Assistant.tsx diff --git a/ui/homepage/app/components/insight/explore/ExploreBuilder.tsx b/dashboard/app/components/insight/explore/ExploreBuilder.tsx similarity index 100% rename from ui/homepage/app/components/insight/explore/ExploreBuilder.tsx rename to dashboard/app/components/insight/explore/ExploreBuilder.tsx diff --git a/ui/homepage/app/components/insight/layout/BreadcrumbBar.tsx b/dashboard/app/components/insight/layout/BreadcrumbBar.tsx similarity index 100% rename from ui/homepage/app/components/insight/layout/BreadcrumbBar.tsx rename to dashboard/app/components/insight/layout/BreadcrumbBar.tsx diff --git a/ui/homepage/app/components/insight/layout/Sidebar.tsx b/dashboard/app/components/insight/layout/Sidebar.tsx similarity index 100% rename from ui/homepage/app/components/insight/layout/Sidebar.tsx rename to dashboard/app/components/insight/layout/Sidebar.tsx diff --git a/ui/homepage/app/components/insight/layout/TimeRangePicker.tsx b/dashboard/app/components/insight/layout/TimeRangePicker.tsx similarity index 100% rename from ui/homepage/app/components/insight/layout/TimeRangePicker.tsx rename to dashboard/app/components/insight/layout/TimeRangePicker.tsx diff --git a/ui/homepage/app/components/insight/layout/WorkspaceGrid.tsx b/dashboard/app/components/insight/layout/WorkspaceGrid.tsx similarity index 100% rename from ui/homepage/app/components/insight/layout/WorkspaceGrid.tsx rename to dashboard/app/components/insight/layout/WorkspaceGrid.tsx diff --git a/ui/homepage/app/components/insight/layout/WorkspaceHeader.tsx b/dashboard/app/components/insight/layout/WorkspaceHeader.tsx similarity index 100% rename from ui/homepage/app/components/insight/layout/WorkspaceHeader.tsx rename to dashboard/app/components/insight/layout/WorkspaceHeader.tsx diff --git a/ui/homepage/app/components/insight/services/adapters/logs.ts b/dashboard/app/components/insight/services/adapters/logs.ts similarity index 100% rename from ui/homepage/app/components/insight/services/adapters/logs.ts rename to dashboard/app/components/insight/services/adapters/logs.ts diff --git a/ui/homepage/app/components/insight/services/adapters/openobserve.ts b/dashboard/app/components/insight/services/adapters/openobserve.ts similarity index 100% rename from ui/homepage/app/components/insight/services/adapters/openobserve.ts rename to dashboard/app/components/insight/services/adapters/openobserve.ts diff --git a/ui/homepage/app/components/insight/services/adapters/prometheus.ts b/dashboard/app/components/insight/services/adapters/prometheus.ts similarity index 100% rename from ui/homepage/app/components/insight/services/adapters/prometheus.ts rename to dashboard/app/components/insight/services/adapters/prometheus.ts diff --git a/ui/homepage/app/components/insight/services/adapters/traces.ts b/dashboard/app/components/insight/services/adapters/traces.ts similarity index 100% rename from ui/homepage/app/components/insight/services/adapters/traces.ts rename to dashboard/app/components/insight/services/adapters/traces.ts diff --git a/ui/homepage/app/components/insight/services/correlator.ts b/dashboard/app/components/insight/services/correlator.ts similarity index 100% rename from ui/homepage/app/components/insight/services/correlator.ts rename to dashboard/app/components/insight/services/correlator.ts diff --git a/ui/homepage/app/components/insight/services/gitops.ts b/dashboard/app/components/insight/services/gitops.ts similarity index 100% rename from ui/homepage/app/components/insight/services/gitops.ts rename to dashboard/app/components/insight/services/gitops.ts diff --git a/ui/homepage/app/components/insight/slo/AlertWizard.tsx b/dashboard/app/components/insight/slo/AlertWizard.tsx similarity index 100% rename from ui/homepage/app/components/insight/slo/AlertWizard.tsx rename to dashboard/app/components/insight/slo/AlertWizard.tsx diff --git a/ui/homepage/app/components/insight/slo/SLOPanel.tsx b/dashboard/app/components/insight/slo/SLOPanel.tsx similarity index 100% rename from ui/homepage/app/components/insight/slo/SLOPanel.tsx rename to dashboard/app/components/insight/slo/SLOPanel.tsx diff --git a/ui/homepage/app/components/insight/snippets/SnippetLibrary.tsx b/dashboard/app/components/insight/snippets/SnippetLibrary.tsx similarity index 100% rename from ui/homepage/app/components/insight/snippets/SnippetLibrary.tsx rename to dashboard/app/components/insight/snippets/SnippetLibrary.tsx diff --git a/ui/homepage/app/components/insight/store/urlState.ts b/dashboard/app/components/insight/store/urlState.ts similarity index 100% rename from ui/homepage/app/components/insight/store/urlState.ts rename to dashboard/app/components/insight/store/urlState.ts diff --git a/ui/homepage/app/components/insight/store/useInsightState.ts b/dashboard/app/components/insight/store/useInsightState.ts similarity index 100% rename from ui/homepage/app/components/insight/store/useInsightState.ts rename to dashboard/app/components/insight/store/useInsightState.ts diff --git a/ui/homepage/app/components/insight/topology/NetworkTopologyPanel.tsx b/dashboard/app/components/insight/topology/NetworkTopologyPanel.tsx similarity index 100% rename from ui/homepage/app/components/insight/topology/NetworkTopologyPanel.tsx rename to dashboard/app/components/insight/topology/NetworkTopologyPanel.tsx diff --git a/ui/homepage/app/components/insight/topology/TopologyCanvas.tsx b/dashboard/app/components/insight/topology/TopologyCanvas.tsx similarity index 100% rename from ui/homepage/app/components/insight/topology/TopologyCanvas.tsx rename to dashboard/app/components/insight/topology/TopologyCanvas.tsx diff --git a/ui/homepage/app/components/insight/topology/types.ts b/dashboard/app/components/insight/topology/types.ts similarity index 100% rename from ui/homepage/app/components/insight/topology/types.ts rename to dashboard/app/components/insight/topology/types.ts diff --git a/ui/homepage/app/components/insight/viz/LogsTable.tsx b/dashboard/app/components/insight/viz/LogsTable.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/LogsTable.tsx rename to dashboard/app/components/insight/viz/LogsTable.tsx diff --git a/ui/homepage/app/components/insight/viz/LogsTopStats.tsx b/dashboard/app/components/insight/viz/LogsTopStats.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/LogsTopStats.tsx rename to dashboard/app/components/insight/viz/LogsTopStats.tsx diff --git a/ui/homepage/app/components/insight/viz/LogsViewer.tsx b/dashboard/app/components/insight/viz/LogsViewer.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/LogsViewer.tsx rename to dashboard/app/components/insight/viz/LogsViewer.tsx diff --git a/ui/homepage/app/components/insight/viz/MetricsChart.tsx b/dashboard/app/components/insight/viz/MetricsChart.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/MetricsChart.tsx rename to dashboard/app/components/insight/viz/MetricsChart.tsx diff --git a/ui/homepage/app/components/insight/viz/MetricsTable.tsx b/dashboard/app/components/insight/viz/MetricsTable.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/MetricsTable.tsx rename to dashboard/app/components/insight/viz/MetricsTable.tsx diff --git a/ui/homepage/app/components/insight/viz/MetricsTopStats.tsx b/dashboard/app/components/insight/viz/MetricsTopStats.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/MetricsTopStats.tsx rename to dashboard/app/components/insight/viz/MetricsTopStats.tsx diff --git a/ui/homepage/app/components/insight/viz/TracesTable.tsx b/dashboard/app/components/insight/viz/TracesTable.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/TracesTable.tsx rename to dashboard/app/components/insight/viz/TracesTable.tsx diff --git a/ui/homepage/app/components/insight/viz/TracesTopStats.tsx b/dashboard/app/components/insight/viz/TracesTopStats.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/TracesTopStats.tsx rename to dashboard/app/components/insight/viz/TracesTopStats.tsx diff --git a/ui/homepage/app/components/insight/viz/TracesWaterfall.tsx b/dashboard/app/components/insight/viz/TracesWaterfall.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/TracesWaterfall.tsx rename to dashboard/app/components/insight/viz/TracesWaterfall.tsx diff --git a/ui/homepage/app/components/insight/viz/VizArea.tsx b/dashboard/app/components/insight/viz/VizArea.tsx similarity index 100% rename from ui/homepage/app/components/insight/viz/VizArea.tsx rename to dashboard/app/components/insight/viz/VizArea.tsx diff --git a/ui/homepage/app/demo/DemoContent.tsx b/dashboard/app/demo/DemoContent.tsx similarity index 100% rename from ui/homepage/app/demo/DemoContent.tsx rename to dashboard/app/demo/DemoContent.tsx diff --git a/ui/homepage/app/demo/page.tsx b/dashboard/app/demo/page.tsx similarity index 100% rename from ui/homepage/app/demo/page.tsx rename to dashboard/app/demo/page.tsx diff --git a/ui/homepage/app/docs/DocCollectionCard.tsx b/dashboard/app/docs/DocCollectionCard.tsx similarity index 100% rename from ui/homepage/app/docs/DocCollectionCard.tsx rename to dashboard/app/docs/DocCollectionCard.tsx diff --git a/ui/homepage/app/docs/[collection]/[version]/DocCollectionView.tsx b/dashboard/app/docs/[collection]/[version]/DocCollectionView.tsx similarity index 100% rename from ui/homepage/app/docs/[collection]/[version]/DocCollectionView.tsx rename to dashboard/app/docs/[collection]/[version]/DocCollectionView.tsx diff --git a/ui/homepage/app/docs/[collection]/[version]/DocReader.tsx b/dashboard/app/docs/[collection]/[version]/DocReader.tsx similarity index 100% rename from ui/homepage/app/docs/[collection]/[version]/DocReader.tsx rename to dashboard/app/docs/[collection]/[version]/DocReader.tsx diff --git a/ui/homepage/app/docs/[collection]/[version]/DocViewSection.tsx b/dashboard/app/docs/[collection]/[version]/DocViewSection.tsx similarity index 100% rename from ui/homepage/app/docs/[collection]/[version]/DocViewSection.tsx rename to dashboard/app/docs/[collection]/[version]/DocViewSection.tsx diff --git a/ui/homepage/app/docs/[collection]/[version]/page.tsx b/dashboard/app/docs/[collection]/[version]/page.tsx similarity index 100% rename from ui/homepage/app/docs/[collection]/[version]/page.tsx rename to dashboard/app/docs/[collection]/[version]/page.tsx diff --git a/ui/homepage/app/docs/[collection]/page.tsx b/dashboard/app/docs/[collection]/page.tsx similarity index 100% rename from ui/homepage/app/docs/[collection]/page.tsx rename to dashboard/app/docs/[collection]/page.tsx diff --git a/ui/homepage/app/docs/page.tsx b/dashboard/app/docs/page.tsx similarity index 100% rename from ui/homepage/app/docs/page.tsx rename to dashboard/app/docs/page.tsx diff --git a/ui/homepage/app/docs/resources.server.ts b/dashboard/app/docs/resources.server.ts similarity index 100% rename from ui/homepage/app/docs/resources.server.ts rename to dashboard/app/docs/resources.server.ts diff --git a/ui/homepage/app/docs/types.ts b/dashboard/app/docs/types.ts similarity index 100% rename from ui/homepage/app/docs/types.ts rename to dashboard/app/docs/types.ts diff --git a/ui/homepage/app/docs/utils.ts b/dashboard/app/docs/utils.ts similarity index 100% rename from ui/homepage/app/docs/utils.ts rename to dashboard/app/docs/utils.ts diff --git a/ui/homepage/app/download/[...segments]/page.tsx b/dashboard/app/download/[...segments]/page.tsx similarity index 100% rename from ui/homepage/app/download/[...segments]/page.tsx rename to dashboard/app/download/[...segments]/page.tsx diff --git a/ui/homepage/app/download/page.tsx b/dashboard/app/download/page.tsx similarity index 100% rename from ui/homepage/app/download/page.tsx rename to dashboard/app/download/page.tsx diff --git a/ui/homepage/app/globals.css b/dashboard/app/globals.css similarity index 100% rename from ui/homepage/app/globals.css rename to dashboard/app/globals.css diff --git a/ui/homepage/app/insight/InsightWorkbench.tsx b/dashboard/app/insight/InsightWorkbench.tsx similarity index 100% rename from ui/homepage/app/insight/InsightWorkbench.tsx rename to dashboard/app/insight/InsightWorkbench.tsx diff --git a/ui/homepage/app/insight/page.tsx b/dashboard/app/insight/page.tsx similarity index 100% rename from ui/homepage/app/insight/page.tsx rename to dashboard/app/insight/page.tsx diff --git a/dashboard/app/layout.tsx b/dashboard/app/layout.tsx new file mode 100644 index 0000000..8733c2a --- /dev/null +++ b/dashboard/app/layout.tsx @@ -0,0 +1,31 @@ +export const dynamic = 'error' + +import { Fragment } from 'react' + +import './globals.css' +import { applyExtensionLayouts, getActiveTheme } from '@cms' +import { AppProviders } from './AppProviders' + +export const metadata = { + title: 'CloudNative Suite', + description: 'Unified tools for your cloud native stack', +} + +const theme = getActiveTheme() +const ThemeProvider = theme.Provider ?? Fragment +const htmlAttributes = theme.htmlAttributes ?? { lang: 'en' } +const bodyClassName = theme.bodyClassName ?? 'bg-gray-50 text-gray-900' + +export default function RootLayout({ children }: { children: React.ReactNode }) { + const content = applyExtensionLayouts(children) + + return ( + + + + {content} + + + + ) +} diff --git a/ui/homepage/app/login/LoginContent.tsx b/dashboard/app/login/LoginContent.tsx similarity index 100% rename from ui/homepage/app/login/LoginContent.tsx rename to dashboard/app/login/LoginContent.tsx diff --git a/ui/homepage/app/login/LoginForm.tsx b/dashboard/app/login/LoginForm.tsx similarity index 100% rename from ui/homepage/app/login/LoginForm.tsx rename to dashboard/app/login/LoginForm.tsx diff --git a/ui/homepage/app/login/page.tsx b/dashboard/app/login/page.tsx similarity index 100% rename from ui/homepage/app/login/page.tsx rename to dashboard/app/login/page.tsx diff --git a/ui/homepage/app/logout/LogoutClient.tsx b/dashboard/app/logout/LogoutClient.tsx similarity index 100% rename from ui/homepage/app/logout/LogoutClient.tsx rename to dashboard/app/logout/LogoutClient.tsx diff --git a/ui/homepage/app/logout/page.tsx b/dashboard/app/logout/page.tsx similarity index 100% rename from ui/homepage/app/logout/page.tsx rename to dashboard/app/logout/page.tsx diff --git a/dashboard/app/page.tsx b/dashboard/app/page.tsx new file mode 100644 index 0000000..9cc3276 --- /dev/null +++ b/dashboard/app/page.tsx @@ -0,0 +1,10 @@ +export const dynamic = 'error' + +import { getActiveTemplate } from '@cms' + +const template = getActiveTemplate() +const HomePageTemplate = template.pages.home + +export default function HomePage() { + return +} diff --git a/ui/homepage/app/panel/account/MfaSetupPanel.tsx b/dashboard/app/panel/account/MfaSetupPanel.tsx similarity index 100% rename from ui/homepage/app/panel/account/MfaSetupPanel.tsx rename to dashboard/app/panel/account/MfaSetupPanel.tsx diff --git a/ui/homepage/app/panel/account/page.tsx b/dashboard/app/panel/account/page.tsx similarity index 100% rename from ui/homepage/app/panel/account/page.tsx rename to dashboard/app/panel/account/page.tsx diff --git a/ui/homepage/app/panel/agent/page.tsx b/dashboard/app/panel/agent/page.tsx similarity index 100% rename from ui/homepage/app/panel/agent/page.tsx rename to dashboard/app/panel/agent/page.tsx diff --git a/ui/homepage/app/panel/api/page.tsx b/dashboard/app/panel/api/page.tsx similarity index 100% rename from ui/homepage/app/panel/api/page.tsx rename to dashboard/app/panel/api/page.tsx diff --git a/ui/homepage/app/panel/components/Card.tsx b/dashboard/app/panel/components/Card.tsx similarity index 100% rename from ui/homepage/app/panel/components/Card.tsx rename to dashboard/app/panel/components/Card.tsx diff --git a/ui/homepage/app/panel/components/Header.tsx b/dashboard/app/panel/components/Header.tsx similarity index 100% rename from ui/homepage/app/panel/components/Header.tsx rename to dashboard/app/panel/components/Header.tsx diff --git a/ui/homepage/app/panel/components/Sidebar.tsx b/dashboard/app/panel/components/Sidebar.tsx similarity index 100% rename from ui/homepage/app/panel/components/Sidebar.tsx rename to dashboard/app/panel/components/Sidebar.tsx diff --git a/ui/homepage/app/panel/components/UserOverview.tsx b/dashboard/app/panel/components/UserOverview.tsx similarity index 100% rename from ui/homepage/app/panel/components/UserOverview.tsx rename to dashboard/app/panel/components/UserOverview.tsx diff --git a/ui/homepage/app/panel/layout.tsx b/dashboard/app/panel/layout.tsx similarity index 100% rename from ui/homepage/app/panel/layout.tsx rename to dashboard/app/panel/layout.tsx diff --git a/ui/homepage/app/panel/ldp/page.tsx b/dashboard/app/panel/ldp/page.tsx similarity index 100% rename from ui/homepage/app/panel/ldp/page.tsx rename to dashboard/app/panel/ldp/page.tsx diff --git a/ui/homepage/app/panel/lib/api.ts b/dashboard/app/panel/lib/api.ts similarity index 100% rename from ui/homepage/app/panel/lib/api.ts rename to dashboard/app/panel/lib/api.ts diff --git a/ui/homepage/app/panel/loading.tsx b/dashboard/app/panel/loading.tsx similarity index 100% rename from ui/homepage/app/panel/loading.tsx rename to dashboard/app/panel/loading.tsx diff --git a/ui/homepage/app/panel/management/__tests__/ManagementComponents.test.tsx b/dashboard/app/panel/management/__tests__/ManagementComponents.test.tsx similarity index 100% rename from ui/homepage/app/panel/management/__tests__/ManagementComponents.test.tsx rename to dashboard/app/panel/management/__tests__/ManagementComponents.test.tsx diff --git a/ui/homepage/app/panel/management/components/OverviewCards.tsx b/dashboard/app/panel/management/components/OverviewCards.tsx similarity index 100% rename from ui/homepage/app/panel/management/components/OverviewCards.tsx rename to dashboard/app/panel/management/components/OverviewCards.tsx diff --git a/ui/homepage/app/panel/management/components/PermissionMatrixEditor.tsx b/dashboard/app/panel/management/components/PermissionMatrixEditor.tsx similarity index 100% rename from ui/homepage/app/panel/management/components/PermissionMatrixEditor.tsx rename to dashboard/app/panel/management/components/PermissionMatrixEditor.tsx diff --git a/ui/homepage/app/panel/management/components/TrendChart.tsx b/dashboard/app/panel/management/components/TrendChart.tsx similarity index 100% rename from ui/homepage/app/panel/management/components/TrendChart.tsx rename to dashboard/app/panel/management/components/TrendChart.tsx diff --git a/ui/homepage/app/panel/management/components/UserGroupManagement.tsx b/dashboard/app/panel/management/components/UserGroupManagement.tsx similarity index 100% rename from ui/homepage/app/panel/management/components/UserGroupManagement.tsx rename to dashboard/app/panel/management/components/UserGroupManagement.tsx diff --git a/ui/homepage/app/panel/management/page.tsx b/dashboard/app/panel/management/page.tsx similarity index 100% rename from ui/homepage/app/panel/management/page.tsx rename to dashboard/app/panel/management/page.tsx diff --git a/ui/homepage/app/panel/page.tsx b/dashboard/app/panel/page.tsx similarity index 100% rename from ui/homepage/app/panel/page.tsx rename to dashboard/app/panel/page.tsx diff --git a/ui/homepage/app/panel/subscription/page.tsx b/dashboard/app/panel/subscription/page.tsx similarity index 100% rename from ui/homepage/app/panel/subscription/page.tsx rename to dashboard/app/panel/subscription/page.tsx diff --git a/ui/homepage/app/register/RegisterContent.tsx b/dashboard/app/register/RegisterContent.tsx similarity index 100% rename from ui/homepage/app/register/RegisterContent.tsx rename to dashboard/app/register/RegisterContent.tsx diff --git a/ui/homepage/app/register/page.tsx b/dashboard/app/register/page.tsx similarity index 100% rename from ui/homepage/app/register/page.tsx rename to dashboard/app/register/page.tsx diff --git a/dashboard/cms/config.ts b/dashboard/cms/config.ts new file mode 100644 index 0000000..1c0d43c --- /dev/null +++ b/dashboard/cms/config.ts @@ -0,0 +1,55 @@ +export type TemplateName = 'default' +export type ThemeName = 'default' +export type ExtensionName = 'app-shell' | 'markdown-sync' + +export interface ContentSourceConfig { + type: 'filesystem' | 'git' + /** + * Absolute path to the root directory that stores markdown content. + * When `type` is `git`, the directory is expected to be hydrated by a + * GitOps workflow ahead of time. + */ + root: string + /** Remote git repository used for GitOps synchronisation. */ + repository?: string + /** Branch or tag to fetch when GitOps is enabled. */ + ref?: string +} + +export interface CmsConfig { + template: TemplateName + theme: ThemeName + extensions: ExtensionName[] + content: { + /** Default namespace used when a section does not override its source. */ + defaultNamespace: string + sources: Record + } +} + +export const cmsConfig: CmsConfig = { + template: 'default', + theme: 'default', + extensions: ['app-shell', 'markdown-sync'], + content: { + defaultNamespace: 'homepage', + sources: { + homepage: { + type: 'filesystem', + root: 'cms/content/homepage', + }, + docs: { + type: 'filesystem', + root: 'cms/content/docs', + }, + marketing: { + type: 'git', + root: 'cms/content/marketing', + repository: 'git@github.com:example/xcontrol-marketing.git', + ref: 'main', + }, + }, + }, +} + +export type { CmsConfig } diff --git a/dashboard/cms/content/ContentContext.tsx b/dashboard/cms/content/ContentContext.tsx new file mode 100644 index 0000000..a719dd9 --- /dev/null +++ b/dashboard/cms/content/ContentContext.tsx @@ -0,0 +1,26 @@ +'use client' + +import { createContext, type ReactNode, useContext, useMemo } from 'react' + +import { listContentSourcesMetadata } from '..' + +type ContentSourceState = { + namespace: string + type: 'filesystem' | 'git' + repository?: string + ref?: string +} + +const MarkdownContentContext = createContext([]) + +export function MarkdownContentProvider({ children }: { children: ReactNode }) { + const sources = useMemo(() => { + return listContentSourcesMetadata() + }, []) + + return {children} +} + +export function useMarkdownSources() { + return useContext(MarkdownContentContext) +} diff --git a/ui/homepage/content/getting-started.md b/dashboard/cms/content/getting-started.md similarity index 100% rename from ui/homepage/content/getting-started.md rename to dashboard/cms/content/getting-started.md diff --git a/ui/homepage/lib/homepageContent.ts b/dashboard/cms/content/homepage.ts similarity index 97% rename from ui/homepage/lib/homepageContent.ts rename to dashboard/cms/content/homepage.ts index d76ea71..d3019c6 100644 --- a/ui/homepage/lib/homepageContent.ts +++ b/dashboard/cms/content/homepage.ts @@ -1,7 +1,8 @@ import { promises as fs } from 'fs' import path from 'path' -import { readMarkdownDirectory, readMarkdownFile } from './markdown' +import { readMarkdownDirectory, readMarkdownFile } from '../../lib/markdown' +import { resolveContentSource } from './source' export interface HeroContent { eyebrow?: string @@ -71,7 +72,7 @@ export interface ContactPanelContent { items: ContactItemContent[] } -const HOMEPAGE_CONTENT_ROOT = path.join(process.cwd(), 'content', 'homepage') +const { absolutePath: HOMEPAGE_CONTENT_ROOT } = resolveContentSource('homepage') function ensureString(value: unknown): string | undefined { if (typeof value === 'string') { diff --git a/ui/homepage/content/homepage/contact/items/newsletter.md b/dashboard/cms/content/homepage/contact/items/newsletter.md similarity index 100% rename from ui/homepage/content/homepage/contact/items/newsletter.md rename to dashboard/cms/content/homepage/contact/items/newsletter.md diff --git a/ui/homepage/content/homepage/contact/items/support.md b/dashboard/cms/content/homepage/contact/items/support.md similarity index 100% rename from ui/homepage/content/homepage/contact/items/support.md rename to dashboard/cms/content/homepage/contact/items/support.md diff --git a/ui/homepage/content/homepage/contact/items/wechat-group.md b/dashboard/cms/content/homepage/contact/items/wechat-group.md similarity index 100% rename from ui/homepage/content/homepage/contact/items/wechat-group.md rename to dashboard/cms/content/homepage/contact/items/wechat-group.md diff --git a/ui/homepage/content/homepage/contact/items/wechat-official.md b/dashboard/cms/content/homepage/contact/items/wechat-official.md similarity index 100% rename from ui/homepage/content/homepage/contact/items/wechat-official.md rename to dashboard/cms/content/homepage/contact/items/wechat-official.md diff --git a/ui/homepage/content/homepage/contact/panel.md b/dashboard/cms/content/homepage/contact/panel.md similarity index 100% rename from ui/homepage/content/homepage/contact/panel.md rename to dashboard/cms/content/homepage/contact/panel.md diff --git a/ui/homepage/content/homepage/hero.md b/dashboard/cms/content/homepage/hero.md similarity index 100% rename from ui/homepage/content/homepage/hero.md rename to dashboard/cms/content/homepage/hero.md diff --git a/ui/homepage/content/homepage/posts/2024-07-12-community-events.md b/dashboard/cms/content/homepage/posts/2024-07-12-community-events.md similarity index 100% rename from ui/homepage/content/homepage/posts/2024-07-12-community-events.md rename to dashboard/cms/content/homepage/posts/2024-07-12-community-events.md diff --git a/ui/homepage/content/homepage/posts/2024-07-30-observability-insight.md b/dashboard/cms/content/homepage/posts/2024-07-30-observability-insight.md similarity index 100% rename from ui/homepage/content/homepage/posts/2024-07-30-observability-insight.md rename to dashboard/cms/content/homepage/posts/2024-07-30-observability-insight.md diff --git a/ui/homepage/content/homepage/posts/2024-08-15-release-notes.md b/dashboard/cms/content/homepage/posts/2024-08-15-release-notes.md similarity index 100% rename from ui/homepage/content/homepage/posts/2024-08-15-release-notes.md rename to dashboard/cms/content/homepage/posts/2024-08-15-release-notes.md diff --git a/ui/homepage/content/homepage/sidebar/community.md b/dashboard/cms/content/homepage/sidebar/community.md similarity index 100% rename from ui/homepage/content/homepage/sidebar/community.md rename to dashboard/cms/content/homepage/sidebar/community.md diff --git a/ui/homepage/content/homepage/sidebar/newsletter.md b/dashboard/cms/content/homepage/sidebar/newsletter.md similarity index 100% rename from ui/homepage/content/homepage/sidebar/newsletter.md rename to dashboard/cms/content/homepage/sidebar/newsletter.md diff --git a/ui/homepage/content/homepage/sidebar/resources.md b/dashboard/cms/content/homepage/sidebar/resources.md similarity index 100% rename from ui/homepage/content/homepage/sidebar/resources.md rename to dashboard/cms/content/homepage/sidebar/resources.md diff --git a/ui/homepage/content/homepage/sidebar/tags.md b/dashboard/cms/content/homepage/sidebar/tags.md similarity index 100% rename from ui/homepage/content/homepage/sidebar/tags.md rename to dashboard/cms/content/homepage/sidebar/tags.md diff --git a/ui/homepage/content/homepage/solutions/xcloudflow.md b/dashboard/cms/content/homepage/solutions/xcloudflow.md similarity index 100% rename from ui/homepage/content/homepage/solutions/xcloudflow.md rename to dashboard/cms/content/homepage/solutions/xcloudflow.md diff --git a/ui/homepage/content/homepage/solutions/xcontrol.md b/dashboard/cms/content/homepage/solutions/xcontrol.md similarity index 100% rename from ui/homepage/content/homepage/solutions/xcontrol.md rename to dashboard/cms/content/homepage/solutions/xcontrol.md diff --git a/ui/homepage/content/homepage/solutions/xscopehub.md b/dashboard/cms/content/homepage/solutions/xscopehub.md similarity index 100% rename from ui/homepage/content/homepage/solutions/xscopehub.md rename to dashboard/cms/content/homepage/solutions/xscopehub.md diff --git a/ui/homepage/content/homepage/solutions/xstream.md b/dashboard/cms/content/homepage/solutions/xstream.md similarity index 100% rename from ui/homepage/content/homepage/solutions/xstream.md rename to dashboard/cms/content/homepage/solutions/xstream.md diff --git a/dashboard/cms/content/index.ts b/dashboard/cms/content/index.ts new file mode 100644 index 0000000..60685cb --- /dev/null +++ b/dashboard/cms/content/index.ts @@ -0,0 +1 @@ +export * from './homepage' diff --git a/dashboard/cms/content/source.ts b/dashboard/cms/content/source.ts new file mode 100644 index 0000000..77bb967 --- /dev/null +++ b/dashboard/cms/content/source.ts @@ -0,0 +1,38 @@ +import path from 'path' + +import { cmsConfig } from '../config' + +export interface ResolvedContentSource { + namespace: string + absolutePath: string + type: 'filesystem' | 'git' + repository?: string + ref?: string +} + +export function resolveContentSource(namespace?: string): ResolvedContentSource { + if (typeof window !== 'undefined') { + throw new Error('resolveContentSource can only be called on the server') + } + + const targetNamespace = namespace ?? cmsConfig.content.defaultNamespace + const source = cmsConfig.content.sources[targetNamespace] + if (!source) { + const fallbackRoot = path.join(process.cwd(), 'cms', 'content', targetNamespace) + return { + namespace: targetNamespace, + absolutePath: fallbackRoot, + type: 'filesystem', + } + } + + return { + namespace: targetNamespace, + absolutePath: path.isAbsolute(source.root) + ? source.root + : path.join(process.cwd(), source.root), + type: source.type, + repository: source.repository, + ref: source.ref, + } +} diff --git a/dashboard/cms/extensions/appShell.tsx b/dashboard/cms/extensions/appShell.tsx new file mode 100644 index 0000000..e5d9d26 --- /dev/null +++ b/dashboard/cms/extensions/appShell.tsx @@ -0,0 +1,23 @@ +import type { ReactNode } from 'react' + +import Footer from '@components/Footer' +import Navbar from '@components/Navbar' +import { AskAIButton } from '@components/AskAIButton' + +import type { CmsExtension } from '../types' + +function AppShellLayout({ children }: { children: ReactNode }) { + return ( + <> + + {children} +