Initial implementation of server statistics

This commit is contained in:
Jonathan Wong 2015-08-29 12:15:11 -07:00
parent 8138c27242
commit 3436175223
5 changed files with 348 additions and 11 deletions

View file

@ -67,7 +67,8 @@ class WebInterface(object):
config = {
"home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH,
"home_stats_type": plexpy.CONFIG.HOME_STATS_TYPE,
"home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT
"home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT,
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
}
return serve_template(templatename="index.html", title="Home", config=config)
@ -126,6 +127,13 @@ class WebInterface(object):
return serve_template(templatename="home_stats.html", title="Stats", data=stats_data)
@cherrypy.expose
def server_stats(self, **kwargs):
pms_connect = pmsconnect.PmsConnect()
stats_data = pms_connect.get_server_stats()
return serve_template(templatename="server_stats.html", title="Server Stats", data=stats_data)
@cherrypy.expose
def history(self):
return serve_template(templatename="history.html", title="History")