44 lines
1.3 KiB
HTML
44 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head><title>Thumbnail Test</title>
|
|
<style>
|
|
body { background: #111; color: #fff; font-family: monospace; padding: 20px; }
|
|
img { margin: 5px; border: 1px solid #333; }
|
|
.slice { display: inline-block; text-align: center; margin: 10px; }
|
|
.slice span { display: block; font-size: 11px; color: #888; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Thumbnails</h2>
|
|
<div id="thumbs">Loading...</div>
|
|
<script>
|
|
const token = prompt('Enter token:');
|
|
const dossier = '3b38234f2b0f7ee6';
|
|
const series = '119a07e4cefd7d17'; // MR AX T2
|
|
|
|
fetch(`/api/v1/dossiers/${dossier}/entries?parent=${series}`, {
|
|
headers: { 'Authorization': 'Bearer ' + token }
|
|
})
|
|
.then(r => {
|
|
console.log('Status:', r.status);
|
|
return r.json();
|
|
})
|
|
.then(data => {
|
|
console.log('Data type:', typeof data, Array.isArray(data));
|
|
if (data.error) {
|
|
document.getElementById('thumbs').innerHTML = 'API Error: ' + data.error;
|
|
return;
|
|
}
|
|
if (!Array.isArray(data)) {
|
|
document.getElementById('thumbs').innerHTML = 'Unexpected: ' + JSON.stringify(data).slice(0,200);
|
|
return;
|
|
}
|
|
document.getElementById('thumbs').innerHTML = data.map(e =>
|
|
e.thumbnail ? `<div class="slice"><img src="${e.thumbnail}"><span>${e.summary}</span></div>` : ''
|
|
).join('') || 'No thumbnails found';
|
|
})
|
|
.catch(e => document.getElementById('thumbs').innerHTML = 'Error: ' + e);
|
|
</script>
|
|
</body>
|
|
</html>
|