@ -10,72 +10,72 @@
< / div >
< / div >
< div class = "modal-body" >
< div class = "modal-body" >
< div class = "mb-3" >
< label for = "type" class = "form-label" > Notification Type < / label >
< select class = "form-select" id = "type" v-model ="notification.type" >
< option value = "telegram" > Telegram < / option >
< option value = "webhook" > Webhook < / option >
< option value = "smtp" > Email ( SMTP ) < / option >
< option value = "discord" > Discord < / option >
< option value = "signal" > Signal < / option >
< option value = "gotify" > Gotify < / option >
< option value = "slack" > Slack < / option >
< option value = "pushover" > Pushover < / option >
< option value = "apprise" > Apprise ( Support 50 + Notification services ) < / option >
< / select >
< / div >
< div class = "mb-3" >
< label for = "name" class = "form-label" > Friendly Name < / label >
< input type = "text" class = "form-control" id = "name" required v-model ="notification.name" >
< / div >
< template v-if ="notification.type === 'telegram'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "type" class = "form-label" > Notification Type < / label >
< label for = "telegram-bot-token" class = "form-label" > Bot Token < / label >
< select class = "form-select" id = "type" v-model ="notification.type" >
< input type = "text" class = "form-control" id = "telegram-bot-token" required v-model ="notification.telegramBotToken" >
< option value = "telegram" > Telegram < / option >
< div class = "form-text" > You can get a token from < a href = "https://t.me/BotFather" target = "_blank" > https : / / t . m e / B o t F a t h e r < / a > . < / d i v >
< option value = "webhook" > Webhook < / option >
< option value = "smtp" > Email ( SMTP ) < / option >
< option value = "discord" > Discord < / option >
< option value = "signal" > Signal < / option >
< option value = "gotify" > Gotify < / option >
< option value = "slack" > Slack < / option >
< option value = "pushover" > Pushover < / option >
< option value = "pushy" > Pushy < / option >
< / select >
< / div >
< / div >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "name" class = "form-label" > Friendly Name < / label >
< label for = "telegram-chat-id" class = "form-label" > Chat ID < / label >
< input type = "text" class = "form-control" id = "name" required v-model ="notification.name" >
< / div >
< template v-if ="notification.type === 'telegram'" >
< div class = "input-group mb-3" >
< div class = "mb-3" >
< input type = "text" class = "form-control" id = "telegram-chat-id" required v-model ="notification.telegramChatID" >
< label for = "telegram-bot-token" class = "form-label" > Bot Token < / label >
< button class = "btn btn-outline-secondary" type = "button" @click ="autoGetTelegramChatID" v-if ="notification.telegramBotToken" > Auto Get < / button >
< input type = "text" class = "form-control" id = "telegram-bot-token" required v-model ="notification.telegramBotToken" >
< div class = "form-text" > You can get a token from < a href = "https://t.me/BotFather" target = "_blank" > https : / / t . m e / B o t F a t h e r < / a > . < / d i v >
< / div >
< / div >
< div class = "mb-3" >
< div class = "form-text" >
< label for = "telegram-chat-id" class = "form-label" > Chat ID < / label >
Support Direct Chat / Group / Channel ' s Chat ID
< div class = "input-group mb-3" >
< input type = "text" class = "form-control" id = "telegram-chat-id" required v-model ="notification.telegramChatID" >
< button class = "btn btn-outline-secondary" type = "button" @click ="autoGetTelegramChatID" v-if ="notification.telegramBotToken" > Auto Get < / button >
< / div >
< div class = "form-text" >
Support Direct Chat / Group / Channel ' s Chat ID
< p style = "margin-top: 8px;" >
< p style = "margin-top: 8px;" >
You can get your chat id by sending message to the bot and go to this url to view the chat_id :
You can get your chat id by sending message to the bot and go to this url to view the chat_id :
< / p >
< / p >
< p style = "margin-top: 8px;" >
< p style = "margin-top: 8px;" >
< template v-if ="notification.telegramBotToken" >
< template v-if ="notification.telegramBotToken" >
< a :href ="telegramGetUpdatesURL" target = "_blank" > { { telegramGetUpdatesURL } } < / a >
< a :href ="telegramGetUpdatesURL" target = "_blank" style = "word-break: break-word; " > { { telegramGetUpdatesURL } } < / a >
< / template >
< / template >
< template v-else >
< template v-else >
{ { telegramGetUpdatesURL } }
{ { telegramGetUpdatesURL } }
< / template >
< / template >
< / p >
< / p >
< / div >
< / div >
< / div >
< / template >
< / div >
< / template >
< template v-if ="notification.type === 'webhook'" >
< template v-if ="notification.type === 'webhook'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "webhook-url" class = "form-label" > Post URL < / label >
< label for = "webhook-url" class = "form-label" > Post URL < / label >
< input type = "url" pattern = "https?://.+" class = "form-control" id = "webhook-url" required v-model ="notification.webhookURL" >
< input type = "url" pattern = "https?://.+" class = "form-control" id = "webhook-url" required v-model ="notification.webhookURL" >
< / div >
< / div >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "webhook-content-type" class = "form-label" > Content Type < / label >
< label for = "webhook-content-type" class = "form-label" > Content Type < / label >
< select class = "form-select" id = "webhook-content-type" v -model = " notification.webhookContentType " required >
< select class = "form-select" id = "webhook-content-type" v -model = " notification.webhookContentType " required >
< option value = "json" > application / json < / option >
< option value = "json" > application / json < / option >
< option value = "form-data" > multipart / form - data < / option >
< option value = "form-data" > multipart / form - data < / option >
< / select >
< / select >
@ -100,7 +100,7 @@
< div class = "mb-3" >
< div class = "mb-3" >
< div class = "form-check" >
< div class = "form-check" >
< input class = "form-check-input" type = "checkbox" value = "" id = "secure" v-model ="notification.smtpSecure" >
< input class = "form-check-input" type = "checkbox" value = "" id = "secure" v-model ="notification.smtpSecure" >
< label class = "form-check-label" for = "secure" >
< label class = "form-check-label" for = "secure" >
Secure
Secure
< / label >
< / label >
@ -141,7 +141,7 @@
< template v-if ="notification.type === 'signal'" >
< template v-if ="notification.type === 'signal'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "signal-url" class = "form-label" > Post URL < / label >
< label for = "signal-url" class = "form-label" > Post URL < / label >
< input type = "url" pattern = "https?://.+" class = "form-control" id = "signal-url" required v-model ="notification.signalURL" >
< input type = "url" pattern = "https?://.+" class = "form-control" id = "signal-url" required v-model ="notification.signalURL" >
< / div >
< / div >
@ -174,70 +174,129 @@
< / template >
< / template >
< template v-if ="notification.type === 'gotify'" >
< template v-if ="notification.type === 'gotify'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "gotify-application-token" class = "form-label" > Application Token < / label >
< label for = "gotify-application-token" class = "form-label" > Application Token < / label >
< input type = "text" class = "form-control" id = "gotify-application-token" required v-model ="notification.gotifyapplicationToken" >
< input type = "text" class = "form-control" id = "gotify-application-token" required v-model ="notification.gotifyapplicationToken" >
< / div >
< / div >
< div class = "mb-3" >
< label for = "gotify-server-url" class = "form-label" > Server URL < / label >
< div class = "input-group mb-3" >
< input type = "text" class = "form-control" id = "gotify-server-url" required v-model ="notification.gotifyserverurl" >
< / div >
< / div >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "gotify-server-url" class = "form-label" > Server URL < / label >
< label for = "gotify-priority" class = "form-label" > Priority < / label >
< div class = "input-group mb-3" >
< input type = "number" class = "form-control" id = "gotify-priority" v-model ="notification.gotifyPriority" required min="0" max="10" step="1" >
< input type = "text" class = "form-control" id = "gotify-server-url" required v-model ="notification.gotifyserverurl" >
< / div >
< / div >
< / div >
< / template >
< template v-if ="notification.type === 'slack'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "gotify-priority" class = "form-label" > Priority < / label >
< label for = "slack-webhook-url" class = "form-label" > Webhook URL < span style = "color:red;" > < sup > * < / sup > < / span > < / label >
< input type = "number" class = "form-control" id = "gotify-priority" v-model ="notification.gotifyPriority" required min="0" max="10" step="1" >
< input type = "text" class = "form-control" id = "slack-webhook-url" required v-model ="notification.slackwebhookURL" >
< label for = "slack-username" class = "form-label" > Username < / label >
< input type = "text" class = "form-control" id = "slack-username" v-model ="notification.slackusername" >
< label for = "slack-iconemo" class = "form-label" > Icon Emoji < / label >
< input type = "text" class = "form-control" id = "slack-iconemo" v-model ="notification.slackiconemo" >
< label for = "slack-channel" class = "form-label" > Channel Name < / label >
< input type = "text" class = "form-control" id = "slack-channel-name" v-model ="notification.slackchannel" >
< label for = "slack-button-url" class = "form-label" > Uptime Kuma URL < / label >
< input type = "text" class = "form-control" id = "slack-button" v-model ="notification.slackbutton" >
< div class = "form-text" >
< span style = "color:red;" > < sup > * < / sup > < / span > Required
< p style = "margin-top: 8px;" >
More info about webhooks on : < a href = "https://api.slack.com/messaging/webhooks" target = "_blank" > https : / / a p i . s l a c k . c o m / m e s s a g i n g / w e b h o o k s < / a >
< / p >
< p style = "margin-top: 8px;" >
Enter the channel name on Slack Channel Name field if you want to bypass the webhook channel . Ex : # other - channel
< / p >
< p style = "margin-top: 8px;" >
If you leave the Uptime Kuma URL field blank , it will default to the Project Github page .
< / p >
< p style = "margin-top: 8px;" >
Emoji cheat sheet : < a href = "https://www.webfx.com/tools/emoji-cheat-sheet/" target = "_blank" > https : / / w w w . w e b f x . c o m / t o o l s / e m o j i - c h e a t - s h e e t / < / a >
< / p >
< / div >
< / div >
< / div >
< / template >
< / template >
< template v-if ="notification.type === 'slack'" >
< template v-if ="notification.type === 'pushover '" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "slack-webhook-url" class = "form-label" > Slack Webhook URL < / label >
< label for = "pushover-user" class = "form-label" > User Key < span style = "color:red;" > < sup > * < / sup > < / span > < / label >
< input type = "text" class = "form-control" id = "slack-webhook-url" required v-model ="notification.slackwebhookURL" autocomplete="false" >
< input type = "text" class = "form-control" id = "pushover-user" required v-model ="notification.pushoveruserkey" >
< label for = "uptimekuma-server-url" class = "form-label" > Uptime Kuma URL < / label >
< label for = "pushover-app-token" class = "form-label" > Application Token < span style = "color:red;" > < sup > * < / sup > < / span > < / label >
< div class = "input-group mb-3" >
< input type = "text" class = "form-control" id = "pushover-app-token" required v-model ="notification.pushoverapptoken" >
< input type = "text" class = "form-control" id = "uptimekuma-server-url" required v-model ="notification.slackbutton" autocomplete="false" >
< label for = "pushover-device" class = "form-label" > Device < / label >
< / div >
< 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 >
< select class = "form-select" id = "pushover-priority" v-model ="notification.pushoverpriority" >
< option > - 2 < / option >
< option > - 1 < / option >
< option > 0 < / option >
< option > 1 < / option >
< option > 2 < / option >
< / select >
< 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;" >
< p style = "margin-top: 8px;" >
More info on : < a href = "https://api.slack.com/messaging/webhooks" target = "_blank" > https : / / a p i . s l a c k . c o m / m e s s a g i n g / w e b h o o k s < / a >
More info on : < a href = "https://pushover.net/api" target = "_blank" > https : / / p u s h o v e r . n e t / a p i < / a >
< / p >
< p style = "margin-top: 8px;" >
Emergency priority ( 2 ) has default 30 second timeout between retries and will expire after 1 hour .
< / p >
< p style = "margin-top: 8px;" >
If you want to send notifications to different devices , fill out Device field .
< / p >
< / p >
< / div >
< / div >
< / div >
< / template >
< / template >
< template v-if ="notification.type === 'pushover'" >
< 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 >
< template v-if ="notification.type === 'apprise'" >
< div class = "mb-3" >
< div class = "mb-3" >
< label for = "pushover-user-key" class = "form-label" > USER_KEY < / label >
< label for = "apprise-url" class = "form-label" > Apprise URL < / label >
< div class = "input-group mb-3" >
< input type = "text" class = "form-control" id = "apprise-url" required v-model ="notification.appriseURL" >
< input type = "text" class = "form-control" id = "pushover-user-key" required v-model ="notification.pushoverUserKey" >
< div class = "form-text" >
< p > Example : twilio : / / A c c o u n t S i d : A u t h T o k e n @ F r o m P h o n e N o < / p >
< p >
Read more : < a href = "https://github.com/caronc/apprise/wiki#notification-services" target = "_blank" > https : / / g i t h u b . c o m / c a r o n c / a p p r i s e / w i k i # n o t i f i c a t i o n - s e r v i c e s < / a >
< / p >
< / div >
< / div >
< / div >
< / div >
< p style = "margin-top: 8px;" >
More info on : < a href = "https://pushover.net/api" target = "_blank" > https : / / p u s h o v e r . n e t / a p i < / 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" >
< div class = "mb-3" >
< label for = "pushy-user-key" class = "form-label" > USER_TOKEN < / label >
< p >
< div class = "input-group mb-3" >
Status :
< input type = "text" class = "form-control" id = "pushy-user-key" required v-model ="notification.pushyToken" >
< span class = "text-primary" v-if ="appriseInstalled" > Apprise is installed < / span >
< / div >
< span class = "text-danger" v-else > Apprise is not installed. < a href = "https://github.com/caronc/apprise" > Read more < / a > < / span >
< / p >
< / div >
< / div >
< p style = "margin-top: 8px;" >
More info on : < a href = "https://pushy.me/docs/api/send-notifications" target = "_blank" > https : / / p u s h y . m e / d o c s / a p i / s e n d - n o t i f i c a t i o n s < / a >
< / p >
< / template >
< / template >
< / div >
< / div >
@ -257,7 +316,7 @@
< script >
< script >
import { Modal } from 'bootstrap'
import { Modal } from 'bootstrap'
import { ucfirst } from "../../server/util" ;
import { ucfirst } from '../util-frontend'
import axios from "axios" ;
import axios from "axios" ;
import { useToast } from 'vue-toastification'
import { useToast } from 'vue-toastification'
import Confirm from "./Confirm.vue" ;
import Confirm from "./Confirm.vue" ;
@ -278,17 +337,15 @@ export default {
type : null ,
type : null ,
gotifyPriority : 8
gotifyPriority : 8
} ,
} ,
appriseInstalled : false ,
}
}
} ,
} ,
mounted ( ) {
mounted ( ) {
this . modal = new Modal ( this . $refs . modal )
this . modal = new Modal ( this . $refs . modal )
/ / T O D O : f o r e d i t
this . $root . getSocket ( ) . emit ( "checkApprise" , ( installed ) => {
this . $root . getSocket ( ) . emit ( "getSettings" , "notification" , ( data ) => {
this . appriseInstalled = installed ;
/ / t h i s . n o t i f i c a t i o n = d a t a
} )
} )
} ,
} ,
methods : {
methods : {