mirror of https://github.com/OpenVidu/openvidu.git
4.3 KiB
4.3 KiB
@openvidu-dashboard/ui
All the dashboard UI: shell, pages, services, building blocks, theme and icons. The CE application
(dashboard-ce/frontend/src) and the applications that extend it only compose it.
Composing an application
providers: [
provideZonelessChangeDetection(),
provideRouter(composeRoutes(DASHBOARD_ROUTES, APP_ROUTES)),
provideHttpClient(withInterceptors([...DASHBOARD_INTERCEPTORS])),
provideDashboard()
];
@use '@fontsource-variable/inter/index' as inter;
@use '@fontsource-variable/jetbrains-mono/index' as jetbrains-mono;
@use '@openvidu-dashboard/ui/styles' as ovd;
@include ovd.theme;
The application copies assets/ (logo, and the icon sprite unless it builds its own) to assets/ of its build and
runs scripts/icons.mjs build before building. icons.mjs build|check [--sprite <file>] [<icons.json>...] compiles and
checks the sprite of several manifests, each listing its icons and the sources directories that use them, so an
application adds its own manifest to the library one.
Extension points
- Routes.
DASHBOARD_ROUTESareDashboardRouteconfigs;composeRoutes(...configs)lets a later config replace any route by path (children merge by path) while keeping thedatakeys it does not set. A page of an extending application replaces a locked CE page by declaring the same path, e.g.{ path: '', children: [{ path: 'rooms', children: [{ path: ':roomSid', loadComponent: … }] }] }. The lockedtracks/:trackSidroute, outside the sidenav, is the one the global search opens for an exact track ID; an edition with track details replaces it. - Navigation metadata.
data.navigationis aNavigationMeta(label, icon, path, order,feature,liveCapable,rangeScoped, and on range-scoped routesretention, theGET /api/v1/inforetention of the page's data that the range picker warns about); orders leave gaps of 10 for new entries. Detail routes declaredata.page(PageMeta),data.breadcrumbanddata.entity.navigationEntries()derives the sidenav from the composed routes. - Feature flags.
FeatureServicereads the features ofGET /api/v1/info(InfoService);FeatureGatewithFeatureContentrenders its content only when the feature is enabled andProLockOverlayotherwise, without any request.FEATURE_COPYholds the lock texts. - Component seams. The library renders a lock while the feature is disabled, and the component an application
provides once it is enabled, loaded on first use:
ANALYTICS_PRO_CARDS: per slot of the Analytics PRO strip (quality,diagnostics,topRooms), aloadComponent()and the metrics and dimensions it adds to the page's combined requests. The card components injectAnalyticsPageContext(state, zone, refresh count, series, breakdowns, chart ranges and notes, CSV export, widen and retry) and render anovd-analytics-cardwithCardContent.ANALYTICS_SCOPE_SELECT(Analytics header) andROOMS_NODE_FILTER(Rooms filter bar): loaders of the node selects, which send their own scopes requests.OVERVIEW_NODES_CARD: the "By node" card of the Overview, givenoverview, the last overview response.
- Status styles.
provideStatusStyles()registers status domains beyond the CE ones ofovd-status-badge, with the styles ofSTATUS_FAMILY_STYLES. - Chart colours.
ChartColorsService.colors()resolves the theme's chart tokens;resolved(tokens)resolves an application's own custom properties under the applied scheme. - Injection tokens.
SEARCH_SOURCES(lists searched by the header),BROWSER_STORAGE(storage behindStorageService). Root services such asInfoServicecan be replaced with a provider. - Shell slots.
DashboardShellprojects[ovdBanner]content under the header, next to the migration, schema and connectivity banners. - Page helpers.
injectRefreshScheduler()registers a page loader with the header refresh control;EntityPreviewServicehands list rows to detail headers and breadcrumbs;QueryStateServiceandListStateServiceown the URL state and the range carried across pages. - Test support.
src/testing/(fixtures, harnesses, media queries, icons, the Analytics page harness and the unit test providers) is shared with the application specs as@openvidu-dashboard/ui/testingthrough tsconfigpaths.