App Nuxt 3 + Nuxt UI qui lit les projets du CMS Grav et compose des portfolios A3 paysage exportés en PDF (gabarit book_v3) : composeur WYSIWYG, templates cover/toc/projet/grille/page libre, pipeline Playwright + Ghostscript, gel du contenu à la génération, partage public opt-in. Dépôt autonome : Dockerfile (base Playwright + Ghostscript + ffmpeg + rsync) inclus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
// Capture de la modale « Ajouter un projet » du composeur (auto-contrôle dev).
|
|
import { chromium } from 'playwright'
|
|
|
|
const [, , id, out = '/app/data/cache/picker.png'] = process.argv
|
|
const base = process.env.BASE_URL ?? 'http://localhost:3000'
|
|
|
|
const browser = await chromium.launch()
|
|
const page = await browser.newPage({ viewportSize: { width: 1440, height: 900 } })
|
|
await page.request.post(`${base}/api/auth/login`, {
|
|
data: { password: process.env.NUXT_PORTFOLIO_PASSWORD ?? 'figureslibres' },
|
|
})
|
|
await page.goto(`${base}/portfolios/${id}`, { waitUntil: 'networkidle' })
|
|
await page.getByRole('button', { name: 'Ajouter', exact: true }).click()
|
|
await page.getByRole('menuitem', { name: /Projet/ }).click()
|
|
await page.waitForTimeout(1500)
|
|
// Filtre « type de travail » si fourni en 3e argument
|
|
const filterLabel = process.argv[4]
|
|
if (filterLabel) {
|
|
await page.getByRole('button', { name: filterLabel, exact: true }).click()
|
|
await page.waitForTimeout(800)
|
|
}
|
|
await page.screenshot({ path: out })
|
|
await browser.close()
|
|
console.log(`screenshot: ${out}`)
|