mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Add notifier id to config modal
This commit is contained in:
parent
8bdf1af021
commit
1206d13978
5 changed files with 15 additions and 13 deletions
|
@ -3077,7 +3077,8 @@ a:hover .overlay-refresh-image:hover {
|
|||
#api_key.form-control[readonly]:focus {
|
||||
background-color: #fff;
|
||||
}
|
||||
#plexpy-notifiers-table .friendly_name {
|
||||
#plexpy-notifiers-table .friendly_name,
|
||||
#notifier-config-modal span.notifier_id {
|
||||
color: #777;
|
||||
}
|
||||
#notifier-config-modal .nav-tabs {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<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">${notifier['agent_label']} Settings</h4>
|
||||
<h4 class="modal-title" id="notifier-config-modal-header">${notifier['agent_label']} Settings <small><span class="notifier_id">(Notifier ID: ${notifier['id']})</span></small></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
|
|
|
@ -13,7 +13,7 @@ DOCUMENTATION :: END
|
|||
% for notifier in notifiers_list:
|
||||
<li>
|
||||
<span>
|
||||
<span class="toggle-left trigger-tooltip ${'active' if any(notifier['actions'].values()) else ''}" data-toggle="tooltip" data-placement="top" title="Triggers active"><i class="fa fa-lg fa-bell"></i></span>
|
||||
<span class="toggle-left trigger-tooltip ${'active' if notifier['active'] else ''}" data-toggle="tooltip" data-placement="top" title="Triggers active"><i class="fa fa-lg fa-bell"></i></span>
|
||||
${notifier['agent_label']} <span class="friendly_name">(${notifier['friendly_name'] or notifier['id']})</span>
|
||||
<a href="#" data-target="#notifier-config-modal" data-id="${notifier['id']}" class="toggle-notifier-config-modal toggle-right" data-toggle="modal"><i class="fa fa-lg fa-cog"></i></a>
|
||||
</span>
|
||||
|
|
|
@ -323,17 +323,21 @@ def get_notify_actions():
|
|||
def get_notifiers(notifier_id=None, notify_action=None):
|
||||
notify_actions = get_notify_actions()
|
||||
|
||||
where_action = ''
|
||||
if notify_action and notify_action in notify_actions:
|
||||
where_action = 'WHERE %s = 1 ' % notify_action
|
||||
where = where_id = where_action = ''
|
||||
if notifier_id or notify_action:
|
||||
where = 'WHERE '
|
||||
if notifier_id:
|
||||
where_id += 'notifier_id = %s' % notifier_id
|
||||
if notify_action and notify_action in notify_actions:
|
||||
where_action = '%s = 1' % notify_action
|
||||
where += ' AND '.join([w for w in [where_id, where_action] if w])
|
||||
|
||||
monitor_db = database.MonitorDatabase()
|
||||
result = monitor_db.select('SELECT id, agent_id, agent_name, agent_label, friendly_name, %s FROM notifiers %s'
|
||||
% (', '.join(notify_actions), where_action))
|
||||
% (', '.join(notify_actions), where))
|
||||
|
||||
for item in result:
|
||||
item['actions'] = {k: helpers.cast_to_int(item.pop(k))
|
||||
for k in item.keys() if k in notify_actions}
|
||||
item['active'] = int(any([item.pop(k) for k in item.keys() if k in notify_actions]))
|
||||
|
||||
return sorted(result, key=lambda k: (k['agent_label'], k['id']))
|
||||
|
||||
|
|
|
@ -2863,10 +2863,7 @@ class WebInterface(object):
|
|||
"agent_name": "telegram",
|
||||
"agent_label": "Telegram",
|
||||
"friendly_name": "",
|
||||
"actions": {"on_play": 0,
|
||||
"on_stop": 0,
|
||||
...
|
||||
},
|
||||
"active": 1
|
||||
}
|
||||
]
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue