feat: admin UX overhaul — status filters, retry/cancel, mobile cards, i18n, shelf pre-populate
- Admin layout: SVG icons, active highlight, divider between nav sections - Scrape page: status filter pills with counts, text + status combined search - Audio page: status filter pills, cancel jobs, retry failed jobs, mobile cards for cache tab - Translation page: status filter pills (incl. cancelled), cancel + retry jobs, mobile cancel/retry cards, i18n for all labels - AI Jobs page: fix concurrent cancel (Set instead of single slot), per-job cancel errors inline, full mobile card layout, i18n title/heading - Text-gen page: tagline editable input + copy, warnings copy, i18n title/heading - Book page: chapter cover Save button, audio monitor link, currentShelf pre-populated from server - pocketbase.ts: add getBookShelf(), shelf field on UserLibraryEntry - New API route: POST /api/admin/translation/bulk (proxy for translation retry) - i18n: 15 new admin_translation_*, admin_ai_jobs_*, admin_text_gen_* keys across all 5 locales
This commit is contained in:
@@ -646,6 +646,7 @@ export interface UserLibraryEntry {
|
||||
user_id?: string;
|
||||
slug: string;
|
||||
saved_at: string;
|
||||
shelf?: string;
|
||||
}
|
||||
|
||||
function libraryFilter(sessionId: string, userId?: string): string {
|
||||
@@ -675,6 +676,19 @@ export async function isBookSaved(
|
||||
return row !== null;
|
||||
}
|
||||
|
||||
/** Returns the shelf the user has placed this book on, or '' if not saved / no shelf set. */
|
||||
export async function getBookShelf(
|
||||
sessionId: string,
|
||||
slug: string,
|
||||
userId?: string
|
||||
): Promise<ShelfName> {
|
||||
const filter = userId
|
||||
? `user_id="${userId}"&&slug="${slug}"`
|
||||
: `session_id="${sessionId}"&&slug="${slug}"`;
|
||||
const row = await listOne<UserLibraryEntry>('user_library', filter).catch(() => null);
|
||||
return (row?.shelf as ShelfName) || '';
|
||||
}
|
||||
|
||||
/** Save a book to the user's library. No-op if already saved. */
|
||||
export async function saveBook(
|
||||
sessionId: string,
|
||||
|
||||
Reference in New Issue
Block a user