Pavel Loginov 2021-02-15 23:18:04 +06:00
parent 6732903e5a
commit f1649fc1f3
4 changed files with 27 additions and 4 deletions

View File

@ -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`)
);
"""

View File

@ -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)

View File

@ -13,6 +13,13 @@
</ul>
<ul id='browse_histroy'></ul>
<div id="provisioning">
{% if not is_terraform %}
<center>
<br />
<h3>You do not have installed Terraform. Read <a href="https://www.terraform.io/downloads.html"
title="Download Terraform" target="_blank">here</a> how to install Terraform</h3>
</center>
{% else %}
<table class="overview" id="ajax-provisioning">
<thead>
<tr class="overviewHead">
@ -37,6 +44,7 @@
</tbody>
</table>
<br /><span class="add-button" title="Create a new server" id="create-provider-button">+ Add</span>
{% endif %}
</div>
<div id="providers">
<table class="overview" id="ajax-providers">

View File

@ -8,7 +8,7 @@
<center>
<br />
<h3>You do not have installed SMON service. Read <a href="https://haproxy-wi.org/services.py?service=smon"
title="Simple monitoring network ports with alerting via Telegram and WEB pannel" target="_blank">here</a> how install SMON service</h3>
title="Simple monitoring network ports with alerting via Telegram and WEB pannel" target="_blank">here</a> how to install SMON service</h3>
</center>
{% elif smon_status.0 == 'failed' %}
<center>
@ -31,7 +31,10 @@
{% elif smon|length == 0 and action != 'add' and action == 'checker_history' %}
<center>
<br />
<h3>There are not any events yet. Check if there are any Checker are enabled on the "HAProxy Overview" or on "Nginx Overview" pages</h3>
<h3>
There are not any events yet. Check if there are any Checker are enabled on the "<a href="hapservers.py" title="HAProxy Overview">HAProxy Overview</a>"
or on "<a href="hapservers.py?service=nginx" title="Nginx Overview">Nginx Overview</a>" pages
</h3>
<br />
</center>
{% else %}
@ -167,4 +170,4 @@
{% endif %}
</div>
{% endif %}
{% endblock %}
{% endblock %}