Browse Source

🚧 WIP: Pushover integration

pull/154/head^2
Philipp Dormann 4 years ago
parent
commit
da8e15a90b
No known key found for this signature in database GPG Key ID: 3BB9ADD52DCA4314
  1. 14
      server/notification.js
  2. 19
      src/components/NotificationDialog.vue

14
server/notification.js

@ -35,6 +35,20 @@ class Notification {
return false;
}
} else if (notification.type === "pushover") {
try {
await axios.post("https://api.pushover.net/1/messages.json", {
"message": msg,
"token": notification.pushoverAppToken,
"user": notification.pushoverUserKey,
"title": "Uptime-Kuma"
})
return true;
} catch (error) {
console.log(error)
return false;
}
} else if (notification.type === "slack") {
try {
if (heartbeatJSON == null) {

19
src/components/NotificationDialog.vue

@ -20,6 +20,7 @@
<option value="signal">Signal</option>
<option value="gotify">Gotify</option>
<option value="slack">Slack</option>
<option value="pushover">Pushover</option>
</select>
</div>
@ -203,6 +204,24 @@
</p>
</div>
</template>
<template v-if="notification.type === 'pushover'">
<div class="mb-3">
<div class="mb-3">
<label for="pushover-app-token" class="form-label">APP_TOKEN</label>
<input type="text" class="form-control" id="pushover-app-token" required v-model="notification.pushoverAppToken">
</div>
<div class="mb-3">
<label for="pushover-user-key" class="form-label">USER_KEY</label>
<div class="input-group mb-3">
<input type="text" class="form-control" id="pushover-user-key" required v-model="notification.pushoverUserKey">
</div>
</div>
<p style="margin-top: 8px;">
More info on: <a href="https://pushover.net/api" target="_blank">https://pushover.net/api</a>
</p>
</template>
</div>
<div class="modal-footer">

Loading…
Cancel
Save