6281dbfa5e
Merge Overview and Full Audit into a single dashboard page that always shows the skipped check count. Fix namespace link 404s by using Headlamp's Link component (which generates cluster-prefixed URLs) instead of raw react-router-dom Link. Add vitest unit tests for all polaris.ts utility functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
78 lines
1.7 KiB
TypeScript
78 lines
1.7 KiB
TypeScript
import {
|
|
registerPluginSettings,
|
|
registerRoute,
|
|
registerSidebarEntry,
|
|
} from '@kinvolk/headlamp-plugin/lib';
|
|
import React from 'react';
|
|
import { PolarisDataProvider } from './api/PolarisDataContext';
|
|
import DashboardView from './components/DashboardView';
|
|
import NamespaceDetailView from './components/NamespaceDetailView';
|
|
import NamespacesListView from './components/NamespacesListView';
|
|
import PolarisSettings from './components/PolarisSettings';
|
|
|
|
// --- Sidebar entries ---
|
|
|
|
registerSidebarEntry({
|
|
parent: null,
|
|
name: 'polaris',
|
|
label: 'Polaris',
|
|
url: '/polaris',
|
|
icon: 'mdi:shield-check',
|
|
});
|
|
|
|
registerSidebarEntry({
|
|
parent: 'polaris',
|
|
name: 'polaris-overview',
|
|
label: 'Overview',
|
|
url: '/polaris',
|
|
icon: 'mdi:view-dashboard',
|
|
});
|
|
|
|
registerSidebarEntry({
|
|
parent: 'polaris',
|
|
name: 'polaris-namespaces',
|
|
label: 'Namespaces',
|
|
url: '/polaris/namespaces',
|
|
icon: 'mdi:dns',
|
|
});
|
|
|
|
// --- Routes ---
|
|
|
|
registerRoute({
|
|
path: '/polaris',
|
|
sidebar: 'polaris-overview',
|
|
name: 'polaris',
|
|
exact: true,
|
|
component: () => (
|
|
<PolarisDataProvider>
|
|
<DashboardView />
|
|
</PolarisDataProvider>
|
|
),
|
|
});
|
|
|
|
registerRoute({
|
|
path: '/polaris/namespaces',
|
|
sidebar: 'polaris-namespaces',
|
|
name: 'polaris-namespaces',
|
|
exact: true,
|
|
component: () => (
|
|
<PolarisDataProvider>
|
|
<NamespacesListView />
|
|
</PolarisDataProvider>
|
|
),
|
|
});
|
|
|
|
registerRoute({
|
|
path: '/polaris/ns/:namespace',
|
|
sidebar: 'polaris-namespaces',
|
|
name: 'polaris-namespace',
|
|
exact: true,
|
|
component: () => (
|
|
<PolarisDataProvider>
|
|
<NamespaceDetailView />
|
|
</PolarisDataProvider>
|
|
),
|
|
});
|
|
|
|
registerPluginSettings('headlamp-polaris-plugin', PolarisSettings, true);
|