From f1649fc1f3cc26eb8010601f10ebfbedccf57f9a Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Mon, 15 Feb 2021 23:18:04 +0600 Subject: [PATCH] 5.0.0.0 Changelog: https://haproxy-wi.org/changelog.py#5_0) --- app/create_db.py | 4 +++- app/provisioning.py | 10 ++++++++++ app/templates/provisioning.html | 8 ++++++++ app/templates/smon.html | 9 ++++++--- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/create_db.py b/app/create_db.py index 5231af92..e9f00668 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -991,7 +991,9 @@ 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`) ); """ diff --git a/app/provisioning.py b/app/provisioning.py index c7305197..e07cdd30 100644 --- a/app/provisioning.py +++ b/app/provisioning.py @@ -16,6 +16,15 @@ try: else: groups=funct.get_user_group(id=1) user_group = funct.get_user_group(id=1) + + cmd = 'which terraform' + output, stderr = funct.subprocess_execute(cmd) + + if stderr != '': + is_terraform = False + else: + is_terraform = True + except Exception as e: print(str(e)) @@ -27,5 +36,6 @@ output_from_parsed_template = template.render(title="Servers provisioning", user_group=user_group, servers=sql.select_provisioned_servers(), providers=sql.select_providers(user_group), + is_terraform=is_terraform, token=token) print(output_from_parsed_template) diff --git a/app/templates/provisioning.html b/app/templates/provisioning.html index 8e24b702..59c18818 100644 --- a/app/templates/provisioning.html +++ b/app/templates/provisioning.html @@ -13,6 +13,13 @@
+ {% if not is_terraform %} +
+
+

You do not have installed Terraform. Read here how to install Terraform

+
+ {% else %} @@ -37,6 +44,7 @@

+ Add + {% endif %}
diff --git a/app/templates/smon.html b/app/templates/smon.html index e817001b..f3f43733 100644 --- a/app/templates/smon.html +++ b/app/templates/smon.html @@ -8,7 +8,7 @@

You do not have installed SMON service. Read here how install SMON service

+ title="Simple monitoring network ports with alerting via Telegram and WEB pannel" target="_blank">here how to install SMON service
{% elif smon_status.0 == 'failed' %}
@@ -31,7 +31,10 @@ {% elif smon|length == 0 and action != 'add' and action == 'checker_history' %}

-

There are not any events yet. Check if there are any Checker are enabled on the "HAProxy Overview" or on "Nginx Overview" pages

+

+ There are not any events yet. Check if there are any Checker are enabled on the "HAProxy Overview" + or on "Nginx Overview" pages +


{% else %} @@ -167,4 +170,4 @@ {% endif %} {% endif %} -{% endblock %} +{% endblock %} \ No newline at end of file