Stage one of notification rewrite. Page cache refresh required.

Each notification has it's own modal config now, PlexWeb-style.
Few minor text changes.
This commit is contained in:
Tim 2015-07-22 01:40:20 +02:00
parent bb3139727e
commit e309d6ba92
6 changed files with 503 additions and 516 deletions

View file

@ -563,6 +563,30 @@ class WebInterface(object):
raise cherrypy.HTTPRedirect("config")
@cherrypy.expose
def set_notification_config(self, **kwargs):
# Handle the variable config options. Note - keys with False values aren't getting passed
checked_configs = [
"email_tls"
]
for checked_config in checked_configs:
if checked_config not in kwargs:
# checked items should be zero or one. if they were not sent then the item was not checked
kwargs[checked_config] = 0
for plain_config, use_config in [(x[4:], x) for x in kwargs if x.startswith('use_')]:
# the use prefix is fairly nice in the html, but does not match the actual config
kwargs[plain_config] = kwargs[use_config]
del kwargs[use_config]
plexpy.CONFIG.process_kwargs(kwargs)
# Write the config
plexpy.CONFIG.write()
raise cherrypy.HTTPRedirect("settings")
@cherrypy.expose
def do_state_change(self, signal, title, timer):
message = title
@ -1154,4 +1178,13 @@ class WebInterface(object):
]
random_number = randint(0, len(quote_list) - 1)
return quote_list[int(random_number)]
return quote_list[int(random_number)]
@cherrypy.expose
def get_notification_agent_config(self, config_id, **kwargs):
config = notifiers.get_notification_agent_config(config_id=config_id)
checkboxes = {'email_tls': checked(plexpy.CONFIG.EMAIL_TLS)}
return serve_template(templatename="notification_config.html", title="Notification Configuration",
data=config, checkboxes=checkboxes)