Backend FastAPI complet : camera gphoto2, filtres/overlays Pillow, chroma key OpenCV, multi-shot/collage, GIF, impression CUPS, email SMTP, QR code. Frontend web vanilla (HTML/CSS/JS) pour Chromium kiosk. Menu admin cache (appui long coin ecran). Toutes les fonctionnalites activables/desactivables. Scripts install + systemd pour RPi4. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
/* Module partage - Impression, email, QR code */
|
|
|
|
async function lancerImpression() {
|
|
if (!photoFinale) return;
|
|
afficherStatut('Impression en cours...', 'succes');
|
|
const resultat = await apiPost('/api/imprimer', { photo: photoFinale });
|
|
if (resultat.succes) {
|
|
afficherStatut('Photo envoyee a l\'imprimante !', 'succes');
|
|
} else {
|
|
afficherStatut('Erreur d\'impression', 'erreur');
|
|
}
|
|
}
|
|
|
|
function ouvrirEmail() {
|
|
document.getElementById('form-email').classList.remove('cache');
|
|
document.getElementById('input-email').focus();
|
|
}
|
|
|
|
function fermerEmail() {
|
|
document.getElementById('form-email').classList.add('cache');
|
|
document.getElementById('input-email').value = '';
|
|
}
|
|
|
|
async function envoyerEmail() {
|
|
const email = document.getElementById('input-email').value.trim();
|
|
if (!email || !photoFinale) return;
|
|
|
|
afficherStatut('Envoi en cours...', 'succes');
|
|
const resultat = await apiPost('/api/email', { email, photo: photoFinale });
|
|
if (resultat.succes) {
|
|
afficherStatut('Email envoye !', 'succes');
|
|
fermerEmail();
|
|
} else {
|
|
afficherStatut('Erreur d\'envoi email', 'erreur');
|
|
}
|
|
}
|
|
|
|
async function afficherQR() {
|
|
const zone = document.getElementById('zone-qr');
|
|
zone.classList.toggle('cache');
|
|
|
|
if (!zone.classList.contains('cache')) {
|
|
const resultat = await apiGet('/api/qr/galerie');
|
|
if (resultat.chemin) {
|
|
document.getElementById('img-qr').src = resultat.chemin;
|
|
} else {
|
|
afficherStatut('QR Code non configure', 'erreur');
|
|
zone.classList.add('cache');
|
|
}
|
|
}
|
|
}
|