diff --git a/frontend/index.html b/frontend/index.html
index aa7ad8a..d35445d 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -150,6 +150,7 @@
+
@@ -359,6 +360,26 @@
+
+
+
Galerie Live
+
Les photos sont envoyees en temps reel sur un site web. Les invites scannent le QR code sur l'ecran d'accueil.
+
+
+
+
URL du serveur
+
Cle API
+
ID evenement
+
+ Code invites : --
+
+
+
+
+
diff --git a/frontend/js/admin.js b/frontend/js/admin.js
index a4b0f73..71b8f2f 100644
--- a/frontend/js/admin.js
+++ b/frontend/js/admin.js
@@ -24,6 +24,7 @@ async function chargerAdmin() {
chargerEmailAdmin();
chargerFondsAdmin();
chargerGalerieAdmin();
+ chargerBoothAdmin();
}
// === MATERIEL ===
@@ -635,3 +636,60 @@ function getValue(id) {
const el = document.getElementById(id);
return el ? el.value : '';
}
+
+// === BOOTH (Galerie Live) ===
+
+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) {
+ try {
+ const info = await apiGet('/api/booth/info');
+ if (info.password) {
+ document.getElementById('admin-booth-password').textContent = info.password;
+ }
+ } catch (e) {
+ document.getElementById('admin-booth-password').textContent = '--';
+ }
+ }
+}
+
+async function sauvegarderBooth() {
+ await apiPost('/api/config', {
+ booth: {
+ actif: document.getElementById('admin-booth-actif').checked,
+ url: getValue('admin-booth-url'),
+ api_key: getValue('admin-booth-apikey'),
+ event_id: getValue('admin-booth-eventid'),
+ }
+ });
+ afficherStatut('Galerie live sauvegardee', 'succes');
+ chargerBoothAdmin();
+ chargerBoothInfo();
+}
+
+async function regenererBoothPassword() {
+ const booth = config.booth || {};
+ const url = getValue('admin-booth-url').replace(/\/$/, '');
+ const apiKey = getValue('admin-booth-apikey');
+ const eventId = getValue('admin-booth-eventid') || 'default';
+
+ try {
+ const resp = await fetch(`${url}/api/${eventId}/reset-password`, {
+ method: 'POST',
+ headers: { 'X-Api-Key': apiKey },
+ });
+ const data = await resp.json();
+ if (data.password) {
+ document.getElementById('admin-booth-password').textContent = data.password;
+ afficherStatut('Nouveau code genere : ' + data.password, 'succes');
+ }
+ } catch (e) {
+ afficherStatut('Erreur connexion au serveur booth', 'erreur');
+ }
+}