ui - set alert_types

This commit is contained in:
Ishaan Jaff 2024-04-18 11:13:05 -07:00
parent b7393eb549
commit 5e0dc57329

View file

@ -2620,6 +2620,9 @@ class ProxyConfig:
if "alerting" in _general_settings: if "alerting" in _general_settings:
general_settings["alerting"] = _general_settings["alerting"] general_settings["alerting"] = _general_settings["alerting"]
proxy_logging_obj.alerting = general_settings["alerting"] proxy_logging_obj.alerting = general_settings["alerting"]
if "alert_types" in _general_settings:
general_settings["alert_types"] = _general_settings["alert_types"]
proxy_logging_obj.alert_types = general_settings["alert_types"]
# router settings # router settings
_router_settings = config_data.get("router_settings", {}) _router_settings = config_data.get("router_settings", {})
@ -8179,10 +8182,12 @@ async def update_config(config_info: ConfigYAML):
updated_general_settings = config_info.general_settings.dict( updated_general_settings = config_info.general_settings.dict(
exclude_none=True exclude_none=True
) )
config["general_settings"] = {
**updated_general_settings, _existing_settings = config["general_settings"]
**config["general_settings"], for k, v in updated_general_settings.items():
} # overwrite existing settings with updated values
_existing_settings[k] = v
config["general_settings"] = _existing_settings
if config_info.environment_variables is not None: if config_info.environment_variables is not None:
config.setdefault("environment_variables", {}) config.setdefault("environment_variables", {})