From eb5589eeaf22e1e6d6adee6497ff9356eb0871af Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 5 Sep 2021 20:09:30 +0200 Subject: [PATCH 1/3] allow numeric input when using telegram --- frontend/src/forms/Notifier.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/forms/Notifier.vue b/frontend/src/forms/Notifier.vue index ebbf0ff3..4eb7538d 100644 --- a/frontend/src/forms/Notifier.vue +++ b/frontend/src/forms/Notifier.vue @@ -282,7 +282,7 @@ export default { this.notifier.form.forEach((f) => { let field = f.field.toLowerCase() let val = this.notifier[field] - if (this.isNumeric(val)) { + if (this.isNumeric(val) && (this.form.method!='telegram' && field != 'var1')) { val = parseInt(val) } this.form[field] = val @@ -304,7 +304,7 @@ export default { this.notifier.form.forEach((f) => { let field = f.field.toLowerCase() let val = this.notifier[field] - if (this.isNumeric(val)) { + if (this.isNumeric(val) && (this.form.method!='telegram' && field != 'var1')) { val = parseInt(val) } this.form[field] = val From 5a0639a14ea2c9be062a25280fa2a0588db0830d Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 5 Sep 2021 20:36:15 +0200 Subject: [PATCH 2/3] adjust info text --- notifiers/telegram.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifiers/telegram.go b/notifiers/telegram.go index e5c87676..ee2558dc 100644 --- a/notifiers/telegram.go +++ b/notifiers/telegram.go @@ -52,8 +52,8 @@ var Telegram = &telegram{¬ifications.Notification{ }, { Type: "text", Title: "Channel", - Placeholder: "@statping_channel", - SmallText: "Insert your Telegram Channel including the @ symbol. The bot will need to be an administrator of this channel.", + Placeholder: "@statping_channel/-123123512312", + SmallText: "Insert your Telegram Channel including the @ symbol. The bot will need to be an administrator of this channel. You can also supply a chat_id.", DbField: "var1", Required: true, }}}, From e764f639d0b015c9e059e18d915f2a4f43161288 Mon Sep 17 00:00:00 2001 From: nils1323 Date: Mon, 6 Sep 2021 17:37:43 +0200 Subject: [PATCH 3/3] Fix logic check if it is var1 is not necessary because telegram only needs strings and no numbers --- frontend/src/forms/Notifier.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/forms/Notifier.vue b/frontend/src/forms/Notifier.vue index 4eb7538d..1e5c8ef5 100644 --- a/frontend/src/forms/Notifier.vue +++ b/frontend/src/forms/Notifier.vue @@ -282,7 +282,7 @@ export default { this.notifier.form.forEach((f) => { let field = f.field.toLowerCase() let val = this.notifier[field] - if (this.isNumeric(val) && (this.form.method!='telegram' && field != 'var1')) { + if (this.isNumeric(val) && this.form.method!='telegram') { val = parseInt(val) } this.form[field] = val @@ -304,7 +304,7 @@ export default { this.notifier.form.forEach((f) => { let field = f.field.toLowerCase() let val = this.notifier[field] - if (this.isNumeric(val) && (this.form.method!='telegram' && field != 'var1')) { + if (this.isNumeric(val) && this.form.method!='telegram') { val = parseInt(val) } this.form[field] = val