Added so much stuff I cant keep up. I think some sorting capability and a way to add metadata to each folder (WIP)

This commit is contained in:
Kylian Schmidt
2025-07-29 09:38:28 +02:00
parent 3e2aaa4be8
commit f3adbe49fa
30 changed files with 1134 additions and 697 deletions
-44
View File
@@ -95,50 +95,6 @@ export class Utils {
}
}
/**
* Refresh gallery by calling CGI script
*/
static async refreshGallery() {
const refreshBtn = document.getElementById('refreshBtn');
if (!refreshBtn) return;
refreshBtn.disabled = true;
refreshBtn.textContent = '⏳';
// Use the CGI script path from config if available
let cgiPath = '/cgi-bin/refresh_gallery.py';
if (window.galleryConfig && window.galleryConfig.paths && window.galleryConfig.paths.cgi_script) {
cgiPath = window.galleryConfig.paths.cgi_script;
// Ensure it starts with a slash for fetch
if (!cgiPath.startsWith('/')) cgiPath = '/' + cgiPath;
}
try {
const response = await fetch(cgiPath, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
});
if (response.ok) {
refreshBtn.textContent = '✅';
setTimeout(() => {
window.location.reload();
}, 1000);
} else {
throw new Error('Refresh failed');
}
} catch (error) {
console.error('Error refreshing gallery:', error);
refreshBtn.textContent = '❌';
setTimeout(() => {
refreshBtn.disabled = false;
refreshBtn.textContent = '🔄';
}, 3000);
}
}
/**
* Toggle keyboard shortcuts help display
*/