The tailnet plugin — machines, users, pre-auth keys, access policy and device invites. Moved out of officerdev/platform, where it had lived in plugins/ since the plugin system was built. Until now this code existed in exactly one place: the platform repository. That made "gitignore the plugins directory" impossible to do safely, because untracking it would have left 49 files on a single disk with no remote. This repository is what makes that move safe. Same extraction as plugins/music before it: source only, no history. The platform's history still holds every commit that shaped this, and the SHAs cited across the codebase keep resolving — replaying it here would have created a second, divergent account of the same work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
13 lines
717 B
TypeScript
13 lines
717 B
TypeScript
import { useParams } from 'react-router';
|
|
import { DEFAULT_HEADSCALE_SECTION, isHeadscaleSection, type HeadscaleSectionId } from './shared';
|
|
|
|
// The URL is the source of truth for which section is open — not a panel channel. See docs/navigation-audit.md:
|
|
// selection held in a channel means the id lives only in an onClick closure, so the section can't be linked to,
|
|
// opened in a new tab, or reached with the back button. HeadscaleScreen redirects anything unrecognised, so the
|
|
// fallback here is only for the instant before that lands.
|
|
|
|
export function useHeadscaleSection(): HeadscaleSectionId {
|
|
const { section } = useParams();
|
|
return isHeadscaleSection(section) ? section : DEFAULT_HEADSCALE_SECTION;
|
|
}
|