Add Bark Notification Parameters

pull/1751/head
Super Manito 3 years ago
parent 11243a6ca1
commit 817c941489

@ -12,9 +12,7 @@ const { default: axios } = require("axios");
// bark is an APN bridge that sends notifications to Apple devices. // bark is an APN bridge that sends notifications to Apple devices.
const barkNotificationGroup = "UptimeKuma";
const barkNotificationAvatar = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png"; const barkNotificationAvatar = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png";
const barkNotificationSound = "telegraph";
const successMessage = "Successes!"; const successMessage = "Successes!";
class Bark extends NotificationProvider { class Bark extends NotificationProvider {
@ -53,10 +51,21 @@ class Bark extends NotificationProvider {
appendAdditionalParameters(postUrl) { appendAdditionalParameters(postUrl) {
// grouping all our notifications // grouping all our notifications
postUrl += "?group=" + barkNotificationGroup; postUrl += "?group=" + barkNotificationGroup;
if (notification.barkGroup != null) {
postUrl += "&group=" + notification.barkGroup;
} else {
postUrl += "&group=" + "UptimeKuma";
// default group
}
// set icon to uptime kuma icon, 11kb should be fine // set icon to uptime kuma icon, 11kb should be fine
postUrl += "&icon=" + barkNotificationAvatar; postUrl += "&icon=" + barkNotificationAvatar;
// picked a sound, this should follow system's mute status when arrival // picked a sound, this should follow system's mute status when arrival
postUrl += "&sound=" + barkNotificationSound; if (notification.barkSound != null) {
postUrl += "&sound=" + notification.barkSound;
} else {
postUrl += "&sound=" + "telegraph";
// default sound
}
return postUrl; return postUrl;
} }

@ -12,4 +12,110 @@
>{{ $t("here") }}</a> >{{ $t("here") }}</a>
</i18n-t> </i18n-t>
</div> </div>
<div class="mb-3">
<label for="Bark Group" class="form-label">{{ $t("Bark Group") }}</label>
<input id="Bark Group" v-model="$parent.notification.barkGroup" type="text" class="form-control" required>
</div>
<div class="mb-3">
<label for="Bark Sound" class="form-label">{{ $t("Bark Sound") }}</label>
<select id="Bark Sound" v-model="$parent.notification.barkSound" class="form-select" required>
<option value="alarm">
alarm
</option>
<option value="anticipate">
anticipate
</option>
<option value="bell">
bell
</option>
<option value="birdsong">
birdsong
</option>
<option value="bloom">
bloom
</option>
<option value="calypso">
calypso
</option>
<option value="chime">
chime
</option>
<option value="choo">
choo
</option>
<option value="descent">
descent
</option>
<option value="electronic">
electronic
</option>
<option value="fanfare">
fanfare
</option>
<option value="glass">
glass
</option>
<option value="gotosleep">
gotosleep
</option>
<option value="healthnotification">
healthnotification
</option>
<option value="horn">
horn
</option>
<option value="ladder">
ladder
</option>
<option value="mailsent">
mailsent
</option>
<option value="minuet">
minuet
</option>
<option value="multiwayinvitation">
multiwayinvitation
</option>
<option value="newmail">
newmail
</option>
<option value="newsflash">
newsflash
</option>
<option value="noir">
noir
</option>
<option value="paymentsuccess">
paymentsuccess
</option>
<option value="shake">
shake
</option>
<option value="sherwoodforest">
sherwoodforest
</option>
<option value="silence">
silence
</option>
<option value="spell">
spell
</option>
<option value="suspense">
suspense
</option>
<option value="telegraph">
telegraph
</option>
<option value="tiptoes">
tiptoes
</option>
<option value="typewriters">
typewriters
</option>
<option value="update">
update
</option>
</select>
</div>
</template> </template>

@ -389,6 +389,8 @@ export default {
SignName: "Знак име", SignName: "Знак име",
"Sms template must contain parameters: ": "SMS шаблонът трябва да съдържа следните параметри: ", "Sms template must contain parameters: ": "SMS шаблонът трябва да съдържа следните параметри: ",
"Bark Endpoint": "Bark крайна точка", "Bark Endpoint": "Bark крайна точка",
"Bark Group": "Bark група",
"Bark Sound": "Bark Звънене",
WebHookUrl: "URL адрес на уеб кука", WebHookUrl: "URL адрес на уеб кука",
SecretKey: "Таен ключ", SecretKey: "Таен ключ",
"For safety, must use secret key": "За сигурност, трябва да се използва таен ключ", "For safety, must use secret key": "За сигурност, трябва да се използва таен ключ",

@ -389,6 +389,8 @@ export default {
SignName: "Signaturname", SignName: "Signaturname",
"Sms template must contain parameters: ": "SMS Vorlage muss folgende Parameter enthalten: ", "Sms template must contain parameters: ": "SMS Vorlage muss folgende Parameter enthalten: ",
"Bark Endpoint": "Bark Endpunkt", "Bark Endpoint": "Bark Endpunkt",
"Bark Group": "Bark Gruppe",
"Bark Sound": "Bark Klingelton",
WebHookUrl: "Webhook URL", WebHookUrl: "Webhook URL",
SecretKey: "Geheimer Schlüssel", SecretKey: "Geheimer Schlüssel",
"For safety, must use secret key": "Zur Sicherheit muss ein geheimer Schlüssel verwendet werden", "For safety, must use secret key": "Zur Sicherheit muss ein geheimer Schlüssel verwendet werden",

@ -406,6 +406,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms template must contain parameters: ", "Sms template must contain parameters: ": "Sms template must contain parameters: ",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "For safety, must use secret key", "For safety, must use secret key": "For safety, must use secret key",

@ -406,6 +406,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms 템플릿은 다음과 같은 파라미터가 포함되어야 해요:", "Sms template must contain parameters: ": "Sms 템플릿은 다음과 같은 파라미터가 포함되어야 해요:",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "웹훅 URL", WebHookUrl: "웹훅 URL",
SecretKey: "Secret Key", SecretKey: "Secret Key",
"For safety, must use secret key": "안전을 위해 꼭 Secret Key를 사용하세요.", "For safety, must use secret key": "안전을 위해 꼭 Secret Key를 사용하세요.",

@ -397,6 +397,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms sjabloon moet de volgende parameters bevatten: ", "Sms template must contain parameters: ": "Sms sjabloon moet de volgende parameters bevatten: ",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "Voor de veiligheid moet je de secret key gebruiken", "For safety, must use secret key": "Voor de veiligheid moet je de secret key gebruiken",

@ -396,6 +396,8 @@ export default {
SignName: "Podpis", SignName: "Podpis",
"Sms template must contain parameters: ": "Szablon sms musi posiadać parametry: ", "Sms template must contain parameters: ": "Szablon sms musi posiadać parametry: ",
"Bark Endpoint": "Punkt końcowy Bark", "Bark Endpoint": "Punkt końcowy Bark",
"Bark Group": "grupa Bark",
"Bark Sound": "Dzwonek Bark",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "Tajny klucz", SecretKey: "Tajny klucz",
"For safety, must use secret key": "Ze względów bezpieczeństwa musisz użyć tajnego klucza", "For safety, must use secret key": "Ze względów bezpieczeństwa musisz użyć tajnego klucza",

@ -396,6 +396,8 @@ export default {
SignName: "ป้ายชื่อ", SignName: "ป้ายชื่อ",
"Sms template must contain parameters: ": "เทมเพลต SMS ต้องมีพารามิเตอร์ : ", "Sms template must contain parameters: ": "เทมเพลต SMS ต้องมีพารามิเตอร์ : ",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "เพื่อความปลอดภัย จำเป็นต้องตั้งค่ากุญแจการเข้าถึง", "For safety, must use secret key": "เพื่อความปลอดภัย จำเป็นต้องตั้งค่ากุญแจการเข้าถึง",

@ -397,6 +397,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms şablonu parametreleri içermelidir:", "Sms template must contain parameters: ": "Sms şablonu parametreleri içermelidir:",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "Güvenlik için gizli anahtar kullanılmalıdır", "For safety, must use secret key": "Güvenlik için gizli anahtar kullanılmalıdır",

@ -396,6 +396,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms template must contain parameters: ", "Sms template must contain parameters: ": "Sms template must contain parameters: ",
"Bark Endpoint": "Bark Endpoint", "Bark Endpoint": "Bark Endpoint",
"Bark Group": "Bark Group",
"Bark Sound": "Bark Sound",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "Để an toàn, hãy dùng secret key", "For safety, must use secret key": "Để an toàn, hãy dùng secret key",

@ -402,6 +402,8 @@ export default {
TemplateCode: "TemplateCode", TemplateCode: "TemplateCode",
SignName: "SignName", SignName: "SignName",
"Bark Endpoint": "Bark 接入点", "Bark Endpoint": "Bark 接入点",
"Bark Group": "Bark 群组",
"Bark Sound": "Bark 铃声",
"Device Token": "Apple Device Token", "Device Token": "Apple Device Token",
Platform: "平台", Platform: "平台",
iOS: "iOS", iOS: "iOS",

@ -396,6 +396,8 @@ export default {
SignName: "SignName", SignName: "SignName",
"Sms template must contain parameters: ": "Sms 範本必須包含參數:", "Sms template must contain parameters: ": "Sms 範本必須包含參數:",
"Bark Endpoint": "Bark 端點", "Bark Endpoint": "Bark 端點",
"Bark Group": "Bark 群組",
"Bark Sound": "Bark 鈴聲",
WebHookUrl: "WebHookUrl", WebHookUrl: "WebHookUrl",
SecretKey: "SecretKey", SecretKey: "SecretKey",
"For safety, must use secret key": "為了安全起見,必須使用秘密金鑰", "For safety, must use secret key": "為了安全起見,必須使用秘密金鑰",

Loading…
Cancel
Save