openvidu-dashboard: the Analytics title names a node scope by its media node label

master
juancarmore 2026-11-04 12:24:17 +01:00
parent d1b3063b38
commit 8d808f63b6
2 changed files with 10 additions and 1 deletions

View File

@ -407,6 +407,14 @@ describe('AnalyticsPage', () => {
expect(text(identities?.querySelector('.chart-heading + .chart-note'))).toBe('per UTC day');
});
it('names a node scope in the title by its media node label', async () => {
const { element } = await open('/analytics?from=now-24h&to=now&tz=UTC&scope=node:media-node-10-0-1-23', [
'per-node-breakdown'
]);
expect(text(element.querySelector('h1'))).toBe('Analytics · media-node-10-0-1-23');
});
it('locks the PRO strip on CE without any PRO request', async () => {
const { requests, element, http } = await open('/analytics?from=now-24h&to=now&tz=UTC');
const locks = [...element.querySelectorAll('ovd-pro-lock-overlay')].map(text);

View File

@ -262,8 +262,9 @@ export class AnalyticsPage implements AnalyticsPageContext {
readonly mediaStats = computed(() => this.summary()?.mediaStats);
protected readonly mediaStatsTexts = RANGE_MEDIA_STATS;
/** "Analytics", or "Analytics · <media node label>" for a node scope. */
protected readonly title = computed(() =>
this.scope() === 'global' ? 'Analytics' : `Analytics · ${this.scope()}`
this.scope() === 'global' ? 'Analytics' : `Analytics · ${this.scope().replace(/^node:/, '')}`
);
/** Names what `auto` resolves to for the range, whatever value is selected. */
protected readonly autoLabel = computed(() => {