From 1fb426a7eb692e2d0443819f48eab5196aa1a608 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Thu, 18 Aug 2022 06:30:55 +0300 Subject: [PATCH] v6.1.4.0 Change log: https://roxy-wi.org/changelog.py#6_1_4 --- app/sections.py | 4 +++- app/templates/sections.html | 24 +++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/sections.py b/app/sections.py index 8d92e470..cd4b535c 100644 --- a/app/sections.py +++ b/app/sections.py @@ -44,6 +44,8 @@ if serv is not None and section is not None: pass start_line, end_line, config_read = funct.get_section_from_config(cfg, section) + server_id = sql.select_server_id_by_ip(serv) + is_restart = sql.select_service_setting(server_id, 'haproxy', 'restart') os.system("/bin/mv %s %s.old" % (cfg, cfg)) @@ -86,6 +88,6 @@ rendered_template = template.render( h2=1, title="Working with HAProxy config sections", role=role, action="sections.py", user=user, select_id="serv", serv=serv, aftersave=aftersave, config=config_read, cfg=cfg, selects=servers, stderr=stderr, error=error, start_line=start_line, end_line=end_line, section=section, sections=sections, is_serv_protected=is_serv_protected, - user_services=user_services, token=token, warning=warning + user_services=user_services, token=token, warning=warning, is_restart=is_restart ) print(rendered_template) diff --git a/app/templates/sections.html b/app/templates/sections.html index 9060c184..a91fd7c1 100644 --- a/app/templates/sections.html +++ b/app/templates/sections.html @@ -53,14 +53,16 @@ -
- +
+
{% if not is_serv_protected or role <= 2 %}

+ {% if is_restart|int == 0 %} + {% endif %} {% if section != 'globals' and section != 'defaults' %} @@ -69,7 +71,22 @@ {% endif %}