mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Implement new home page stats (still needs styling)
This commit is contained in:
parent
9364b06c99
commit
112d5f0efa
4 changed files with 267 additions and 1 deletions
|
@ -83,6 +83,13 @@ class WebInterface(object):
|
|||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps(formats)
|
||||
|
||||
@cherrypy.expose
|
||||
def home_stats(self, time_range='30', **kwargs):
|
||||
plex_watch = plexwatch.PlexWatch()
|
||||
stats_data = plex_watch.get_home_stats(time_range)
|
||||
|
||||
return serve_template(templatename="home_stats.html", title="Stats", stats=stats_data)
|
||||
|
||||
@cherrypy.expose
|
||||
def history(self):
|
||||
return serve_template(templatename="history.html", title="History")
|
||||
|
@ -671,6 +678,18 @@ class WebInterface(object):
|
|||
plex_watch = plexwatch.PlexWatch()
|
||||
result = plex_watch.get_user_gravatar_image(user)
|
||||
|
||||
if result:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps(result)
|
||||
else:
|
||||
logger.warn('Unable to retrieve data.')
|
||||
|
||||
@cherrypy.expose
|
||||
def get_home_stats(self, time_range='30', **kwargs):
|
||||
|
||||
plex_watch = plexwatch.PlexWatch()
|
||||
result = plex_watch.get_home_stats(time_range)
|
||||
|
||||
if result:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps(result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue