Admin → Diagnostics reads the server's stored log: one list, newest first, where a line opens in place to its full record (time, source and logger, account, request and job ids, version, message, attributes, stack). A request or job id narrows the list to that request or job with every other filter off, shown as a removable chip. Filters: level group, source, account, event, period and a free-text search; all of them live in the URL (`l*` keys, which setPage clears like the Plex and Channels keys), so a filtered view is a link and Back restores it. "Live" re-reads the newest page every few seconds while the tab is visible; paging into older rows turns it off. Copy puts the loaded lines on the clipboard as JSON lines. The facet counts now honour every filter but their own, as the feed's do: a request pivot narrows them, and a picked level does not zero its siblings. A value in use stays offered even when the counts drop it. "Saját napló" and the console draw a line with one shared component, `LogLine`, whose phone layout gives the message its own full-width line (sharing the code's line left it a few characters). The level groups moved to lib/log.ts for both. The console's own reads are logged at DEBUG on success, like the healthcheck: at INFO its live tail filled the log with itself.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { pageTitleKey } from "./pageMeta";
|
|
import type { Page } from "./urlState";
|
|
|
|
// pageTitleKey now derives from the ModuleDef registry (titleKey ?? labelKey). These are the exact
|
|
// browser-tab title keys the old hand-written switch produced — pin every page so a future labelKey
|
|
// rename (or a dropped titleKey) can't silently change a tab title.
|
|
const EXPECTED: Record<Page, string> = {
|
|
home: "home.title",
|
|
feed: "header.account.feed",
|
|
channels: "header.channelManager",
|
|
playlists: "header.account.playlists",
|
|
notifications: "inbox.navLabel",
|
|
messages: "messages.navLabel",
|
|
downloads: "downloads.navLabel",
|
|
stats: "header.usageStats",
|
|
plex: "plex.navLabel",
|
|
scheduler: "header.scheduler",
|
|
config: "header.configuration",
|
|
users: "header.users",
|
|
audit: "audit.title",
|
|
logs: "adminLogs.title",
|
|
settings: "settings.title",
|
|
};
|
|
|
|
describe("pageTitleKey", () => {
|
|
it("returns the exact title key for every page (registry-derived)", () => {
|
|
for (const [page, key] of Object.entries(EXPECTED)) {
|
|
expect(pageTitleKey(page as Page)).toBe(key);
|
|
}
|
|
});
|
|
});
|