[PR #41] feat(notifications): Add test notification routes for NTFY, Discord, … #43

Open
opened 2026-05-06 16:08:21 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/BreizhHardware/ntfy_alerts/pull/41
Author: @BreizhHardware
Created: 8/21/2025
Status: 🔄 Open

Base: devHead: fix/config-reset


📝 Commits (1)

  • 66400f2 feat(notifications): Add test notification routes for NTFY, Discord, Slack, and Gotify

📊 Changes

9 files changed (+647 additions, -60 deletions)

View changed files

📝 src/api.rs (+389 -1)
📝 src/notifications/discord.rs (+25 -1)
📝 src/notifications/gotify.rs (+29 -1)
📝 src/notifications/ntfy.rs (+24 -1)
📝 src/notifications/slack.rs (+24 -1)
web/layouts/auth.vue (+5 -0)
📝 web/pages/login.vue (+50 -49)
📝 web/pages/onboarding.vue (+6 -1)
📝 web/pages/settings.vue (+95 -5)

📄 Description

This pull request adds new API endpoints and backend logic to support sending test notifications through four different services (NTFY, Discord, Slack, Gotify), and refactors the login page to use a dedicated authentication layout for improved consistency and maintainability. The changes are grouped into backend (Rust API and notification logic) and frontend (Vue layout and login page) updates.

Backend: Notification Testing API

  • Added new API routes to src/api.rs for sending test notifications via NTFY, Discord, Slack, and Gotify, including authentication and settings checks. [1] [2]
  • Implemented helper functions in src/notifications/ntfy.rs, src/notifications/discord.rs, src/notifications/slack.rs, and src/notifications/gotify.rs to send test notifications with basic error handling and logging. [1] [2] [3] [4]
  • Integrated the notification modules into the API and updated imports to support the new functionality.
  • Added authentication and session expiry checks to all test notification endpoints to ensure only authorized users can trigger test notifications.

Frontend: Layout and Login Page

  • Created a new auth.vue layout for authentication pages, providing a consistent centered and styled background for login and onboarding.
  • Refactored login.vue to use the new authentication layout, cleaned up markup, and improved error message display for better user experience. [1] [2] [3] [4]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BreizhHardware/ntfy_alerts/pull/41 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 8/21/2025 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/config-reset` --- ### 📝 Commits (1) - [`66400f2`](https://github.com/BreizhHardware/ntfy_alerts/commit/66400f2946409c6491c131ea80ec20ea2a7936f8) feat(notifications): Add test notification routes for NTFY, Discord, Slack, and Gotify ### 📊 Changes **9 files changed** (+647 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src/api.rs` (+389 -1) 📝 `src/notifications/discord.rs` (+25 -1) 📝 `src/notifications/gotify.rs` (+29 -1) 📝 `src/notifications/ntfy.rs` (+24 -1) 📝 `src/notifications/slack.rs` (+24 -1) ➕ `web/layouts/auth.vue` (+5 -0) 📝 `web/pages/login.vue` (+50 -49) 📝 `web/pages/onboarding.vue` (+6 -1) 📝 `web/pages/settings.vue` (+95 -5) </details> ### 📄 Description This pull request adds new API endpoints and backend logic to support sending test notifications through four different services (NTFY, Discord, Slack, Gotify), and refactors the login page to use a dedicated authentication layout for improved consistency and maintainability. The changes are grouped into backend (Rust API and notification logic) and frontend (Vue layout and login page) updates. **Backend: Notification Testing API** * Added new API routes to `src/api.rs` for sending test notifications via NTFY, Discord, Slack, and Gotify, including authentication and settings checks. [[1]](diffhunk://#diff-adea2445327e39eb215de697b440dbbc02135357380fb612a10a9e659129a46bR132-R160) [[2]](diffhunk://#diff-adea2445327e39eb215de697b440dbbc02135357380fb612a10a9e659129a46bR181-R184) * Implemented helper functions in `src/notifications/ntfy.rs`, `src/notifications/discord.rs`, `src/notifications/slack.rs`, and `src/notifications/gotify.rs` to send test notifications with basic error handling and logging. [[1]](diffhunk://#diff-12a3556b4e22d8494fe06adfc0a8d2dea5ad1331c5ee244208351c9ff5c74191R85-R107) [[2]](diffhunk://#diff-6330e29fd6abc0c71fbafb97fdc8085989b9e699607960630c35572dc617ddd7R86-R109) [[3]](diffhunk://#diff-3be24f53da50122ad17491b77c44aa2b0fbf619dbd4e66c316037edd2c11abecR132-R154) [[4]](diffhunk://#diff-03eb8a56a1388cbb4f79c2fc330299aafcf8287e1442f74b8356e88772043d03R79-R106) * Integrated the notification modules into the API and updated imports to support the new functionality. * Added authentication and session expiry checks to all test notification endpoints to ensure only authorized users can trigger test notifications. **Frontend: Layout and Login Page** * Created a new `auth.vue` layout for authentication pages, providing a consistent centered and styled background for login and onboarding. * Refactored `login.vue` to use the new authentication layout, cleaned up markup, and improved error message display for better user experience. [[1]](diffhunk://#diff-578458ac08cc6a7051e776a042f7835a6aba78926be57a43ceaaa43b3f60e1deL2) [[2]](diffhunk://#diff-578458ac08cc6a7051e776a042f7835a6aba78926be57a43ceaaa43b3f60e1deL11-R10) [[3]](diffhunk://#diff-578458ac08cc6a7051e776a042f7835a6aba78926be57a43ceaaa43b3f60e1deL20-R34) [[4]](diffhunk://#diff-578458ac08cc6a7051e776a042f7835a6aba78926be57a43ceaaa43b3f60e1deL47-R61) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BreizhHardware/ntfy_alerts#43
No description provided.