Admin : galerie en ligne dans Destinations + booth envoie toutes les photos
- Remplace le toggle "Site internet" par "Galerie en ligne" dans le panneau Destinations - Supprime la section dupliquée "Galerie Live" du panneau Fonctions - Le booth reçoit toutes les photos (imprimées ou non), le filtre sauvegarder_tout ne s'applique qu'à USB/FTP Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -186,24 +186,29 @@ async function resetCompteur() {
|
||||
|
||||
function chargerDestinations() {
|
||||
const dest = config.destinations || {};
|
||||
const booth = config.booth || {};
|
||||
|
||||
document.getElementById('tog-dest-memoire').checked = dest.memoire_interne !== false;
|
||||
document.getElementById('tog-dest-usb').checked = dest.cle_usb || false;
|
||||
document.getElementById('tog-dest-ftp').checked = dest.ftp || false;
|
||||
document.getElementById('tog-dest-web').checked = dest.site_web || false;
|
||||
document.getElementById('tog-dest-galerie').checked = booth.actif || false;
|
||||
document.getElementById('tog-dest-email-auto').checked = dest.email_auto || false;
|
||||
|
||||
// Sous-configs visibles si actives
|
||||
toggleSousConfig('tog-dest-usb', 'dest-usb-details');
|
||||
toggleSousConfig('tog-dest-ftp', 'dest-ftp-details');
|
||||
toggleSousConfig('tog-dest-web', 'dest-web-details');
|
||||
toggleSousConfig('tog-dest-galerie', 'dest-galerie-details');
|
||||
|
||||
setValue('admin-ftp-host', dest.ftp_host);
|
||||
setValue('admin-ftp-port', dest.ftp_port || 21);
|
||||
setValue('admin-ftp-user', dest.ftp_user);
|
||||
setValue('admin-ftp-pass', dest.ftp_password);
|
||||
setValue('admin-ftp-chemin', dest.ftp_chemin || '/photobooth');
|
||||
setValue('admin-web-url', dest.site_web_url);
|
||||
|
||||
// Booth fields
|
||||
setValue('admin-booth-url', booth.url || 'https://booth.copydev.fr');
|
||||
setValue('admin-booth-apikey', booth.api_key || 'booth-photobooth-2026');
|
||||
setValue('admin-booth-eventid', booth.event_id || 'default');
|
||||
|
||||
// Radio sauvegarder tout / imprimees
|
||||
if (dest.sauvegarder_tout === false) {
|
||||
@@ -213,10 +218,10 @@ function chargerDestinations() {
|
||||
}
|
||||
|
||||
// Listeners pour afficher/cacher sous-configs
|
||||
['tog-dest-usb', 'tog-dest-ftp', 'tog-dest-web'].forEach(id => {
|
||||
['tog-dest-usb', 'tog-dest-ftp', 'tog-dest-galerie'].forEach(id => {
|
||||
const el = document.getElementById(id);
|
||||
el.onchange = () => {
|
||||
const map = { 'tog-dest-usb': 'dest-usb-details', 'tog-dest-ftp': 'dest-ftp-details', 'tog-dest-web': 'dest-web-details' };
|
||||
const map = { 'tog-dest-usb': 'dest-usb-details', 'tog-dest-ftp': 'dest-ftp-details', 'tog-dest-galerie': 'dest-galerie-details' };
|
||||
toggleSousConfig(id, map[id]);
|
||||
};
|
||||
});
|
||||
@@ -260,11 +265,15 @@ async function sauvegarderDestinations() {
|
||||
ftp_user: getValue('admin-ftp-user'),
|
||||
ftp_password: getValue('admin-ftp-pass'),
|
||||
ftp_chemin: getValue('admin-ftp-chemin') || '/photobooth',
|
||||
site_web: document.getElementById('tog-dest-web').checked,
|
||||
site_web_url: getValue('admin-web-url'),
|
||||
email_auto: document.getElementById('tog-dest-email-auto').checked,
|
||||
sauvegarder_tout: document.getElementById('sauv-tout').checked,
|
||||
},
|
||||
booth: {
|
||||
actif: document.getElementById('tog-dest-galerie').checked,
|
||||
url: getValue('admin-booth-url'),
|
||||
api_key: getValue('admin-booth-apikey'),
|
||||
event_id: getValue('admin-booth-eventid'),
|
||||
},
|
||||
});
|
||||
afficherStatut('Destinations sauvegardees', 'succes');
|
||||
}
|
||||
@@ -815,10 +824,6 @@ function getValue(id) {
|
||||
|
||||
async function chargerBoothAdmin() {
|
||||
const booth = config.booth || {};
|
||||
document.getElementById('admin-booth-actif').checked = booth.actif || false;
|
||||
setValue('admin-booth-url', booth.url || 'https://booth.copydev.fr');
|
||||
setValue('admin-booth-apikey', booth.api_key || 'booth-photobooth-2026');
|
||||
setValue('admin-booth-eventid', booth.event_id || 'default');
|
||||
|
||||
// Recuperer le code actuel
|
||||
if (booth.actif && booth.url) {
|
||||
@@ -836,7 +841,7 @@ async function chargerBoothAdmin() {
|
||||
async function sauvegarderBooth() {
|
||||
await apiPost('/api/config', {
|
||||
booth: {
|
||||
actif: document.getElementById('admin-booth-actif').checked,
|
||||
actif: document.getElementById('tog-dest-galerie').checked,
|
||||
url: getValue('admin-booth-url'),
|
||||
api_key: getValue('admin-booth-apikey'),
|
||||
event_id: getValue('admin-booth-eventid'),
|
||||
|
||||
Reference in New Issue
Block a user