Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Surface availability endpoints in infrastructure
rcourtman1460a069bc99
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.tsindex 392973f336..c4197fbace 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts+++ b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts@@ -96,9 +96,11 @@ describe('infrastructureSelectors', () => {it('normalizes and deduplicates resource sources', () => {const resource = makeResource(1, {- platformData: { sources: ['PVE', 'proxmox-pve', 'k8s', 'kubernetes', 'invalid'] },+ platformData: {+ sources: ['PVE', 'proxmox-pve', 'k8s', 'kubernetes', 'network-endpoint', 'invalid'],+ },});- expect(getResourceSources(resource)).toEqual(['proxmox-pve', 'kubernetes']);+ expect(getResourceSources(resource)).toEqual(['proxmox-pve', 'kubernetes', 'availability']);});it('collects available sources and statuses with deduplication', () => {@@ -108,10 +110,13 @@ describe('infrastructureSelectors', () => {const resources = [makeResource(1, { status: 'online', platformData: { sources: ['proxmox', 'pve'] } }),makeResource(2, { status: 'offline', platformData: { sources: ['docker', 'docker'] } }),+ makeResource(4, { status: 'online', platformData: { sources: ['availability'] } }),uppercaseStatus,];- expect(collectAvailableSources(resources)).toEqual(new Set(['proxmox-pve', 'docker']));+ expect(collectAvailableSources(resources)).toEqual(+ new Set(['proxmox-pve', 'docker', 'availability']),+ );expect(collectAvailableStatuses(resources)).toEqual(new Set(['online', 'offline']));});});diff --git a/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx b/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsxindex ebb4994459..11958edbf7 100644--- a/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx+++ b/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx@@ -31,10 +31,9 @@ const readinessBadgeClass =const searchInputClass ='h-10 w-full rounded-md border border-border bg-surface py-2 pl-9 pr-3 text-sm text-base-content outline-none transition-colors placeholder:text-muted focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20';-// Primary-path cards present the two onboarding journeys (API connection vs-// agent install) up front so users pick a path before scanning the per--// platform card grid. The grid below stays as a direct alternative for users-// who already know which platform they want.+// Primary-path cards present the main onboarding journeys up front so users+// pick a path before scanning the per-source card grid. The grid below stays+// as a direct alternative for users who already know which source they want.const primaryPathCardClass ='group flex h-full items-start gap-3 rounded-md border border-blue-200 bg-blue-50 p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950/40 dark:hover:bg-blue-900';@@ -51,16 +50,19 @@ const CARD_ICON: Record<InfrastructureSourcePickerItemId, Component<{ class?: stavailability: Activity,};-// Popular platforms shown by default. The rest are hidden behind 'Show more-// platforms' to keep the picker scannable at a glance and let users scroll-// to fewer cards before deciding. Search bypasses this split — searching-// for any platform surfaces it regardless of popular status.+const PRIMARY_PATH_PICKER_ITEM_IDS: ReadonlySet<InfrastructureSourcePickerItemId> = new Set([+ 'availability',+]);++// Popular sources shown by default. The rest are hidden behind 'Show more+// sources' to keep the picker scannable at a glance and let users scroll to+// fewer cards before deciding. Search bypasses this split, including source+// types already represented by a primary path.const POPULAR_PICKER_ITEM_IDS: ReadonlySet<InfrastructureSourcePickerItemId> = new Set(['pve','truenas','unraid','linux-host',- 'availability',]);const itemMatchesQuery = (item: InfrastructureSourcePickerItemPresentation, query: string) => {@@ -84,26 +86,30 @@ const itemMatchesQuery = (item: InfrastructureSourcePickerItemPresentation, querexport const InfrastructureSourcePicker: Component<InfrastructureSourcePickerProps> = (props) => {const [query, setQuery] = createSignal('');- const [showAllPlatforms, setShowAllPlatforms] = createSignal(false);+ const [showAllSources, setShowAllSources] = createSignal(false);const items = () => getInfrastructureSourcePickerItems();const normalizedQuery = createMemo(() => query().trim().toLowerCase());const matchedItems = createMemo(() =>items().filter((item) => itemMatchesQuery(item, normalizedQuery())),);- // When the user is searching, show every match regardless of popular- // status. Otherwise gate the long tail behind a 'Show more platforms'- // disclosure so the default scan is short.+ const catalogItems = createMemo(() => {+ if (normalizedQuery()) return matchedItems();+ return matchedItems().filter((item) => !PRIMARY_PATH_PICKER_ITEM_IDS.has(item.id));+ });+ // When the user is searching, show every match regardless of popular status.+ // Otherwise gate the long tail behind a 'Show more sources' disclosure so+ // the default scan is short.const visibleItems = createMemo(() => {- if (normalizedQuery() || showAllPlatforms()) return matchedItems();- return matchedItems().filter((item) => POPULAR_PICKER_ITEM_IDS.has(item.id));+ if (normalizedQuery() || showAllSources()) return catalogItems();+ return catalogItems().filter((item) => POPULAR_PICKER_ITEM_IDS.has(item.id));});const hiddenCount = createMemo(() =>- normalizedQuery() || showAllPlatforms()+ normalizedQuery() || showAllSources()? 0- : matchedItems().filter((item) => !POPULAR_PICKER_ITEM_IDS.has(item.id)).length,+ : catalogItems().filter((item) => !POPULAR_PICKER_ITEM_IDS.has(item.id)).length,);const heading = createMemo(() =>- normalizedQuery() ? 'Matching choices' : 'Or pick a specific platform',+ normalizedQuery() ? 'Matching choices' : 'Or pick a specific source',);return (@@ -111,9 +117,13 @@ export const InfrastructureSourcePicker: Component<InfrastructureSourcePickerPro<Show when={!normalizedQuery()}><section class="space-y-2"><h3 class="text-sm font-semibold text-base-content">Choose how Pulse should connect</h3>- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2">+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3"><Show when={props.onDetectApiPlatform}>- <button type="button" onClick={props.onDetectApiPlatform} class={primaryPathCardClass}>+ <button+ type="button"+ onClick={props.onDetectApiPlatform}+ class={primaryPathCardClass}+ ><divaria-hidden="true"class="flex h-10 w-10 flex-none items-center justify-center rounded-md border border-blue-200 bg-blue-100 text-blue-700 dark:border-blue-800 dark:bg-blue-900 dark:text-blue-200"@@ -129,6 +139,25 @@ export const InfrastructureSourcePicker: Component<InfrastructureSourcePickerPro</div></button></Show>+ <button+ type="button"+ onClick={() => props.onSelectStep('availability')}+ class={primaryPathCardClass}+ >+ <div+ aria-hidden="true"+ class="flex h-10 w-10 flex-none items-center justify-center rounded-md border border-blue-200 bg-blue-100 text-blue-700 dark:border-blue-800 dark:bg-blue-900 dark:text-blue-200"+ >+ <Activity class="h-5 w-5" />+ </div>+ <div class="min-w-0 flex-1 space-y-1">+ <div class="text-sm font-semibold text-base-content">Monitor network endpoint</div>+ <p class="text-xs leading-5 text-muted">+ Use ICMP ping, TCP port, or HTTP checks for devices and services that cannot run+ the agent.+ </p>+ </div>+ </button><buttontype="button"onClick={() => props.onSelectStep('linux-host')}@@ -164,7 +193,7 @@ export const InfrastructureSourcePicker: Component<InfrastructureSourcePickerProvalue={query()}onInput={(event) => setQuery(event.currentTarget.value)}class={searchInputClass}- placeholder="Search platforms, hosts, services..."+ placeholder="Search sources, devices, services..."/></label></div>@@ -224,10 +253,10 @@ export const InfrastructureSourcePicker: Component<InfrastructureSourcePickerPro<Show when={hiddenCount() > 0}><buttontype="button"- onClick={() => setShowAllPlatforms(true)}+ onClick={() => setShowAllSources(true)}class="mt-1 inline-flex items-center text-xs font-medium text-blue-700 hover:text-blue-900 hover:underline dark:text-blue-300 dark:hover:text-blue-100">- Show {hiddenCount()} more platform{hiddenCount() === 1 ? '' : 's'}+ Show {hiddenCount()} more source{hiddenCount() === 1 ? '' : 's'}</button></Show></Show>diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureSourcePicker.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureSourcePicker.test.tsxindex d26a1ed1a6..23e9675e7e 100644--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureSourcePicker.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureSourcePicker.test.tsx@@ -10,16 +10,17 @@ describe('InfrastructureSourcePicker', () => {it('labels admitted VMware as Preview and keeps Pulse Agent on the host profile path', () => {render(() => <InfrastructureSourcePicker onSelectStep={vi.fn()} />);- expect(screen.getByPlaceholderText('Search platforms, hosts, services...')).toBeInTheDocument();- // Picker now leads with the two primary paths (API detect / agent- // install); the per-platform card grid below is framed as the+ expect(screen.getByPlaceholderText('Search sources, devices, services...')).toBeInTheDocument();+ // Picker now leads with the primary paths (API detect / endpoint probe /+ // agent install); the per-source card grid below is framed as the// alternative.expect(screen.getByText('Choose how Pulse should connect')).toBeInTheDocument();- expect(screen.getByText('Or pick a specific platform')).toBeInTheDocument();- // VMware lives behind 'Show more platforms' since it is a less common+ expect(screen.getByRole('button', { name: /Monitor network endpoint/i })).toBeInTheDocument();+ expect(screen.getByText('Or pick a specific source')).toBeInTheDocument();+ // VMware lives behind 'Show more sources' since it is a less common// homelab choice; expand the long tail to verify the Preview badge still// renders for it.- fireEvent.click(screen.getByRole('button', { name: /Show \d+ more platforms?/i }));+ fireEvent.click(screen.getByRole('button', { name: /Show \d+ more sources?/i }));expect(screen.getByText('Preview')).toBeInTheDocument();expect(screen.queryByText('Available now')).toBeNull();expect(screen.getByText('Unraid')).toBeInTheDocument();@@ -41,12 +42,15 @@ describe('InfrastructureSourcePicker', () => {expect(trueNasButton).not.toBeNull();fireEvent.click(trueNasButton!);expect(onSelectStep).toHaveBeenLastCalledWith('truenas');++ fireEvent.click(screen.getByRole('button', { name: /Monitor network endpoint/i }));+ expect(onSelectStep).toHaveBeenLastCalledWith('availability');});it('filters the catalog by user-recognizable names and aliases', () => {render(() => <InfrastructureSourcePicker onSelectStep={vi.fn()} />);- fireEvent.input(screen.getByPlaceholderText('Search platforms, hosts, services...'), {+ fireEvent.input(screen.getByPlaceholderText('Search sources, devices, services...'), {target: { value: 'nas' },});@@ -54,5 +58,11 @@ describe('InfrastructureSourcePicker', () => {expect(screen.getByText('TrueNAS SCALE')).toBeInTheDocument();expect(screen.getByText('Unraid')).toBeInTheDocument();expect(screen.queryByText('VMware vCenter')).toBeNull();++ fireEvent.input(screen.getByPlaceholderText('Search sources, devices, services...'), {+ target: { value: 'mqtt' },+ });++ expect(screen.getByText('Network endpoint')).toBeInTheDocument();});});diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsxindex 5ad06fbe0e..381f53e66c 100644--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx@@ -293,9 +293,7 @@ describe('InfrastructureWorkspace', () => {// Row-level 'Install agent' surfaces per system that has API coverage// but no Pulse Agent yet. The fixture has one such system, so at least// one of these buttons should exist.- expect(- screen.getAllByRole('button', { name: /^Install agent$/i }).length,- ).toBeGreaterThan(0);+ expect(screen.getAllByRole('button', { name: /^Install agent$/i }).length).toBeGreaterThan(0);const readiness = screen.getByRole('region', {name: /Infrastructure setup summary/i,});@@ -634,11 +632,16 @@ describe('InfrastructureWorkspace', () => {screen.getByText('Choose the system, platform, host, or service you want Pulse to monitor.'),).toBeInTheDocument();expect(- within(dialog).getByPlaceholderText('Search platforms, hosts, services...'),+ within(dialog).getByPlaceholderText('Search sources, devices, services...'),+ ).toBeInTheDocument();+ expect(+ within(dialog).getByRole('button', { name: /Detect API platform/i }),+ ).toBeInTheDocument();+ expect(+ within(dialog).getByRole('button', { name: /Monitor network endpoint/i }),).toBeInTheDocument();- expect(within(dialog).getByRole('button', { name: /Detect API platform/i })).toBeInTheDocument();expect(within(dialog).getByText('Choose how Pulse should connect')).toBeInTheDocument();- expect(within(dialog).getByText('Or pick a specific platform')).toBeInTheDocument();+ expect(within(dialog).getByText('Or pick a specific source')).toBeInTheDocument();expect(within(dialog).queryByText('Agent telemetry')).toBeNull();expect(within(dialog).queryByText('API inventory')).toBeNull();expect(within(dialog).getByRole('button', { name: /TrueNAS SCALE/i })).toBeInTheDocument();diff --git a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.tsindex 62f26fd7f5..b924f3b0a8 100644--- a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts+++ b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts@@ -32,20 +32,33 @@ describe('infrastructurePageModel', () => {status: 'degraded',platformData: { sources: ['proxmox'] },}),+ makeResource({+ id: 'resource-3',+ type: 'network-endpoint',+ platformType: 'availability',+ status: 'offline',+ platformData: { sources: ['availability'] },+ }),];const derivation = buildInfrastructurePageFilterDerivation(resources, '', '', '');- expect(Array.from(derivation.availableSources)).toEqual(['agent', 'proxmox-pve']);+ expect(Array.from(derivation.availableSources)).toEqual([+ 'agent',+ 'proxmox-pve',+ 'availability',+ ]);// sourceOptions follow DEFAULT_INFRASTRUCTURE_SOURCE_ORDER from the- // platform manifest: agent, truenas, proxmox-pve, ...+ // source contract: agent, availability, truenas, proxmox-pve, ...expect(derivation.sourceOptions).toEqual([{ key: 'agent', label: 'Agent' },+ { key: 'availability', label: 'Availability' },{ key: 'proxmox-pve', label: 'PVE' },]);expect(derivation.statusOptions).toEqual([{ key: 'online', label: 'Online' },{ key: 'degraded', label: 'Degraded' },+ { key: 'offline', label: 'Offline' },]);expect(derivation.activeFilterCount).toBe(0);expect(derivation.hasActiveFilters).toBe(false);@@ -84,12 +97,7 @@ describe('infrastructurePageModel', () => {});it('reports an empty filtered result without losing the active-filter signal', () => {- const derivation = buildInfrastructurePageFilterDerivation(- [makeResource()],- '',- 'offline',- '',- );+ const derivation = buildInfrastructurePageFilterDerivation([makeResource()], '', 'offline', '');expect(derivation.activeFilterCount).toBe(1);expect(derivation.hasActiveFilters).toBe(true);@@ -145,4 +153,29 @@ describe('infrastructurePageModel', () => {]);expect(derivation.hasFilteredResources).toBe(true);});++ it('normalizes availability sources into the infrastructure source filter', () => {+ const derivation = buildInfrastructurePageFilterDerivation(+ [+ makeResource({+ id: 'resource-availability-1',+ displayName: 'MQTT power meter',+ type: 'network-endpoint',+ platformType: 'availability',+ sourceType: 'api',+ platformData: { sources: ['network-endpoint'] },+ }),+ ],+ 'availability',+ '',+ '',+ );++ expect(Array.from(derivation.availableSources)).toEqual(['availability']);+ expect(derivation.sourceOptions).toEqual([{ key: 'availability', label: 'Availability' }]);+ expect(derivation.filteredResources.map((resource) => resource.id)).toEqual([+ 'resource-availability-1',+ ]);+ expect(derivation.hasFilteredResources).toBe(true);+ });});diff --git a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.tsindex 1a09028043..d590444d12 100644--- a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts+++ b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.test.ts@@ -7,8 +7,9 @@ import {describe('sourcePlatformOptions', () => {it('orders canonical source platform keys with preferred source ordering', () => {- expect(orderSourcePlatformKeys(['truenas', 'pbs', 'agent', 'docker'])).toEqual([+ expect(orderSourcePlatformKeys(['truenas', 'pbs', 'availability', 'agent', 'docker'])).toEqual(['agent',+ 'availability','truenas','proxmox-pbs','docker',@@ -21,24 +22,31 @@ describe('sourcePlatformOptions', () => {{ key: 'proxmox-pbs', label: 'PBS' },{ key: 'custom-source', label: 'Custom Source' },]);+ expect(buildSourcePlatformOptions(['network-endpoint'])).toEqual([+ { key: 'availability', label: 'Availability' },+ ]);});it('exports the default infrastructure source options in canonical order', () => {expect(DEFAULT_INFRASTRUCTURE_SOURCE_OPTIONS.map((option) => option.key)).toEqual(['agent',+ 'availability','truenas','proxmox-pve','proxmox-pbs','proxmox-pmg','docker','kubernetes',+ 'vmware-vsphere',]);});it('keeps the Docker runtime discoverable in customer-facing source options', () => {- expect(DEFAULT_INFRASTRUCTURE_SOURCE_OPTIONS.find((option) => option.key === 'docker')).toEqual({- key: 'docker',- label: 'Docker / Podman',- });+ expect(DEFAULT_INFRASTRUCTURE_SOURCE_OPTIONS.find((option) => option.key === 'docker')).toEqual(+ {+ key: 'docker',+ label: 'Docker / Podman',+ },+ );});});diff --git a/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts b/frontend-modern/src/utils/__tests__/sourcePlatforms.test.tsindex cfba3f03a5..d63e3d01d1 100644--- a/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts+++ b/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts@@ -37,6 +37,7 @@ describe('sourcePlatforms', () => {expect(normalizeSourcePlatformKey('pbs')).toBe('proxmox-pbs');expect(normalizeSourcePlatformKey('pmg')).toBe('proxmox-pmg');expect(normalizeSourcePlatformKey('k8s')).toBe('kubernetes');+ expect(normalizeSourcePlatformKey('network-endpoint')).toBe('availability');});});@@ -45,6 +46,9 @@ describe('sourcePlatforms', () => {expect(getSourcePlatformPresentation('proxmox-pve')).toMatchObject({ label: 'PVE' });expect(getSourcePlatformPresentation('proxmox-pbs')).toMatchObject({ label: 'PBS' });expect(getSourcePlatformPresentation('agent')).toMatchObject({ label: 'Agent' });+ expect(getSourcePlatformPresentation('availability')).toMatchObject({+ label: 'Availability',+ });expect(getSourcePlatformPresentation('agent')?.tone).toContain('emerald');});@@ -66,6 +70,7 @@ describe('sourcePlatforms', () => {it('returns label for known platforms', () => {expect(getSourcePlatformLabel('docker')).toBe('Docker / Podman');expect(getSourcePlatformLabel('kubernetes')).toBe('K8s');+ expect(getSourcePlatformLabel('availability')).toBe('Availability');});it('returns canonical labels for normalized aliases', () => {@@ -86,6 +91,7 @@ describe('sourcePlatforms', () => {it('canonicalizes query values while preserving all and unknown tokens', () => {expect(normalizeSourcePlatformQueryValue('pve')).toBe('proxmox-pve');expect(normalizeSourcePlatformQueryValue('pbs')).toBe('proxmox-pbs');+ expect(normalizeSourcePlatformQueryValue('endpoint')).toBe('availability');expect(normalizeSourcePlatformQueryValue(' all ')).toBe('all');expect(normalizeSourcePlatformQueryValue('custom-platform')).toBe('custom-platform');expect(normalizeSourcePlatformQueryValue('')).toBe('');@@ -164,7 +170,12 @@ describe('sourcePlatforms', () => {it('keeps VMware on the admitted vCenter-backed floor until live proof lands', () => {expect(ADMITTED_PLATFORM_IDS).toEqual(['vmware-vsphere']);expect(getSourcePlatformReadinessStage('vmware')).toBe('first-lab-ready');- expect(getSourcePlatformCanonicalProjections('vmware')).toEqual(['agent', 'vm', 'storage']);+ expect(getSourcePlatformCanonicalProjections('vmware')).toEqual([+ 'agent',+ 'vm',+ 'storage',+ 'network',+ ]);expect(getSourcePlatformSupportFloor('vmware')).toMatchObject({setup: 'supported',visibility: 'supported',diff --git a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts b/frontend-modern/src/utils/infrastructureOnboardingPresentation.tsindex 8664595835..4087e60f73 100644--- a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts+++ b/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts@@ -247,7 +247,19 @@ const PRODUCT_PRESENTATION: Record<bestFor: 'Devices that expose ICMP, TCP, or HTTP but cannot run Pulse Agent',coverage: 'Agentless availability checks and downtime alerts',catalogDescription: 'Ping, TCP port, and HTTP availability checks',- searchAliases: ['ping', 'tcp', 'http', 'endpoint', 'website', 'ip address'],+ searchAliases: [+ 'ping',+ 'icmp',+ 'tcp',+ 'http',+ 'endpoint',+ 'probe',+ 'port',+ 'website',+ 'ip address',+ 'mqtt',+ 'esphome',+ ],sourceStrategy: 'probe',autoDetect: false,primaryMode: 'api-backed',@@ -304,7 +316,8 @@ const AGENT_CATALOG_ITEMS: Record<routeStep: 'docker',label: 'Docker',bestFor: 'Docker hosts where containers should be discovered from the machine running them.',- coverage: 'Docker inventory plus host CPU, memory, disk, network, services, and SMART telemetry',+ coverage:+ 'Docker inventory plus host CPU, memory, disk, network, services, and SMART telemetry',catalogDescription: 'Containers plus host telemetry',searchAliases: ['containers', 'container host', 'compose'],sourceStrategy: 'agent',@@ -517,8 +530,9 @@ export const getInfrastructureApiProductsByGovernanceState = ((product) => product.governanceState === governanceState,);-export const getInfrastructureSourcePickerItems = (): InfrastructureSourcePickerItemPresentation[] =>- SOURCE_PICKER_ITEM_ORDER.map((id) => getInfrastructureSourcePickerItemPresentation(id));+export const getInfrastructureSourcePickerItems =+ (): InfrastructureSourcePickerItemPresentation[] =>+ SOURCE_PICKER_ITEM_ORDER.map((id) => getInfrastructureSourcePickerItemPresentation(id));export const getInfrastructureAutoDetectLabels = (): string[] =>getInfrastructureApiProductPresentations()diff --git a/frontend-modern/src/utils/sourcePlatformOptions.ts b/frontend-modern/src/utils/sourcePlatformOptions.tsindex edd275630e..1c179a8e98 100644--- a/frontend-modern/src/utils/sourcePlatformOptions.ts+++ b/frontend-modern/src/utils/sourcePlatformOptions.ts@@ -6,7 +6,11 @@ export interface SourcePlatformOption {label: string;}-const DEFAULT_SOURCE_PLATFORM_ORDER = DEFAULT_INFRASTRUCTURE_SOURCE_ORDER;+const DEFAULT_SOURCE_PLATFORM_ORDER = [+ 'agent',+ 'availability',+ ...DEFAULT_INFRASTRUCTURE_SOURCE_ORDER.filter((key) => key !== 'agent'),+];export const orderSourcePlatformKeys = (keys: Iterable<string>,diff --git a/frontend-modern/src/utils/sourcePlatforms.ts b/frontend-modern/src/utils/sourcePlatforms.tsindex 633a612ed7..5f966ad9c2 100644--- a/frontend-modern/src/utils/sourcePlatforms.ts+++ b/frontend-modern/src/utils/sourcePlatforms.ts@@ -10,7 +10,8 @@ import {import { titleCaseDelimitedLabel } from '@/utils/textPresentation';export type PresentationOnlySourcePlatform = (typeof PRESENTATION_ONLY_PLATFORM_IDS)[number];-export type KnownSourcePlatform = GeneratedKnownSourcePlatform;+export type ProviderSourcePlatform = 'availability';+export type KnownSourcePlatform = GeneratedKnownSourcePlatform | ProviderSourcePlatform;export interface SourcePlatformPresentation {label: string;@@ -29,16 +30,30 @@ export interface SourcePlatformFlags {}export const SOURCE_PLATFORM_PRESENTATION: Record<KnownSourcePlatform, SourcePlatformPresentation> =- GENERATED_SOURCE_PLATFORM_PRESENTATION as Record<KnownSourcePlatform, SourcePlatformPresentation>;--export const KNOWN_SOURCE_PLATFORM_KEYS =- GENERATED_KNOWN_SOURCE_PLATFORM_KEYS as readonly KnownSourcePlatform[];+ {+ ...GENERATED_SOURCE_PLATFORM_PRESENTATION,+ availability: {+ label: 'Availability',+ tone: 'bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300',+ },+ } as Record<KnownSourcePlatform, SourcePlatformPresentation>;++export const KNOWN_SOURCE_PLATFORM_KEYS = [+ ...GENERATED_KNOWN_SOURCE_PLATFORM_KEYS,+ 'availability',+] as readonly KnownSourcePlatform[];const PLATFORM_ALIASES = SOURCE_PLATFORM_ALIAS_MAP as Record<string,Exclude<KnownSourcePlatform, 'generic'>>;+const SOURCE_PROVIDER_ALIASES: Record<string, ProviderSourcePlatform> = {+ 'availability-probe': 'availability',+ endpoint: 'availability',+ 'network-endpoint': 'availability',+};+export const normalizeSourcePlatformKey = (value: string | null | undefined,): KnownSourcePlatform | null => {@@ -50,6 +65,9 @@ export const normalizeSourcePlatformKey = (if (Object.prototype.hasOwnProperty.call(PLATFORM_ALIASES, normalized)) {return PLATFORM_ALIASES[normalized];}+ if (Object.prototype.hasOwnProperty.call(SOURCE_PROVIDER_ALIASES, normalized)) {+ return SOURCE_PROVIDER_ALIASES[normalized];+ }return null;};@@ -158,7 +176,7 @@ const hasGenericSource = (sources?: string[]): boolean =>);const hasAvailabilitySource = (sources?: string[]): boolean =>- Boolean(sources?.some((source) => source.trim().toLowerCase() === 'availability'));+ Boolean(sources?.some((source) => normalizeSourcePlatformKey(source) === 'availability'));export const resolvePlatformTypeFromSources = (sources?: string[]): PlatformType | undefined => {const flags = readSourcePlatformFlags(sources);