From cf41055cbd4e5fd411f5a643e6da5120bd01680c Mon Sep 17 00:00:00 2001 From: SEB Fotografie - soeren Date: Thu, 13 Nov 2025 17:48:49 +0100 Subject: [PATCH] finished the upgrade to filament 4. completely revamped the frontend with codex, now it looks great! --- resources/js/Components/ImageContextMenu.vue | 5 +-- resources/js/Components/StyleSelector.vue | 43 +++----------------- resources/js/Pages/Home.vue | 24 ++++++++++- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/resources/js/Components/ImageContextMenu.vue b/resources/js/Components/ImageContextMenu.vue index da62bdb..4aeb43b 100644 --- a/resources/js/Components/ImageContextMenu.vue +++ b/resources/js/Components/ImageContextMenu.vue @@ -50,9 +50,8 @@

Lass die KI dein Motiv verzaubern.

- - - + + diff --git a/resources/js/Components/StyleSelector.vue b/resources/js/Components/StyleSelector.vue index 71fb62b..ebb3098 100644 --- a/resources/js/Components/StyleSelector.vue +++ b/resources/js/Components/StyleSelector.vue @@ -14,7 +14,7 @@ -
+

Stile werden geladen …

@@ -31,7 +31,8 @@ > Style preview @@ -53,13 +54,11 @@ diff --git a/resources/js/Pages/Home.vue b/resources/js/Pages/Home.vue index b797789..3e1b2c0 100644 --- a/resources/js/Pages/Home.vue +++ b/resources/js/Pages/Home.vue @@ -163,6 +163,24 @@ let refreshTimer = null; const getImageIdentifier = (image) => image?.id ?? image?.image_id ?? null; +const extractFilenameFromHeader = (disposition) => { + if (!disposition) { + return null; + } + + const filenameMatch = disposition.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i); + if (!filenameMatch) { + return null; + } + + const encodedName = filenameMatch[1] || filenameMatch[2]; + try { + return decodeURIComponent(encodedName); + } catch (error) { + return encodedName; + } +}; + watch( () => props.images, (newImages) => { @@ -306,8 +324,12 @@ const downloadImage = (imageParam = null) => { const blob = new Blob([response.data]); const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); + const disposition = response.headers?.['content-disposition']; + const filenameFromHeader = extractFilenameFromHeader(disposition); + const fallbackName = image.name || `stylegallery_${new Date().toISOString().replace(/[:.]/g, '-')}`; + link.href = url; - link.download = image.name || 'image'; + link.download = filenameFromHeader || fallbackName; document.body.appendChild(link); link.click(); document.body.removeChild(link);