فهرست منبع

fix(alerts): show Matrix and ntfy alerts in details and stats (#5123)

Both alert types are dispatched by alert.sh but were never added to the
details output or the stats report, so an enabled Matrix or ntfy alert
was invisible in details and uncounted in stats.
Daniel Gibbs 4 روز پیش
والد
کامیت
65aeb3fd5b
2فایلهای تغییر یافته به همراه20 افزوده شده و 0 حذف شده
  1. 10 0
      lgsm/modules/info_messages.sh
  2. 10 0
      lgsm/modules/info_stats.sh

+ 10 - 0
lgsm/modules/info_messages.sh

@@ -557,6 +557,8 @@ fn_info_messages_script() {
 	# Email alert:            off
 	# Gotify alert:           off
 	# IFTTT alert:            off
+	# Matrix alert:           off
+	# ntfy alert:             off
 	# Pushbullet alert:       off
 	# Pushover alert:         off
 	# Rocketchat alert:       off
@@ -608,6 +610,14 @@ fn_info_messages_script() {
 		if [ "${iftttalert}" == "on" ]; then
 			echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
 		fi
+		# Matrix alert
+		if [ "${matrixalert}" == "on" ]; then
+			echo -e "${lightblue}Matrix alert:\t${default}${matrixalert}"
+		fi
+		# ntfy alert
+		if [ "${ntfyalert}" == "on" ]; then
+			echo -e "${lightblue}ntfy alert:\t${default}${ntfyalert}"
+		fi
 		# Pushbullet alert
 		if [ "${pushbulletalert}" == "on" ]; then
 			echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"

+ 10 - 0
lgsm/modules/info_stats.sh

@@ -132,6 +132,16 @@ if [ "${iftttalert}" == "on" ]; then
 	fn_alert_payload
 	curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
 fi
+if [ "${matrixalert}" == "on" ]; then
+	alerttype="matrix"
+	fn_alert_payload
+	curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
+fi
+if [ "${ntfyalert}" == "on" ]; then
+	alerttype="ntfy"
+	fn_alert_payload
+	curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
+fi
 if [ "${pushbulletalert}" == "on" ]; then
 	alerttype="pushbullet"
 	fn_alert_payload