9da27f4186
Adds full plugin starter template including: - package.json with @kinvolk/headlamp-plugin devDependency and standard scripts - tsconfig.json extending headlamp plugin config - vitest.config.mts + vitest.setup.ts (jsdom, NODE_ENV=test, localStorage shim) - src/index.tsx: registers sidebar entry and route for ResourceListPage - src/components/ResourceListPage.tsx: placeholder CRD list view with TODO guide - src/components/ResourceListPage.test.tsx: example tests using vi.mock pattern - .github/workflows/ci.yaml: delegates to shared plugin-ci.yaml - .github/workflows/release.yaml: delegates to shared plugin-release.yaml - artifacthub-pkg.yml + artifacthub-repo.yml: ArtifactHub metadata with TODO markers - renovate.json: Mend Renovate config for weekly dependency updates - README.md: complete getting-started guide - CONTRIBUTING.md: local dev, code style, testing, PR process - LICENSE: Apache-2.0 Co-Authored-By: Paperclip <noreply@paperclip.ing>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
/**
|
|
* my-headlamp-plugin — entry point.
|
|
*
|
|
* Registers sidebar entries and routes for this Headlamp plugin.
|
|
* Replace the sidebar labels, URLs, and route component with your own.
|
|
*/
|
|
|
|
import { registerRoute, registerSidebarEntry } from '@kinvolk/headlamp-plugin/lib';
|
|
import React from 'react';
|
|
import ResourceListPage from './components/ResourceListPage';
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Sidebar entries
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// Top-level sidebar section (parent = null creates a new group in the nav)
|
|
registerSidebarEntry({
|
|
parent: null,
|
|
name: 'my-plugin',
|
|
label: 'My Plugin',
|
|
url: '/my-plugin',
|
|
icon: 'mdi:kubernetes',
|
|
});
|
|
|
|
// Child entry — shown nested under the parent section above
|
|
registerSidebarEntry({
|
|
parent: 'my-plugin',
|
|
name: 'my-plugin-list',
|
|
label: 'Resources',
|
|
url: '/my-plugin',
|
|
});
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Routes
|
|
// ---------------------------------------------------------------------------
|
|
|
|
registerRoute({
|
|
path: '/my-plugin',
|
|
sidebar: 'my-plugin-list',
|
|
name: 'my-plugin-list',
|
|
exact: true,
|
|
component: () => <ResourceListPage />,
|
|
});
|