pull/56/head
Aidaho12 6 years ago
parent 70ce151dc1
commit 392485c046

@ -44,4 +44,4 @@ template = template.render(h2 = 1,
checker_worker = ''.join(checker_worker),
error = stderr,
token = token)
print(template)
print(template)

@ -41,7 +41,7 @@ async def async_get_overviewWaf(serv1, serv2):
commands = [ "ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l" ]
commands1 = [ "cat %s/waf/modsecurity.conf |grep SecRuleEngine |grep -v '#' |awk '{print $2}'" % haproxy_dir ]
server_status = (serv1,serv2, funct.ssh_command(serv2, commands), funct.ssh_command(serv2, commands1), sql.select_waf_metrics_enable_server(serv2))
server_status = (serv1,serv2, funct.ssh_command(serv2, commands), funct.ssh_command(serv2, commands1).strip(), sql.select_waf_metrics_enable_server(serv2))
return server_status
async def get_runner_overviewWaf(url):
@ -111,7 +111,9 @@ def get_map(serv):
G = nx.DiGraph()
funct.get_config(serv, cfg)
error = funct.get_config(serv, cfg)
if error:
print('<div class="alert alert-danger">'+error+'</div>')
try:
conf = open(cfg, "r")
except IOError:

@ -125,7 +125,11 @@
<input type="text" id="name-{{ group.0 }}" value="{{ group.1 }}" class="form-control">
</td>
<td>
<input type="text" id="descript-{{ group.0 }}" value="{{ group.2 }}" class="form-control" size="100">
{% if group.2 != "None" %}
<input type="text" id="descript-{{ group.0 }}" value="{{ group.2 }}" class="form-control" size="100">
{% else %}
<input type="text" id="descript-{{ group.0 }}" value="" class="form-control" size="100">
{% endif %}
</td>
<td>
<a class="delete" onclick="confirmDeleteGroup({{ group.0 }})" title="Delete group {{group.1}}" style="cursor: pointer;"></a>

@ -1,6 +1,6 @@
{% set waf_servers = [] %}
{% for service in service_status %}
{% if service.3 or url == "waf.py" %}
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" or url == "waf.py" %}
{% do waf_servers.append(1) %}
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn">
@ -27,7 +27,7 @@
{% endif %}
</td>
<td>
{% if service.3 %}
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" %}
{{ service.3 }}
{%else %}
<a title="Install WAF"><button onclick="installWaf('{{ service.1 }}')">Install</button></a>
@ -35,11 +35,11 @@
</td>
{% if url == "waf.py" %}
<td>
{% if service.3 %}
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" %}
{% if service.4|int() == 1 %}
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}" checked>
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}" checked>
{% else %}
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}">
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}">
{% endif %}
{% endif %}
</td>

@ -10,6 +10,7 @@ template = env.get_template('waf.html')
print('Content-type: text/html\n')
funct.check_login()
funct.page_for_admin(level = 2)
try:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))

@ -71,7 +71,7 @@ pre {
padding-left: 20px;
}
.container {
min-height: calc(100vh - 0px);
min-height: calc(99vh - 0px);
max-width: 91%;
min-width: 40%;
background-color: #fff;

Loading…
Cancel
Save