mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-09 23:24:07 -08:00
commit
403137280e
|
@ -177,6 +177,35 @@ class Notification {
|
|||
return false;
|
||||
}
|
||||
|
||||
} else if (notification.type === "pushover") {
|
||||
var pushoverlink = 'https://api.pushover.net/1/messages.json'
|
||||
try {
|
||||
if (heartbeatJSON == null) {
|
||||
let data = {'message': "<b>Uptime Kuma Pushover testing successful.</b>",
|
||||
'user': notification.pushoveruserkey, 'token': notification.pushoverapptoken, 'sound':notification.pushoversounds,
|
||||
'priority': notification.pushoverpriority, 'title':notification.pushovertitle, 'retry': "30", 'expire':"3600", 'html': 1}
|
||||
let res = await axios.post(pushoverlink, data)
|
||||
return true;
|
||||
}
|
||||
|
||||
let data = {
|
||||
"message": "<b>Uptime Kuma Alert</b>\n\n<b>Message</b>:" +msg + '\n<b>Time (UTC)</b>:' +time,
|
||||
"user":notification.pushoveruserkey,
|
||||
"token": notification.pushoverapptoken,
|
||||
"sound": notification.pushoversounds,
|
||||
"priority": notification.pushoverpriority,
|
||||
"title": notification.pushovertitle,
|
||||
"retry": "30",
|
||||
"expire": "3600",
|
||||
"html": 1
|
||||
}
|
||||
let res = await axios.post(pushoverlink, data)
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Error("Notification type is not supported")
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
@ -202,6 +203,55 @@
|
|||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="notification.type === 'pushover'">
|
||||
<div class="mb-3">
|
||||
<label for="pushover-app-token" class="form-label">Application Token<span style="color:red;"><sup>*</sup></span></label>
|
||||
<input type="text" class="form-control" id="pushover-app-token" required v-model="notification.pushoverapptoken">
|
||||
<label for="pushover-user" class="form-label">User Key<span style="color:red;"><sup>*</sup></span></label>
|
||||
<input type="text" class="form-control" id="pushover-user" required v-model="notification.pushoveruserkey">
|
||||
<label for="pushover-device" class="form-label">Device</label>
|
||||
<input type="text" class="form-control" id="pushover-device" v-model="notification.pushoverdevice">
|
||||
<label for="pushover-device" class="form-label">Message Title</label>
|
||||
<input type="text" class="form-control" id="pushover-title" v-model="notification.pushovertitle">
|
||||
<label for="pushover-priority" class="form-label">Priority</label>
|
||||
<input type="text" class="form-control" id="pushover-priority" v-model="notification.pushoverpriority">
|
||||
<label for="pushover-sound" class="form-label">Notification Sound</label>
|
||||
<select class="form-select" id="pushover-sound" v-model="notification.pushoversounds">
|
||||
<option>pushover</option>
|
||||
<option>bike</option>
|
||||
<option>bugle</option>
|
||||
<option>cashregister</option>
|
||||
<option>classical</option>
|
||||
<option>cosmic</option>
|
||||
<option>falling</option>
|
||||
<option>gamelan</option>
|
||||
<option>incoming</option>
|
||||
<option>intermission</option>
|
||||
<option>mechanical</option>
|
||||
<option>pianobar</option>
|
||||
<option>siren</option>
|
||||
<option>spacealarm</option>
|
||||
<option>tugboat</option>
|
||||
<option>alien</option>
|
||||
<option>climb</option>
|
||||
<option>persistent</option>
|
||||
<option>echo</option>
|
||||
<option>updown</option>
|
||||
<option>vibrate</option>
|
||||
<option>none</option>
|
||||
</select>
|
||||
<div class="form-text">
|
||||
<span style="color:red;"><sup>*</sup></span>Required
|
||||
<p style="margin-top: 8px;">
|
||||
More info on: <a href="https://pushover.net/api" target="_blank">https://pushover.net/api</a>
|
||||
</p>
|
||||
<p style="margin-top: 8px;">
|
||||
Emergency priority(2) has default 30 second timeout between retries and will expire after 1 hour.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
Loading…
Reference in a new issue