mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-31 02:42:34 +02:00
add Pushy notification service
This commit is contained in:
parent
dbe4ac210a
commit
8c3ec93af1
2 changed files with 37 additions and 0 deletions
|
@ -49,6 +49,25 @@ class Notification {
|
|||
return false;
|
||||
}
|
||||
|
||||
} else if (notification.type === "pushy") {
|
||||
try {
|
||||
await axios.post(`https://api.pushy.me/push?api_key=${notification.pushyAPIKey}`, {
|
||||
"to": notification.pushyToken,
|
||||
"data": {
|
||||
"message": "Uptime-Kuma"
|
||||
},
|
||||
"notification": {
|
||||
"body": msg,
|
||||
"badge": 1,
|
||||
"sound": "ping.aiff"
|
||||
}
|
||||
})
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (notification.type === "slack") {
|
||||
try {
|
||||
if (heartbeatJSON == null) {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<option value="gotify">Gotify</option>
|
||||
<option value="slack">Slack</option>
|
||||
<option value="pushover">Pushover</option>
|
||||
<option value="pushy">Pushy</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
@ -221,6 +222,23 @@
|
|||
More info on: <a href="https://pushover.net/api" target="_blank">https://pushover.net/api</a>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template v-if="notification.type === 'pushy'">
|
||||
<div class="mb-3">
|
||||
<label for="pushy-app-token" class="form-label">API_KEY</label>
|
||||
<input type="text" class="form-control" id="pushy-app-token" required v-model="notification.pushyAPIKey">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="pushy-user-key" class="form-label">USER_TOKEN</label>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" id="pushy-user-key" required v-model="notification.pushyToken">
|
||||
</div>
|
||||
</div>
|
||||
<p style="margin-top: 8px;">
|
||||
More info on: <a href="https://pushy.me/docs/api/send-notifications" target="_blank">https://pushy.me/docs/api/send-notifications</a>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
Loading…
Add table
Reference in a new issue