Intégration station d'impression photo (photostation)

- Icône discrète coin bas-gauche, visible seulement si photostation installée
- Popup PIN (4 chiffres) avant lancement
- Backend : /api/photostation/disponible + /api/photostation/lancer
- kiosk-session.sh : Chromium attend le flag /tmp/photostation_running avant redémarrage
- Script install-photostation.sh pour déploiement sur la Surface

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 09:20:48 +02:00
parent fe71921d1a
commit babd89425c
6 changed files with 174 additions and 0 deletions

View File

@@ -135,6 +135,26 @@ html, body {
color: rgba(255,255,255,0.4);
}
.btn-photostation {
position: absolute;
bottom: 12px;
left: 12px;
width: 56px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
color: rgba(255,255,255,0.15);
cursor: pointer;
border-radius: 50%;
transition: color 0.3s;
}
.btn-photostation:hover, .btn-photostation:active {
color: rgba(255,255,255,0.4);
}
/* Popup mot de passe */
.popup-overlay {
position: fixed;

View File

@@ -42,8 +42,34 @@
</div>
<!-- Icone admin coin bas-droit -->
<div id="btn-admin" class="btn-admin" onclick="ouvrirAdmin()">&#9881;</div>
<!-- Icone photostation coin bas-gauche (visible seulement si installée) -->
<div id="btn-photostation" class="btn-photostation cache" onclick="ouvrirPhotostation()">&#128444;</div>
</section>
<!-- Popup PIN photostation -->
<div id="popup-pin-photostation" class="popup-mdp cache">
<div class="popup-mdp-contenu">
<h3>Station d'impression</h3>
<p class="aide">Entrez le code PIN</p>
<div id="pin-photostation-affichage" class="mdp-affichage">&#9679;&#9679;&#9679;&#9679;</div>
<div id="pin-photostation-erreur" class="mdp-erreur cache">Code incorrect</div>
<div class="pave-numerique">
<button onclick="pinPhotostationTouche('1')">1</button>
<button onclick="pinPhotostationTouche('2')">2</button>
<button onclick="pinPhotostationTouche('3')">3</button>
<button onclick="pinPhotostationTouche('4')">4</button>
<button onclick="pinPhotostationTouche('5')">5</button>
<button onclick="pinPhotostationTouche('6')">6</button>
<button onclick="pinPhotostationTouche('7')">7</button>
<button onclick="pinPhotostationTouche('8')">8</button>
<button onclick="pinPhotostationTouche('9')">9</button>
<button onclick="pinPhotostationEffacer()">&#8592;</button>
<button onclick="pinPhotostationTouche('0')">0</button>
<button onclick="fermerPopupPhotostation()">&#10005;</button>
</div>
</div>
</div>
<!-- Choix du mode -->
<section id="ecran-mode" class="ecran">
<h2>Choisissez votre mode</h2>

View File

@@ -15,6 +15,7 @@ async function init() {
setupModes();
setupOnglets();
chargerBoothInfo();
verifierPhotostationDisponible();
}
function appliquerConfig() {
@@ -137,6 +138,8 @@ function setupEcranAccueil() {
// --- Admin : icone + mot de passe ---
const MDP_ADMIN = '1234';
const PIN_PHOTOSTATION = '1234';
let _pinPhotostationSaisi = '';
function ouvrirAdmin() {
const popup = document.getElementById('popup-mdp');
@@ -161,6 +164,59 @@ function paveEffacer() {
input.value = input.value.slice(0, -1);
}
// --- Photostation ---
async function verifierPhotostationDisponible() {
const data = await apiGet('/api/photostation/disponible').catch(() => null);
if (data?.disponible) {
document.getElementById('btn-photostation').classList.remove('cache');
}
}
function ouvrirPhotostation() {
_pinPhotostationSaisi = '';
_majAffichagePin();
document.getElementById('pin-photostation-erreur').classList.add('cache');
document.getElementById('popup-pin-photostation').classList.remove('cache');
}
function fermerPopupPhotostation() {
document.getElementById('popup-pin-photostation').classList.add('cache');
_pinPhotostationSaisi = '';
}
function pinPhotostationTouche(c) {
if (_pinPhotostationSaisi.length >= 4) return;
_pinPhotostationSaisi += c;
_majAffichagePin();
if (_pinPhotostationSaisi.length === 4) {
setTimeout(_validerPinPhotostation, 150);
}
}
function pinPhotostationEffacer() {
_pinPhotostationSaisi = _pinPhotostationSaisi.slice(0, -1);
_majAffichagePin();
}
function _majAffichagePin() {
const n = _pinPhotostationSaisi.length;
const el = document.getElementById('pin-photostation-affichage');
el.textContent = '●'.repeat(n) + '○'.repeat(4 - n);
}
async function _validerPinPhotostation() {
if (_pinPhotostationSaisi !== PIN_PHOTOSTATION) {
document.getElementById('pin-photostation-erreur').classList.remove('cache');
_pinPhotostationSaisi = '';
_majAffichagePin();
return;
}
fermerPopupPhotostation();
afficherStatut('Lancement de la station d\'impression...', 'succes');
await apiPost('/api/photostation/lancer', {});
}
function validerMdpAdmin() {
const input = document.getElementById('input-mdp-admin');
if (input.value === MDP_ADMIN) {