From ae03c5b06fb2d8b115ea5c75658bdc12648e97bb Mon Sep 17 00:00:00 2001 From: Jeffrey Koehler Date: Wed, 20 Oct 2021 02:28:59 -0500 Subject: [PATCH] Add method of for enabling templates only where tested Also set default template to Low Detail, which matches current format. --- src/components/NotificationDialog.vue | 15 +++++++++++---- src/components/notifications/index.js | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 8cc4f98..6cbd238 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -22,7 +22,7 @@ -
+
+
+ Uses Liquid templates Via LiquidJS.
+ See the Uptime Kuma Wiki for full detauls.
+
@@ -85,7 +89,7 @@ import { Modal } from "bootstrap"; import { ucfirst } from "../util.ts"; import Confirm from "./Confirm.vue"; -import {NotificationFormList, NotificationDetailList} from "./notifications"; +import {NotificationFormList, NotificationDetailList, TemplateEnabledList} from "./notifications"; // import from "./notifications"; @@ -119,6 +123,9 @@ export default { return null; } return NotificationFormList[this.notification.type]; + }, + enableTemplateOptions(){ + return (TemplateEnabledList.includes(this.notification.type)) } }, @@ -169,7 +176,7 @@ export default { // Set Default value here this.notification.type = this.notificationTypes[0]; - this.notification.detail = this.detailLevels[0]; + this.notification.detail = this.detailLevels[1]; this.notification.template = "[{{monitor.name}}] [{{monitor.health}}] {{monitor.msg}}" } diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 0eaf4f4..c0ab7eb 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -51,6 +51,10 @@ export const NotificationFormList = { "DingDing": DingDing } +export const TemplateEnabledList = [ + "smtp" +] + export const NotificationDetailList = [ "Minimal Detail", "Low Detail",