mirror of https://github.com/Aidaho12/haproxy-wi
86 lines
2.9 KiB
HTML
86 lines
2.9 KiB
HTML
{% set waf_servers = [] %}
|
|
{% for service in service_status %}
|
|
{% 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') }}" id="{{service.0}}-select-line">
|
|
<td class="padding10 first-collumn-wi">
|
|
{% if service.2|int() >= 1 %}
|
|
<span class="serverUp" title="running {{service.2 }} processes"> UP</span>
|
|
{% else %}
|
|
<span class="serverDown"> DOWN</span>
|
|
{% endif %}
|
|
<a href="#{{ service.0 }}" title="Go to {{ service.0 }} status" style="color: #000">{{ service.0 }}</a>
|
|
</td>
|
|
<!-- <td class="second-collumn"> -->
|
|
|
|
<!-- </td> -->
|
|
<td>
|
|
{% if role <= 1 %}
|
|
<a id="{{ service.1 }}" class="start-waf" title="Start WAF service">
|
|
<img src=/inc/images/start.png alt="start" class="icon" style="margin-bottom: -2px;">
|
|
</a>
|
|
<a id="{{ service.1 }}" class="stop-waf" title="Stop WAF service">
|
|
<img src=/inc/images/stop.png alt="start" class="icon" width="17px">
|
|
</a>
|
|
<a id="{{ service.1 }}" class="restart-waf" title="Restart WAF service">
|
|
<img src=/inc/images/update.png alt="restart" class="icon">
|
|
</a>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if role <= 1 %}
|
|
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" %}
|
|
<select class="waf_mode" id="{{ service.0 }}_select">
|
|
{% set waf_modes = [] %}
|
|
{% do waf_modes.append("On") %}
|
|
{% do waf_modes.append("Off") %}
|
|
{% do waf_modes.append("DetectionOnly") %}
|
|
{% for waf_mode in waf_modes %}
|
|
{% if service.3 == waf_mode %}
|
|
<option value={{waf_mode}} selected="selected">{{waf_mode}}</option>
|
|
{% else %}
|
|
<option value={{waf_mode}}>{{waf_mode}}</option>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</select>
|
|
{%else %}
|
|
<a title="Install WAF"><button onclick="installWaf('{{ service.1 }}')">Install</button></a>
|
|
{% endif %}
|
|
{% else %}
|
|
{{ service.3 }}
|
|
{% endif %}
|
|
</td>
|
|
{% if url == "waf.py" %}
|
|
<td style="padding-top: 2px;">
|
|
{% 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>
|
|
{% else %}
|
|
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}">
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
<td></td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if waf_servers|count == 0 and url != "waf.py" %}
|
|
<tr>
|
|
<td class="padding10 first-collumn-wi">
|
|
You have not installed the WAF server yet
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
<script>
|
|
$( "select" ).selectmenu();
|
|
{% if role <= 1 %}
|
|
$( "select" ).on('selectmenuchange',function() {
|
|
var id = $(this).attr('id');
|
|
changeWafMode(id)
|
|
});
|
|
{% endif %}
|
|
</script>
|
|
<style>
|
|
.ui-selectmenu-button.ui-button {width: 10em;}
|
|
</style> |