feat: sync saved example images path with backend on path update. Fixes #250

This commit is contained in:
Will Miao
2025-06-25 15:34:25 +08:00
parent 2ee057e19b
commit 446b6d6158
2 changed files with 28 additions and 2 deletions

View File

@@ -254,13 +254,15 @@
/* New styles for hover reveal mode */
.hover-reveal .card-header,
.hover-reveal .card-footer {
.hover-reveal .card-footer,
.hover-reveal .recipe-indicator {
opacity: 0;
transition: opacity 0.2s ease;
}
.hover-reveal .lora-card:hover .card-header,
.hover-reveal .lora-card:hover .card-footer {
.hover-reveal .lora-card:hover .card-footer,
.hover-reveal .lora-card:hover .recipe-indicator {
opacity: 1;
}

View File

@@ -69,6 +69,30 @@ class ExampleImagesManager {
pathInput.value = savedPath;
// Enable download button if path is set
this.updateDownloadButtonState(true);
// Sync the saved path with the backend
try {
const response = await fetch('/api/settings', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
example_images_path: savedPath
})
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
if (!data.success) {
console.error('Failed to sync example images path with backend:', data.error);
}
} catch (error) {
console.error('Failed to sync saved path with backend:', error);
}
} else {
// Disable download button if no path is set
this.updateDownloadButtonState(false);