mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Add support for Apprise Tags
This commit is contained in:
@@ -78,7 +78,7 @@ def main():
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def check_config():
|
||||
if get_setting_value('APPRISE_URL') == '' or get_setting_value('APPRISE_HOST') == '':
|
||||
if get_setting_value('APPRISE_HOST') == '' or get_setting_value('APPRISE_URL') == '':
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
@@ -113,6 +113,14 @@ def send(html, text):
|
||||
"body": payloadData
|
||||
}
|
||||
|
||||
if get_setting_value('APPRISE_TARGETTYPE') == 'tag':
|
||||
_json_payload = {
|
||||
"tags": get_setting_value('APPRISE_URL'),
|
||||
"title": "NetAlertX Notifications",
|
||||
"format": get_setting_value('APPRISE_PAYLOAD'),
|
||||
"body": payloadData
|
||||
}
|
||||
|
||||
try:
|
||||
# try runnning a subprocess
|
||||
p = subprocess.Popen(["curl","-i","-X", "POST" ,"-H", "Content-Type:application/json" ,"-d", json.dumps(_json_payload), get_setting_value('APPRISE_HOST')], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
|
||||
@@ -422,6 +422,38 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "TARGETTYPE",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{ "elementType": "select", "elementOptions": [], "transformers": [] }
|
||||
]
|
||||
},
|
||||
"default_value": "url",
|
||||
"options": ["url", "tag"],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Target type"
|
||||
},
|
||||
{
|
||||
"language_code": "es_es",
|
||||
"string": "Tipo de alvo"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Select the target type sent to Apprise."
|
||||
},
|
||||
{
|
||||
"language_code": "es_es",
|
||||
"string": "Seleccione el tipo de alvo enviada a Apprise."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "URL",
|
||||
"type": {
|
||||
|
||||
Reference in New Issue
Block a user