diff --git a/app/login.py b/app/login.py
index bd1a9e1a..6d5efe1f 100644
--- a/app/login.py
+++ b/app/login.py
@@ -54,7 +54,10 @@ def ban():
c["ban"] = 1
c["ban"]["path"] = "/app/"
c["ban"]["expires"] = expires.strftime("%a, %d %b %Y %H:%M:%S GMT")
- funct.logging('locahost', login+' Failed log in', haproxywi=1, login=1)
+ try:
+ funct.logging('locahost', login+' Failed log in', haproxywi=1, login=1)
+ except:
+ funct.logging('locahost', ' Failed log in', haproxywi=1)
print(c)
print("Content-type: text/html\n")
print('ban')
diff --git a/app/overview.py b/app/overview.py
index dc91e6d2..8c22223a 100644
--- a/app/overview.py
+++ b/app/overview.py
@@ -41,6 +41,7 @@ template = template.render(h2 = 1,
user = user,
users = users,
groups = groups,
+ roles = sql.select_roles(),
metrics_master = ''.join(metrics_master),
metrics_worker = ''.join(metrics_worker),
checker_master = ''.join(checker_master),
diff --git a/app/templates/admin.html b/app/templates/admin.html
index daf0212d..7facb9a2 100644
--- a/app/templates/admin.html
+++ b/app/templates/admin.html
@@ -10,7 +10,7 @@
Users
Groups
Servers
- Roles
+
SSH credentials
Checker
{% if user %}
@@ -273,21 +273,21 @@
+ Add
-
-
-
- Name |
- Desciption |
-
-
- {% for role in roles %}
-
- {{role.1}} |
- {{role.2}} |
-
- {% endfor %}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/templates/ajax/new_server.html b/app/templates/ajax/new_server.html
index 0ab84e21..8fdeeed9 100644
--- a/app/templates/ajax/new_server.html
+++ b/app/templates/ajax/new_server.html
@@ -94,6 +94,9 @@
{% endif %}
+
+
+ |
|
diff --git a/app/templates/ajax/overivewWaf.html b/app/templates/ajax/overivewWaf.html
index c6b21ca6..a7446fa4 100644
--- a/app/templates/ajax/overivewWaf.html
+++ b/app/templates/ajax/overivewWaf.html
@@ -3,7 +3,7 @@
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" or url == "waf.py" %}
{% do waf_servers.append(1) %}
-
+ |
{% if service.2|int() >= 1 %}
UP
{% else %}
@@ -11,9 +11,9 @@
{% endif %}
{{ service.0 }}
|
-
+
- |
+
{% if role <= 1 %}
@@ -67,7 +67,7 @@
{% endfor %}
{% if waf_servers|count == 0 and url != "waf.py" %}
-
+ |
You have not installed the WAF server yet
|
diff --git a/app/templates/ajax/overview.html b/app/templates/ajax/overview.html
index 43387a57..39cf798f 100644
--- a/app/templates/ajax/overview.html
+++ b/app/templates/ajax/overview.html
@@ -21,9 +21,9 @@
|
-
+
- |
+
{% if role <= 1 %}
@@ -37,7 +37,7 @@
{% endif %}
{% if role <= 2 %}
-
+
{% endif %}
@@ -45,7 +45,7 @@
|
-
+ |
{% if "ls: cannot access" in service.3 %}
Cannot find HAProxy config
{% else %}
diff --git a/app/templates/ajax/server_update.html b/app/templates/ajax/server_update.html
deleted file mode 100644
index 57ddd6b2..00000000
--- a/app/templates/ajax/server_update.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{% for server in servers %}
- |
-
-
- |
-
-
- |
-
-
- |
-
- {% if server.5 == 1 %}
-
- {% else %}
-
- {% endif %}
- |
-
- {% if server.4 == 1 %}
-
- {% else %}
-
- {% endif %}
- |
-
-
- |
-
-
- |
-
- {% endfor %}
-
-
diff --git a/app/templates/ajax/servers_update.html b/app/templates/ajax/servers_update.html
deleted file mode 100644
index a408b497..00000000
--- a/app/templates/ajax/servers_update.html
+++ /dev/null
@@ -1,51 +0,0 @@
-{% for server in servers %}
-
-
-
- |
-
-
- |
-
-
- |
-
- {% if server.5 == 1 %}
-
- {% else %}
-
- {% endif %}
- |
-
- {% if server.4 == 1 %}
-
- {% else %}
-
- {% endif %}
- |
-
-
- |
-
-
- |
-
- {% endfor %}
\ No newline at end of file
diff --git a/app/templates/base.html b/app/templates/base.html
index 00347286..1ba704aa 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -81,7 +81,7 @@
-
+
diff --git a/app/templates/ovw.html b/app/templates/ovw.html
index 27a7342d..42293838 100644
--- a/app/templates/ovw.html
+++ b/app/templates/ovw.html
@@ -3,122 +3,15 @@
-{% if role <= 1 %}
-
-
- Login |
- |
- Group |
- Role |
-
-
-
- Show all
-
-
- |
-
- {% set counter = 0 -%}
- {% for USER in users %}
- {% set counter = counter + loop.index0 %}
- {% if counter <= 2 %}
-
-
-
- {{ USER.1 }}
-
-
- |
- |
- {% for group in groups %}
- {% if USER.5 == group.0|string() %}
- {{ group.1 }} |
- {% endif %}
- {% endfor %}
- {{ USER.4 }} |
- |
-
- {% else %}
-
-
-
- {{ USER.1 }}
-
-
- |
- {{ USER.2 }} |
- {% for group in groups %}
- {% if group.0|string() == USER.5 %}
- {{ group.1 }} |
- {% endif %}
- {% endfor %}
- {{ USER.4 }} |
- |
-
- {% endif %}
- {% endfor %}
-
-
-
-
- Tools status
- |
-
-
-
-
- {% if metrics_master|int() >= 1 %}
- UP
- {% else %}
- DOWN
- {% endif %}
- Metrics master
-
-
- {% if metrics_worker|int() >= 1 %}
- UP
- {% else %}
- DOWN
- {% endif %}
- Metrics workers
- |
- |
-
- {% if checker_master|int() >= 1 %}
- UP
- {% else %}
- DOWN
- {% endif %}
- Checker master
-
-
- {% if checker_worker|int() >= 1 %}
- UP
- {% else %}
- DOWN
- {% endif %}
- Checker workers
- |
-
- {% if keep_alive|int() >= 1 %}
- UP
- {% else %}
- DOWN
- {% endif %}
- Keep alive
- |
-
-
-{% endif %}
-
+
-
+ |
Server
|
-
-
- |
-
+
+
+
+ |
Action
|
@@ -129,16 +22,16 @@
|
-
-
+
-
+ |
WAF
|
-
+
- |
-
+
+ |
Action
|
@@ -150,15 +43,167 @@
|
+
+
+
+ Tools status
+ |
+
+
+
+ {% if metrics_master|int() >= 1 %}
+ UP
+ {% else %}
+ DOWN
+ {% endif %}
+ Metrics master
+
+ |
+
+ {% if checker_master|int() >= 1 %}
+ UP
+ {% else %}
+ DOWN
+ {% endif %}
+ Checker master
+ |
+
+ {% if keep_alive|int() >= 1 %}
+ UP
+ {% else %}
+ DOWN
+ {% endif %}
+ Keep alive
+ |
+
+
+
+ {% if metrics_worker|int() >= 1 %}
+ UP
+ {% else %}
+ DOWN
+ {% endif %}
+ Metrics workers
+ |
+
+ {% if checker_worker|int() >= 1 %}
+ UP
+ {% else %}
+ DOWN
+ {% endif %}
+ Checker workers
+ |
+ |
+
+
+
+{% if role <= 1 %}
+
+
+ Login |
+
+ Group |
+ Role |
+
+
+
+ Show all
+
+
+ |
+
+ {% set counter = 0 -%}
+ {% for USER in users %}
+ {% set counter = counter + loop.index0 %}
+ {% if counter <= 2 %}
+
+
+
+ {{ USER.1 }}
+
+
+ |
+
+ {% for group in groups %}
+ {% if USER.5 == group.0|string() %}
+ {{ group.1 }} |
+ {% endif %}
+ {% endfor %}
+ {{ USER.4 }} |
+ |
+
+ {% else %}
+
+
+
+ {{ USER.1 }}
+
+
+ |
+
+ {% for group in groups %}
+ {% if group.0|string() == USER.5 %}
+ {{ group.1 }} |
+ {% endif %}
+ {% endfor %}
+ {{ USER.4 }} |
+ |
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+ Group |
+ Desctiption |
+ |
+ |
+
+ {% for group in groups %}
+
+
+
+ {{ group.1 }}
+
+
+ |
+ {{ group.2 }} |
+ |
+ |
+
+ {% endfor %}
+
+
+
+
+ Role |
+ Desctiption |
+ |
+ |
+
+ {% for role in roles %}
+
+
+ {{ role.1 }}
+ |
+ {{ role.2 }} |
+ |
+ |
+
+ {% endfor %}
+
+{% endif %}
+
-
+
-
+
diff --git a/inc/style.css b/inc/style.css
index e12b9c68..cfdcca3c 100644
--- a/inc/style.css
+++ b/inc/style.css
@@ -10,6 +10,7 @@ body {
margin: 0;
padding: 0;
overflow: auto;
+ height:100%
}
h2 {
background: #5D9CEB;
@@ -42,7 +43,8 @@ pre {
}
.top-menu {
position: absolute;
- height: 110%;
+ min-height: calc(99vh - 50px);
+ height: 120%;
width: 207px;
float: left;
margin-bottom: 20px;
@@ -74,6 +76,7 @@ pre {
}
.container {
min-height: calc(99vh - 50px);
+ height: 100%;
max-width: 91%;
min-width: 40%;
background-color: #fff;
@@ -83,7 +86,7 @@ pre {
}
.footer {
min-height: 50px;
- top: calc(99vh - 50px);
+ top: calc(99vh - 40px);
right: 0;
left: 0;
max-width: 91%;
@@ -93,6 +96,7 @@ pre {
margin-right: 20px;
border-top: 1px solid #ddd;
clear: both;
+ position: fixed;
}
.footer-div {
display: block;
@@ -238,6 +242,7 @@ pre {
font-style: italic;
color: #fff;
margin-left: 30px;
+ position: fixed;
}
.line {
background-color: #f5faf4;
@@ -317,11 +322,23 @@ pre {
width: 100%;
/* margin-top: 1.5em; */
}
+.overview-wi {
+ width: 46%;
+ min-width: 600px;
+ max-width: 50%;
+ border: 1px solid #ddd;
+ height: 160px;
+ float: left;
+ margin: 20px;
+}
.overviewHead {
border-radius: 5px;
background-color: #F9FFF8;
font-weight: bold;
}
+.overview-wi .overviewHead {
+ border: 1px solid #ddd;
+}
.overview tr{
border-bottom: 1px solid #ddd;
border-radius: 5px;
@@ -360,7 +377,7 @@ pre {
.serverUp {
background-color: #5CB85C;
}
-.add-button {
+.add-button, .add-button-wi {
background-color: #5CB85C;
border-radius: 5px;
color: #fff;
@@ -368,9 +385,14 @@ pre {
padding-right: 10px;
padding-left: 10px;
float: right;
- margin-right: 10px;
+ margin-right: 1px;
cursor: pointer;
}
+.add-button-wi {
+ padding-right: 5px;
+ padding-left: 5px;
+ font-size: 13px;
+}
.serverDown {
background-color: red;
}
@@ -388,12 +410,19 @@ pre {
padding-left: 15px;
width: 20%;
}
+.first-collumn-wi {
+ padding-left: 15px;
+ width: 40%;
+}
.second-collumn {
width: 20%;
}
.third-collumn {
width: 45%;
}
+.third-collumn-wi {
+ width: 30%;
+}
.ro {
border: none;
}
@@ -700,7 +729,7 @@ label {
color: #999;
}
.server-act-links a {
- margin-right: 0.36em !important
+ margin-right: 4.3px !important
}
.server-act-links a:last-child {
margin-right: 0 !important;