mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-31 03:50:11 -07:00
Add retry and expire for Pushover priority 2
This commit is contained in:
parent
48d7c2c54c
commit
39406c25c3
2 changed files with 43 additions and 7 deletions
|
@ -606,6 +606,22 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
% elif notifier['agent_name'] == 'pushover':
|
||||||
|
function pushoverPriority() {
|
||||||
|
if ($('#pushover_priority').val() == '2') {
|
||||||
|
$('#pushover_retry').closest('.form-group').show();
|
||||||
|
$('#pushover_expire').closest('.form-group').show();
|
||||||
|
} else {
|
||||||
|
$('#pushover_retry').closest('.form-group').hide();
|
||||||
|
$('#pushover_expire').closest('.form-group').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pushoverPriority();
|
||||||
|
$('#pushover_priority').change( function () {
|
||||||
|
pushoverPriority();
|
||||||
|
});
|
||||||
|
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
function validateLogic() {
|
function validateLogic() {
|
||||||
|
|
|
@ -2691,8 +2691,10 @@ class PUSHOVER(Notifier):
|
||||||
_DEFAULT_CONFIG = {'api_token': '',
|
_DEFAULT_CONFIG = {'api_token': '',
|
||||||
'key': '',
|
'key': '',
|
||||||
'html_support': 1,
|
'html_support': 1,
|
||||||
'priority': 0,
|
|
||||||
'sound': '',
|
'sound': '',
|
||||||
|
'priority': 0,
|
||||||
|
'retry': 30,
|
||||||
|
'expire': 3600,
|
||||||
'incl_url': 1,
|
'incl_url': 1,
|
||||||
'incl_subject': 1,
|
'incl_subject': 1,
|
||||||
'incl_poster': 0,
|
'incl_poster': 0,
|
||||||
|
@ -2713,6 +2715,10 @@ class PUSHOVER(Notifier):
|
||||||
if self.config['incl_subject']:
|
if self.config['incl_subject']:
|
||||||
data['title'] = subject.encode("utf-8")
|
data['title'] = subject.encode("utf-8")
|
||||||
|
|
||||||
|
if self.config['priority'] == 2:
|
||||||
|
data['retry'] = max(30, self.config['retry'])
|
||||||
|
data['expire'] = max(30, self.config['expire'])
|
||||||
|
|
||||||
headers = {'Content-type': 'application/x-www-form-urlencoded'}
|
headers = {'Content-type': 'application/x-www-form-urlencoded'}
|
||||||
|
|
||||||
files = {}
|
files = {}
|
||||||
|
@ -2789,6 +2795,13 @@ class PUSHOVER(Notifier):
|
||||||
'description': 'Your Pushover user or group key.',
|
'description': 'Your Pushover user or group key.',
|
||||||
'input_type': 'text'
|
'input_type': 'text'
|
||||||
},
|
},
|
||||||
|
{'label': 'Sound',
|
||||||
|
'value': self.config['sound'],
|
||||||
|
'name': 'pushover_sound',
|
||||||
|
'description': 'Set the notification sound. Leave blank for the default sound.',
|
||||||
|
'input_type': 'select',
|
||||||
|
'select_options': self.get_sounds()
|
||||||
|
},
|
||||||
{'label': 'Priority',
|
{'label': 'Priority',
|
||||||
'value': self.config['priority'],
|
'value': self.config['priority'],
|
||||||
'name': 'pushover_priority',
|
'name': 'pushover_priority',
|
||||||
|
@ -2796,12 +2809,19 @@ class PUSHOVER(Notifier):
|
||||||
'input_type': 'select',
|
'input_type': 'select',
|
||||||
'select_options': {-2: -2, -1: -1, 0: 0, 1: 1, 2: 2}
|
'select_options': {-2: -2, -1: -1, 0: 0, 1: 1, 2: 2}
|
||||||
},
|
},
|
||||||
{'label': 'Sound',
|
{'label': 'Retry Interval',
|
||||||
'value': self.config['sound'],
|
'value': self.config['retry'],
|
||||||
'name': 'pushover_sound',
|
'name': 'pushover_retry',
|
||||||
'description': 'Set the notification sound. Leave blank for the default sound.',
|
'description': 'Set the interval in seconds to keep retrying the notification.<br>'
|
||||||
'input_type': 'select',
|
'Note: For priority 2 only. Minimum 30 seconds.',
|
||||||
'select_options': self.get_sounds()
|
'input_type': 'number'
|
||||||
|
},
|
||||||
|
{'label': 'Expire Duration',
|
||||||
|
'value': self.config['expire'],
|
||||||
|
'name': 'pushover_expire',
|
||||||
|
'description': 'Set the duration in seconds when the notification will stop retrying.<br>'
|
||||||
|
'Note: For priority 2 only. Minimum 30 seconds.',
|
||||||
|
'input_type': 'number'
|
||||||
},
|
},
|
||||||
{'label': 'Enable HTML Support',
|
{'label': 'Enable HTML Support',
|
||||||
'value': self.config['html_support'],
|
'value': self.config['html_support'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue