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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user