From 5c416a3bfcc51c3a8237a1118aba4235b242dcb7 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Mon, 13 May 2019 23:07:32 +0300 Subject: [PATCH] v3.4.4.1 27. Ability to hide part of the config tags: "#HideBlockStart" and "#HideBlockEnd" --- README.md | 1 + app/config.py | 8 ++++---- app/templates/ajax/config_show.html | 10 ++++++++++ app/templates/base.html | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f69cc4d9..47f79410 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Began to lead a [Twitter](https://twitter.com/haproxy_wi), subscribe! I will wri 24. Web application firewall 25. LDAP support 26. Keep active HAProxy service +27. Ability to hide part of the config tags: "#HideBlockStart" and "#HideBlockEnd" ![alt text](image/haproxy-wi-metrics.jpeg "Merics") diff --git a/app/config.py b/app/config.py index 03870470..d4708d2e 100644 --- a/app/config.py +++ b/app/config.py @@ -78,10 +78,10 @@ if serv is not None and form.getvalue('config') is not None: funct.diff_config(oldcfg, cfg) - if save: - c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) - c["restart"] = form.getvalue('serv') - print(c) + #if save: + # c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) + # c["restart"] = form.getvalue('serv') + # print(c) os.system("/bin/rm -f " + hap_configs_dir + "*.old") diff --git a/app/templates/ajax/config_show.html b/app/templates/ajax/config_show.html index f0c0c169..66a64cc2 100644 --- a/app/templates/ajax/config_show.html +++ b/app/templates/ajax/config_show.html @@ -13,6 +13,16 @@ {% set i = 0 -%} {% for line in conf %} {% set i = i + loop.index0 %} + {% if not role %} + {% if line.startswith('#HideBlockStart') %} + + {% continue %} + {% endif %} + {% endif %} {% if line.startswith('global') %} {{ line }}
{% continue %} diff --git a/app/templates/base.html b/app/templates/base.html index 9e0ec60e..b5ba91f6 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -115,7 +115,7 @@ @@ -217,4 +217,4 @@
- + \ No newline at end of file