@@ -10,9 +34,11 @@
{% else %}
{% endif %}
-
+ {% if not serv %}
+ {{s.1}}
+ {% else %}
{{s.1}}
-
+ {% endif %}
{% if s.6|int() >= 1 %}
![]()
= 1 %}
@@ -24,14 +50,14 @@
{% endif %}
{% if role <= 1 %}
-
-
+
+
-
-
+
+
-
-
+
+
{% endif %}
@@ -68,9 +94,21 @@
{% endfor %}
+{% if serv %}
+
+

+
+ {% for s in servers %}
+
+
+
+
+
+
+ {% endfor %}
+{% endif %}
-
{% endblock %}
\ No newline at end of file
diff --git a/app/templates/include/add_proxy.html b/app/templates/include/add_proxy.html
new file mode 100644
index 00000000..84f54a36
--- /dev/null
+++ b/app/templates/include/add_proxy.html
@@ -0,0 +1,135 @@
+
+
+
+
+
+ Create Listen
+
+
+ A "listen" section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.
+
+
+
+
+
+
+ Create HTTP Listen
+
+
+ Create HTTP proxy
+
+
+
+
+
+
+ Create SSL Listen
+
+
+ Create HTTPS Proxy with the SSL termination on HAProxy and SSL offload.
+ HAProxy will send to backends HTTP traffic. You need have uploaded a PEM certificat
+
+
+
+
+
+
+ Create HTTPS Listen
+
+
+ Create HTTPS Proxy without the SSL termination on HAProxy and SSL offload. HAProxy will send to backends HTTPS traffic
+
+
+
+
+
+
+
+
+ Create Frontend
+
+
+ A "frontend" section describes a set of listening sockets accepting client connections.
+ And forwards them to backend
+
+
+
+
+
+
+ Create HTTP Frontend
+
+
+ Create HTTP Frontend
+
+
+
+
+
+ Create SSL Frontend
+
+
+ Create HTTPS Frontend with the SSL termination on HAProxy and SSL offload. HAProxy will send to backends HTTP traffic. You need have uploaded a PEM certificat
+
+
+
+
+
+
+ Create HTTPS Frontend
+
+
+ Create HTTPS Frontend without the SSL termination on HAProxy and SSL offload. HAProxy will send to backends HTTPS traffic
+
+
+
+
+
+
+
+
+ Create Backend
+
+
+ A "backend" section describes a set of servers to which the proxy will connect to forward incoming connections.
+
+
+
+
+
+
+
+ Create HTTP Backend
+
+
+ Create HTTP Backend
+
+
+
+
+
+ Create SSL Backend
+
+
+ Create HTTPS Backend with the SSL termination on HAProxy and SSL offload. HAProxy will send to backends HTTP traffic. You need have uploaded a PEM certificat
+
+
+
+
+
+
+ Create HTTPS Backend
+
+
+ Create HTTPS Backend without the SSL termination on HAProxy and SSL offload. HAProxy will send to backends HTTPS traffic
+
+
+
+
+ {% if add %}
+
+
{{ add }} was success added
+ {{ conf_add }}
+
+ {% endif %}
+
\ No newline at end of file
diff --git a/app/templates/include/add_servers.html b/app/templates/include/add_servers.html
new file mode 100644
index 00000000..29b10bcb
--- /dev/null
+++ b/app/templates/include/add_servers.html
@@ -0,0 +1,13 @@
+
+ :
+
+
+ :
+
+
+ :
+
+
+
+
+
\ No newline at end of file
diff --git a/app/templates/include/admin_add_server.html b/app/templates/include/admin_add_server.html
new file mode 100644
index 00000000..68105d90
--- /dev/null
+++ b/app/templates/include/admin_add_server.html
@@ -0,0 +1,62 @@
+{% from 'include/input_macros.html' import input, checkbox %}
+
+
+
+ Form fields tag "*" are required.
+
+ |
+
+
+
+ New hostname
+ *
+ |
+ {{ input('new-server-add') }} |
+
+
+ IP
+ *
+ |
+ {{ input('new-ip', size='14') }} |
+
+
+ Port
+ *
+ |
+ {{ input('new-port', value='22', size='1') }} |
+
+
+ Enable |
+ {{ checkbox('enable', checked='checked') }} |
+
+
+ Virt |
+ {{ checkbox('typeip') }} |
+
+
+ Alert |
+ {{ checkbox('alert') }} |
+
+
+ Metrics |
+ {{ checkbox('metrics') }} |
+
+
+ Start |
+ {{ checkbox('active') }} |
+
+
+ Slave for |
+
+
+ |
+
+
+ Description |
+ {{ input('desc', size='30') }} |
+
\ No newline at end of file
diff --git a/app/templates/include/admin_add_user.html b/app/templates/include/admin_add_user.html
new file mode 100644
index 00000000..53a11bbc
--- /dev/null
+++ b/app/templates/include/admin_add_user.html
@@ -0,0 +1,38 @@
+{% from 'include/input_macros.html' import input, checkbox %}
+
+
+
+ Form fields tag "*" are required.
+
+ |
+
+
+
+ New user
+ *
+ |
+
+ {{ input('new-username') }}
+ {% if ldap_enable == '1' %}
+ Search user in AD
+ {% endif %}
+ |
+
+
+
+ Password
+ *
+ |
+ {{ input('new-password', type='password') }} |
+
+
+ Active |
+ {{ checkbox('activeuser', checked='checked') }} |
+
+
+
+ Email
+ *
+ |
+ {{ input('new-email') }} |
+
\ No newline at end of file
diff --git a/app/templates/include/admin_servers.html b/app/templates/include/admin_servers.html
new file mode 100644
index 00000000..f374ba96
--- /dev/null
+++ b/app/templates/include/admin_servers.html
@@ -0,0 +1,82 @@
+{% from 'include/input_macros.html' import input, checkbox %}
+
+ {% set id = 'enable-' + server.0|string() %}
+ {% if server.5 == 1 %}
+ {{ checkbox(id, checked='checked') }}
+ {% else %}
+ {{ checkbox(id) }}
+ {% endif %}
+ |
+
+ {% set id = 'typeip-' + server.0|string() %}
+ {% if server.4 == 1 %}
+ {{ checkbox(id, checked='checked') }}
+ {% else %}
+ {{ checkbox(id) }}
+ {% endif %}
+ |
+
+ {% set id = 'alert-' + server.0|string() %}
+ {% if server.8 == 1 %}
+ {{ checkbox(id, checked='checked') }}
+ {% else %}
+ {{ checkbox(id) }}
+ {% endif %}
+ |
+
+ {% set id = 'metrics-' + server.0|string() %}
+ {% if server.9 == 1 %}
+ {{ checkbox(id, checked='checked') }}
+ {% else %}
+ {{ checkbox(id) }}
+ {% endif %}
+ |
+
+ {% set id = 'active-' + server.0|string() %}
+ {% if server.12 == 1 %}
+ {{ checkbox(id, checked='checked') }}
+ {% else %}
+ {{ checkbox(id) }}
+ {% endif %}
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+ {% set id = 'desc-' + server.0|string() %}
+ {% if server.11 != "None" %}
+ {{ input(id, value=server.11, size='20') }}
+ {% else %}
+ {{ input(id, size='20') }}
+ {% endif %}
+ |
+
+
+ |
+
+
+ |
\ No newline at end of file
diff --git a/app/templates/include/admin_user.html b/app/templates/include/admin_user.html
new file mode 100644
index 00000000..4d99c4a1
--- /dev/null
+++ b/app/templates/include/admin_user.html
@@ -0,0 +1,28 @@
+
+ {% if user.6 == 1%}
+
+ {% else %}
+
+ {% endif %}
+ |
+
+ {% if user.6 != 1%}
+
+
+
+ {% endif %}
+ |
+
+ {% if user.7 == 1 %}
+
+ {% else %}
+
+ {% endif %}
+ |
+
+ {% if user.6 == 1%}
+
+ {% else %}
+
+ {% endif %}
+ |
\ No newline at end of file
diff --git a/app/templates/include/admin_users.html b/app/templates/include/admin_users.html
new file mode 100644
index 00000000..4fd0a115
--- /dev/null
+++ b/app/templates/include/admin_users.html
@@ -0,0 +1,32 @@
+{% from 'include/input_macros.html' import input, checkbox %}
+
+ {% set login_id = 'login-' + user.0|string() %}
+ {% if user.6 == 1%}
+ {{ input(login_id, value=user.1, readonly='readonly') }}
+ {% else %}
+ {{ input(login_id, value=user.1) }}
+ {% endif %}
+ |
+
+ {% if user.6 != 1%}
+
+
+
+ {% endif %}
+ |
+
+ {% set activeuser_id = 'activeuser-' + user.0|string() %}
+ {% if user.7 == 1 %}
+ {{ checkbox(activeuser_id, checked='checked') }}
+ {% else %}
+ {{ checkbox(activeuser_id) }}
+ {% endif %}
+ |
+
+ {% set email_id = 'email-' + user.0|string() %}
+ {% if user.6 == 1%}
+ {{ input(email_id, value=user.2, readonly='readonly') }}
+ {% else %}
+ {{ input(email_id, value=user.2) }}
+ {% endif %}
+ |
\ No newline at end of file
diff --git a/app/templates/include/change_pass_form.html b/app/templates/include/change_pass_form.html
new file mode 100644
index 00000000..b4e07852
--- /dev/null
+++ b/app/templates/include/change_pass_form.html
@@ -0,0 +1,23 @@
+{% from 'include/input_macros.html' import input %}
+
+
+
+
+ Enter password and confirm
+ |
+
+
+ Password |
+ {{ input('change-password', type='password') }} |
+
+
+ Confirm password |
+ {{ input('change2-password', type='password') }} |
+
+
+
+ Passwords are mismatched
+ |
+
+
+
\ No newline at end of file
diff --git a/app/templates/include/del_confirm.html b/app/templates/include/del_confirm.html
new file mode 100644
index 00000000..7d0941db
--- /dev/null
+++ b/app/templates/include/del_confirm.html
@@ -0,0 +1,3 @@
+
+
Deleting irreversibly all data will be lost?
+
\ No newline at end of file
diff --git a/app/templates/include/errors.html b/app/templates/include/errors.html
new file mode 100644
index 00000000..f4e3d47d
--- /dev/null
+++ b/app/templates/include/errors.html
@@ -0,0 +1,6 @@
+
+ Some errors:
+
+ {{stderr}}
+ {{error}}
+
\ No newline at end of file
diff --git a/app/templates/include/input_macros.html b/app/templates/include/input_macros.html
new file mode 100644
index 00000000..e6a172ae
--- /dev/null
+++ b/app/templates/include/input_macros.html
@@ -0,0 +1,31 @@
+{% macro input(id, name='', value='', type='text', size='', readonly='', required='', placeholder='', title='', class='form-control', style='') -%}
+ {% if name == '' %}
+ {% set name = id %}
+ {% endif %}
+
+{%- endmacro %}
+
+{%- macro checkbox(id, name='', checked='', title='', value='', desc='') -%}
+ {% if name == '' %}
+ {% set name = id %}
+ {% endif %}
+
+{%- endmacro %}
+
+{%- macro select(id, values, name='', required='', first='', class='', selected='') -%}
+ {% if name == '' %}
+ {% set name = id %}
+ {% endif %}
+
+{%- endmacro %}
\ No newline at end of file
diff --git a/app/templates/include/login.html b/app/templates/include/login.html
new file mode 100644
index 00000000..7bc347ee
--- /dev/null
+++ b/app/templates/include/login.html
@@ -0,0 +1,5 @@
+{% if user %}
+
Logout
+{% else %}
+
Login
+{% endif %}
\ No newline at end of file
diff --git a/app/templates/include/select.html b/app/templates/include/select.html
new file mode 100644
index 00000000..f11c06a1
--- /dev/null
+++ b/app/templates/include/select.html
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/app/templates/lists.html b/app/templates/lists.html
index 56730016..76fe2d2e 100644
--- a/app/templates/lists.html
+++ b/app/templates/lists.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% block content %}
+{% from 'include/input_macros.html' import input %}
In this section you can create and edit black and white lists. And after use them in the HAProxy configs or in the "Add proxy" pages
@@ -35,6 +36,6 @@
Note: Each new address should be specified from a new line
-
+
{% endblock %}
\ No newline at end of file
diff --git a/app/templates/login.html b/app/templates/login.html
index ff25dcdb..37c2d571 100644
--- a/app/templates/login.html
+++ b/app/templates/login.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% block content %}
+{% from 'include/input_macros.html' import input %}
-
-
Deleting irreversibly all data will be lost?
-
+{% include 'include/del_confirm.html' %}
@@ -19,11 +18,7 @@
SSH credentials
Checker
Install HAProxy
- {% if user %}
-
Logout
- {% else %}
-
Login
- {% endif %}
+ {% include 'include/login.html' %}