Save graph config to local storage instead of server

This commit is contained in:
JonnyWong16 2018-10-13 18:07:26 -07:00
parent be0144bbe1
commit 0e0fb2e2b8
4 changed files with 128 additions and 165 deletions

View file

@ -182,10 +182,6 @@ _CONFIG_DEFINITIONS = {
'GIT_TOKEN': (str, 'General', ''),
'GIT_USER': (str, 'General', 'Tautulli'),
'GIT_REPO': (str, 'General', 'Tautulli'),
'GRAPH_TYPE': (str, 'General', 'plays'),
'GRAPH_DAYS': (int, 'General', 30),
'GRAPH_MONTHS': (int, 'General', 12),
'GRAPH_TAB': (str, 'General', 'tabs-1'),
'GROUP_HISTORY_TABLES': (int, 'General', 1),
'GROWL_ENABLED': (int, 'Growl', 0),
'GROWL_HOST': (str, 'Growl', ''),

View file

@ -1849,24 +1849,6 @@ class WebInterface(object):
return serve_template(templatename="graphs.html", title="Graphs", config=config)
@cherrypy.expose
@requireAuth(member_of("admin"))
def set_graph_config(self, graph_type=None, graph_days=None, graph_months=None, graph_tab=None, **kwargs):
if graph_type:
plexpy.CONFIG.__setattr__('GRAPH_TYPE', graph_type)
plexpy.CONFIG.write()
if graph_days:
plexpy.CONFIG.__setattr__('GRAPH_DAYS', graph_days)
plexpy.CONFIG.write()
if graph_months:
plexpy.CONFIG.__setattr__('GRAPH_MONTHS', graph_months)
plexpy.CONFIG.write()
if graph_tab:
plexpy.CONFIG.__setattr__('GRAPH_TAB', graph_tab)
plexpy.CONFIG.write()
return "Updated graphs config values."
@cherrypy.expose
@cherrypy.tools.json_out()
@requireAuth()