fix: remove UI button section, fix _path→path, show folder in file pickers
🚀 Deploy — JH Photomaton / 🔍 Vérification (push) Has been cancelled
🚀 Deploy — JH Photomaton / 🍓 Deploy sur le Pi (push) Has been cancelled

This commit is contained in:
2026-07-17 17:41:54 +02:00
parent 2393396948
commit 4388503102
2 changed files with 2 additions and 36 deletions
+1 -35
View File
@@ -227,8 +227,6 @@ function cardHTML(action, idx) {
const name = esc(action.name || 'Sans nom');
const proc = action.processing || {};
const jc = action.jobcontrol || {};
const ui = (action.trigger || {}).ui_trigger || {};
const chips = [
`<span class="ac-chip">⏱ ${jc.countdown_capture ?? '?'}s</span>`,
];
@@ -242,8 +240,6 @@ function cardHTML(action, idx) {
chips.push('<span class="ac-chip hl">Remove BG</span>');
if (proc.image_filter && proc.image_filter !== 'original')
chips.push(`<span class="ac-chip hl">🎨 ${esc(proc.image_filter.split('.').pop())}</span>`);
if (ui.show_button)
chips.push(`<span class="ac-chip hl">🔘 ${esc(ui.title || '')}</span>`);
return `
<div class="action-card" draggable="true" data-idx="${idx}" id="ac-${idx}">
@@ -267,7 +263,6 @@ function cardHTML(action, idx) {
function editFormHTML(action, idx) {
const proc = action.processing || {};
const jc = action.jobcontrol || {};
const ui = (action.trigger || {}).ui_trigger || {};
const frameSel = assetSelect(`ef-frame-sel-${idx}`, proc.img_frame_file || '', assets.frames, '— aucun cadre —', `ef-frame-${idx}`);
const bgSel = assetSelect(`ef-bg-sel-${idx}`, proc.img_background_file || '', assets.backgrounds, '— aucun fond —', `ef-bg-${idx}`);
@@ -341,30 +336,6 @@ function editFormHTML(action, idx) {
</div>
</div>
<div class="edit-section">
<div class="edit-section-title">Interface photobooth (bouton UI)</div>
<div class="grid-3">
<div class="form-group">
<label class="form-label flex items-center gap-1">
<input type="checkbox" id="ef-ui-show-${idx}" ${ui.show_button?'checked':''}> Afficher le bouton
</label>
<label class="form-label mt-1">Titre du bouton</label>
<input type="text" class="form-control" id="ef-ui-title-${idx}"
value="${esc(ui.title||'')}" placeholder="Photo normal…">
</div>
<div class="form-group">
<label class="form-label">Icône (nom Material)</label>
<input type="text" class="form-control" id="ef-ui-icon-${idx}"
value="${esc(ui.icon||'Photo')}" placeholder="Photo, star_shine, brick…">
<label class="form-label mt-1 flex items-center gap-1">
<input type="checkbox" id="ef-ui-usecol-${idx}" ${ui.use_custom_color?'checked':''}> Couleur personnalisée
</label>
<input type="color" class="form-control mt-1" id="ef-ui-color-${idx}"
value="${esc(ui.custom_color||'#016911')}" style="height:36px;max-width:80px">
</div>
</div>
</div>
<div class="flex gap-1">
<button class="btn btn-primary btn-sm" onclick="saveAction(${idx})">💾 Sauvegarder</button>
<button class="btn btn-ghost btn-sm" onclick="toggleEdit(${idx})">Annuler</button>
@@ -373,7 +344,7 @@ function editFormHTML(action, idx) {
function assetSelect(selId, current, options, placeholder, textId) {
const opts = options.map(f => {
const label = f.split('/').pop();
const label = f.replace(/^userdata\//, '');
return `<option value="${esc(f)}" ${f===current?'selected':''}>${esc(label)}</option>`;
}).join('');
return `<select class="form-control" id="${selId}"
@@ -410,11 +381,6 @@ async function saveAction(idx) {
fill_background_color: document.getElementById(`ef-fill-color-${idx}`).value,
remove_background: document.getElementById(`ef-rmbg-${idx}`).checked,
image_filter: document.getElementById(`ef-filter-${idx}`).value,
ui_show_button: document.getElementById(`ef-ui-show-${idx}`).checked,
ui_title: document.getElementById(`ef-ui-title-${idx}`).value,
ui_icon: document.getElementById(`ef-ui-icon-${idx}`).value,
ui_use_custom_color: document.getElementById(`ef-ui-usecol-${idx}`).checked,
ui_custom_color: document.getElementById(`ef-ui-color-${idx}`).value,
};
try {
await api('PUT', `/api/actions/photobooth/${realIdx}`, updates);