mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Catch notifier config error
This commit is contained in:
parent
0df1bd137d
commit
f77e061ff1
3 changed files with 29 additions and 8 deletions
|
@ -372,7 +372,8 @@ fieldset[disabled] .btn-bright.active {
|
|||
.modal-body a:focus i.fa {
|
||||
color: #f9aa03;
|
||||
}
|
||||
.modal-body strong {
|
||||
.modal-body strong,
|
||||
.modal-body strong i.fa {
|
||||
color: #F9AA03;
|
||||
}
|
||||
.modal-footer {
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="help-block">
|
||||
Test if ${notifier['agent_label']} notifications are working. See the <a href="logs">logs</a> for troubleshooting.
|
||||
Test if ${notifier['agent_label']} notifications are working. Check the <a href="logs">logs</a> for troubleshooting.
|
||||
</p>
|
||||
% if notifier['agent_name'] == 'scripts':
|
||||
<div class="form-group">
|
||||
|
@ -252,7 +252,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<script>
|
||||
|
||||
|
@ -492,3 +491,20 @@
|
|||
$(this).on('focus keyup input', function () { resizeTextarea(this); }).removeAttr('data-autoresize');
|
||||
});
|
||||
</script>
|
||||
% else:
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
||||
<h4 class="modal-title" id="notifier-config-modal-header">Error</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<center><strong>
|
||||
<i class="fa fa-exclamation-circle"></i> Failed to retrieve notifier configuration. Check the <a href="logs">logs</a> for more info.
|
||||
</strong></center>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
|
|
|
@ -398,9 +398,13 @@ def get_notifier_config(notifier_id=None):
|
|||
if not result:
|
||||
return None
|
||||
|
||||
try:
|
||||
config = json.loads(result.pop('notifier_config') or '{}')
|
||||
notifier_agent = get_agent_class(agent_id=result['agent_id'], config=config)
|
||||
notifier_config = notifier_agent.return_config_options()
|
||||
except Exception as e:
|
||||
logger.error(u"PlexPy Notifiers :: Failed to get notifier config options: %s." % e)
|
||||
return
|
||||
|
||||
notify_actions = get_notify_actions()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue