Merge remote-tracking branch 'origin/master' into feature/1685-prometheus-api-key

# Conflicts:
#	src/lang/en.json
This commit is contained in:
Louis Lam
2023-02-25 00:06:25 +08:00
59 changed files with 1964 additions and 115 deletions

View File

@@ -13,7 +13,10 @@
<div class="mb-3">
<label for="notification-type" class="form-label">{{ $t("Notification Type") }}</label>
<select id="notification-type" v-model="notification.type" class="form-select">
<option v-for="type in notificationTypes" :key="type" :value="type">{{ $t(type) }}</option>
<option v-for="(name, type) in notificationNameList.regularList" :key="type" :value="type">{{ name }}</option>
<optgroup :label="$t('notificationRegional')">
<option v-for="(name, type) in notificationNameList.regionalList" :key="type" :value="type">{{ name }}</option>
</optgroup>
</select>
</div>
@@ -67,7 +70,7 @@
</Confirm>
</template>
<script lang="ts">
<script>
import { Modal } from "bootstrap";
import Confirm from "./Confirm.vue";
@@ -103,7 +106,91 @@ export default {
return null;
}
return NotificationFormList[this.notification.type];
}
},
notificationNameList() {
let regularList = {
"alerta": "Alerta",
"AlertNow": "AlertNow",
"apprise": this.$t("apprise"),
"Bark": "Bark",
"clicksendsms": "ClickSend SMS",
"discord": "Discord",
"GoogleChat": "Google Chat (Google Workspace)",
"gorush": "Gorush",
"gotify": "Gotify",
"HomeAssistant": "Home Assistant",
"Kook": "Kook",
"line": "LINE Messenger",
"LineNotify": "LINE Notify",
"lunasea": "LunaSea",
"matrix": "Matrix",
"mattermost": "Mattermost",
"ntfy": "Ntfy",
"octopush": "Octopush",
"OneBot": "OneBot",
"PagerDuty": "PagerDuty",
"pushbullet": "Pushbullet",
"PushByTechulus": "Push by Techulus",
"pushover": "Pushover",
"pushy": "Pushy",
"rocket.chat": "Rocket.Chat",
"signal": "Signal",
"slack": "Slack",
"squadcast": "SquadCast",
"SMSEagle": "SMSEagle",
"smtp": this.$t("smtp"),
"stackfield": "Stackfield",
"teams": "Microsoft Teams",
"telegram": "Telegram",
"Splunk": "Splunk",
"webhook": "Webhook",
"GoAlert": "GoAlert",
"ZohoCliq": "ZohoCliq"
};
// Put notifications here if it's not supported in most regions or its documentation is not in English
let regionalList = {
"AliyunSMS": "AliyunSMS (阿里云短信服务)",
"DingDing": "DingDing (钉钉自定义机器人)",
"Feishu": "Feishu (飞书)",
"FreeMobile": "FreeMobile (mobile.free.fr)",
"PushDeer": "PushDeer",
"promosms": "PromoSMS",
"serwersms": "SerwerSMS.pl",
"SMSManager": "SmsManager (smsmanager.cz)",
"WeCom": "WeCom (企业微信群机器人)",
"ServerChan": "ServerChan (Server酱)",
};
// Sort by notification name
// No idea how, but it works
// https://stackoverflow.com/questions/1069666/sorting-object-property-by-values
let sort = (list2) => {
return Object.entries(list2)
.sort(([ , a ], [ , b ]) => a.localeCompare(b))
.reduce((r, [ k, v ]) => ({
...r,
[k]: v
}), {});
};
return {
regularList: sort(regularList),
regionalList: sort(regionalList),
};
},
notificationFullNameList() {
let list = {};
for (let [ key, value ] of Object.entries(this.notificationNameList.regularList)) {
list[key] = value;
}
for (let [ key, value ] of Object.entries(this.notificationNameList.regionalList)) {
list[key] = value;
}
return list;
},
},
watch: {
@@ -203,11 +290,12 @@ export default {
* @return {string}
*/
getUniqueDefaultName(notificationKey) {
let index = 1;
let name = "";
do {
name = this.$t("defaultNotificationName", {
notification: this.$t(notificationKey).replace(/\(.+\)/, "").trim(),
notification: this.notificationFullNameList[notificationKey].replace(/\(.+\)/, "").trim(),
number: index++
});
} while (this.$root.notificationList.find(it => it.name === name));

View File

@@ -16,7 +16,7 @@
<div class="mb-3">
<label for="gorush-platform" class="form-label">{{ $t("Platform") }}</label><span style="color: red;"><sup>*</sup></span>
<select id="gorush-platform" v-model="$parent.notification.gorushPlatform" class="form-select">
<option value="ios">{{ $t("iOS") }}</option>
<option value="ios">iOS</option>
<option value="android">{{ $t("Android") }}</option>
<option value="huawei">{{ $t("Huawei") }}</option>
</select>

View File

@@ -28,6 +28,30 @@
<a :href="telegramGetUpdatesURL('withToken')" target="_blank" style="word-break: break-word;">{{ telegramGetUpdatesURL("masked") }}</a>
</p>
</div>
<label for="message_thread_id" class="form-label">{{ $t("telegramMessageThreadID") }}</label>
<input id="message_thread_id" v-model="$parent.notification.telegramMessageThreadID" type="text" class="form-control">
<p class="form-text">{{ $t("telegramMessageThreadIDDescription") }}</p>
<div class="form-check form-switch">
<input v-model="$parent.notification.telegramSendSilently" class="form-check-input" type="checkbox">
<label class="form-check-label">{{ $t("telegramSendSilently") }}</label>
</div>
<div class="form-text">
{{ $t("telegramSendSilentlyDescription") }}
</div>
</div>
<div class="mb-3">
<div class="form-check form-switch">
<input v-model="$parent.notification.telegramProtectContent" class="form-check-input" type="checkbox">
<label class="form-check-label">{{ $t("telegramProtectContent") }}</label>
</div>
<div class="form-text">
{{ $t("telegramProtectContentDescription") }}
</div>
</div>
</template>

View File

@@ -90,7 +90,7 @@
"Heartbeat Interval": "فاصل نبضات القلب",
"Retries": "يحاول مجدداً",
"Heartbeat Retry Interval": "الفاصل الزمني لإعادة محاكمة نبضات القلب",
"Resend Notification if Down X times consequently": "إعادة تقديم الإخطار إذا انخفض x مرات بالتالي",
"Resend Notification if Down X times consecutively": "إعادة تقديم الإخطار إذا انخفض x مرات بالتالي",
"Advanced": "متقدم",
"Upside Down Mode": "وضع أسفل أسفل",
"Max. Redirects": "الأعلى. إعادة التوجيه",
@@ -215,6 +215,7 @@
"Bot Token": "رمز الروبوت",
"wayToGetTelegramToken": "يمكنك الحصول على رمز من {0}.",
"Chat ID": "معرف الدردشة",
"telegramMessageThreadID": "معرف المواضيع",
"supportTelegramChatID": "دعم الدردشة المباشرة / معرف الدردشة للقناة",
"wayToGetTelegramChatID": "يمكنك الحصول على معرف الدردشة الخاص بك عن طريق إرسال رسالة إلى الروبوت والانتقال إلى عنوان URL هذا لعرض Chat_id",
"YOUR BOT TOKEN HERE": "رمز الروبوت الخاص بك هنا",

View File

@@ -539,7 +539,7 @@
"wayToGetLineNotifyToken": "Можете да получите токен код за достъп от {0}",
"resendEveryXTimes": "Изпращай повторно на всеки {0} пъти",
"resendDisabled": "Повторното изпращане е изключено",
"Resend Notification if Down X times consequently": "Повторно изпращане на известие, ако е недостъпен X пъти последователно",
"Resend Notification if Down X times consecutively": "Повторно изпращане на известие, ако е недостъпен X пъти последователно",
"Bark Group": "Bark група",
"Bark Sound": "Bark звук",
"HTTP Headers": "HTTP хедъри",

View File

@@ -90,7 +90,7 @@
"Heartbeat Interval": "Heartbeat interval",
"Retries": "Počet pokusů",
"Heartbeat Retry Interval": "Interval opakování heartbeatu",
"Resend Notification if Down X times consequently": "Zaslat oznámení znovu, pokud je služba nedostupná Xkrát za sebou",
"Resend Notification if Down X times consecutively": "Zaslat oznámení znovu, pokud je služba nedostupná Xkrát za sebou",
"Advanced": "Rozšířené",
"Upside Down Mode": "Inverzní režim",
"Max. Redirects": "Max. přesměrování",

View File

@@ -165,7 +165,7 @@
"Pink": "Pink",
"Search...": "Suchen…",
"Heartbeat Retry Interval": "Überprüfungsintervall",
"Resend Notification if Down X times consequently": "Benachrichtigung erneut senden, wenn Inaktiv X mal hintereinander",
"Resend Notification if Down X times consecutively": "Benachrichtigung erneut senden, wenn Inaktiv X mal hintereinander",
"retryCheckEverySecond": "Alle {0} Sekunden neu versuchen",
"resendEveryXTimes": "Erneut versenden alle {0} mal",
"resendDisabled": "Erneut versenden deaktiviert",

View File

@@ -165,7 +165,7 @@
"Pink": "Pink",
"Search...": "Suchen…",
"Heartbeat Retry Interval": "Überprüfungsintervall",
"Resend Notification if Down X times consequently": "Benachrichtigung erneut senden, wenn inaktiv X Mal hintereinander",
"Resend Notification if Down X times consecutively": "Benachrichtigung erneut senden, wenn inaktiv X Mal hintereinander",
"retryCheckEverySecond": "Alle {0} Sekunden neu versuchen",
"resendEveryXTimes": "Erneut versenden alle {0} mal",
"resendDisabled": "Erneut versenden deaktiviert",

View File

@@ -74,7 +74,7 @@
"Heartbeat Interval": "Διάστημα καρδιακών παλμών",
"Retries": "Επαναλήψεις",
"Heartbeat Retry Interval": "Διάστημα επανάληψης παλμών καρδιάς",
"Resend Notification if Down X times consequently": "Αποστολή νέας ειδοποίησης εάν κατω X φορές κατά συνέχεια",
"Resend Notification if Down X times consecutively": "Αποστολή νέας ειδοποίησης εάν κατω X φορές κατά συνέχεια",
"Advanced": "Προχωρημένα",
"Upside Down Mode": "Ανάποδη λειτουργία",
"Max. Redirects": "Μέγιστη. Ανακατευθύνσεις",

View File

@@ -55,7 +55,7 @@
"Heartbeat Interval": "Heartbeat Interval",
"Retries": "Retries",
"Heartbeat Retry Interval": "Heartbeat Retry Interval",
"Resend Notification if Down X times consequently": "Resend Notification if Down X times consecutively",
"Resend Notification if Down X times consecutively": "Resend Notification if Down X times consecutively",
"Advanced": "Advanced",
"checkEverySecond": "Check every {0} seconds",
"retryCheckEverySecond": "Retry every {0} seconds",
@@ -186,7 +186,6 @@
"defaultNotificationName": "My {notification} Alert ({number})",
"here": "here",
"Required": "Required",
"webhook": "Webhook",
"Post URL": "Post URL",
"Content Type": "Content Type",
"webhookJsonDesc": "{0} is good for any modern HTTP servers such as Express.js",
@@ -359,11 +358,15 @@
"Domain": "Domain",
"Workstation": "Workstation",
"Packet Size": "Packet Size",
"telegram": "Telegram",
"ZohoCliq": "ZohoCliq",
"Bot Token": "Bot Token",
"wayToGetTelegramToken": "You can get a token from {0}.",
"Chat ID": "Chat ID",
"telegramMessageThreadID": "(Optional) Message Thread ID",
"telegramMessageThreadIDDescription": "Optional Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
"telegramSendSilently": "Send Silently",
"telegramSendSilentlyDescription": "Sends the message silently. Users will receive a notification with no sound.",
"telegramProtectContent": "Protect Forwarding/Saving",
"telegramProtectContentDescription": "If enabled, the bot messages in Telegram will be protected from forwarding and saving.",
"supportTelegramChatID": "Support Direct Chat / Group / Channel's Chat ID",
"wayToGetTelegramChatID": "You can get your chat ID by sending a message to the bot and going to this URL to view the chat_id:",
"YOUR BOT TOKEN HERE": "YOUR BOT TOKEN HERE",
@@ -388,7 +391,6 @@
"backupOutdatedWarning": "Deprecated: Since a lot of features were added and this backup feature is a bit unmaintained, it cannot generate or restore a complete backup.",
"backupRecommend": "Please backup the volume or the data folder (./data/) directly instead.",
"Optional": "Optional",
"squadcast": "Squadcast",
"or": "or",
"recurringInterval": "Interval",
"Recurring": "Recurring",
@@ -436,6 +438,7 @@
"uninstall": "Uninstall",
"uninstalling": "Uninstalling",
"confirmUninstallPlugin": "Are you sure want to uninstall this plugin?",
"notificationRegional": "Regional",
"smtp": "Email (SMTP)",
"secureOptionNone": "None / STARTTLS (25, 587)",
"secureOptionTLS": "TLS (465)",
@@ -530,28 +533,11 @@
"pushoversounds none": "None (silent)",
"pushyAPIKey": "Secret API Key",
"pushyToken": "Device token",
"discord": "Discord",
"teams": "Microsoft Teams",
"signal": "Signal",
"gotify": "Gotify",
"slack": "Slack",
"rocket.chat": "Rocket.Chat",
"pushover": "Pushover",
"pushy": "Pushy",
"PushByTechulus": "Push by Techulus",
"octopush": "Octopush",
"promosms": "PromoSMS",
"clicksendsms": "ClickSend SMS",
"lunasea": "LunaSea",
"apprise": "Apprise (Support 50+ Notification services)",
"GoogleChat": "Google Chat (Google Workspace only)",
"pushbullet": "Pushbullet",
"Kook": "Kook",
"wayToGetKookBotToken": "Create application and get your bot token at {0}",
"wayToGetKookGuildID": "Switch on 'Developer Mode' in Kook setting, and right click the guild to get its ID",
"Guild ID": "Guild ID",
"line": "Line Messenger",
"mattermost": "Mattermost",
"User Key": "User Key",
"Device": "Device",
"Message Title": "Message Title",
@@ -586,12 +572,10 @@
"SendKey": "SendKey",
"SMSManager API Docs": "SMSManager API Docs ",
"Gateway Type": "Gateway Type",
"SMSManager": "SMSManager",
"You can divide numbers with": "You can divide numbers with",
"Base URL": "Base URL",
"goAlertInfo": "GoAlert is a An open source application for on-call scheduling, automated escalations and notifications (like SMS or voice calls). Automatically engage the right person, the right way, and at the right time! {0}",
"goAlertIntegrationKeyInfo": "Get generic API integration key for the service in this format \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\" usually the value of token parameter of copied URL.",
"goAlert": "GoAlert",
"AccessKeyId": "AccessKey ID",
"SecretAccessKey": "AccessKey Secret",
"PhoneNumbers": "PhoneNumbers",
@@ -606,7 +590,6 @@
"For safety, must use secret key": "For safety, must use secret key",
"Device Token": "Device Token",
"Platform": "Platform",
"iOS": "iOS",
"Android": "Android",
"Huawei": "Huawei",
"High": "High",
@@ -617,7 +600,6 @@
"Proxy Protocol": "Proxy Protocol",
"Proxy Server": "Proxy Server",
"Proxy server has authentication": "Proxy server has authentication",
"matrix": "Matrix",
"promosmsTypeEco": "SMS ECO - cheap but slow and often overloaded. Limited only to Polish recipients.",
"promosmsTypeFlash": "SMS FLASH - Message will automatically show on recipient device. Limited only to Polish recipients.",
"promosmsTypeFull": "SMS FULL - Premium tier of SMS, You can use your Sender Name (You need to register name first). Reliable for alerts.",
@@ -653,19 +635,15 @@
"do nothing": "do nothing",
"auto acknowledged": "auto acknowledged",
"auto resolve": "auto resolve",
"gorush": "Gorush",
"alerta": "Alerta",
"alertaApiEndpoint": "API Endpoint",
"alertaEnvironment": "Environment",
"alertaApiKey": "API Key",
"alertaAlertState": "Alert State",
"alertaRecoverState": "Recover State",
"serwersms": "SerwerSMS.pl",
"serwersmsAPIUser": "API Username (incl. webapi_ prefix)",
"serwersmsAPIPassword": "API Password",
"serwersmsPhoneNumber": "Phone number",
"serwersmsSenderName": "SMS Sender Name (registered via customer portal)",
"smseagle": "SMSEagle",
"smseagleTo": "Phone number(s)",
"smseagleGroup": "Phonebook group name(s)",
"smseagleContact": "Phonebook contact name(s)",
@@ -675,14 +653,12 @@
"smseagleUrl": "Your SMSEagle device URL",
"smseagleEncoding": "Send as Unicode",
"smseaglePriority": "Message priority (0-9, default = 0)",
"stackfield": "Stackfield",
"Recipient Number": "Recipient Number",
"From Name/Number": "From Name/Number",
"Leave blank to use a shared sender number.": "Leave blank to use a shared sender number.",
"Octopush API Version": "Octopush API Version",
"Legacy Octopush-DM": "Legacy Octopush-DM",
"ntfy Topic": "ntfy Topic",
"HomeAssistant": "Home Assistant",
"onebotHttpAddress": "OneBot HTTP Address",
"onebotMessageType": "OneBot Message Type",
"onebotGroupMessage": "Group",
@@ -696,6 +672,7 @@
"Edit Tag": "Edit Tag",
"Server Address": "Server Address",
"Learn More": "Learn More",
"Body Encoding": "Body Encoding",
"API Keys": "API Keys",
"Expiry": "Expiry",
"Expiry date": "Expiry date",

View File

@@ -304,7 +304,7 @@
"General Monitor Type": "Monitor Tipo General",
"Specific Monitor Type": "Monitor Tipo Específico",
"Monitor": "Monitores",
"Resend Notification if Down X times consequently": "Reenviar Notificación si Caído X veces consecutivamente",
"Resend Notification if Down X times consecutively": "Reenviar Notificación si Caído X veces consecutivamente",
"resendEveryXTimes": "Reenviar cada {0} veces",
"resendDisabled": "Reenvío deshabilitado",
"needPushEvery": "Debe llamar a esta URL cada {0} segundos.",

View File

@@ -89,7 +89,7 @@
"Heartbeat Interval": "Intervalle de vérification",
"Retries": "Essais",
"Heartbeat Retry Interval": "Réessayer l'intervalle de vérification",
"Resend Notification if Down X times consequently": "Renvoyer la notification si en panne X fois consécutivement",
"Resend Notification if Down X times consecutively": "Renvoyer la notification si en panne X fois consécutivement",
"Advanced": "Avancé",
"Upside Down Mode": "Mode inversé",
"Max. Redirects": "Nombre maximum de redirections",

View File

@@ -89,7 +89,7 @@
"Heartbeat Interval": "מרווח פעימות",
"Retries": "נסיונות חוזרים",
"Heartbeat Retry Interval": "מרווח נסיונות חוזר של פעימות",
"Resend Notification if Down X times consequently": "שלח שוב הודעה אם ירד X פעמים כתוצאה מכך",
"Resend Notification if Down X times consecutively": "שלח שוב הודעה אם ירד X פעמים כתוצאה מכך",
"Advanced": "מתקדם",
"Upside Down Mode": "מצב הפוך",
"Max. Redirects": "מקסימום הפניות מחדש",

View File

@@ -378,7 +378,7 @@
"resendEveryXTimes": "Ponovno pošalji svakih {0} puta",
"resendDisabled": "Ponovno slanje je onemogućeno",
"dnsPortDescription": "Port DNS poslužitelja. Zadana vrijednost je 53. Moguće je promijeniti ga u svakom trenutku.",
"Resend Notification if Down X times consequently": "Ponovno pošalji obavijest ako je usluga nedostupna više puta zaredom",
"Resend Notification if Down X times consecutively": "Ponovno pošalji obavijest ako je usluga nedostupna više puta zaredom",
"topic": "Tema",
"topicExplanation": "MQTT tema koja će se monitorirati",
"successMessage": "Poruka o uspjehu",

View File

@@ -74,7 +74,7 @@
"Heartbeat Interval": "Jarak Waktu Heartbeat",
"Retries": "Coba lagi",
"Heartbeat Retry Interval": "Jeda Pengulangan Heartbeat",
"Resend Notification if Down X times consequently": "Kirim Ulang Notifikasi jika Tidak Aktif X kali",
"Resend Notification if Down X times consecutively": "Kirim Ulang Notifikasi jika Tidak Aktif X kali",
"Advanced": "Tingkat Lanjut",
"Upside Down Mode": "Mode Terbalik",
"Max. Redirects": "Maksimal Pengalihan",

View File

@@ -680,7 +680,7 @@
"Passive Monitor Type": "수동 모니터링",
"Specific Monitor Type": "특정 모니터링",
"Monitor": "모니터",
"Resend Notification if Down X times consequently": "X번 중단될 경우 알림 다시 보내기",
"Resend Notification if Down X times consecutively": "X번 중단될 경우 알림 다시 보내기",
"Schedule maintenance": "점검 예약하기",
"Affected Monitors": "영향을 받는 모니터링",
"Pick Affected Monitors...": "영향을 받는 모니터링 선택하기…",

View File

@@ -494,7 +494,7 @@
"atLeastOneMonitor": "Wybierz co najmniej jeden monitor, którego dotyczy problem",
"deleteMaintenanceMsg": "Czy na pewno chcesz usunąć tę konserwację?",
"dnsPortDescription": "Port serwera DNS. Domyślnie 53. Możesz zmienić port w dowolnym momencie.",
"Resend Notification if Down X times consequently": "Wyślij ponownie powiadomienie, jeśli nie działa X razy z rzędu",
"Resend Notification if Down X times consecutively": "Wyślij ponownie powiadomienie, jeśli nie działa X razy z rzędu",
"error": "błąd",
"critical": "krytyczny",
"wayToGetPagerDutyKey": "Możesz to uzyskać, przechodząc do Service -> Service Directory -> (wybierz usługę) -> Integrations -> Add integration. Tutaj możesz wyszukać \"Events API V2\". Więcej informacji {0}",

View File

@@ -249,7 +249,7 @@
"enabled": "Ativado",
"setAsDefault": "Definir como padrão",
"Primary Base URL": "URL base principal",
"Resend Notification if Down X times consequently": "Reenviar Notificação se OFFLINE X vezes consecutivamente",
"Resend Notification if Down X times consecutively": "Reenviar Notificação se OFFLINE X vezes consecutivamente",
"pushOptionalParams": "Parâmetros opcionais: {0}",
"webhookFormDataDesc": "{multipart} é bom para PHP. O JSON precisará ser analisado com {decodeFunction}",
"HeadersInvalidFormat": "Os cabeçalhos da solicitação não são um JSON válidos: ",

View File

@@ -522,7 +522,7 @@
"resendEveryXTimes": "ส่งซ้ำทุก {0} ครั้ง",
"resendDisabled": "การส่งซ้ำถูกปิดใช้งาน",
"dnsPortDescription": "พอร์ตของเซิร์ฟเวอร์ DNS, ค่าเริ่มต้นคือ 53, คุณสามารถเปลี่ยนพอร์ตตอนไหนก็ได้",
"Resend Notification if Down X times consequently": "ส่งการแจ้งเตือนซ้ำถ้าออฟไลน์ครบ X ครั้ง",
"Resend Notification if Down X times consecutively": "ส่งการแจ้งเตือนซ้ำถ้าออฟไลน์ครบ X ครั้ง",
"error": "เกิดข้อผิดพลาด",
"critical": "วิกฤต",
"wayToGetPagerDutyKey": "คุณสามารถรับคีย์ได้โดยการไปที่ Service -> Service Directory -> (Select a service) -> Integrations -> Add integration, และค้นหา \"Events API V2\", สำหรับข้อมูลเพิ่มเติม {0}",

View File

@@ -74,7 +74,7 @@
"Heartbeat Interval": "Servis Test Aralığı",
"Retries": "Yeniden deneme",
"Heartbeat Retry Interval": "Sağlık Durumları Tekrar Deneme Sıklığı",
"Resend Notification if Down X times consequently": "Art arda X kez düşerse bildirimi yeniden gönder",
"Resend Notification if Down X times consecutively": "Art arda X kez düşerse bildirimi yeniden gönder",
"Advanced": "Gelişmiş",
"Upside Down Mode": "Ters/Düz Modu",
"Max. Redirects": "Maksimum Yönlendirme",

View File

@@ -89,7 +89,7 @@
"Heartbeat Interval": "心跳间隔",
"Retries": "重试次数",
"Heartbeat Retry Interval": "心跳重试间隔",
"Resend Notification if Down X times consequently": "连续失败时重复发送通知的间隔次数",
"Resend Notification if Down X times consecutively": "连续失败时重复发送通知的间隔次数",
"Advanced": "高级",
"Upside Down Mode": "反转模式",
"Max. Redirects": "最大重定向次数",
@@ -272,7 +272,6 @@
"apprise": "Apprise (支持 50+ 种通知服务)",
"GoogleChat": "Google Chat仅 Google Workspace",
"pushbullet": "Pushbullet",
"AliyunSMS": "阿里云短信服务",
"Kook": "Kook",
"wayToGetKookBotToken": "在 {0} 创建应用并获取机器人 Token",
"wayToGetKookGuildID": "在 Kook 设置中打开“开发者模式”,然后右键点击频道可获取其 ID",
@@ -448,7 +447,6 @@
"Bark Endpoint": "Bark 接入点",
"Bark Group": "Bark 群组",
"Bark Sound": "Bark 铃声",
"DingDing": "钉钉自定义机器人",
"WebHookUrl": "钉钉自定义机器人 Webhook 地址",
"SecretKey": "钉钉自定义机器人加签密钥",
"For safety, must use secret key": "出于安全考虑,必须使用加签密钥",

View File

@@ -397,7 +397,7 @@
"affectedStatusPages": "在已選取的狀態頁中顯示此維護訊息",
"Primary Base URL": "主要 Base URL",
"Passive Monitor Type": "被動監測器類型",
"Resend Notification if Down X times consequently": "每 X 次心跳皆離線,重新傳送通知",
"Resend Notification if Down X times consecutively": "每 X 次心跳皆離線,重新傳送通知",
"Game": "遊戲",
"Specific Monitor Type": "特定監測器類型",
"Monitor": "監測器 | 監測器",

View File

@@ -89,7 +89,7 @@
"Heartbeat Interval": "心跳間隔",
"Retries": "重試次數",
"Heartbeat Retry Interval": "心跳重試間隔",
"Resend Notification if Down X times consequently": "若 X 次心跳皆離線,重新傳送通知",
"Resend Notification if Down X times consecutively": "若 X 次心跳皆離線,重新傳送通知",
"Advanced": "進階",
"Upside Down Mode": "顛倒模式",
"Max. Redirects": "最大重新導向次數",

View File

@@ -340,7 +340,7 @@
<div class="my-3">
<label for="resend-interval" class="form-label">
{{ $t("Resend Notification if Down X times consequently") }}
{{ $t("Resend Notification if Down X times consecutively") }}
<span v-if="monitor.resendInterval > 0">({{ $t("resendEveryXTimes", [ monitor.resendInterval ]) }})</span>
<span v-else>({{ $t("resendDisabled") }})</span>
</label>
@@ -503,6 +503,15 @@
</select>
</div>
<!-- Encoding -->
<div class="my-3">
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>
<select id="httpBodyEncoding" v-model="monitor.httpBodyEncoding" class="form-select">
<option value="json">JSON</option>
<option value="xml">XML</option>
</select>
</div>
<!-- Body -->
<div class="my-3">
<label for="body" class="form-label">{{ $t("Body") }}</label>
@@ -723,6 +732,15 @@ message HealthCheckResponse {
` ]);
},
bodyPlaceholder() {
if (this.monitor && this.monitor.httpBodyEncoding && this.monitor.httpBodyEncoding === "xml") {
return this.$t("Example:", [ `
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Uptime>Kuma</Uptime>
</soap:Body>
</soap:Envelope>` ]);
}
return this.$t("Example:", [ `
{
"key": "value"
@@ -872,6 +890,7 @@ message HealthCheckResponse {
mqttTopic: "",
mqttSuccessMessage: "",
authMethod: null,
httpBodyEncoding: "json"
};
if (this.$root.proxyList && !this.monitor.proxyId) {
@@ -909,7 +928,7 @@ message HealthCheckResponse {
* @returns {boolean} Is the form input valid?
*/
isInputValid() {
if (this.monitor.body) {
if (this.monitor.body && (!this.monitor.httpBodyEncoding || this.monitor.httpBodyEncoding === "json")) {
try {
JSON.parse(this.monitor.body);
} catch (err) {
@@ -933,6 +952,7 @@ message HealthCheckResponse {
* @returns {void}
*/
async submit() {
this.processing = true;
if (!this.isInputValid()) {
@@ -940,11 +960,15 @@ message HealthCheckResponse {
return;
}
// Beautify the JSON format
if (this.monitor.body) {
// Beautify the JSON format (only if httpBodyEncoding is not set or === json)
if (this.monitor.body && (!this.monitor.httpBodyEncoding || this.monitor.httpBodyEncoding === "json")) {
this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4);
}
if (this.monitor.type && this.monitor.type !== "http" && this.monitor.type !== "keyword") {
this.monitor.httpBodyEncoding = null;
}
if (this.monitor.headers) {
this.monitor.headers = JSON.stringify(JSON.parse(this.monitor.headers), null, 4);
}

View File

@@ -20,6 +20,9 @@
<div class="my-3">
<label for="description" class="form-label">{{ $t("Description") }}</label>
<textarea id="description" v-model="config.description" class="form-control"></textarea>
<div class="form-text">
{{ $t("markdownSupported") }}
</div>
</div>
<!-- Footer Text -->
@@ -258,7 +261,9 @@
<!-- Description -->
<strong v-if="editMode">{{ $t("Description") }}:</strong>
<Editable v-model="config.description" :contenteditable="editMode" tag="div" class="mb-4 description" />
<Editable v-if="enableEditMode" v-model="config.description" :contenteditable="editMode" tag="div" class="mb-4 description" />
<!-- eslint-disable-next-line vue/no-v-html-->
<div v-if="! enableEditMode" class="alert-heading p-2" v-html="descriptionHTML"></div>
<div v-if="editMode" class="mb-4">
<div>
@@ -497,11 +502,27 @@ export default {
},
incidentHTML() {
return DOMPurify.sanitize(marked(this.incident.content));
if (this.incident.content != null) {
return DOMPurify.sanitize(marked(this.incident.content));
} else {
return "";
}
},
descriptionHTML() {
if (this.config.description != null) {
return DOMPurify.sanitize(marked(this.config.description));
} else {
return "";
}
},
footerHTML() {
return DOMPurify.sanitize(marked(this.config.footerText));
if (this.config.footerText != null) {
return DOMPurify.sanitize(marked(this.config.footerText));
} else {
return "";
}
},
},
watch: {