mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Add browser notifications
This commit is contained in:
parent
ff532a5c6c
commit
d09c7b13b3
8 changed files with 236 additions and 22 deletions
|
@ -1636,6 +1636,22 @@ class WebInterface(object):
|
|||
logger.debug(u"Unable to send test notification, no notification agent ID received.")
|
||||
return "No notification agent ID received."
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
def get_browser_notifications(self, **kwargs):
|
||||
browser = notifiers.Browser()
|
||||
result = browser.get_notifications()
|
||||
|
||||
if result:
|
||||
notifications = result['notifications']
|
||||
if notifications:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps(notifications)
|
||||
else:
|
||||
return None
|
||||
else:
|
||||
logger.warn('Unable to retrieve browser notifications.')
|
||||
return None
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue