Actualiser js/admin.js
This commit is contained in:
+18
-1
@@ -369,7 +369,24 @@ function openEditModal(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function closeAdminModal() { document.getElementById('admin-modal').classList.remove('open'); }
|
function closeAdminModal() { document.getElementById('admin-modal').classList.remove('open'); }
|
||||||
function openConfigModal() { document.getElementById('config-modal').classList.add('open'); }
|
async function openConfigModal() {
|
||||||
|
document.getElementById('config-modal').classList.add('open');
|
||||||
|
|
||||||
|
// Réinitialise les placeholders
|
||||||
|
document.getElementById('tmdb-key-input').placeholder = 'Pour les critiques (réalisateur, streaming)';
|
||||||
|
document.getElementById('ean-search-key-input').placeholder = 'Recherche par code-barres (Vidéothèque)';
|
||||||
|
document.getElementById('barcode-lookup-key-input').placeholder = 'Recherche par code-barres (Vidéothèque)';
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${API_URL}?action=get_config_keys`, {
|
||||||
|
headers: { 'Authorization': localStorage.getItem('token') }
|
||||||
|
});
|
||||||
|
const data = await res.json();
|
||||||
|
if (data.tmdb_api_key) document.getElementById('tmdb-key-input').placeholder = '✅ Clé configurée (laisser vide pour ne pas changer)';
|
||||||
|
if (data.ean_search_key) document.getElementById('ean-search-key-input').placeholder = '✅ Clé configurée (laisser vide pour ne pas changer)';
|
||||||
|
if (data.barcode_lookup_key) document.getElementById('barcode-lookup-key-input').placeholder = '✅ Clé configurée (laisser vide pour ne pas changer)';
|
||||||
|
} catch(e) { console.error(e); }
|
||||||
|
}
|
||||||
function closeConfigModal() { document.getElementById('config-modal').classList.remove('open'); }
|
function closeConfigModal() { document.getElementById('config-modal').classList.remove('open'); }
|
||||||
function openPasswordModal() {
|
function openPasswordModal() {
|
||||||
document.getElementById('pwd-error').style.display = 'none';
|
document.getElementById('pwd-error').style.display = 'none';
|
||||||
|
|||||||
Reference in New Issue
Block a user