- Add intelligent content-game compatibility system with visual badges - Fix Adventure Reader to work with Dragon's Pearl content structure - Implement multi-column games grid for faster navigation - Add pronunciation display for Chinese vocabulary and sentences - Fix navigation breadcrumb to show proper hierarchy (Home > Levels > Content) - Add back buttons to all navigation pages - Improve JSONContentLoader to preserve story structure - Add comprehensive debugging and diagnostic tools 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
100 lines
3.9 KiB
HTML
100 lines
3.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Test DigitalOcean Auth</title>
|
|
<style>
|
|
body { font-family: monospace; padding: 20px; background: #f0f0f0; }
|
|
.result { margin: 10px 0; padding: 10px; border-radius: 5px; }
|
|
.success { background: #d4edda; color: #155724; }
|
|
.error { background: #f8d7da; color: #721c24; }
|
|
.info { background: #d1ecf1; color: #0c5460; }
|
|
button { padding: 10px 20px; margin: 5px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>🔧 Test Authentification DigitalOcean</h1>
|
|
<button onclick="testAuth()">Tester l'authentification</button>
|
|
<button onclick="testListFiles()">Lister les fichiers</button>
|
|
<div id="results"></div>
|
|
|
|
<script src="js/core/env-config.js"></script>
|
|
<script>
|
|
// Mock logSh si pas défini
|
|
if (typeof logSh === 'undefined') {
|
|
window.logSh = (msg, level) => console.log(`[${level}] ${msg}`);
|
|
}
|
|
|
|
function addResult(message, type = 'info') {
|
|
const div = document.createElement('div');
|
|
div.className = `result ${type}`;
|
|
div.innerHTML = `[${new Date().toLocaleTimeString()}] ${message}`;
|
|
document.getElementById('results').appendChild(div);
|
|
}
|
|
|
|
async function testAuth() {
|
|
addResult('🚀 Test d\'authentification avec la nouvelle clé...', 'info');
|
|
|
|
try {
|
|
// Test avec un fichier qui devrait exister
|
|
const testUrl = 'https://autocollant.fra1.digitaloceanspaces.com/Class_generator/ContentMe/greetings-basic.json';
|
|
|
|
addResult(`URL testée: ${testUrl}`, 'info');
|
|
|
|
// Générer les headers d'auth
|
|
const authHeaders = await window.envConfig.getAuthHeaders('GET', testUrl);
|
|
addResult('Headers générés: ' + JSON.stringify(authHeaders, null, 2), 'info');
|
|
|
|
// Faire la requête
|
|
const response = await fetch(testUrl, {
|
|
method: 'GET',
|
|
headers: authHeaders
|
|
});
|
|
|
|
addResult(`Status: ${response.status} ${response.statusText}`, response.ok ? 'success' : 'error');
|
|
|
|
if (response.ok) {
|
|
const content = await response.text();
|
|
addResult(`✅ Contenu reçu (${content.length} caractères): ${content.substring(0, 200)}...`, 'success');
|
|
} else {
|
|
const errorText = await response.text();
|
|
addResult(`❌ Erreur: ${errorText}`, 'error');
|
|
}
|
|
|
|
} catch (error) {
|
|
addResult(`❌ Erreur: ${error.message}`, 'error');
|
|
}
|
|
}
|
|
|
|
async function testListFiles() {
|
|
addResult('📂 Test de listage des fichiers...', 'info');
|
|
|
|
try {
|
|
const listUrl = 'https://autocollant.fra1.digitaloceanspaces.com/Class_generator/ContentMe/';
|
|
|
|
const authHeaders = await window.envConfig.getAuthHeaders('GET', listUrl);
|
|
|
|
const response = await fetch(listUrl, {
|
|
method: 'GET',
|
|
headers: authHeaders
|
|
});
|
|
|
|
addResult(`Status listage: ${response.status}`, response.ok ? 'success' : 'error');
|
|
|
|
if (response.ok) {
|
|
const content = await response.text();
|
|
addResult(`📋 Contenu du dossier: ${content.substring(0, 500)}...`, 'success');
|
|
} else {
|
|
addResult(`❌ Impossible de lister: ${response.statusText}`, 'error');
|
|
}
|
|
|
|
} catch (error) {
|
|
addResult(`❌ Erreur listage: ${error.message}`, 'error');
|
|
}
|
|
}
|
|
|
|
// Test automatique au chargement
|
|
addResult('🔧 Page de test chargée. Clique sur les boutons pour tester.', 'info');
|
|
addResult(`Configuration: ${window.envConfig.getRemoteContentUrl()}`, 'info');
|
|
</script>
|
|
</body>
|
|
</html> |