Refactor UI routes to pass services to config edit and config new pages

This commit is contained in:
Théophile Diot 2024-09-26 17:11:56 +02:00
parent 12057ffa8d
commit 1cc221176e
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -229,7 +229,13 @@ def configs_new():
db_custom_config = DB.get_custom_config(config_type, config_name, service_id=config_service if config_service != "global" else None, with_data=True)
clone = db_custom_config.get("data", b"").decode("utf-8")
return render_template(
"config_edit.html", config_types=CONFIG_TYPES, config_value=clone, config_service=config_service, type=config_type.upper(), name=config_name
"config_edit.html",
config_types=CONFIG_TYPES,
config_value=clone,
config_service=config_service,
type=config_type.upper(),
name=config_name,
services=BW_CONFIG.get_config(global_only=True, methods=False, with_drafts=True, filtered_settings=("SERVER_NAME"))["SERVER_NAME"].split(" "),
)
@ -335,4 +341,5 @@ def configs_edit(service: str, config_type: str, name: str):
name=db_config["name"],
config_method=db_config["method"],
config_template=db_config.get("template"),
services=BW_CONFIG.get_config(global_only=True, methods=False, with_drafts=True, filtered_settings=("SERVER_NAME"))["SERVER_NAME"].split(" "),
)