From c433e2ed0a0266be1106cafe09923c70f2de7cb2 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Wed, 3 Mar 2021 19:47:42 +0600 Subject: [PATCH] v5.0.1.0 Changelog: https://haproxy-wi.org/changelog.py#5_0_1 --- app/add.py | 6 ++ app/create_db.py | 4 +- app/funct.py | 4 +- app/templates/add.html | 145 +++++++++++++++++-------------------- app/templates/base.html | 2 +- app/templates/config.html | 12 +-- app/templates/logs.html | 2 +- app/templates/servers.html | 32 -------- inc/add.js | 110 +++++++++++++++++++--------- inc/style.css | 3 + 10 files changed, 165 insertions(+), 155 deletions(-) diff --git a/app/add.py b/app/add.py index 7209c772..d8c58085 100644 --- a/app/add.py +++ b/app/add.py @@ -194,6 +194,8 @@ elif form.getvalue('mode') is not None: acl_if_word = 'path_beg -i ' elif a == '4': acl_if_word = 'path_end -i ' + elif a == '6': + acl_if_word = 'src ip ' else: acl_if_word = '' @@ -207,6 +209,10 @@ elif form.getvalue('mode') is not None: elif acl_then[i] == '4': acl += ' http-request deny' acl_then_value = '' + elif acl_then[i] == '6': + acl += ' return ' + elif acl_then[i] == '7': + acl += ' set-header ' acl += acl_then_value + ' if { ' + acl_if_word + acl_value[i] + ' } \n' except Exception: diff --git a/app/create_db.py b/app/create_db.py index e9f00668..d18da350 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -991,7 +991,7 @@ def update_db_v_5(**kwargs): `type` VARCHAR ( 64 ), `group` VARCHAR ( 64 ), `key` VARCHAR ( 64 ), - `secret` VARCHAR ( 64 ), + `secret` VARCHAR ( 64 ), `create_date` DATETIME default '0000-00-00 00:00:00', `edit_date` DATETIME default '0000-00-00 00:00:00', PRIMARY KEY(`id`) @@ -1053,7 +1053,7 @@ def update_db_v_51(**kwargs): def update_ver(): con, cur = get_cur() - sql = """update version set version = '5.0.0.0'; """ + sql = """update version set version = '5.0.1.0'; """ try: cur.execute(sql) con.commit() diff --git a/app/funct.py b/app/funct.py index 840b1d7a..195e37b8 100644 --- a/app/funct.py +++ b/app/funct.py @@ -494,7 +494,7 @@ def show_installation_output(error, output, service): print('error: '+error) else: for l in output: - if "msg" in l or "FAILED" in l: + if "FAILED" in l: try: l = l.split(':')[1] l = l.split('"')[1] @@ -1232,4 +1232,4 @@ def get_services_status(): except Exception: services.append([s, status, v, '']) - return services + return services \ No newline at end of file diff --git a/app/templates/add.html b/app/templates/add.html index d58b0791..0a9790df 100644 --- a/app/templates/add.html +++ b/app/templates/add.html @@ -13,7 +13,7 @@ 'option smtpchk':'Check a SMTP service'} %} {% set if_values = dict() %} -{% set if_values = {'1':'Host name starts with','2':'Host name ends with','3':'Path starts with','4':'Path ends with'} %} +{% set if_values = {'1':'Host name starts with','2':'Host name ends with','3':'Path starts with','4':'Path ends with', '6': 'Src ip'} %}
@@ -121,20 +121,19 @@ @@ -261,9 +260,9 @@
- + - +
@@ -335,20 +334,19 @@
@@ -432,9 +430,9 @@
- + - +
@@ -505,20 +503,19 @@
@@ -629,7 +626,7 @@
- +
@@ -647,7 +644,7 @@ {% endfor %} - + + +

SSL

@@ -676,8 +673,8 @@

- -
@@ -724,11 +721,11 @@ {% for option in options %} - + {% if option.2 == group or group == '1' %} + @@ -762,15 +759,15 @@
In this section you can create, edit and delete options with given parameters. And after use them as autocomplete in the "Add" sections -
-
- How to use pre saved option you can see in - +
+ - +
{{ option.0 }} -
@@ -779,11 +776,11 @@ {% for s in saved_servers %} - + {% if s.3 == group or group == '1' %} + @@ -817,10 +814,10 @@
In this section you can create, edit and delete servers. And after use them as autocomplete in the "Add" sections -
-
- How to use pre saved servers you can see in - +
+ @@ -856,7 +853,7 @@
- Groups: - {{ input('userlist-group', title="User`s group", placeholder="group_name") }} + {{ input('userlist-group', title="User`s group", placeholder="group_name") }} @@ -868,9 +865,9 @@ User: - {{ input('userlist-user', required='required', title="User name", placeholder="user_name") }} - {{ input('userlist-password', required='required', title="User password. By default it insecure-password", placeholder="password") }} - {{ input('userlist-user-group', title="User`s group", placeholder="user`s group") }} + {{ input('userlist-user', required='required', title="User name", placeholder="user_name") }} + {{ input('userlist-password', required='required', title="User password. By default it insecure-password", placeholder="password") }} + {{ input('userlist-user-group', title="User`s group", placeholder="user`s group") }} @@ -890,14 +887,14 @@
In this section you can create userlists. And after use them in the "Add" sections -
-
- How to use userlists you can read - +
+ - +
@@ -916,7 +913,7 @@ {% for select in selects %} - {% endfor %} + {% endfor %} - + {{ input('group', value=group, type='hidden') }}
@@ -924,7 +921,7 @@ {{ list }} {% endfor %}
@@ -945,7 +942,7 @@ {% for select in selects %} - {% endfor %} + {% endfor %}
@@ -963,7 +960,7 @@ + {% include 'include/del_confirm.html' %}