|
|
|
@@ -4,27 +4,30 @@ dir: frontend/src/integrations
|
|
|
|
|
index: frontend/src/integrations/.pi-map.index.md
|
|
|
|
|
|
|
|
|
|
## role
|
|
|
|
|
Frontend integration layer that maps backend service types and widgets to their corresponding React components, metadata, and configuration schemas.
|
|
|
|
|
Central registry and integration layer that maps external services and built-in widgets to their React components, metadata, and navigation entries.
|
|
|
|
|
## files
|
|
|
|
|
- registry.test.ts | Tests the service and widget registry module, verifying correct service registrations, widget bindings, and widget resolution logic. | dep: vitest, ./registry, ../types
|
|
|
|
|
- registry.ts | Defines a frontend registry mapping service types and built-in widgets to their React components, metadata, and config schemas, with a resolver to look up widgets by instance. | exp: WidgetComponentProps, ServiceWidgetBinding, ServiceBinding, SERVICE_REGISTRY, BUILTIN_WIDGETS, ResolvedWidget, func:getServiceBinding(serviceType: string) → ServiceBinding | undefined, func:getBuiltinBinding(kind: string) → ServiceWidgetBinding | undefined, func:resolveWidget(widget: WidgetInstance, services: ServiceInstance[]) → ResolvedWidget | undefined, call:services.find, call:getServiceBinding, call:binding?.widgets.find, call:getBuiltinBinding, func:enrichServiceTypes(types: ServiceTypeInfo[]) → ServiceTypeInfo[] | dep: react, ../widgets/AlertmanagerAlertsWidget, ../widgets/BackupsWidget, ../widgets/GrafanaLinkWidget, ../widgets/JellyfinWidget, ../widgets/PrometheusMetricWidget, ../widgets/SshTaskWidget, ../widgets/StaticWidget, ../types, AlertmanagerAlertsWidget, BackupsWidget, GrafanaLinkWidget, JellyfinWidget, PrometheusMetricWidget, SshTaskWidget, StaticWidget, types
|
|
|
|
|
- navEntries.ts | Defines a static mapping of service types to their navigation entries and provides a filter function to return only entries for currently configured services. | exp: NavEntry, SERVICE_TYPE_NAV_ENTRIES, func:configuredNavEntries(configuredTypes: Set<string>) → NavEntry[], call:SERVICE_TYPE_NAV_ENTRIES.filter, call:configuredTypes.has | dep: lucide-react
|
|
|
|
|
- registry.test.ts | Tests the service and widget registry module, validating service registrations, widget bindings, and widget resolution logic. | dep: vitest, ./registry, ../types
|
|
|
|
|
- registry.ts | Maps service types and built-in widgets to their respective React components, metadata, and config schemas, and provides lookup functions to resolve widget instances. | exp: WidgetComponentProps, ServiceWidgetBinding, ServiceBinding, SERVICE_REGISTRY, BUILTIN_WIDGETS, ResolvedWidget, func:getServiceBinding(serviceType: string) → ServiceBinding | undefined, func:getBuiltinBinding(kind: string) → ServiceWidgetBinding | undefined, func:resolveWidget(widget: WidgetInstance, services: ServiceInstance[]) → ResolvedWidget | undefined, call:services.find, call:getServiceBinding, call:binding?.widgets.find, call:getBuiltinBinding, func:enrichServiceTypes(types: ServiceTypeInfo[]) → ServiceTypeInfo[] | dep: react, ../widgets/AlertmanagerAlertsWidget, ../widgets/BackupsWidget, ../widgets/PrometheusChartWidget, ../widgets/PrometheusGaugeWidget, ../widgets/PrometheusMeanWidget, ../widgets/JellyfinWidget, ../widgets/JellyfinNowPlayingWidget, ../widgets/PrometheusMetricWidget, ../widgets/QbittorrentActiveTorrentsWidget, ../widgets/QbittorrentSpeedWidget, ../widgets/QbittorrentTotalsWidget, ../widgets/SshTaskWidget, ../widgets/StaticWidget, ../types, various widget components, types
|
|
|
|
|
## arch
|
|
|
|
|
Registry pattern implementing a centralized lookup dictionary with a resolver function to dynamically discover and instantiate the correct widget components based on service instances.
|
|
|
|
|
Registry pattern with static mappings, lookup/resolution functions, and filter utilities to dynamically expose only configured service integrations.
|
|
|
|
|
## tags
|
|
|
|
|
service, binding, widget, widgets, registry, types, builtin, get
|
|
|
|
|
service, widgets, widget, binding, nav, entries, types, registry
|
|
|
|
|
## symbols
|
|
|
|
|
- configuredNavEntries
|
|
|
|
|
- getServiceBinding
|
|
|
|
|
- getBuiltinBinding
|
|
|
|
|
- resolveWidget
|
|
|
|
|
- enrichServiceTypes
|
|
|
|
|
- WidgetComponentProps
|
|
|
|
|
- ServiceWidgetBinding
|
|
|
|
|
- ServiceBinding
|
|
|
|
|
- SERVICE_REGISTRY
|
|
|
|
|
- NavEntry
|
|
|
|
|
- SERVICE_TYPE_NAV_ENTRIES
|
|
|
|
|
- call:SERVICE_TYPE_NAV_ENTRIES.filter
|
|
|
|
|
## workflows
|
|
|
|
|
- change integrations behavior
|
|
|
|
|
read: registry.ts
|
|
|
|
|
read: navEntries.ts, registry.ts
|
|
|
|
|
- update integrations tests
|
|
|
|
|
read: registry.test.ts
|
|
|
|
|
- explore integrations subdirectories
|
|
|
|
|
index: frontend/src/integrations/__tests__/.pi-map.index.md
|
|
|
|
|
## dirty
|
|
|
|
|
-
|
|
|
|
|