feat(zero): admin panel section + site /zero page + autogen card
Admin (/admin/zero):
- new AdminZero with list, status filters, generate button (bucket + allow_dup)
- per-note actions: approve, edit inline, regenerate (bucket pick), skip,
'publish now' (approve + scheduled_at=now → runner picks up within 1m)
- config panel: toggle on/off, generate/approve/publish hour MSK, site URL base
- new pin 'Зеро' (☕) in AdminNav
Site (zeropost.ru):
- ZeroBlock — feed of last 3-6 Zero notes, rendered on home next to Серии
- /zero — full Zero notes list page with character bio block (avatar + bullets)
Autogen integration:
- ZeroAutogenCard on /admin/autogen — amber card with on/off, hour pickers,
'generate now' and last-3 preview, link to full section
Plumbing:
- lib/engine.js: listZeroNotes(), getZeroCharacter()
- app/admin/api/zero/[...path]/route.js: catch-all proxy with cookie auth
This commit is contained in:
@@ -221,6 +221,17 @@ export async function adminRequeueArticle(articleId) {
|
||||
return call(`/api/scheduled-posts/schedule-article/${articleId}`, { method: 'POST' });
|
||||
}
|
||||
|
||||
// ── Zero notes — публичный API для сайта (zeropost.ru/zero) ──────────────
|
||||
export async function listZeroNotes({ limit = 12, offset = 0 } = {}) {
|
||||
try { return (await call(`/api/zero/notes?limit=${limit}&offset=${offset}`, { cache: 'no-store' })).items || []; }
|
||||
catch { return []; }
|
||||
}
|
||||
|
||||
export async function getZeroCharacter() {
|
||||
try { return await call('/api/zero/character', { next: { revalidate: 3600 } }); }
|
||||
catch { return null; }
|
||||
}
|
||||
|
||||
// Главная страница — собранный набор секций
|
||||
export async function getHomeData() {
|
||||
return call('/api/articles/home');
|
||||
|
||||
Reference in New Issue
Block a user