Start sorting of services by SERVER_NAME on services page in web UI

This commit is contained in:
Théophile Diot 2024-05-02 10:04:33 +02:00
parent 7fa75d8800
commit 03cfcf6873
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -883,7 +883,7 @@ def services():
config = app.config["CONFIG"].get_config(methods=False, with_drafts=True)
server_name = variables["SERVER_NAME"].split(" ")[0]
was_draft = config.get(f"{server_name}_IS_DRAFT", "no") == "yes"
operation = request.form["operation"]
operation = request.form["operation"]
# Get all variables starting with custom_config and delete them from variables
custom_configs = []
config_types = ("http", "stream", "server-http", "server-stream", "default-server-http", "modsec", "modsec-crs")
@ -1024,6 +1024,8 @@ def services():
}
)
services.sort(key=lambda x: x["SERVER_NAME"]["value"])
return render_template(
"services.html",
services=services,