diff --git a/services/notificationService.js b/services/notificationService.js index bbc5d8c..ebdaf85 100644 --- a/services/notificationService.js +++ b/services/notificationService.js @@ -28,8 +28,7 @@ async function sendNtfyNotification(adminNtfy, userNtfy, payload) { const server = (userNtfy.serverUrl || adminNtfy.serverUrl || 'https://ntfy.sh').replace(/\/+$/, ''); const sanitizedPrefix = (adminNtfy.topicPrefix || '').replace(/^-+|-+$/g, ''); const sanitizedTopic = (userNtfy.topic || '').replace(/^-+|-+$/g, ''); - const separator = sanitizedPrefix && sanitizedTopic ? '_' : ''; - const topic = `${sanitizedPrefix}${separator}${sanitizedTopic}` || sanitizedPrefix || sanitizedTopic; + const topic = `${sanitizedPrefix}${sanitizedTopic}` || sanitizedPrefix || sanitizedTopic; let url = `${server}/${topic}`; if (payload.title) { const delimiter = url.includes('?') ? '&' : '?'; diff --git a/src/App.js b/src/App.js index 3edcd97..daebe9c 100644 --- a/src/App.js +++ b/src/App.js @@ -575,8 +575,7 @@ function App() { return null; } const prefix = (notificationCapabilities.ntfy.topicPrefix || '').replace(/^-+|-+$/g, ''); - const separator = prefix && sanitizedTopic ? '_' : ''; - const slug = `${prefix}${separator}${sanitizedTopic}` || sanitizedTopic || prefix; + const slug = `${prefix}${sanitizedTopic}` || sanitizedTopic || prefix; if (!slug) { return null; } diff --git a/src/components/NotificationPanel.js b/src/components/NotificationPanel.js index 153405e..fddcc50 100644 --- a/src/components/NotificationPanel.js +++ b/src/components/NotificationPanel.js @@ -72,6 +72,16 @@ const NotificationPanel = ({ disabled={!settings.ntfy.enabled} /> + {capabilities.ntfy.serverUrl && ( +

+ Server: {capabilities.ntfy.serverUrl} (vom Admin festgelegt) +

+ )} + {capabilities.ntfy.topicPrefix && ( +

+ Präfix: {capabilities.ntfy.topicPrefix} (Topic wird direkt angehängt) +

+ )} {ntfyPreviewUrl && (