Some checks failed
Deploy / Deploy Production (push) Has been skipped
Deploy / Cleanup Preview (push) Has been skipped
Deploy / Deploy Preview (push) Failing after 1s
CI / UI / Build (pull_request) Successful in 16s
CI / Scraper / Test (pull_request) Successful in 16s
CI / Scraper / Lint (pull_request) Successful in 19s
CI / Scraper / Build (pull_request) Successful in 16s
- Add /profile page with reading settings (voice, speed, auto-next) and password change form - Add /admin/scrape page showing scraping task history with live status polling and trigger controls - Add /admin/audio page showing audio cache entries with client-side search filter - Add changePassword(), listAudioCache(), listScrapingTasks() to pocketbase.ts - Add /api/admin/scrape and /api/browse-page server-side proxy routes - Replace browse page pagination with IntersectionObserver infinite scroll - Update nav: username becomes a /profile link; admin users see Scrape and Audio cache links
18 lines
489 B
TypeScript
18 lines
489 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
import { listAudioCache } from '$lib/server/pocketbase';
|
|
import { log } from '$lib/server/logger';
|
|
|
|
export const load: PageServerLoad = async ({ locals }) => {
|
|
if (locals.user?.role !== 'admin') {
|
|
redirect(302, '/');
|
|
}
|
|
|
|
const entries = await listAudioCache().catch((e) => {
|
|
log.warn('admin/audio', 'failed to load audio cache', { err: String(e) });
|
|
return [];
|
|
});
|
|
|
|
return { entries };
|
|
};
|