Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Webpush notification provider #5444

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

DoidoYo
Copy link

@DoidoYo DoidoYo commented Dec 16, 2024

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Add Web push notification provider for progressive web apps, works with most modern browsers on desktop, iOS and theoretically android (tested on windows 10 edge, chrome. macOS safari, chrome. iOS safari.)

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

NOTES

  1. HTTPS is needed for this to work. Specifically for non localhost urls (tested on Mac safari and chrome). For iOS: HTTPS + page added to Home Screen.
  2. serviceWorker is needed for web push, had to install Vite PWA in order to attach a service worker to the application. ** OF NOTE ** Service worker is only attached in production, NOT attached in dev. will not work in dev
  3. "Webpush Documentation" can be an Uptime Kuma wiki page with more detailed info on point 1 above. I can write it up after code approval.

Screenshots (if any)

image IMG_1748

@DoidoYo DoidoYo marked this pull request as draft December 16, 2024 19:39
@DoidoYo DoidoYo marked this pull request as ready for review December 16, 2024 20:18
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable.

I have not had time to work if it works, but here are a few code comments to unblock you.

src/serviceWorker.ts Outdated Show resolved Hide resolved
src/serviceWorker.ts Outdated Show resolved Hide resolved
server/server.js Outdated Show resolved Hide resolved
src/components/notifications/Webpush.vue Outdated Show resolved Hide resolved
src/components/notifications/Webpush.vue Outdated Show resolved Hide resolved
src/components/notifications/Webpush.vue Outdated Show resolved Hide resolved
src/serviceWorker.ts Outdated Show resolved Hide resolved
src/serviceWorker.ts Outdated Show resolved Hide resolved
src/components/notifications/Webpush.vue Show resolved Hide resolved
src/components/notifications/Webpush.vue Show resolved Hide resolved
@DoidoYo
Copy link
Author

DoidoYo commented Dec 31, 2024

@CommanderStorm just pushed latest changes with fixes for comments. thank you for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants