diff --git a/app/create_db.py b/app/create_db.py
index 5a7f4845..d7d20027 100644
--- a/app/create_db.py
+++ b/app/create_db.py
@@ -432,7 +432,7 @@ def update_db_v_42(**kwargs):
def update_ver(**kwargs):
con, cur = get_cur()
- sql = """update version set version = '4.1.0.0'; """
+ sql = """update version set version = '4.2.0.0'; """
try:
cur.execute(sql)
con.commit()
diff --git a/app/login.py b/app/login.py
index f5605cba..65764a37 100644
--- a/app/login.py
+++ b/app/login.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-import cgi
import os
import sys
import funct
diff --git a/app/options.py b/app/options.py
index 231abb43..51b6149b 100644
--- a/app/options.py
+++ b/app/options.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-"
+# -*- coding: utf-8 -*-
import os, sys
import funct
import sql
@@ -595,10 +595,10 @@ if form.getvalue('servaction') is not None:
command = [ cmd ]
if enable != "show":
- print('
{% set i = 0 -%}
{% set section_name = {} %}
{% for line in conf -%}
{% set i = i + loop.index0 %}
{% if not role %}
- {% if line.startswith('#HideBlockStart') %}
-
+ {% continue %}
+ {% endif %}
{% endif %}
- {% if line.startswith('#HideBlockEnd') %}
- {{line}}-->
- {% continue %}
- {% endif %}
- {% endif %}
- {% if line.startswith('global') %}
- {{ line }}
- {% if role %}
- {% if service != 'keepalived' %}
+ {% if service == 'nginx' %}
+ {%- if "server {" in line -%}
+ {% if i > 1 %}
+
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {% if "listen " in line or "location" in line or "server_name" in line or "}" in line %}
+ {% if "#" not in line %}
+
+ {{ i }}
+
+
+ {{ line }}
+
+ {% continue %}
+ {% endif %}
+ {% endif %}
+ {% if "#" in line %}
+
+ {{ i }}
+
+
+ {% continue %}
+ {% endif %}
+ {% if line|length > 1 %}
+
+ {{ i }}
+ {{ line }}
+
+ {% endif %}
+ {% else %}
+ {% if line.startswith('global') %}
+
{{ line }}
+ {% if role %}
+ {% if service != 'keepalived' %}
+
+ Edit
+
+ {% endif %}
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {% if line.startswith('defaults') %}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {%- if line.startswith('listen') -%}
+
{{- line -}}
+ {% if role %}
Edit
{% endif %}
- {% endif %}
-
- {% continue %}
- {% endif %}
- {% if line.startswith('defaults') %}
-
{{ line }}
- {% if role %}
+ {%- set backend = line.split(' ') -%}
- Edit
+ Stats
- {% endif %}
-
- {% continue %}
- {% endif %}
- {%- if line.startswith('listen') -%}
-
{{- line -}}
- {% if role %}
-
- Edit
-
- {% endif %}
- {%- set backend = line.split(' ') -%}
-
- Stats
-
- {%- set backend = backend|join('_') -%}
- {%- do section_name.update({i: backend}) -%}
-
-
+ {%- set backend = backend|join('_') -%}
+ {%- do section_name.update({i: backend}) -%}
+
+
+ {% continue %}
+ {%- endif -%}
+ {%- if line.startswith('frontend') -%}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+ {% set backend = line.split(' ') %}
+
+ Stats
+
+ {% set backend = backend|join('_') %}
+ {% do section_name.update({i: backend}) %}
+
+
+ {% continue %}
+ {%- endif -%}
+ {% if line.startswith('backend') %}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+ {% set backend = line.split(' ') %}
+
+ Stats
+
+
{% continue %}
- {%- endif -%}
- {%- if line.startswith('frontend') -%}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
- {% set backend = line.split(' ') %}
-
- Stats
-
- {% set backend = backend|join('_') %}
- {% do section_name.update({i: backend}) %}
-
-
- {% continue %}
- {%- endif -%}
- {% if line.startswith('backend') %}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
- {% set backend = line.split(' ') %}
-
- Stats
-
+ {% endif %}
+ {% if line.startswith('cache') %}
+ {{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
- {% continue %}
- {% endif %}
- {% if line.startswith('cache') %}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
-
- {% continue %}
- {% endif %}
- {% if line.startswith('peers') %}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
-
- {% continue %}
- {% endif %}
- {% if line.startswith('resolvers') %}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
-
- {% continue %}
- {% endif %}
- {% if line.startswith('userlist') %}
-
{{ line }}
- {% if role %}
-
- Edit
-
- {% endif %}
-
- {% continue %}
- {% endif %}
- {% if "acl" in line or "option" in line or "server" in line %}
- {% if "timeout" not in line and "default-server" not in line and "#use_backend" not in line and "#" not in line%}
-
+ {% continue %}
+ {% endif %}
+ {% if line.startswith('peers') %}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {% if line.startswith('resolvers') %}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {% if line.startswith('userlist') %}
+
{{ line }}
+ {% if role %}
+
+ Edit
+
+ {% endif %}
+
+ {% continue %}
+ {% endif %}
+ {% if "acl" in line or "option" in line or "server" in line %}
+ {% if "timeout" not in line and "default-server" not in line and "#use_backend" not in line and "#" not in line%}
{{ i }}
- {{ line }}
-
- {% continue %}
+
+ {{ line }}
+
+ {% continue %}
+ {% endif %}
{% endif %}
- {% endif %}
- {% if line.startswith("#") %}
-
+ {% continue %}
+ {% endif %}
+ {% if line|length > 1 %}
+
+ {{ i }}
+ {{ line }}
+
+ {% endif %}
+ {%- if "bind" in line -%}
+ {%- set bind = line.split(':') -%}
+
+ {%- endif -%}
{%- endif -%}
{%- endfor -%}
- {% endif %}
{% if configver %}